asdf29 yazdı:ben bunu aşağıdaki şekildeki gibi yaptım ama bir sorun çıktı.. color gurup modu kurulu idi ve daha önce bu bölümde üye adları renk guruplarına göre gözükürdü ama artık o bölümde üye adı renkli gözükmüyor
http://www.canver.net/1-vt9092.html?start=0CeNK yazdı:-->| Last Post Topic on Index/ Ana sayfada son konunun görüntülenmesi
MOD Başlığı: Last Post Topic on Index
MOD Versiyonu: 1.4.0
MOD Yazarı : e-sven <sven@e-sven.net> http://www.e-sven.net
MOD Açıklaması: Ana sayfada son konunun görüntülenmesini sağlar
Kurulum Seviyesi : Kolay
Kurulum Süresi: ~5 dakika
Düzenlenecek Dosyalar: 1 Adet
includes/sessions.php
Yüklenecek Dosyalar: 1 Adet
index.php
Dosya Boyutu : ---
Ekran Görüntüsü :
[syntax="sql"]#
#-----[ AÇ ]------------------------------------------------
#
index.php
#
#-----[ BUL]-----------------------------------------
#
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
FROM (( " . FORUMS_TABLE . " f
LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
ORDER BY f.cat_id, f.forum_order";
break;
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
$forum_data[] = $row;
}
if ( !($total_forums = count($forum_data)) )
{
message_die(GENERAL_MESSAGE, $lang['No_forums']);
}
//
// Obtain a list of topic ids which contain
#
#-----[ BUNUNLA DEĞİŞTİR]----------------------------------------
#
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id, t.topic_title, t.topic_last_post_id " .
" FROM ((( " . FORUMS_TABLE . " f " .
" LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )" .
" LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id ) " .
" LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_last_post_id = p.post_id ) " .
" ORDER BY f.cat_id, f.forum_order";
break;
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
$topic_last_ary = array();
$i=0;
while( $row = $db->sql_fetchrow($result) )
{
if (!in_array($row['topic_last_post_id'], $topic_last_ary) || $row['topic_last_post_id']==0) {
$topic_last_ary[i]=$row['topic_last_post_id'];
$i++;
$forum_data[] = $row;
}
}
unset($topic_last_ary);
if ( !($total_forums = count($forum_data)) )
{
message_die(GENERAL_MESSAGE, $lang['No_forums']);
}
//
// Filter topic_title not allowed to read
//
if ( !($userdata['user_level'] == ADMIN && $userdata['session_logged_in']) ) {
$auth_read_all = array();
$auth_read_all=auth(AUTH_READ, AUTH_LIST_ALL, $userdata, $forum_data);
$auth_data = '';
for($i=0; $i<count($forum_data); $i++)
{
if (!$auth_read_all[$forum_data[$i]['forum_id']]['auth_read']) {
$forum_data[$i]['topic_title']='';
}
}
}
//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
//
// Obtain a list of topic ids which contain
#
#-----[ BUL ]-----------------------------------------
#
if ( $forum_data[$j]['forum_last_post_id'] )
{
...
}
#
#-----[ BUNUNLA DEĞİŞTİR ]---------------------------------
#
if ( $forum_data[$j]['forum_last_post_id'] )
{
$topic_title = $forum_data[$j]['topic_title'];
$topic_title2 = $forum_data[$j]['topic_title'];
//
// Censor topic title
//
if ( count($orig_word) )
{
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
$topic_title2 = preg_replace($orig_word, $replacement_word, $topic_title2);
}
if (strlen($topic_title)>27) {
$topic_title = substr($topic_title,0,24) . '...';
}
$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);
$last_post = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '" title="' . $topic_title2 . '">' . $topic_title . '</a><br>';
$last_post .= $last_post_time . ' <a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '"></a><br>' . $lang['by'] . ' ';
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
}
#
#-----[ KAYDET ve GÖNDER]----------------------------------
#
[/syntax]
#
#-----[ AÇ ]------------------------------------------------
#
index.php
#
#-----[ BUL ]-----------------------------------------
#
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
FROM (( " . FORUMS_TABLE . " f
LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
ORDER BY f.cat_id, f.forum_order";
break;
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
$forum_data[] = $row;
}
if ( !($total_forums = count($forum_data)) )
{
message_die(GENERAL_MESSAGE, $lang['No_forums']);
}
//
// Obtain a list of topic ids which contain
#
#-----[ BUNUNLA DEGISTIR ]----------------------------------------
#
// Modified by Easy Sub-Forums MOD
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id, t.topic_id, t.topic_title, t.topic_last_post_id " .
"FROM ((( " . FORUMS_TABLE . " f " .
"LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id ) " .
"LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id ) " .
"LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_last_post_id = f.forum_last_post_id) " .
"GROUP BY f.forum_id ORDER BY f.cat_id, f.forum_order";
// END Modified by Easy Sub-Forums MOD
break;
}
if ( !($result = $db->sql_query($sql, false, 'posts_')) )
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
$topic_last_ary = array();
$i=0;
while( $row = $db->sql_fetchrow($result) )
{
if (!in_array($row['topic_last_post_id'], $topic_last_ary) || $row['topic_last_post_id']==0) {
$topic_last_ary[i]=$row['topic_last_post_id'];
$i++;
$forum_data[] = $row;
}
}
// Added by Easy Sub-Forums MOD
$attach=$forum_data;
// END Added by Easy Sub-Forums MOD
$db->sql_freeresult($result);
unset($topic_last_ary);
if ( !($total_forums = count($forum_data)) )
{
message_die(GENERAL_MESSAGE, $lang['No_forums']);
}
//
// Filter topic_title not allowed to read
//
if ( !($userdata['user_level'] == ADMIN && $userdata['session_logged_in']) ) {
$auth_read_all = array();
$auth_read_all=auth(AUTH_READ, AUTH_LIST_ALL, $userdata, $forum_data);
$auth_data = '';
for($i=0; $i<count($forum_data); $i++)
{
if (!$auth_read_all[$forum_data[$i]['forum_id']]['auth_read']) {
$forum_data[$i]['topic_title']='';
}
}
}
//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
//
// Obtain a list of topic ids which contain
// posts made since user last visited
//
if ($userdata['session_logged_in'])
{
// 60 days limit
if ($userdata['user_lastvisit'] < (time() - 5184000))
{
$userdata['user_lastvisit'] = time() - 5184000;
}
$sql = "SELECT t.forum_id, t.topic_id, p.post_time
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE p.post_id = t.topic_last_post_id
AND p.post_time > " . $userdata['user_lastvisit'] . "
AND t.topic_moved_id = 0";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql);
}
$new_topic_data = array();
while( $topic_data = $db->sql_fetchrow($result) )
{
$new_topic_data[$topic_data['forum_id']][$topic_data['topic_id']] = $topic_data['post_time'];
}
$db->sql_freeresult($result);
}
//
// Obtain list of moderators of each forum
// First users, then groups ... broken into two queries
#
#-----[ BUL ]-----------------------------------------
# Burayi {.....} ve arasindaki kodlari. Bu bölümde alt forumlar
# icin kodlar varsa, ona göre düzenlemelisiniz.
#
if ( $forum_data[$j]['forum_last_post_id'] )
{
...
}
#
#-----[ BUNUNLA DEGISTIR ]---------------------------------
#
if ( $forum_data[$j]['forum_last_post_id'] )
{
$topic_title = $forum_data[$j]['topic_title'];
$topic_title2 = $forum_data[$j]['topic_title'];
//
// Censor topic title
//
if ( count($orig_word) )
{
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
$topic_title2 = preg_replace($orig_word, $replacement_word, $topic_title2);
}
// Modified by Easy Sub-Forums MOD
if (strlen($forum_data[$j]['topic_title'])>=25)
{
$forum_data[$j]['topic_title']=substr($forum_data[$j]['topic_title'],0,25). "...";
}
$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);
$last_post = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '" title="' . $topic_title2 . '">' . $topic_title . '</a><br>';
$last_post .= $last_post_time . '<br>';
$style_color = ($user_color = color_groups_user($forum_data[$j]['user_id'])) ? 'style="font-weight:bold;color: #' . $user_color . '" ' : '';
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a ' . $style_color . 'href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a>' . ' <a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
// END Modified by Easy Sub-Forums MOD
#
#-----[ AÇ ]------------------------------------------------
#
index.php
#
#-----[ BUL ]-----------------------------------------
#
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
FROM (( " . FORUMS_TABLE . " f
LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
ORDER BY f.cat_id, f.forum_order";
break;
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
$forum_data[] = $row;
}
if ( !($total_forums = count($forum_data)) )
{
message_die(GENERAL_MESSAGE, $lang['No_forums']);
}
//
// Obtain a list of topic ids which contain
#
#-----[ BUNUNLA DEGISTIR ]----------------------------------------
#
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id, u.user_level, t.topic_title, t.topic_last_post_id " .
" FROM ((( " . FORUMS_TABLE . " f " .
" LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )" .
" LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )" .
" LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_last_post_id = p.post_id ) " .
" ORDER BY f.cat_id, f.forum_order";
break;
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
$topic_last_ary = array();
$i=0;
while( $row = $db->sql_fetchrow($result) )
{
// BEGIN Forum Auth by Post Count 1.0.0 (www.phpBBDoctor.com)
// $forum_data[] = $row;
if (phpbbdoctor_post_count_auth($row['min_posts_to_view'], $row['max_posts_to_view']) && (!in_array($row['topic_last_post_id'], $topic_last_ary) || $row['topic_last_post_id']==0))
{
$topic_last_ary[i]=$row['topic_last_post_id'];
$i++;
$forum_data[] = $row;
}
// END Forum Auth by Post Count 1.0.0 (www.phpBBDoctor.com)
}
unset($topic_last_ary);
$db->sql_freeresult($result);
if ( !($total_forums = count($forum_data)) )
{
message_die(GENERAL_MESSAGE, $lang['No_forums']);
}
//
// Filter topic_title not allowed to read
//
if ( !($userdata['user_level'] == ADMIN && $userdata['session_logged_in']) ) {
$auth_read_all = array();
$auth_read_all=auth(AUTH_READ, AUTH_LIST_ALL, $userdata, $forum_data);
$auth_data = '';
for($i=0; $i<count($forum_data); $i++)
{
if (!$auth_read_all[$forum_data[$i]['forum_id']]['auth_read']) {
$forum_data[$i]['topic_title']='';
}
}
}
//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
//
// Obtain a list of topic ids which contain
// posts made since user last visited
#
#-----[ BUL ]-----------------------------------------
# Burayi {.....} ve arasindaki kodlari. Bu bölümde alt forumlar
# icin kodlar varsa, ona göre düzenlemelisiniz.
#
if ( $forum_data[$j]['forum_last_post_id'] )
{
...
}
#
#-----[ BUNUNLA DEGISTIR ]---------------------------------
#
if ( $forum_data[$j]['forum_last_post_id'] )
{
$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);
$topic_title = $forum_data[$j]['topic_title'];
$topic_title2 = $forum_data[$j]['topic_title'];
//
// Censor topic title
//
if ( count($orig_word) )
{
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
$topic_title2 = preg_replace($orig_word, $replacement_word, $topic_title2);
}
if (strlen($topic_title)>27) {
$topic_title = substr($topic_title,0,24) . '...';
}
// OLD
// $last_post = $last_post_time . '<br />';
//
// MOD - TODAY AT - BEGIN
//
if ( $board_config['time_today'] < $forum_data[$j]['post_time'])
{
$last_post = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $forum_data[$j]['post_time'], $board_config['board_timezone'])) . '<br />';
}
else if ( $board_config['time_yesterday'] < $forum_data[$j]['post_time'])
{
$last_post = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $forum_data[$j]['post_time'], $board_config['board_timezone'])) . '<br />';
}
else
{
$last_post = $last_post_time . '<br />';
}
// MOD - TODAY AT - END
$last_post = '<b><a class="gensmall" href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '" title="' . $topic_title2 . '">' . $topic_title . '</a></b><br>' . $last_post;
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '"' . $style_color . '>' . $username_color . '</a> ';
$last_post .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
// Begin Simple Subforums MOD
$last_post_sub = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . ($unread_topics ? $images['icon_newest_reply'] : $images['icon_latest_reply']) . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
$last_post_time = $forum_data[$j]['post_time'];
// End Simple Subforums MOD
Bu forumu görüntüleyenler: Kayıtlı kullanıcı yok ve 0 misafir