|
From: OryNider <ory...@us...> - 2007-08-11 21:53:24
|
Update of /cvsroot/mxbb/mx_glance In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14155 Modified Files: mx_glance.php Log Message: This is fixing the color ptoblem with phpBB2. Index: mx_glance.php =================================================================== RCS file: /cvsroot/mxbb/mx_glance/mx_glance.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mx_glance.php 11 Aug 2007 07:00:57 -0000 1.6 --- mx_glance.php 11 Aug 2007 21:53:18 -0000 1.7 *************** *** 190,193 **** --- 190,194 ---- $recent_news_forum_id = ($recent_news_forum_id) ? $recent_news_forum_id : 0; + /* $sql = $db->sql_build_query('SELECT', array( 'SELECT' => 'f.forum_id, f.forum_name' . $sql_title . ', t.*, p.post_time, p.poster_id, u.username as last_username, u.username as author_username', *************** *** 210,213 **** --- 211,238 ---- )); + */ + + $sql = " + SELECT + f.forum_id, f.forum_name" . $sql_title . ", t.*, + p2.post_time, p2.poster_id, + u.username as last_username, + u2.username as author_username + FROM " + . FORUMS_TABLE . " f, " + . POSTS_TABLE . " p, " + . TOPICS_TABLE . " t, " + . POSTS_TABLE . " p2, " + . USERS_TABLE . " u, " + . USERS_TABLE . " u2 + WHERE + f.forum_id IN (" . $recent_news_forum_id . ") + AND t.forum_id = f.forum_id + AND p.post_id = t.topic_first_post_id + AND p2.post_id = t.topic_last_post_id + AND t.topic_moved_id = 0 + AND p2.poster_id = u.user_id + AND t.topic_poster = u2.user_id + ORDER BY t.topic_last_post_id DESC"; if( !($result = $db->sql_query_limit($sql, $sql_news_limit, $sql_news_start)) ) *************** *** 317,320 **** --- 342,346 ---- $sql_forums_start = ($recent_forums_offset) ? $recent_forums_offset : 0; + /* $sql = $db->sql_build_query('SELECT', array( 'SELECT' => 'f.forum_id, f.forum_name' . $sql_title . ', t.*, p.post_time, p.poster_id, u.username as last_username, u.username as author_username', *************** *** 337,340 **** --- 363,390 ---- )); + */ + + $sql = " + SELECT + f.forum_id, f.forum_name" . $sql_title . ", t.*, + p2.post_time, p2.poster_id, + u.username as last_username, + u2.username as author_username + FROM " + . FORUMS_TABLE . " f, " + . POSTS_TABLE . " p, " + . TOPICS_TABLE . " t, " + . POSTS_TABLE . " p2, " + . USERS_TABLE . " u, " + . USERS_TABLE . " u2 + WHERE + f.forum_id NOT IN (" . $recentforumsignore . $recent_forums_ignore . ") + AND t.forum_id = f.forum_id + AND p.post_id = t.topic_first_post_id + AND p2.post_id = t.topic_last_post_id + AND t.topic_moved_id = 0 + AND p2.poster_id = u.user_id + AND t.topic_poster = u2.user_id + ORDER BY t.topic_last_post_id DESC"; if( !($result = $db->sql_query_limit($sql, $sql_forums_limit, $sql_forums_start)) ) *************** *** 438,447 **** else { ! $last_poster = ($latest_news[$i]['poster_id'] == ANONYMOUS ) ? ( ($latest_news[$i]['last_username'] != '' ) ? $latest_news[$i]['last_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . mx_append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $latest_news[$i]['poster_id']) . '">' . $latest_news[$i]['last_username'] . '</a> '; $last_poster_full = $last_poster . '<a href="' . mx_append_sid(PHPBB_URL . "viewtopic.$phpEx?" . POST_POST_URL . '=' . $latest_news[$i]['topic_last_post_id']) . '#' . $latest_news[$i]['topic_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>'; ! $last_poster_color = ''; //never used ! $topic_poster = ($latest_news[$i]['topic_poster'] == ANONYMOUS ) ? ( ($latest_news[$i]['author_username'] != '' ) ? $latest_news[$i]['author_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . mx_append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $latest_news[$i]['topic_poster']) . '">' . $latest_news[$i]['author_username'] . '</a> '; $topic_poster_full = $topic_poster; - $topic_poster_color = ''; //never used } --- 488,554 ---- else { ! $sql = "SELECT username, user_id, user_level ! FROM ".USERS_TABLE." ! WHERE user_id = ".$latest_news[$i]['poster_id']." ! ORDER BY username ASC"; ! if( !($result = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, 'Could not obtain user information', '', __LINE__, __FILE__, $sql); ! } ! ! while( $row = $db->sql_fetchrow($result) ) ! { ! if ($row['user_level'] == ADMIN) ! { ! $last_poster_color = $theme['fontcolor3']; ! $last_poster_style = 'style="color:#' . $last_poster_color . '; font-weight : bold;"'; ! } ! else if ($row['user_level'] == MOD) ! { ! $last_poster_color = $theme['fontcolor2']; ! $last_poster_style = 'style="color:#' . $last_poster_color . '; font-weight : bold;"'; ! } ! else ! { ! $last_poster_color = ''; ! $last_poster_style = 'style="font-weight : bold;"'; ! } ! } ! $db->sql_freeresult($result); ! ! $last_poster = ($latest_news[$i]['poster_id'] == ANONYMOUS ) ? '<span ' . $last_poster_style . '>' . $lang['Guest'] . '</span>' : '<a href="' . mx_append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $latest_news[$i]['poster_id']) . '"><span ' . $last_poster_style . '>' . $latest_news[$i]['last_username'] . '</span></a> '; $last_poster_full = $last_poster . '<a href="' . mx_append_sid(PHPBB_URL . "viewtopic.$phpEx?" . POST_POST_URL . '=' . $latest_news[$i]['topic_last_post_id']) . '#' . $latest_news[$i]['topic_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>'; ! ! $sql = "SELECT username, user_id, user_level ! FROM ".USERS_TABLE." ! WHERE user_id = ".$latest_news[$i]['topic_poster']." ! ORDER BY username ASC"; ! if( !($result = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, 'Could not obtain user information', '', __LINE__, __FILE__, $sql); ! } ! ! while( $row = $db->sql_fetchrow($result) ) ! { ! if ($row['user_level'] == ADMIN) ! { ! $topic_poster_color = $theme['fontcolor3']; ! $topic_poster_style = 'style="color:#' . $topic_poster_color . '; font-weight : bold;"'; ! } ! else if ($row['user_level'] == MOD) ! { ! $topic_poster_color = $theme['fontcolor2']; ! $topic_poster_style = 'style="color:#' . $topic_poster_color . '; font-weight : bold;"'; ! } ! else ! { ! $topic_poster_color = ''; ! $topic_poster_style = 'style="font-weight : bold;"'; ! } ! } ! $db->sql_freeresult($result); ! ! $topic_poster = ($latest_news[$i]['topic_poster'] == ANONYMOUS ) ? '<span ' . $topic_poster_style . '>' . $lang['Guest'] . '</span>' : '<a href="' . mx_append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $latest_news[$i]['topic_poster']) . '"><span ' . $topic_poster_style . '>' . $latest_news[$i]['author_username'] . '</span></a> '; $topic_poster_full = $topic_poster; } *************** *** 623,633 **** else { ! $last_poster = ($latest_topics[$i]['poster_id'] == ANONYMOUS ) ? ( ($latest_topics[$i]['last_username'] != '' ) ? $latest_topics[$i]['last_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a alt="' . $last_post_time . '" title="' . $last_post_time . '" href="' . mx_append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $latest_topics[$i]['poster_id']) . '">' . $latest_topics[$i]['last_username'] . '</a> '; $last_poster_full = $last_poster . '<a href="' . mx_append_sid(PHPBB_URL . "viewtopic.$phpEx?" . POST_POST_URL . '=' . $latest_topics[$i]['topic_last_post_id']) . '#' . $latest_topics[$i]['topic_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>'; - $last_poster_color = ''; //never used ! $topic_poster = ($latest_topics[$i]['topic_poster'] == ANONYMOUS ) ? ( ($latest_topics[$i]['author_username'] != '' ) ? $latest_topics[$i]['author_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . mx_append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $latest_topics[$i]['topic_poster']) . '">' . $latest_topics[$i]['author_username'] . '</a> '; $topic_poster_full = $topic_poster; - $topic_poster_color = ''; //never used } --- 730,798 ---- else { ! ! $sql = "SELECT username, user_id, user_level ! FROM ".USERS_TABLE." ! WHERE user_id = ".$latest_topics[$i]['poster_id']." ! ORDER BY username ASC"; ! if( !($result = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, 'Could not obtain user information', '', __LINE__, __FILE__, $sql); ! } ! ! while( $row = $db->sql_fetchrow($result) ) ! { ! if ($row['user_level'] == ADMIN) ! { ! $last_poster_color = $theme['fontcolor3']; ! $last_poster_style = 'style="color:#' . $last_poster_color . '; font-weight : bold;"'; ! } ! else if ($row['user_level'] == MOD) ! { ! $last_poster_color = $theme['fontcolor2']; ! $last_poster_style = 'style="color:#' . $last_poster_color . '; font-weight : bold;"'; ! } ! else ! { ! $last_poster_color = ''; ! $last_poster_style = 'style="font-weight : bold;"'; ! } ! } ! $db->sql_freeresult($result); ! ! $last_poster = ($latest_topics[$i]['poster_id'] == ANONYMOUS ) ? '<span ' . $last_poster_style . '>' . $lang['Guest'] . '</span>' : '<a alt="' . $last_post_time . '" title="' . $last_post_time . '" href="' . mx_append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $latest_topics[$i]['poster_id']) . '"><span ' . $last_poster_style . '>' . $latest_topics[$i]['last_username'] . '</span></a> '; $last_poster_full = $last_poster . '<a href="' . mx_append_sid(PHPBB_URL . "viewtopic.$phpEx?" . POST_POST_URL . '=' . $latest_topics[$i]['topic_last_post_id']) . '#' . $latest_topics[$i]['topic_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>'; ! $sql = "SELECT username, user_id, user_level ! FROM ".USERS_TABLE." ! WHERE user_id = ".$latest_topics[$i]['topic_poster']." ! ORDER BY username ASC"; ! if( !($result = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, 'Could not obtain user information', '', __LINE__, __FILE__, $sql); ! } ! ! while( $row = $db->sql_fetchrow($result) ) ! { ! if ($row['user_level'] == ADMIN) ! { ! $topic_poster_color = $theme['fontcolor3']; ! $topic_poster_style = 'style="color:#' . $topic_poster_color . '; font-weight : bold;"'; ! } ! else if ($row['user_level'] == MOD) ! { ! $topic_poster_color = $theme['fontcolor2']; ! $topic_poster_style = 'style="color:#' . $topic_poster_color . '; font-weight : bold;"'; ! } ! else ! { ! $topic_poster_color = $theme['fontcolor1']; ! $topic_poster_style = 'style="font-weight : bold;"'; ! } ! } ! $db->sql_freeresult($result); ! ! ! $topic_poster = ($latest_topics[$i]['topic_poster'] == ANONYMOUS ) ? '<span ' . $topic_poster_style . '>' . $lang['Guest'] . '</span>' : '<a href="' . mx_append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $latest_topics[$i]['topic_poster']) . '"><span ' . $topic_poster_style . '>' . $latest_topics[$i]['author_username'] . '</span></a> '; $topic_poster_full = $topic_poster; } |