|
From: OryNider <ory...@us...> - 2007-06-06 21:47:57
|
Update of /cvsroot/mxbb/mx_glance/contrib In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6660/contrib Added Files: glance_body_old.tpl mx_glance_new.pak mx_glance_sdesc.php Log Message: --- NEW FILE: glance_body_old.tpl --- <table width="{BLOCK_SIZE}" cellpadding="4" cellspacing="1" border="0" class="forumline" style="border-top:none;"> <!-- BEGIN switch_glance_news --> <tr> <td class="catLeft" height="28"><span class="cattitle">{NEWS_HEADING}</span></td> </tr> <tr> <td class="row1" valign="top"><span class="genmed"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <!-- END switch_glance_news --> <!-- BEGIN news --> <tr> <td nowrap valign="top">{news.BULLET}</td> <td valign="top" width="100%"><span class="genmed"> <a href="{news.TOPIC_LINK}" class="genmed">{news.TOPIC_TITLE}</a></span><br><span class="gensmall" nowrap="nowrap">{news.TOPIC_TIME}</span></td> </tr> <!-- END news --> <!-- BEGIN switch_glance_news --> </table> </span></td> </tr> <!-- END switch_glance_news --> <!-- BEGIN switch_glance_recent --> <tr> <td class="catLeft" height="28"><span class="cattitle">{RECENT_HEADING}</span></td> </tr> <tr> <td class="row1" valign="top" height="100%"><span class="genmed"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <!-- END switch_glance_recent --> <!-- BEGIN recent --> <tr> <td nowrap valign="top">{recent.BULLET}</td> <td valign="top" width="100%"><span class="genmed"> <a href="{recent.TOPIC_LINK}" class="genmed">{recent.TOPIC_TITLE}</a></span> <span class="gensmall"><br />{L_WRITEN_BY}: {recent.TOPIC_POSTER}</a> <br>({recent.TOPIC_REPLIES}) {L_COMMENTS}</span> </td> </tr> <!-- END recent --> <!-- BEGIN switch_glance_recent --> </table> </span></td> </tr> <!-- END switch_glance_recent --> </table> --- NEW FILE: mx_glance_new.pak --- module=+:62=+:Last News and Topics=+:modules/mx_glance/=+:Glance Module=+:0 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:62=+:73=+:Last News and Topics=+:Last News and Topics=+:mx_glance.php=+: parameter=+:73=+:137=+:Glance_news_forum_id=+:Number=+:1=+:=+:0 parameter=+:73=+:138=+:Glance_num_news=+:Number=+:1=+:=+:0 parameter=+:73=+:139=+:Glance_num_recent=+:Number=+:5=+:=+:0 parameter=+:73=+:140=+:Glance_table_width=+:Number=+:200=+:=+:0 parameter=+:73=+:141=+:Glance_show_new_bullets=+:Boolean=+:TRUE=+:=+:0 parameter=+:73=+:142=+:Glance_track=+:Boolean=+:TRUE=+:=+:0 parameter=+:73=+:143=+:Glance_auth_read=+:Boolean=+:FALSE=+:=+:0 parameter=+:73=+:144=+:Glance_use_large=+:Radio_single_select=+:vertical=+:a:2:{i:0;s:8:"vertical";i:1;s:10:"horizontal";}=+:0=+:20 parameter=+:73=+:145=+:Glance_news_forum=+:Function=+:=+:get_list_multiple("{parameter_id}[]", FORUMS_TABLE, 'forum_id', 'forum_name', "{parameter_value}", TRUE)=+:0 parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Last News and Topics=+:Demo block=+:30=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 --- NEW FILE: mx_glance_sdesc.php --- <?php /** * * @package mxBB Portal Module - mx_glance * @version $Id: mx_glance_sdesc.php,v 1.1 2007/06/06 21:47:47 orynider Exp $ * @copyright (c) 2001-2006 blulegend, Jack Kan, OryNider * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ /******************************************************************************* * mx_glance.php ******************************************************************************** * History: *OryNider (31/01/2007) : 1st try *OryNider (20/02/2007) : modified for Simple Topic Description Mod - untested * to use rename/upload the file and add * {news.TOPIC_DESCRIPTION} / {recent.TOPIC_DESCRIPTION} * to your template files ;) ****************************************************************************** if( !defined('IN_PORTAL') || !is_object($mx_block)) { die("Hacking attempt"); } $phpEx = substr(strrchr(__FILE__, '.'), 1); if ( !function_exists( 'auth' ) ) { include_once($phpbb_root_path . 'includes/auth.'.$phpEx); } define('IN_GLANCE', true); // FORUM DIRECTORY // $glance_forum_dir = $phpbb_root_path; // // Read Block Settings // $title = $mx_block->block_info['block_title']; // // Setup config parameters // $glance_use_large = $mx_block->get_parameters( 'Glance_use_large' ); // NEWS FORUM ID // $glance_news_forum = $mx_block->get_parameters( 'Glance_news_forum' ); $glance_news_forum_id = $mx_block->get_parameters( 'Glance_news_forum_id' ); // NUMBER OF NEWS ARTICLES YOU WISH TO DISPLAY $glance_num_news = $mx_block->get_parameters( 'Glance_num_news' ); // NUMBER OF RECENT ARTICLES YOU WISH TO DISPLAY $glance_num_recent = $mx_block->get_parameters( 'Glance_num_recent' ); // TABLE WIDTH $glance_table_width = $mx_block->get_parameters( 'Glance_table_width' ); // CHANGE THE BULLET IF A TOPIC IS NEW? (true / false) $glance_show_new_bullets = $mx_block->get_parameters( 'Glance_show_new_bullets' ); // MESSAGE TRACKING WILL TRACK TO SEE IF A USER HAS READ THE TOPIC DURING THEIR SESSION (true / false) $glance_track = $mx_block->get_parameters( 'Glance_track' ); // SHOW TOPICS THE USER CAN VIEW, BUT NOT READ? (true / false) $glance_auth_read = $mx_block->get_parameters( 'Glance_auth_read' ); /* if ( empty($glance_news_forum) ) { $glance_news_forum = $auth_data_sql_msg; } if ( empty($glance_news_forum) ) { $glance_news_forum = -1; } */ // // Instantiate the mx_text class // include_once($mx_root_path . 'includes/mx_functions_tools.'.$phpEx); $mx_text = new mx_text(); $mx_text->init(true, false, false); // // Decode for display // $title = $mx_text->display($title); // // BEGIN OUTPUT // $template_tmp = $glance_use_large == 'horizontal' ? array('glance_output' => 'glance_body_big.tpl') : array('glance_output' => 'glance_body.tpl'); $template->set_filenames($template_tmp); // NEWS BULLET OLD $glance_news_bullet_old = '<span class="genmed"><b>›</b> </span>'; // CAN ALSO BE AN IMAGE // RECENT TOPIC BULLET OLD $glance_recent_bullet_old = '<span class="genmed"><b>›</b> </span>'; // CAN ALSO BE AN IMAGE // NEWS BULLET NEW $glance_news_bullet_new = '<span class="genmed" style="color:#FFA34F"><b>›</b> </span>'; // CAN ALSO BE AN IMAGE // RECENT TOPIC BULLET NEW $glance_recent_bullet_new = '<span class="genmed" style="color:#FFA34F"><b>›</b> </span>'; // CAN ALSO BE AN IMAGE // // Read language definition // if ( !file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) { include( $module_root_path . 'language/lang_english/lang_main.' . $phpEx ); } else { include( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); } // // GET USER LAST VISIT // $glance_last_visit = $userdata['user_lastvisit']; $glance_recent_offset = $HTTP_GET_VARS['glance_recent_offset']; $glance_news_offset = $HTTP_GET_VARS['glance_news_offset']; // // MESSAGE TRACKING // if ( !isset($tracking_topics) && $glance_track ) $tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : ''; // CHECK FOR BAD WORDS // // Define censored word matches // $orig_word = array(); $replacement_word = array(); obtain_word_list($orig_word, $replacement_word); // set the topic title sql depending on the character limit set in glance_config $sql_title = ($glance_topic_length) ? ", LEFT(t.topic_title, " . $glance_topic_length . ") as topic_title" : ", t.topic_title"; // // GET THE LATEST NEWS TOPIC // if ( $glance_num_news ) { $news_data = $db->sql_fetchrow($result); /* if ( 1 ) { $sql_select = ", p.post_time"; $sql_from = ", " . POSTS_TABLE . " p"; $sql_where = " AND p.post_id = t.topic_last_post_id"; } */ $sql = " SELECT f.forum_id, f.forum_name" . $sql_title . ", t.topic_id, t.topic_time, t.topic_last_post_id, t.topic_poster, t.topic_views, t.topic_replies, t.topic_type, t.topic_status, 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 (" . $glance_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"; $sql .= ($glance_news_offset) ? " LIMIT " . $glance_news_offset . ", " . $glance_num_news : " LIMIT " . $glance_num_news; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Could not query new news information", "", __LINE__, __FILE__, $sql); } $latest_news = array(); while ( $topic_row = $db->sql_fetchrow($result) ) { $topic_row['topic_title'] = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_row['topic_title']) : $topic_row['topic_title']; $latest_news[] = $topic_row; } $db->sql_freeresult($result); // MOD NAV BEGIN // obtain the total number of topic for our news topic navigation bit $sql = "SELECT SUM(forum_topics) as topic_total FROM " . FORUMS_TABLE . " f WHERE f.forum_id IN (" . $glance_news_forum_id . ")"; if ( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Could not query total topics information", "", __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $overall_news_topics = $row['topic_total']; $db->sql_freeresult($result); // MOD NAV END } // // GET THE LAST 5 TOPICS // if ( $glance_num_recent ) { $unauthed_forums = array(); $sql = "SELECT forum_id, auth_view FROM " . FORUMS_TABLE . " WHERE forum_id <> " . $glance_news_forum_id; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Could not query new topic information", "", __LINE__, __FILE__, $sql); } $glance_auth_level = ( $glance_auth_read ) ? AUTH_VIEW : AUTH_ALL; $is_auth_ary = array(); $is_auth_ary = auth($glance_auth_level, AUTH_LIST_ALL, $userdata); $forumsignore = $glance_news_forum_id; $base_url = mx_this_url(); if ( $num_forums = count($is_auth_ary) ) { while ( list($forum_id, $auth_mod) = each($is_auth_ary) ) { $unauthed = false; if ( !$auth_mod['auth_view'] && $auth_mod['forum_id'] != $glance_news_forum_id ) { $unauthed = true; } if ( !$glance_auth_read && !$auth_mod['auth_read'] && $auth_mod['forum_id'] != $glance_news_forum_id ) { $unauthed = true; } if ( $unauthed ) { $forumsignore .= ($forumsignore) ? ',' . $forum_id : $forum_id; } } } $forumsignore .= ($forumsignore && $glance_recent_ignore) ? ',' : ''; $sql = " SELECT f.forum_id, f.forum_name" . $sql_title . ", t.topic_id, t.topic_time, t.topic_last_post_id, t.topic_poster, t.topic_views, t.topic_replies, t.topic_type, t.topic_description, 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 (" . $forumsignore . $glance_recent_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"; $sql .= ($glance_recent_offset) ? " LIMIT " . $glance_recent_offset . ", " . $glance_num_recent : " LIMIT " . $glance_num_recent; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Could not query latest topic information", "", __LINE__, __FILE__, $sql); } $latest_topics = array(); $latest_anns = array(); $latest_stickys = array(); while ( $topic_row = $db->sql_fetchrow($result) ) { $topic_row['topic_title'] = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_row['topic_title']) : $topic_row['topic_title']; switch ($topic_row['topic_type']) { case POST_ANNOUNCE: $latest_anns[] = $topic_row; break; case POST_STICKY: $latest_stickys[] = $topic_row; break; default: $latest_topics[] = $topic_row; break; } } $latest_topics = array_merge($latest_anns, $latest_stickys, $latest_topics); $db->sql_freeresult($result); // MOD NAV BEGIN // obtain the total number of topic for our recent topic navigation bit $sql = "SELECT SUM(forum_topics) as topic_total FROM " . FORUMS_TABLE . " f WHERE f.forum_id NOT IN (" . $forumsignore . $glance_recent_ignore . $glance_news_forum_id . ")"; if ( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Could not query total topics information", "", __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $overall_total_topics = $row['topic_total']; $db->sql_freeresult($result); // MOD NAV END } if ( $glance_num_news ) { if ( !empty($latest_news) ) { $bullet_pre = 'glance_news_bullet'; for ( $i = 0; $i < count($latest_news); $i++ ) { if ( $userdata['session_logged_in'] ) { $unread_topics = false; $topic_id = $latest_news[$i]['topic_id']; if ( $latest_news[$i]['post_time'] > $glance_last_visit ) { $unread_topics = true; if( !empty($tracking_topics[$topic_id]) && $glance_track ) { if( $tracking_topics[$topic_id] >= $latest_news[$i]['post_time'] ) { $unread_topics = false; } } } $shownew = $unread_topics; } else { $unread_topics = false; $shownew = true; } $bullet_full = $bullet_pre . ( ( $shownew && $glance_show_new_bullets ) ? '_new' : '_old' ); $newest_code = ( $unread_topics && $glance_show_new_bullets ) ? '&view=newest' : ''; $topic_link = append_sid(PHPBB_URL . 'viewtopic.php?t=' . $latest_news[$i]['topic_id'] . $newest_code); // // MOD TODAY AT BEGIN // //if ( $board_config['time_today'] < $latest_news[$i]['post_time']) //{ // $last_post_time = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $latest_news[$i]['post_time'], $board_config['board_timezone'])); //} //else if ( $board_config['time_yesterday'] < $latest_topics[$i]['post_time']) //{ // $last_post_time = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $latest_news[$i]['post_time'], $board_config['board_timezone'])); //} // MOD TODAY AT END if ( $display_date == "TRUE" ) { $message_date = create_date($board_config['default_dateformat'], $latest_news[$i]['topic_time'], $board_config['board_timezone']); } else { $message_date = create_date($board_config['default_dateformat'], $latest_news[$i]['topic_time'], $board_config['board_timezone']); } $last_poster = ($latest_news[$i]['poster_id'] == ANONYMOUS ) ? ( ($latest_news[$i]['last_username'] != '' ) ? $latest_news[$i]['last_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $latest_news[$i]['poster_id']) . '">' . $latest_news[$i]['last_username'] . '</a> '; $last_poster .= '<a href="' . 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>'; $topic_poster = ($latest_news[$i]['topic_poster'] == ANONYMOUS ) ? ( ($latest_news[$i]['author_username'] != '' ) ? $latest_news[$i]['author_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $latest_news[$i]['topic_poster']) . '">' . $latest_news[$i]['author_username'] . '</a> '; $last_post_time = create_date($board_config['default_dateformat'], $latest_news[$i]['post_time'], $board_config['board_timezone']); $last_topic_description = $latest_news[$i]['topic_description']; $template->assign_block_vars('news', array( 'BULLET' => $$bullet_full, 'TOPIC_TITLE' => $latest_news[$i]['topic_title'], 'TOPIC_LINK' => append_sid($topic_link), 'TOPIC_TIME' => $message_date, 'TOPIC_DESCRIPTION' => $last_topic_description, 'POST_TIME' => $last_post_time, 'TOPIC_POSTER' => $topic_poster, 'TOPIC_VIEWS' => $latest_news[$i]['topic_views'], 'TOPIC_REPLIES' => $latest_news[$i]['topic_replies'], 'LAST_POSTER' => $last_poster, 'FORUM_TITLE' => $latest_news[$i]['forum_name'], 'FORUM_LINK' => $glance_forum_dir . 'viewforum.php?f=' . $latest_news[$i]['forum_id'] )); } // MOD NAV BEGIN if (($glance_news_offset > 0) or ($glance_news_offset+$glance_num_news < $overall_news_topics)) { $new_url = '<a href="' . $glance_forum_dir . 'index.' . $phpEx . '?glance_news_offset='; if ($glance_news_offset > 0) { // if we're not on the first record, we can always go backwards $prev_news_url = ($glance_recent_offset > 0) ? $new_url . ($glance_news_offset-$glance_num_news) . '&glance_recent_offset=' . $glance_recent_offset . '" class="th"><< Prev ' . $glance_num_news . '</a>' : $new_url . ($glance_news_offset-$glance_num_news).'" class="th"><< Prev ' . $glance_num_news . '</a>'; } if ($glance_news_offset+$glance_num_news < $overall_total_topics) { // offset + limit gives us the maximum record number // that we could have displayed on this page. if it's // less than the total number of entries, that means // there are more entries to see, and we can go forward $next_news_url = ($glance_recent_offset > 0) ? $new_url . ($glance_news_offset+$glance_num_news) . '&glance_recent_offset=' . $glance_recent_offset . '" class="th">Next ' . $glance_num_news . ' >></a>' : $new_url . ($glance_news_offset+$glance_num_news).'" class="th">Next ' . $glance_num_news . ' >></a>'; } } // MOD NAV END } else { $glance_news_total_info = 'None'; $template->assign_block_vars('news', array( 'BULLET' => $glance_recent_bullet_old, 'LAST_POSTER' => 'None', 'TOPIC_POSTER' => 'None', 'TOPIC_AUTHOR' => 'None', 'TOPIC_REPLIES' => '0', 'TOPIC_TITLE' => 'None' )); } } if ( $glance_num_recent ) { $glance_info = 'counted recent'; $bullet_pre = 'glance_recent_bullet'; if ( !empty($latest_topics) ) { for ( $i = 0; $i < count($latest_topics); $i++ ) { if ( $userdata['session_logged_in'] ) { $unread_topics = false; $topic_id = $latest_topics[$i]['topic_id']; if ( $latest_topics[$i]['post_time'] > $glance_last_visit ) { $unread_topics = true; if( !empty($tracking_topics[$topic_id]) && $glance_track ) { if( $tracking_topics[$topic_id] >= $latest_topics[$i]['post_time'] ) { $unread_topics = false; } } } $shownew = $unread_topics; } else { $unread_topics = false; $shownew = true; } if ( $display_date == "TRUE" ) { $topic_date_time = create_date($board_config['default_dateformat'], $latest_topics[$i]['topic_time'], $board_config['board_timezone']); } else { $topic_date_time = create_date($board_config['default_dateformat'], $latest_topics[$i]['topic_time'], $board_config['board_timezone']); } $bullet_full = $bullet_pre . ( ( $shownew && $glance_show_new_bullets ) ? '_new' : '_old' ); $newest_code = ( $unread_topics && $glance_show_new_bullets ) ? '&view=newest' : ''; $topic_link = append_sid(PHPBB_URL . 'viewtopic.php?t=' . $latest_topics[$i]['topic_id'] . $newest_code); $last_post_time = create_date($board_config['default_dateformat'], $latest_topics[$i]['post_time'], $board_config['board_timezone']); $last_topic_description = $latest_topics[$i]['topic_description']; $topic_poster = ($latest_topics[$i]['topic_poster'] == ANONYMOUS ) ? ( ($latest_topics[$i]['author_username'] != '' ) ? $latest_topics[$i]['author_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $latest_topics[$i]['topic_poster']) . '">' . $latest_topics[$i]['author_username'] . '</a> '; $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="' . append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $latest_topics[$i]['poster_id']) . '">' . $latest_topics[$i]['last_username'] . '</a> '; $last_poster .= '<a href="' . 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>'; // // MOD TODAY AT BEGIN // //if ( $board_config['time_today'] < $latest_topics[$i]['post_time']) //{ // $last_post_time = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $latest_topics[$i]['post_time'], $board_config['board_timezone'])); //} //else if ( $board_config['time_yesterday'] < $latest_topics[$i]['post_time']) //{ // $last_post_time = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $latest_topics[$i]['post_time'], $board_config['board_timezone'])); //} // MOD TODAY AT END $template->assign_block_vars('recent', array( 'BULLET' => $$bullet_full, 'TOPIC_LINK' => append_sid($topic_link), 'TOPIC_POSTS' => $latest_topics[$i]['topic_replies'], 'TOPIC_TIME' => $topic_date_time, 'TOPIC_DESCRIPTION' => $last_topic_description, 'TOPIC_TITLE' => $latest_topics[$i]['topic_title'], 'TOPIC_VIEWS' => $latest_topics[$i]['topic_views'], 'TOPIC_REPLIES' => $latest_topics[$i]['topic_replies'], 'POST_TIME' => $last_post_time, 'LAST_POSTER' => $last_poster, 'TOPIC_POSTER' => $topic_poster, 'TOPIC_AUTHOR' => $topic_poster, 'FORUM_TITLE' => $latest_topics[$i]['forum_name'], 'FORUM_LINK' => $glance_forum_dir . 'viewforum.php?f=' . $latest_topics[$i]['forum_id'] )); } // MOD NAV BEGIN if (($glance_recent_offset > 0) or ($glance_recent_offset+$glance_num_recent < $overall_total_topics)) { $new_url = '<a href="' . $glance_forum_dir . 'index.' . $phpEx . '?glance_recent_offset='; if ($glance_recent_offset > 0) { // if we're not on the first record, we can always go backwards $prev_recent_url = ($glance_news_offset > 0) ? $new_url . ($glance_recent_offset-$glance_num_recent) . '&glance_news_offset=' . $glance_news_offset . '" class="th"><< Prev ' . $glance_num_recent . '</a>' : $new_url . ($glance_recent_offset-$glance_num_recent).'" class="th"><< Prev ' . $glance_num_recent . '</a>'; } if ($glance_recent_offset+$glance_num_recent < $overall_total_topics) { // offset + limit gives us the maximum record number // that we could have displayed on this page. if it's // less than the total number of entries, that means // there are more entries to see, and we can go forward $next_recent_url = ($glance_news_offset > 0) ? $new_url . ($glance_recent_offset+$glance_num_recent) . '&glance_news_offset=' . $glance_news_offset . '" class="th">Next ' . $glance_num_recent . ' >></a>' : $new_url . ($glance_recent_offset+$glance_num_recent).'" class="th">Next ' . $glance_num_recent . ' >></a>'; } } // MOD NAV END } else { $glance_recent_total_info = 'None'; $template->assign_block_vars('recent', array( 'BULLET' => $glance_recent_bullet_old, 'LAST_POSTER' => 'None', 'TOPIC_POSTER' => 'None', 'TOPIC_AUTHOR' => 'None', 'TOPIC_REPLIES' => '0', 'TOPIC_TITLE' => 'None' )); } } if ( $glance_num_news ) { $template->assign_block_vars('switch_glance_news', array( 'NEXT_URL' => $next_news_url, 'PREV_URL' => $prev_news_url )); // MOD CAT ROLLOUT BEGIN //$news_on = !isset($HTTP_COOKIE_VARS['phpbbGlance_news']) || !empty($HTTP_COOKIE_VARS['phpbbGlance_news']) ? true : false; //if( $news_on ) //{ // $template->assign_block_vars('switch_glance_news.switch_news_on', array()); //} //else //{ // $template->assign_block_vars('switch_glance_news.switch_news_off', array()); //} // MOD CAT ROLLOUT END } if ( $glance_num_recent ) { $template->assign_block_vars('switch_glance_recent', array( 'NEXT_URL' => $next_recent_url, 'PREV_URL' => $prev_recent_url )); // MOD CAT ROLLOUT BEGIN //$recent_on = !isset($HTTP_COOKIE_VARS['phpbbGlance_recent']) || !empty($HTTP_COOKIE_VARS['phpbbGlance_recent']) ? true : false; //if( $recent_on ) //{ // $template->assign_block_vars('switch_glance_recent.switch_recent_on', array()); //} //else //{ // $template->assign_block_vars('switch_glance_recent.switch_recent_off', array()); //} // MOD CAT ROLLOUT END } if ($glance_news_total_info == 'None' && $glance_recent_total_info == 'None') { $template->assign_block_vars("no_glance_news_and_recent", array( 'L_NO_ITEMS' => $lang['No_items_found'] )); } $template->assign_vars(array( 'L_TITLE' => ( !empty($title) ? $title : 'Last Message' ), 'NEWS_HEADING' => ( !empty($lang['glance_news_heading']) ? $lang['glance_news_heading'] : 'Latest Site News' ), 'RECENT_HEADING' => ( !empty($lang['glance_recent_heading']) ? $lang['glance_recent_heading'] : 'Recent Discussions' ), 'U_PHPBB_ROOT_PATH' => PHPBB_URL, 'U_PORTAL_ROOT_PATH' => PORTAL_URL, 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, 'L_COMMENTS' => $lang['comments'], 'L_TOPICS' => $lang['Topics'], 'L_REPLIES' => $lang['Replies'], 'L_VIEWS' => $lang['Views'], 'L_LASTPOST' => $lang['Last_Post'], 'L_AUTHOR' => $lang['Author'], 'L_WRITEN_BY' => $lang['writen_by'], 'L_LAST_BY' => $lang['last_by'], 'L_LAST_REPLY' => $lang['last_reply'], 'L_FORUM' => $lang['Forum'], 'L_POSTS' => $lang['Posts'], 'L_NO_NEW_POSTS' => $lang['No_new_posts'], 'L_NEW_POSTS' => $lang['New_posts'], 'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'], 'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'], 'BLOCK_SIZE' => ( !empty($block_size) ? $block_size : $glance_table_width ), 'L_BACK_TO_TOP' => ( !empty($lang['Back_to_top']) ? $lang['Back_to_top'] : 'Back to Top' ) )); $template->pparse('glance_output'); // THE END ?> |