diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-08-17 22:08:34 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-08-17 22:08:34 +0000 |
commit | 26190e5c3bdc9344ae635e7f5be52f9207201fa9 (patch) | |
tree | daf5a358360155098ab9c9ab8b1a6166c0e42427 /phpBB/index.php | |
parent | ecf33211ece04da0f68465cd66675d98bad03f51 (diff) | |
download | forums-26190e5c3bdc9344ae635e7f5be52f9207201fa9.tar forums-26190e5c3bdc9344ae635e7f5be52f9207201fa9.tar.gz forums-26190e5c3bdc9344ae635e7f5be52f9207201fa9.tar.bz2 forums-26190e5c3bdc9344ae635e7f5be52f9207201fa9.tar.xz forums-26190e5c3bdc9344ae635e7f5be52f9207201fa9.zip |
Some sql changes
git-svn-id: file:///svn/phpbb/trunk@2866 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/index.php')
-rw-r--r-- | phpBB/index.php | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/phpBB/index.php b/phpBB/index.php index ae0a133b88..398596253a 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -127,18 +127,16 @@ if ( ( $total_categories = count($category_rows) ) ) switch ( SQL_LAYER ) { case 'oracle': - $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id - FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u - WHERE p.post_id = f.forum_last_post_id(+) - AND u.user_id = p.poster_id(+) + $sql = "SELECT f.*, u.username, u.user_id + FROM " . FORUMS_TABLE . " f, " . USERS_TABLE . " u + WHERE u.user_id = p.poster_id(+) ORDER BY f.cat_id, f.forum_order"; break; default: - $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 ) + $sql = "SELECT f.*, u.username, u.user_id + FROM ( " . FORUMS_TABLE . " f + LEFT JOIN " . USERS_TABLE . " u ON u.user_id = f.forum_last_poster_id ) ORDER BY f.cat_id, f.forum_order"; break; } @@ -184,8 +182,6 @@ if ( ( $total_categories = count($category_rows) ) ) 'L_LEGEND' => $lang['Legend'], 'L_NO_FORUMS' => $lang['No_forums'], - 'S_LEGEND' => $legend, - 'U_MARK_READ' => "index.$phpEx$SID&mark=forums") ); @@ -247,20 +243,12 @@ if ( ( $total_categories = count($category_rows) ) ) foreach ( $new_topic_data[$row_forum_id] as $check_topic_id => $check_post_time ) { - if ( empty($tracking_topics[$check_topic_id]) ) + if ( empty($tracking_topics[$check_topic_id]) || $tracking_topics[$check_topic_id] < $check_post_time) { $unread_topics = true; $forum_last_post_time = max($check_post_time, $forum_last_post_time); } - else - { - if ( $tracking_topics[$check_topic_id] < $check_post_time ) - { - $unread_topics = true; - $forum_last_post_time = max($check_post_time, $forum_last_post_time); - } - } } if ( !empty($tracking_forums[$row_forum_id]) ) @@ -278,7 +266,6 @@ if ( ( $total_categories = count($category_rows) ) ) $unread_topics = false; } } - } } @@ -291,11 +278,11 @@ if ( ( $total_categories = count($category_rows) ) ) 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_time = create_date($board_config['default_dateformat'], $forum_data[$j]['forum_last_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="' . "profile.$phpEx$SID&mode=viewprofile&u=" . $forum_data[$j]['user_id'] . '">' . $forum_data[$j]['username'] . '</a> '; + $last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['forum_last_poster_name'] != '' ) ? $forum_data[$j]['forum_last_poster_name'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . "profile.$phpEx$SID&mode=viewprofile&u=" . $forum_data[$j]['user_id'] . '">' . $forum_data[$j]['username'] . '</a> '; $last_post .= '<a href="' . "viewtopic.$phpEx$SID&f=$row_forum_id&p=" . $forum_data[$j]['forum_last_post_id'] . '#' . $forum_data[$j]['forum_last_post_id'] . '">' . create_img($theme['goto_post_latest'], $lang['View_latest_post']) . '</a>'; } |