Webmaster общности: Predpriemach.com | SearchEngines.bg

    Добавете и заглавието на темата в индекса

    Пиша този урок относно запитване на burgazliq.
    Трябва да се промени само един файл (index.php) и времетраенето за този мод е не повече от 1-2 минути.
    Този мод добавя и името на темата в индекса на форума до името на потребителя пуснал последното мнение в даден раздел.

    #
    #-----[ ОТВОРЕТЕ ]------------------------------------------------
    #
    index.php
    
    #
    #-----[ НАМЕРЕТЕ ]-----------------------------------------
    #
    $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;
    
    #
    #-----[ ЗАМЕНЕТЕ С ТОВА ]----------------------------------------
    #
    $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id, t.topic_title, t.topic_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_id = p.topic_id )
    ORDER BY f.cat_id, f.forum_order";
    break;
    
    #
    #-----[ НАМЕРЕТЕ ]-----------------------------------------
    #
    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']);
    
    $last_post = $last_post_time . '<br />';
    
    $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> ';
    
    $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>';
    }
    
    #
    #-----[ ЗАМЕНЕТЕ С ТОВА ]---------------------------------
    #
    $max_topic_length = 30;
    
    if ( $forum_data[$j]['forum_last_post_id'] )
    {
    $forum_data[$j]['topic_title'] = (strlen($forum_data[$j]['topic_title']) > $max_topic_length) ? substr($forum_data[$j]['topic_title'], 0, $max_topic_length) . '…' : $forum_data[$j]['topic_title'];
    
    $last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);
    
    $last_post = $last_post_time . ' <br />';
    
    $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> ';
    
    $last_post .= '<br /><a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $forum_data[$j]['topic_id']) . '">' . $forum_data[$j]['topic_title'] . '</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>';
    }
    
    #
    #-----[ ЗАПАМЕТЕ ВСИЧКИ ПРОМЕНИ ]----------------------------------
    #

    Успех на всички