|
From: OryNider <ory...@us...> - 2007-06-06 21:48:02
|
Update of /cvsroot/mxbb/mx_glance In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6660 Added Files: db_install.php db_upgrade.php index.htm mx_glance.pak mx_glance.php mx_install_readme.htm Log Message: --- NEW FILE: db_upgrade.php --- <?php /** * * @package mxBB Portal Module - mx_glance * @version $Id: db_upgrade.php,v 1.1 2007/06/06 21:47:49 orynider Exp $ * @copyright (c) 2002-2006 [Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $mx_root_path = './../../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $mx_user->init($user_ip, PAGE_INDEX); if ( !$userdata['session_logged_in'] ) { die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { die( "Hacking attempt(2)" ); } // End session management } $mx_module_version = '2.3.3'; $mx_module_copy = 'mxBB <i> - At A Glace</i> module by blulegend, Jack Kan & <a href="http://www.mxbb.net" target="_blank">Mx Team</a>'; $message = "<b>Upgrading!</b><br/><br/>"; $sql = array(); $sql[] = "UPDATE " . $mx_table_prefix . "module" . " SET module_version = '" . $mx_module_version . "', module_copy = '" . $mx_module_copy . "' WHERE module_id = '" . $mx_module_id . "'"; $message .= mx_do_install_upgrade( $sql ); echo "<br /><br />"; echo "<table width=\"90%\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\" class=\"forumline\">"; echo "<tr><th class=\"thHead\" align=\"center\">Module Installation/Upgrading/Uninstalling Information - module specific db tables</th></tr>"; echo "<tr><td class=\"row1\" align=\"left\"><span class=\"gen\">" . $message . "</span></td></tr>"; echo "</table><br />"; ?> --- NEW FILE: mx_install_readme.htm --- <html> <head> <title>Mx Portal installation - readme</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!-- link rel="stylesheet" href="templates/subSilver/subSilver.css" type="text/css" --> <style type="text/css"> <!-- /* The original subSilver Theme for phpBB version 2+ Created by subBlue design http://www.subBlue.com NOTE: These CSS definitions are stored within the main page body so that you can use the phpBB2 theme administration centre. When you have finalised your style you could cut the final CSS code and place it in an external file, deleting this section to save bandwidth. */ /* General page style. The scroll bar colours only visible in IE5.5+ */ body { background-color: #E5E5E5; scrollbar-face-color: #DEE3E7; scrollbar-highlight-color: #FFFFFF; scrollbar-shadow-color: #DEE3E7; scrollbar-3dlight-color: #D1D7DC; scrollbar-arrow-color: #006699; scrollbar-track-color: #EFEFEF; scrollbar-darkshadow-color: #98AAB1; } /* General font families for common tags */ font, th, td, p { font-family: Verdana, Arial, Helvetica, sans-serif } a:link, a:active, a:visited { color : #006699; } a:hover { text-decoration: underline; color : #DD6900; } hr { height: 0px; border: solid #D1D7DC 0px; border-top-width: 1px;} /* This is the border line & background colour round the entire page */ .bodyline { background-color: #FFFFFF; border: 1px #98AAB1 solid; } /* This is the outline round the main forum tables */ .forumline { background-color: #FFFFFF; border: 2px #006699 solid; } /* Main table cell colours and backgrounds */ td.row1 { background-color: #EFEFEF; } td.row2 { background-color: #DEE3E7; } td.row3 { background-color: #D1D7DC; } /* This is for the table cell above the Topics, Post & Last posts on the index.php page By default this is the fading out gradiated silver background. However, you could replace this with a bitmap specific for each forum */ td.rowpic { background-color: #FFFFFF; background-image: url('../../install/templates/subSilver/images/cellpic2.jpg'); background-repeat: repeat-y } /* Header cells - the blue and silver gradient backgrounds */ th { color: #FFA34F; font-size: 11px; font-weight : bold; background-color: #006699; height: 25px; background-image: url('../../install/templates/subSilver/images/cellpic3.gif'); } td.cat, td.catHead, td.catSides, td.catLeft, td.catRight, td.catBottom { background-image: url('../../install/templates/subSilver/images/cellpic1.gif'); background-color:#D1D7DC; border: medium solid #FFFFFF; height: 28px } /* Setting additional nice inner borders for the main table cells. The names indicate which sides the border will be on. Don't worry if you don't understand this, just ignore it :-) */ td.cat, td.catHead, td.catBottom { height: 29px; border-width: 0px 0px 0px 0px; } th.thHead, th.thSides, th.thTop, th.thLeft, th.thRight, th.thBottom, th.thCornerL, th.thCornerR { font-weight: bold; border: #FFFFFF; border-style: solid; height: 28px; } td.row3Right, td.spaceRow { background-color: #D1D7DC; border: #FFFFFF; border-style: solid; } th.thHead, td.catHead { font-size: 12px; border-width: 1px 1px 0px 1px; } th.thSides, td.catSides, td.spaceRow { border-width: 0px 1px 0px 1px; } th.thRight, td.catRight, td.row3Right { border-width: 0px 1px 0px 0px; } th.thLeft, td.catLeft { border-width: 0px 0px 0px 1px; } th.thBottom, td.catBottom { border-width: 0px 1px 1px 1px; } th.thTop { border-width: 1px 0px 0px 0px; } th.thCornerL { border-width: 1px 0px 0px 1px; } th.thCornerR { border-width: 1px 1px 0px 0px; } /* The largest text used in the index page title and toptic title etc. */ .maintitle { font-weight: bold; font-size: 22px; font-family: "Trebuchet MS",Verdana, Arial, Helvetica, sans-serif; text-decoration: none; line-height : 120%; color : #000000; } /* General text */ .gen { font-size : 12px; } .genmed { font-size : 11px; } .gensmall { font-size : 10px; } .gen, .genmed, .gensmall { color : #000000; } a.gen, a.genmed, a.gensmall { color: #006699; text-decoration: none; } a.gen:hover, a.genmed:hover, a.gensmall:hover { color: #DD6900; text-decoration: underline; } /* The register, login, search etc links at the top of the page */ .mainmenu { font-size : 11px; color : #000000 } a.mainmenu { text-decoration: none; color : #006699; } a.mainmenu:hover{ text-decoration: underline; color : #DD6900; } /* Forum category titles */ .cattitle { font-weight: bold; font-size: 12px ; letter-spacing: 1px; color : #006699} a.cattitle { text-decoration: none; color : #006699; } a.cattitle:hover{ text-decoration: underline; } /* Forum title: Text and link to the forums used in: index.php */ .forumlink { font-weight: bold; font-size: 12px; color : #006699; } a.forumlink { text-decoration: none; color : #006699; } a.forumlink:hover{ text-decoration: underline; color : #DD6900; } /* Used for the navigation text, (Page 1,2,3 etc) and the navigation bar when in a forum */ .nav { font-weight: bold; font-size: 11px; color : #000000;} a.nav { text-decoration: none; color : #006699; } a.nav:hover { text-decoration: underline; } /* titles for the topics: could specify viewed link colour too */ .topictitle, h1, h2 { font-weight: bold; font-size: 11px; color : #000000; } a.topictitle:link { text-decoration: none; color : #006699; } a.topictitle:visited { text-decoration: none; color : #5493B4; } a.topictitle:hover { text-decoration: underline; color : #DD6900; } /* Name of poster in viewmsg.php and viewtopic.php and other places */ .name { font-size : 11px; color : #000000;} /* Location, number of posts, post date etc */ .postdetails { font-size : 10px; color : #000000; } /* The content of the posts (body of text) */ .postbody { font-size : 12px; line-height: 18px} a.postlink:link { text-decoration: none; color : #006699 } a.postlink:visited { text-decoration: none; color : #5493B4; } a.postlink:hover { text-decoration: underline; color : #DD6900} /* Quote & Code blocks */ .code { font-family: Courier, 'Courier New', sans-serif; font-size: 11px; color: #006600; background-color: #FAFAFA; border: #D1D7DC; border-style: solid; border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px } .quote { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #444444; line-height: 125%; background-color: #FAFAFA; border: #D1D7DC; border-style: solid; border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px } /* Copyright and bottom info */ .copyright { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;} a.copyright { color: #444444; text-decoration: none;} a.copyright:hover { color: #000000; text-decoration: underline;} /* Form elements */ input, textarea, select { color : #000000; font: normal 11px Verdana, Arial, Helvetica, sans-serif; border-color : #000000; } /* The text input fields background colour */ input.post, textarea.post, select { background-color : #FFFFFF; } input { text-indent : 2px; } /* The buttons used for bbCode styling in message post */ input.button { background-color : #EFEFEF; color : #000000; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; } /* The main submit button option */ input.mainoption { background-color : #FAFAFA; font-weight : bold; } /* None-bold submit button */ input.liteoption { background-color : #FAFAFA; font-weight : normal; } /* This is the line in the posting page which shows the rollover help line. This is actually a text box, but if set to be the same colour as the background no one will know ;) */ .helpline { background-color: #DEE3E7; border-style: none; } /* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */ @import url("templates/subSilver/formIE.css"); --> </style> <script language="Javascript" type="text/javascript"> <!-- if ( 0 ) { window.open('privmsg.php?mode=newpm', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');; } //--> </script> </head> <body bgcolor="#FFFFFF" text="#000000"> <table> <tr> <td colspan="2"><p><b><font face="Tahoma">MX Module - mx_glance<br> v. </font></b><font face="Tahoma"><b>2.3.3</b></font></p> <p><font face="Tahoma"> <span style="line-height: normal; font-weight:bold">Module</span> <br /> - tested with Mx Portal v. 2.8.0</font></p> <p><font face="Tahoma"><strong>Authors</strong><br /> blulegend, Jack Kan, OryNider, netclectic<br /> <br /> <span style="font-weight: bold">Description</span> <br /> The MX Module is an addon product for the mxBB-portal. This module / block is showing latest news and recent topics on any page.Customizable to show only news, only recent topics, or both. Will check the authorization of users and only show allowed topics.</font></p> <p><font face="Tahoma"><strong>Features</strong> <br /> Easy to use and install/uninstall module.</font></p> <p> <font face="Tahoma"> <br /> I. <a href="#install">Installation instructions</a> <br /> <br /> II. <a href="#themes">Additional styles</a> <br /> <br /> III. <a href="#languages">Additional languages</a><br /> <br /> <a target="_blank" class="postlink" href="http://pubory.uv.ro/potal/"> </a> <br /> <br /><a name="install"> <br /> <span style="font-weight: bold">I. Installation Instructions</span> <br /> To install this module, follow these instructions.</a></font></p> <font face="Tahoma">To summarize:<br> If installing from scratch, use import module in the AdminCP.<br> If upgrading, upgrade from AdminCP<br> If uninstalling, use the delete feature in the AdminCP</font></p> <p style="margin-top: 0; margin-bottom: 0"> <font face="Tahoma"> <br /> <span class="gensmall"><a href="#top" onclick="window.scrollTo(0,0); return false"> <font size="2">Back to Top</font></a></span><font size="2"> </font> <br /> <br /><b>II. Additional Styles</b> <br> This module is compatible with any theme/style. <br> <a name="themes"> </font></p> <p style="margin-top: 0; margin-bottom: 0"><font face="Tahoma"> <span class="gensmall"><a href="#top" onclick="window.scrollTo(0,0); return false"> <font size="2">Back to Top</font></a></span><font size="2"> </font> <br /><a name="languages"> <br /> <span style="font-weight: bold">III. Additional Languages</span> <br /> First check to see if your language is already translated. </a> <br /> <br /> If exists, download and install in the modules/mx_glance/language folder. If not, duplicate (copy and paste) any included language file, rename to match your language, translate using any texteditor, save and upload. <br /> <br /> <span class="gensmall"><a href="#top" onclick="window.scrollTo(0,0); return false"> <font size="2">Back to Top</font></a></span><font size="2"> </font> </font></p> <p> <font face="Tahoma">/Mx Development Team</font></p> </td> </tr> </table> </body> </html> --- NEW FILE: db_install.php --- <?php /** * * @package mxBB Portal Module - mx_glance * @version $Id: db_install.php,v 1.1 2007/06/06 21:47:48 orynider Exp $ * @copyright (c) 2002-2006 [Jon Ohlsson] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $mx_root_path = './../../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include( $mx_root_path . 'common.' . $phpEx ); // Start session management $mx_user->init($user_ip, PAGE_INDEX); if ( !$userdata['session_logged_in'] ) { die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { die( "Hacking attempt(2)" ); } // End session management } $mx_module_version = '2.3.3'; $mx_module_copy = 'mxBB <i> - At A Glance</i> module by blulegend, Jack Kan & <a href="http://www.mxbb.net" target="_blank">Mx Team</a>'; $message = "<b>This is a fresh install!</b><br/><br/>"; $sql = array(); $sql[] = "UPDATE " . $mx_table_prefix . "module" . " SET module_version = '" . $mx_module_version . "', module_copy = '" . $mx_module_copy . "' WHERE module_id = '" . $mx_module_id . "'"; $message .= mx_do_install_upgrade( $sql ); echo "<br /><br />"; echo "<table width=\"90%\" align=\"center\" cellpadding=\"4\" cellspacing=\"1\" border=\"0\" class=\"forumline\">"; echo "<tr><th class=\"thHead\" align=\"center\">Module Installation/Upgrading/Uninstalling Information - module specific db tables</th></tr>"; echo "<tr><td class=\"row1\" align=\"left\"><span class=\"gen\">" . $message . "</span></td></tr>"; echo "</table><br />"; ?> --- NEW FILE: mx_glance.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=+:0 parameter=+:73=+:142=+:Glance_track=+:Boolean=+:TRUE=+:=+:0=+:0 parameter=+:73=+:143=+:Glance_auth_read=+:Boolean=+:FALSE=+:=+:0=+: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=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Last News and Topics=+:Demo - Vertical block=+:30=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 --- NEW FILE: mx_glance.php --- <?php /** * * @package mxBB Portal Module - mx_glance * @version $Id: mx_glance.php,v 1.1 2007/06/06 21:47:54 orynider Exp $ * @copyright (c) 2001-2006 blulegend, Jack Kan, OryNider * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ 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, 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']); $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, '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']); $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_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 ?> --- NEW FILE: index.htm --- <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> </body> </html> |