From d87edd9ec25d6884b630f99cfac9085a35037801 Mon Sep 17 00:00:00 2001 From: Ice Date: Wed, 23 Apr 2008 15:44:17 +0000 Subject: [PATCH] Unreported: Wrong user when news post order was switched, cleaned up the if/else. --- root/portal/includes/functions.php | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/root/portal/includes/functions.php b/root/portal/includes/functions.php index 268419fe..391b4337 100644 --- a/root/portal/includes/functions.php +++ b/root/portal/includes/functions.php @@ -134,17 +134,8 @@ function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_le $topic_type = 't.topic_type = ' . POST_NORMAL; $str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : ''; - $user_link = 't.topic_last_poster_id = u.user_id'; - - if ( $portal_config['portal_news_show_last'] ) - { - $post_link = 't.topic_last_post_id = p.post_id'; - } - else - { - $post_link = 't.topic_first_post_id = p.post_id'; - } - + $user_link = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ; + $post_link = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ; $topic_order = 't.topic_last_post_time DESC'; break; @@ -152,17 +143,8 @@ function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_le $topic_type = '( t.topic_type <> ' . POST_ANNOUNCE . ' ) AND ( t.topic_type <> ' . POST_GLOBAL . ')'; $str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : ''; - $user_link = 't.topic_last_poster_id = u.user_id'; - - if ( $portal_config['portal_news_show_last'] ) - { - $post_link = 't.topic_last_post_id = p.post_id'; - } - else - { - $post_link = 't.topic_first_post_id = p.post_id'; - } - + $user_link = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ; + $post_link = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ; $topic_order = 't.topic_last_post_time DESC'; break;