|
From: Jon O. <jon...@us...> - 2005-05-06 06:48:22
|
Update of /cvsroot/mxbb/core27x/modules/mx_statistics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13016/modules/mx_statistics Added Files: index.htm mx_install_readme.htm mx_statistics.php statistics.pak version_history.txt Log Message: Initital core 2.7.x commit :-) --- NEW FILE: statistics.pak --- module=+:70=+:statistics=+:modules/mx_statistics/=+:Statistics Modules=+:0 function=+:70=+:190=+:statistics=+:Statistics Module=+:mx_statistics.php=+: block=+:41=+:Statistics=+:=+:190=+:0=+:0=+:0 --- 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: #FFFFFF; border-style: solid; 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"><span class="postbody"><a name="top"> <p><br /> <span style="font-weight: bold"><span style="font-size: 16px; line-height: normal">Core Module</span></span> <br /> - for Mx Portal v. 2.7 (or later) <br /> <br /> <span style="font-weight: bold">Description</span> <br /> This module is an addon module for the Mx Portal. More detailed release info is published (and updated) at <a href="http://www.mx-system.com">www.mx-system.com</a>.<br /> <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 href="http://www.mx-system.com" target="_blank" class="postlink">DEMO </a> <br /> <br /> <a href="http://www.mx-system.com/index.php?page=4&action=category&cat_id=5" target="_blank" class="postlink"> DOWNLOAD </a> <br /> <br /><a name="install"> <br /> <span style="font-weight: bold">I. Installation Instructions</span> <br /> To install this module, follow these instructions. If you encounter any problems during install, visit the <a href="http://www.mx-system.com/forum/viewforum.php?f=20" target="_blank" class="postlink"> module support forum</a>. <br /> </p> <p>0) Consult the version_history.txt to learn about module version changes/updates. To install this module, follow these instructions. If you encounter any problems during install, visit the [url=http://www.mx-system.com/forum/viewforum.php?f=20] module support forum[/url].</p> <p>1) Override your old files, i.e. unzip the distributed files into your portal modules directory, /modules, and upload.</p> <p>2) Remove old module installation from MX.<br> In the AdminCP, browse to 'Module Management' and 'delete' any old module version. </p> <p><em>Note</em>: This will only remove the module from the MX system kernel. Module data itself (like actual downloads, weblinks, photos etc) will not be touch or deleted.</p> <p>3) Import new module to MX<br> In the AdminCP, browse to 'Module Management' and 'import' Module Pack for this module. Some warnings may be reported but this is generally nothing to worry about...but a symptom when upgrading.</p> <p>4) Now the module is installed, but to use it you need to add the module Block to a Portal Page. In the AdminCP, browse to 'Page Administration' and 'Add Block' to any portal page. Done!</p> <p><br /> <br /><a href="#top"> Back to Top<a> <br /> <br /><a name="themes"> <br /> <span style="font-weight: bold">II. Additional Styles</span> <br /> This module is compatible with any theme/style. All template files are located within modules/mx_modulename/templates. Note: You dont have to specify 'SubSilver' or any theme name, since all theme settings follow from the general portal/phpbb page header. <br /> <br /><a href="#top"> Back to Top<a> <br /> <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. <br /> <br /> Translated languages are downloaded <a href="http://www.mx-system.com/index.php?page=4&action=category&cat_id=5" target="_blank" class="postlink"> here</a>. <br /> <br /> If exists, download and install in the modules/mx_modulename/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 /><a href="#top"> Back to Top<a> <br /> <br /> /Mx Team</span><span class="gensmall"></span></p> </td> </tr> </table> </body> </html> --- NEW FILE: version_history.txt --- ################################################################# ## ## Mx Portal 2.7 - Statistics Module v. 1.04 ## v. 1.04 - Redeclare auth() fix - Some files updated. No db updates. Reinstalling (importing) is not needed! v. 1.03 - Bugfixes: BM13 - New/Updated file(s): mx_statistics.php mx_install_readme.htm - Delete old file(s): mx_install - readme.htm v. 1.02 - Various bugfixes - Changed files: *.pak file and mx_statistics.php v. 1.01 - New *.pak file, for automatic Block generation during install v. 1.0 - Numerous bugfixes ## ## /Mx Team ## ################################################################# --- 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> --- NEW FILE: mx_statistics.php --- <?php /*************************************************************************** * statistics.php * ------------------- * begin : Tue February 26 2002 * copyright : (C) 2002 Nivisec.com * email : ad...@ni... * * $Id: mx_statistics.php,v 1.1 2005/05/06 06:48:07 jonohlsson Exp $ * * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ if ( !defined('IN_PORTAL') ) { define('IN_PORTAL', true); $mx_root_path = "../../"; include($mx_root_path . 'extension.inc'); include($mx_root_path . 'common.'.$phpEx); // // // Start session management // $userdata = session_pagestart($user_ip, PAGE_INDEX); mx_init_userprefs($userdata); // // End session management // $block = FALSE; } else { // // Read block Configuration // $block_config = read_block_config( $block_id ); $title = $block_config[$block_id]['block_title']; $block = TRUE; } // //Start user modifiable variables // $return_limit = 10; // //End user modifiable variables // $template->assign_block_vars("switch_view", array()); // // End session management // //Vote Images based on the theme path, (i.e. templates/CURRNT_THEME/ is already inserted) $vote_left = PHPBB_URL . TEMPLATE_ROOT_PATH . "/images/vote_lcap.gif"; $vote_right = PHPBB_URL . TEMPLATE_ROOT_PATH . "/images/vote_rcap.gif"; $vote_bar = PHPBB_URL . TEMPLATE_ROOT_PATH . "/images/voting_bar.gif"; if ( file_exists($module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.'.$phpEx) ) { include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx); include($module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx); } else { include($phpbb_root_path . 'language/lang_english/lang_admin.' . $phpEx); include($module_root_path . 'language/lang_english/lang_main.' . $phpEx); } // Do the math :) (i think this is the same method as in philip mayer's statistic's file) // Taken from Acyd Burn. function do_math($firstval, $value, $total, &$percentage, &$bar_percent) { $cst = ($firstval > 0) ? 90 / $firstval : 90; if ( $value != 0 ) { $percentage = ( $total ) ? round( min(100, ($value / $total) * 100)) : 0; } else { $percentage = 0; } $bar_percent = round($value * $cst); } $template->set_filenames(array( "body" => "mx_statistics.tpl") ); $template->assign_vars(array( "GRAPH_IMAGE" => $graph_image, "L_ADMIN_STATISTICS" => $lang['Admin_Stats'], "L_TOP_SMILIES" => $lang['Top_Smilies'], "L_MOST_ACTIVE" => $lang['Most_Active_Topics'], "L_MOST_VIEWED" => $lang['Most_Viewed_Topics'], "L_TOP_POSTERS" => $lang['Top_Posting_Users'], "L_USES" => $lang['Uses'], "L_RANK" => $lang['Rank'], "L_PERCENTAGE" => $lang['Percent'], "L_GRAPH" => $lang['Graph'], "L_REPLIES" => $lang['Replies'], "L_TOPIC" => $lang['Topic'], "L_VIEWS" => $lang['Views'], "L_USERNAME" => $lang['Username'], "L_POSTS" => $lang['Posts'], "L_STATISTIC" => $lang['Statistic'], "L_VALUE" => $lang['Value'], "L_IMAGE" => $lang['smiley_url'], "L_CODE" => $lang['smiley_code'], "PAGE_NAME" => $lang['Statistics']) ); // // Authorization SQL // $auth_data_sql_stats = get_auth_forum(); // // Getting voting bar info from template // if( !$board_config['override_user_style'] ) { if( $userdata['user_id'] != ANONYMOUS && isset($userdata['user_style']) ) { $style = $userdata['user_style']; if( !$theme ) $style = $board_config['default_style']; } else $style = $board_config['default_style']; } else $style = $board_config['default_style']; $sql = "SELECT * FROM " . THEMES_TABLE . " WHERE themes_id = $style"; if(!$result = $db->sql_query($sql)) { message_die(CRITICAL_ERROR, "Couldn't query database for theme info."); } if( !$row = $db->sql_fetchrow($result) ) { message_die(CRITICAL_ERROR, "Couldn't get theme data for themes_id=$style."); } $template->assign_vars(array( "LEFT_GRAPH_IMAGE" => $vote_left, "RIGHT_GRAPH_IMAGE" => $vote_right, "GRAPH_IMAGE" => $vote_bar) ); // // Top posters SQL // $sql = "SELECT user_id, username, user_posts FROM " . USERS_TABLE . " WHERE user_id <> " . ANONYMOUS . " AND user_posts > 0 ORDER BY user_posts DESC LIMIT " . $return_limit; if (!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't retrieve users data", "", __LINE__, __FILE__, $sql); } $user_count = $db->sql_numrows($result); $user_data = $db->sql_fetchrowset($result); $percentage = 0; $bar_percent = 0; $firstcount = $user_data[0]['user_posts']; for ($i = 0; $i < $user_count; $i++) { do_math($firstcount, $user_data[$i]['user_posts'], get_db_stat('postcount'), $percentage, $bar_percent); $template->assign_block_vars("users", array( "RANK" => $i+1, "CLASS" => ( !($i+1 % 2) ) ? $theme['td_class2'] : $theme['td_class1'], "USERNAME" => $user_data[$i]['username'], "PERCENTAGE" => $percentage, "BAR" => $bar_percent, "URL" => append_sid( PHPBB_URL . "profile.php?mode=viewprofile&u=" . $user_data[$i]['user_id'] ), "POSTS" => $user_data[$i]['user_posts']) ); } // // Most active topics SQL // $sql = "SELECT topic_id, topic_title, topic_replies FROM " . TOPICS_TABLE ." WHERE forum_id IN ( $auth_data_sql_stats ) AND topic_status <> 2 AND topic_replies > 0 ORDER BY topic_replies DESC LIMIT " . $return_limit; if (!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't retrieve topic data", "", __LINE__, __FILE__, $sql); } $topic_data = $db->sql_fetchrowset($result); for ($i = 0; $i < count($topic_data); $i++) { $template->assign_block_vars("topicreplies", array( "RANK" => $i+1, "CLASS" => ( !($i+1 % 2) ) ? $theme['td_class2'] : $theme['td_class1'], "TITLE" => $topic_data[$i]['topic_title'], "REPLIES" => $topic_data[$i]['topic_replies'], "URL" => append_sid( PHPBB_URL . "viewtopic.php?t=" . $topic_data[$i]['topic_id'])) ); } // // Most viewed topics SQL // $rank = 0; $sql = "SELECT topic_id, topic_title, topic_views FROM " . TOPICS_TABLE ." WHERE forum_id IN ( $auth_data_sql_stats ) AND topic_status <> 2 AND topic_views > 0 ORDER BY topic_views DESC LIMIT " . $return_limit; if (!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't retrieve topic data", "", __LINE__, __FILE__, $sql); } $topic_data = $db->sql_fetchrowset($result); for ($i = 0; $i < count($topic_data); $i++) { $template->assign_block_vars("topicviews", array( "RANK" => $i+1, "CLASS" => ( !($i+1 % 2) ) ? $theme['td_class2'] : $theme['td_class1'], "TITLE" => $topic_data[$i]['topic_title'], "VIEWS" => $topic_data[$i]['topic_views'], "URL" => append_sid( PHPBB_URL . "viewtopic.php?t=" . $topic_data[$i]['topic_id'])) ); } // // Get forum statistics (taken from admin panel) // $total_posts = get_db_stat('postcount'); $total_users = get_db_stat('usercount'); $total_topics = get_db_stat('topiccount'); $start_date = create_date($board_config['default_dateformat'], $board_config['board_startdate'], $board_config['board_timezone']); $boarddays = ( time() - $board_config['board_startdate'] ) / 86400; $posts_per_day = sprintf("%.2f", $total_posts / $boarddays); $topics_per_day = sprintf("%.2f", $total_topics / $boarddays); $users_per_day = sprintf("%.2f", $total_users / $boarddays); $avatar_dir_size = 0; if ($avatar_dir = @opendir($phpbb_root_path . $board_config['avatar_path'])) { while( $file = @readdir($avatar_dir) ) { if( $file != "." && $file != ".." ) { $avatar_dir_size += @filesize($phpbb_root_path . $board_config['avatar_path'] . "/" . $file); } } @closedir($avatar_dir); // // This bit of code translates the avatar directory size into human readable format // Borrowed the code from the PHP.net annoted manual, origanally written by: // Jesse (je...@je...) // if($avatar_dir_size >= 1048576) { $avatar_dir_size = round($avatar_dir_size / 1048576 * 100) / 100 . " MB"; } else if($avatar_dir_size >= 1024) { $avatar_dir_size = round($avatar_dir_size / 1024 * 100) / 100 . " KB"; } else { $avatar_dir_size = $avatar_dir_size . " Bytes"; } } else { // Couldn't open Avatar dir. $avatar_dir_size = $lang['Not_available']; } if($posts_per_day > $total_posts) { $posts_per_day = $total_posts; } if($topics_per_day > $total_topics) { $topics_per_day = $total_topics; } if($users_per_day > $total_users) { $users_per_day = $total_users; } // // DB size ... MySQL only // // This code is heavily influenced by a similar routine // in phpMyAdmin 2.2.0 // if( preg_match("/^mysql/", SQL_LAYER) ) { $sql = "SELECT VERSION() AS mysql_version"; if($result = $db->sql_query($sql)) { $row = $db->sql_fetchrow($result); $version = $row['mysql_version']; if( preg_match("/^(3\.23|4\.)/", $version) ) { $db_name = ( preg_match("/^(3\.23\.[6-9])|(3\.23\.[1-9][1-9])|(4\.)/", $version) ) ? "`$dbname`" : $dbname; $sql = "SHOW TABLE STATUS"; // FROM " . $db_name; if($result = $db->sql_query($sql)) { $tabledata_ary = $db->sql_fetchrowset($result); $dbsize = 0; for($i = 0; $i < count($tabledata_ary); $i++) { if( $tabledata_ary[$i]['Type'] != "MRG_MyISAM" ) { if( $table_prefix != "" ) { if( strstr($tabledata_ary[$i]['Name'], $table_prefix) ) { $dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length']; } } else { $dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length']; } } } if( $dbsize >= 1048576 ) { $dbsize = sprintf("%.2f MB", ( $dbsize / 1048576 )); } else if( $dbsize >= 1024 ) { $dbsize = sprintf("%.2f KB", ( $dbsize / 1024 )); } else { $dbsize = sprintf("%.2f Bytes", $dbsize); } } // Else we couldn't get the table status. } else { $dbsize = $lang['Not_available']; } } else { $dbsize = $lang['Not_available']; } } else { $dbsize = $lang['Not_available']; } // //Newest user data // $newest_userdata = get_db_stat('newestuser'); $newest_user = $newest_userdata['username']; $newest_uid = $newest_userdata['user_id']; $sql = "SELECT user_regdate FROM " . USERS_TABLE . " WHERE user_id = " . $newest_userdata['user_id'] . " LIMIT 1"; if (!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't retrieve users data", "", __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $newest_user_date = $row['user_regdate']; // //Most Online data // $sql = "SELECT * FROM " . CONFIG_TABLE . " WHERE config_name = 'record_online_users' OR config_name = 'record_online_date'"; if (!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't retrieve configuration data", "", __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $most_users_date = ($row['config_value'] > 0) ? create_date($board_config['default_dateformat'], $row['config_value'], $board_config['board_timezone']) : $most_users_date = $lang['Not_available']; $row = $db->sql_fetchrow($result); $most_users = ($row['config_value'] > 0) ? $row['config_value'] : $lang['Not_available']; $statistic_array = array($lang['Number_posts'],$lang['Posts_per_day'],$lang['Number_topics'],$lang['Topics_per_day'],$lang['Number_users'],$lang['Users_per_day'],$lang['Board_started'],$lang['Board_Up_Days'],$lang['Database_size'],$lang['Avatar_dir_size'],$lang['Latest_Reg_User_Date'],$lang['Latest_Reg_User'],$lang['Most_Ever_Online_Date'],$lang['Most_Ever_Online'],$lang['Gzip_compression']); $value_array = array($total_posts, $posts_per_day, $total_topics, $topics_per_day, $total_users, $users_per_day, $start_date, sprintf('%.2f', $boarddays), $dbsize, $avatar_dir_size, create_date($board_config['default_dateformat'], $newest_user_date, $board_config['board_timezone']), sprintf('<a href="' . append_sid( PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">' . $newest_user . '</a>'), $most_users_date, $most_users, ( $board_config['gzip_compress'] ) ? $lang['Enabled'] : $lang['Disabled']); for ($i = 0; $i < count($statistic_array); $i += 2) { $template->assign_block_vars("adminrow", array( "STATISTIC" => $statistic_array[$i], "VALUE" => $value_array[$i], "STATISTIC2" => (isset($statistic_array[$i+1])) ? $statistic_array[$i + 1] : "", "VALUE2" => (isset($value_array[$i+1])) ? $value_array[$i + 1] : "") ); } // // End forum statistics // // //Output the page // $page_title = $lang['Statistics']; if ( !$block ) { include($mx_root_path . 'includes/page_header.'.$phpEx); } $template->pparse("body"); if ( !$block ) { include($mx_root_path . 'includes/page_tail.'.$phpEx); } ?> |