|
From: OryNider <ory...@us...> - 2007-08-12 18:46:15
|
Update of /cvsroot/mxbb/mx_glance In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32609 Modified Files: mx_glance.pak mx_glance.php Log Message: Added option to enable/disable user colors and bold. Index: mx_glance.php =================================================================== RCS file: /cvsroot/mxbb/mx_glance/mx_glance.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mx_glance.php 11 Aug 2007 21:53:18 -0000 1.7 --- mx_glance.php 12 Aug 2007 18:46:01 -0000 1.8 *************** *** 46,49 **** --- 46,55 ---- // CHANGE THE BULLET IF A TOPIC IS NEW? (true / false) $recent_show_new_bullets = $mx_block->get_parameters( 'Glance_show_new_bullets' ); + + // SHOW ADMIN AND MOD WITH COLORS? (true / false) + $recent_show_user_color = $mx_block->get_parameters( 'Glance_show_user_color' ); + + // SHOW USERS WITH BOLD IF PREVIOUS OPTION IS FALSE? (true / false) + $recent_show_user_bold = $mx_block->get_parameters( 'Glance_show_user_bold' ); // MESSAGE TRACKING WILL TRACK TO SEE IF A USER HAS READ THE TOPIC DURING THEIR SESSION (true / false) *************** *** 488,551 **** 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> '; --- 494,583 ---- else { ! if ($recent_show_user_color) { ! $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)) ) ! { ! 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); + } + else if ($recent_show_user_bold) + { + $last_poster_color = ''; + $last_poster_style = 'style="font-weight : bold;"'; + } + else + { + $last_poster_color = ''; + $last_poster_style = ''; } $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>'; ! if ($recent_show_user_color) { ! $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)) ) ! { ! 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); + } + else if ($recent_show_user_bold) + { + $topic_poster_color = ''; + $topic_poster_style = 'style="font-weight : bold;"'; + } + else + { + $topic_poster_color = ''; + $topic_poster_style = ''; } $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> '; *************** *** 730,795 **** 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> '; --- 762,851 ---- else { ! if ($recent_show_user_color) { ! $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)) ) ! { ! 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); + } + else if ($recent_show_user_bold) + { + $last_poster_color = ''; + $last_poster_style = 'style="font-weight : bold;"'; + } + else + { + $last_poster_color = ''; + $last_poster_style = ''; } $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>'; ! if ($recent_show_user_color) { ! $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)) ) ! { ! 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); + } + else if ($recent_show_user_bold) + { + $topic_poster_color = ''; + $topic_poster_style = 'style="font-weight : bold;"'; + } + else + { + $topic_poster_color = ''; + $topic_poster_style = ''; } $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> '; Index: mx_glance.pak =================================================================== RCS file: /cvsroot/mxbb/mx_glance/mx_glance.pak,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mx_glance.pak 5 Aug 2007 19:42:07 -0000 1.3 --- mx_glance.pak 12 Aug 2007 18:46:00 -0000 1.4 *************** *** 9,12 **** --- 9,14 ---- parameter=+:73=+:142=+:Glance_title_length=+:Number=+:0=+:=+:0 parameter=+:73=+:143=+:Glance_show_new_bullets=+:Boolean=+:TRUE=+:=+:0=+:0 + parameter=+:73=+:143=+:Glance_show_user_color=+:Boolean=+:TRUE=+:=+:0=+:0 + parameter=+:73=+:143=+:Glance_show_user_bold=+:Boolean=+:TRUE=+:=+:0=+:0 parameter=+:73=+:144=+:Glance_track=+:Boolean=+:TRUE=+:=+:0=+:0 parameter=+:73=+:145=+:Glance_auth_read=+:Boolean=+:FALSE=+:=+:0=+:0 |