Update of /cvsroot/mxbb/mx_sitestats In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29610 Added Files: SiteStats.pak adminstats.php collector.php counter.php db_install.php db_uninstall.php db_upgrade.php fastestusers.php monthlyposts.php monthlytopics.php monthlyusers.php mostintopics.php mx_install_readme.htm sitestaff.php topavatars.php topposters.php topposters_tiny.php topreferers.php topsmilies.php topstarters.php toptopics.php topwords.php usersranks.php version_history.txt Log Message: readded this module... --- NEW FILE: topstarters.php --- <?php /** ------------------------------------------------------------------------ * Subject : mxBB - a fully modular portal and CMS (for phpBB) * Author : Jon Ohlsson and the mxBB Team * Credits : The phpBB Group & Marc Morisette, Marc Ferran (www.phpmix.com) * based on : Most Active Topic Starter MOD v.1.2.0 by RustyDragon * Copyright : (C) 2002-2005 mxBB Portal, phpMiX (c) 2004 * Email : jo...@mx... * Project site : www.mxbb-portal.com * ------------------------------------------------------------------------- * * $Id: topstarters.php,v 1.1 2005/10/15 22:18:27 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. */ // -------------------------------------------------------------------------------- // Block Initialization // -------------------------------------------------------------------------------- if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt !!!" ); } // Include common module stuff... include_once( $module_root_path . 'includes/common.' . $phpEx ); $block_config = read_block_config( $block_id ); $title = !empty($lang[$block_config[$block_id]['block_title']]) ? $lang[$block_config[$block_id]['block_title']] : $block_config[$block_id]['block_title']; if ( !isset( $ss_phpbb ) ) { $ss_phpbb = new sitestats_phpbb(); } // -------------------------------------------------------------------------------- // Block Procedure // -------------------------------------------------------------------------------- // This is the template used to render this block. $template->set_filenames( array( 'body' => 'sitestats_topstarters_body.tpl' ) ); // Most Active Topic Starters $sql = 'SELECT u.user_id, u.username, COUNT(t.topic_poster) AS num_topics FROM ' . USERS_TABLE . ' u, ' . TOPICS_TABLE . ' t WHERE (t.topic_poster <> ' . ANONYMOUS . ' ) AND (u.user_posts > 0) AND (u.user_id = t.topic_poster) GROUP BY t.topic_poster ORDER BY num_topics DESC LIMIT ' . $ss_phpbb->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 ); $firstcount = $user_data[0]['num_topics']; $total_topics = $ss_phpbb->get_db_stat( 'topiccount' ); for( $i = 0; $i < $user_count; $i++ ) { $percent_array = $ss_phpbb->do_percent_math( $firstcount, $user_data[$i]['num_topics'], $total_topics ); $template->assign_block_vars( 'datarow', array( 'RANK' => $i + 1, 'CLASS' => ( !( $i + 1 % 2 ) ) ? $theme['td_class2'] : $theme['td_class1'], 'USERNAME' => $user_data[$i]['username'], 'PERCENTAGE' => $percent_array['percentage'], 'BAR' => $percent_array['bar_percent'], 'URL' => append_sid( PHPBB_URL . 'profile.php?mode=viewprofile&u=' . $user_data[$i]['user_id'] ), 'TOPICS' => $user_data[$i]['num_topics'] ) ); } // Setup voting bar images... $ss_phpbb->set_voting_bar(); // Setup common template vars and display the block. $template->assign_vars( array( 'L_TOPICS' => $lang['Topics'], 'L_RANK' => $lang['Rank'], 'L_PERCENTAGE' => $lang['Percent'], 'L_GRAPH' => $lang['Graph'], 'L_USERNAME' => $lang['Username'], 'TEXT_CLASS' => $ss_phpbb->text_class, 'L_TITLE' => $lang['Top_Starters'] ) ); $template->pparse( 'body' ); ?> --- NEW FILE: version_history.txt --- ################################################################# ## ## mx_sitestats module v.1.3.1 for MX-System Portal 2.7+ ## ## mx_sitestats Author: ## - markus_petrux ## ## NOTE: ## - Be sure to apply the MODs to page_header.php (see section below). ## - For further information, please visit http://www.phpmix.com ## ## Editor TabSize = 4 ## v.1.3.1 - 2004/07/13 (markus_petrux) - Fixed a problem related to PHP Session Management. v.1.3.0 - 2004/06/12 (markus_petrux) - Final? - Added width and height to counter images using getimagesize. - Fixed a small bug with the HTTP Referers parser. - Added new parameter to allow link from Counter block to SiteStats page. v.1.3.0 - 2004/06/02 (markus_petrux) - Beta 2 - Added option to decide which counter to show: hits, session or both. - Fixed db_uninstall.php, config table was missing in beta 1. v.1.3.0 - 2004/06/02 (markus_petrux) - Beta 1 - Added option to display the counter with graphics. - Removed block parameters for the Counter. - Added new AdminCP script to manage Counter/Referer settings. - Changed the way collector.php works. - Now page_header.php MOD is required to activate the collector !!! - Added TopPosters (Tiny) block (only shows username and posts). v.1.3.0 - 2004/05/22 (markus_petrux) - Alfa 2 (self testing) - Added db_upgrade.php script. - Added Top HTTP Referers functionality. v.1.3.0 - 2004/01/15 (markus_petrux) - Alfa 1 (self testing) - Added unique session counter (now, we can count hits and sessions). - Added javascript function to preload graph images. v.1.2.0 - 2003/09/12 (markus_petrux) - Added AdminStats block (based on Administrative Statistics v.2.1.0 by Nivisec, Acyd Burn). - Added MonthlyPosts block (based on New Posts By Month v.1.0.0 by Tommy Jensen). - Added MonthlyTopics block (based on New Topics By Month v.1.0.0 by Tommy Jensen). - Added MonthlyUsers block (based on New Users By Month v.1.0.0 by Tommy Jensen). - Added TopPosters block (based on Top Posters v.2.1.0 by Nivisec, Acyd Burn). - Added TopStarters block (based on Most Active Topic Starter v.1.2.0 by Rusty Dragon). - Added FastestUsers block (based on Fastest Users v.1.1.0 by Rusty Dragon). - Added TopTopics block (based on Most Viewed/Active Topics v.2.1.0 by Nivisec, Acyd Burn). - Added MostInTopics block (based on Most Intersenting Topics v.1.3.0 by Rusty Dragon). - Added TopSmilies block (based on Top Smilies v.2.1.0 by Acyd Burn). - Added TopAvatars block (based on Top Avatars v.1.5.0 by Rusty Dragon). - Added TopWords block (based on Top Words v.1.2.0 by Rusty Dragon). - Added UsersRanks block (based on Users Ranks v.1.3.1 by Rusty Dragon). v.1.1.0 - 2003/09/07 (markus_petrux) - Added SiteStaff block (based on Staff v.2.0.3 by Acid). v.1.0.2 - 2003/07/31 (markus_petrux) - Fixed problem with collector.php and $module_root_path. v.1.0.1 - 2003/07/22 (markus_petrux) - Added db_uninstall.php script. - Added AdminCP option to manage counters. - General cleanup of common classes. - Added collector.php which should be included in page_header.php - Please, apply the MODs at the end of this file. v.1.0.0 - 2003/07/10 (markus_petrux) - Very first beta. ## ## /Markus ## ################################################################# ################################################################# ## ## M M OOO DDDD SSS ## MM MM O O D D S ## M M M O O D D SSS ## M M M O O D D S ## M M OOO DDDD SSS ## ################################################################# ## ## # #---[ OPEN ]---------- # mxroot/includes/page_header.php # #---[ FIND ]---------- # ?> # #---[ BEFORE, ADD ]---------- # // ------------------------------ // MOD:mx_sitestats:begin // include_once( $mx_root_path . 'modules/mx_sitestats/collector.' . $phpEx ); // //MOD:mx_sitestats:end // ------------------------------ # #---[ SAVE ]---------- # ## ## ################################################################# ## ## # #---[ OPEN ]---------- # phpbb/includes/page_header.php # #---[ FIND ]---------- # ?> # #---[ BEFORE, ADD ]---------- # // ------------------------------ // MOD:mx_sitestats:begin // // Select (or edit) to match relative path to your mx root !!! $mx_root_path = '../portal/'; $mx_root_path = '../'; include_once( $mx_root_path . 'modules/mx_sitestats/collector.' . $phpEx ); // //MOD:mx_sitestats:end // ------------------------------ # #---[ SAVE ]---------- # ## ## ## ################################################################# --- NEW FILE: SiteStats.pak --- module=+:48=+:SiteStats=+:modules/mx_sitestats/=+:Site Statistics module v1.3.1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:62=+:SiteStats Administrative=+:=+:adminstats.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - SiteStats Administrative=+:Demo block=+:62=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:60=+:Counter=+:=+:counter.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - Counter=+:Demo block=+:60=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:68=+:SiteStats FastestUsers=+:=+:fastestusers.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - SiteStats FastestUsers=+:Demo block=+:68=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:63=+:SiteStats MonthlyPosts=+:=+:monthlyposts.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - SiteStats MonthlyPosts=+:Demo block=+:63=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:64=+:SiteStats MonthlyTopics=+:=+:monthlytopics.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - SiteStats MonthlyTopics=+:Demo block=+:64=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:65=+:SiteStats MonthlyUsers=+:=+:monthlyusers.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - SiteStats MonthlyUsers=+:Demo block=+:65=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:70=+:SiteStats MostInTopics=+:=+:mostintopics.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - SiteStats MostInTopics=+:Demo block=+:70=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:75=+:SiteStats Staff=+:=+:sitestaff.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - SiteStats Staff=+:Demo block=+:75=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:72=+:SiteStats TopAvatars=+:=+:topavatars.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - SiteStats TopAvatars=+:Demo block=+:72=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:66=+:SiteStats TopPosters=+:=+:topposters.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - SiteStats TopPosters=+:Demo block=+:66=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:76=+:SiteStats TopPosters (Tiny)=+:=+:topposters_tiny.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - SiteStats TopPosters (Tiny)=+:Demo block=+:76=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:61=+:SiteStats TopReferers=+:=+:topreferers.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - SiteStats TopReferers=+:Demo block=+:61=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:71=+:SiteStats TopSmilies=+:=+:topsmilies.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - SiteStats TopSmilies=+:Demo block=+:71=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:67=+:SiteStats TopStarters=+:=+:topstarters.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - SiteStats TopStarters=+:Demo block=+:67=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:69=+:SiteStats TopTopics=+:=+:toptopics.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - SiteStats TopTopics=+:Demo block=+:69=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:73=+:SiteStats TopWords=+:=+:topwords.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - SiteStats TopWords=+:Demo block=+:73=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 function=+:48=+:74=+:SiteStats UsersRanks=+:=+:usersranks.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Demo - SiteStats UsersRanks=+:Demo block=+:74=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 --- NEW FILE: monthlyposts.php --- <?php /** ------------------------------------------------------------------------ * Subject : mxBB - a fully modular portal and CMS (for phpBB) * Author : Jon Ohlsson and the mxBB Team * Credits : The phpBB Group & Marc Morisette, Marc Ferran (www.phpmix.com) * based on : New Posts By Month MOD v.1.0.0 by Tommy Jensen * Copyright : (C) 2002-2005 mxBB Portal, phpMiX (c) 2004 * Email : jo...@mx... * Project site : www.mxbb-portal.com * ------------------------------------------------------------------------- * * $Id: monthlyposts.php,v 1.1 2005/10/15 22:18:27 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. */ // -------------------------------------------------------------------------------- // Block Initialization // -------------------------------------------------------------------------------- if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt !!!" ); } // Include common module stuff... include_once( $module_root_path . 'includes/common.' . $phpEx ); $block_config = read_block_config( $block_id ); $title = !empty($lang[$block_config[$block_id]['block_title']]) ? $lang[$block_config[$block_id]['block_title']] : $block_config[$block_id]['block_title']; if ( !isset( $ss_phpbb ) ) { $ss_phpbb = new sitestats_phpbb(); } // -------------------------------------------------------------------------------- // Block Procedure // -------------------------------------------------------------------------------- // This is the template used to render this block. $template->set_filenames( array( 'body' => 'sitestats_monthlystats_body.tpl' ) ); // Number of New Posts by Month $sql = 'SELECT YEAR(FROM_UNIXTIME(post_time)) AS aar, MONTH(FROM_UNIXTIME(post_time)) AS mnd, COUNT(*) AS ant FROM ' . POSTS_TABLE . ' GROUP BY YEAR(FROM_UNIXTIME(post_time)),MONTH(FROM_UNIXTIME(post_time)) ORDER BY post_time'; if ( !( $result = $db->sql_query( $sql ) ) ) { message_die( GENERAL_ERROR, "Couldn't retrieve posts data", '', __LINE__, __FILE__, $sql ); } $posts_count = $db->sql_numrows( $result ); $posts_data = $db->sql_fetchrowset( $result ); for( $i = 0; $i < $posts_count; $i = ( $i + $k ) ) { $year = $posts_data[$i]['aar']; $k = 0; for( $j = 0; $j < 12; $j++ ) { $m[$j + 1] = 0; } for( $j = 0; $j < 12; $j++ ) { if ( $year == $posts_data[$i + $j]['aar'] ) { $month = $posts_data[$i + $j]['mnd']; $m[$month] = $posts_data[$i + $j]['ant']; $k++; } } $template->assign_block_vars( 'datarow', array( 'CLASS' => ( !( $i + 1 % 2 ) ) ? $theme['td_class2'] : $theme['td_class1'], 'YEAR' => $year, 'M01' => $m[1], 'M02' => $m[2], 'M03' => $m[3], 'M04' => $m[4], 'M05' => $m[5], 'M06' => $m[6], 'M07' => $m[7], 'M08' => $m[8], 'M09' => $m[9], 'M10' => $m[10], 'M11' => $m[11], 'M12' => $m[12] ) ); } // Setup common template vars and display the block. $template->assign_vars( array( 'L_YEAR' => $lang['Year'], 'L_MONTH' => $lang['Month'], 'L_NUMBER' => $lang['Number'], 'L_JAN' => $lang['datetime']['Jan'], 'L_FEB' => $lang['datetime']['Feb'], 'L_MAR' => $lang['datetime']['Mar'], 'L_APR' => $lang['datetime']['Apr'], 'L_MAY' => $lang['datetime']['May'], 'L_JUN' => $lang['datetime']['Jun'], 'L_JUL' => $lang['datetime']['Jul'], 'L_AUG' => $lang['datetime']['Aug'], 'L_SEP' => $lang['datetime']['Sep'], 'L_OCT' => $lang['datetime']['Oct'], 'L_NOV' => $lang['datetime']['Nov'], 'L_DEC' => $lang['datetime']['Dec'], 'TEXT_CLASS' => $ss_phpbb->text_class, 'L_TITLE' => $lang['Monthly_Posts'] ) ); $template->pparse( 'body' ); ?> --- NEW FILE: adminstats.php --- <?php /** ------------------------------------------------------------------------ * Subject : mxBB - a fully modular portal and CMS (for phpBB) * Author : Jon Ohlsson and the mxBB Team * Credits : The phpBB Group & Marc Morisette, Marc Ferran (www.phpmix.com) * based on : Administrative Stats MOD v.2.1.0 by Nivisec, Acyd Burn * Copyright : (C) 2002-2005 mxBB Portal, phpMiX (c) 2004 * Email : jo...@mx... * Project site : www.mxbb-portal.com * ------------------------------------------------------------------------- * * $Id: adminstats.php,v 1.1 2005/10/15 22:18:27 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. */ // -------------------------------------------------------------------------------- // Block Initialization // -------------------------------------------------------------------------------- if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt !!!" ); } // Include common module stuff... include_once( $module_root_path . 'includes/common.' . $phpEx ); $block_config = read_block_config( $block_id ); $title = !empty($lang[$block_config[$block_id]['block_title']]) ? $lang[$block_config[$block_id]['block_title']] : $block_config[$block_id]['block_title']; if ( !isset( $ss_phpbb ) ) { $ss_phpbb = new sitestats_phpbb(); } // Load language files, required for several Administrative Statistics... if ( file_exists( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) ) { include_once( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ); } else { include_once( $phpbb_root_path . 'language/lang_english/lang_admin.' . $phpEx ); } // -------------------------------------------------------------------------------- // Block Procedure // -------------------------------------------------------------------------------- // This is the template used to render this block. $template->set_filenames( array( 'body' => 'sitestats_adminstats_body.tpl' ) ); // Administrative Statistics $attachment_mod_installed = ( defined( 'ATTACH_VERSION' ) ) ? true : false; $attachment_version = ( $attachment_mod_installed ) ? ATTACH_VERSION : ''; if ( $attachment_mod_installed ) { include( $phpbb_root_path . 'attach_mod/includes/functions_admin.' . $phpEx ); } $total_posts = $ss_phpbb->get_db_stat( 'postcount' ); $total_users = $ss_phpbb->get_db_stat( 'usercount' ); $total_topics = $ss_phpbb->get_db_stat( 'topiccount' ); $start_date = create_date( $board_config['default_dateformat'], $board_config['board_startdate'], $board_config['board_timezone'] ); $boarddays = max( 1, round( ( 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 ( !$attachment_mod_installed ) { 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 { if ( $avatar_dir_size >= 1048576 ) { $avatar_dir_size = round( $avatar_dir_size / 1048576 * 100 ) / 100 . ' ' . $lang['MB']; } else if ( $avatar_dir_size >= 1024 ) { $avatar_dir_size = round( $avatar_dir_size / 1024 * 100 ) / 100 . ' ' . $lang['KB']; } else { $avatar_dir_size = $avatar_dir_size . ' ' . $lang['Bytes']; } } } else { $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 ( $attachment_mod_installed ) { if ( $dbsize >= 1048576 ) { $dbsize = sprintf( '%.2f ' . $lang['MB'], ( $dbsize / 1048576 ) ); } else if ( $dbsize >= 1024 ) { $dbsize = sprintf( '%.2f ' . $lang['KB'], ( $dbsize / 1024 ) ); } else { $dbsize = sprintf( '%.2f ' . $lang['Bytes'], $dbsize ); } } else { 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 = $ss_phpbb->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_uid . ' 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_fetchrowset( $result ); $most_users_date = $lang['Not_available']; $most_users = $lang['Not_available']; for( $i = 0; $i < count( $row ); $i++ ) { if ( ( intval( $row[$i]['config_value'] ) > 0 ) && ( $row[$i]['config_name'] == 'record_online_date' ) ) { $most_users_date = create_date( $board_config['default_dateformat'], intval( $row[$i]['config_value'] ), $board_config['board_timezone'] ); } else if ( ( intval( $row[$i]['config_value'] ) > 0 ) && ( $row[$i]['config_name'] == 'record_online_users' ) ) { $most_users = intval( $row[$i]['config_value'] ); } } $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'] ); // Disk Usage, if Attachment Mod is installed if ( $attachment_mod_installed ) { $disk_usage = get_formatted_dirsize(); $statistic_array[] = $lang['Disk_usage']; $value_array[] = $disk_usage; } for( $i = 0; $i < count( $statistic_array ); $i += 2 ) { $template->assign_block_vars( 'datarow', 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] : '' ) ); } // Setup common template vars and display the block. $template->assign_vars( array( 'L_STATISTIC' => $lang['Statistic'], 'L_VALUE' => $lang['Value'], 'TEXT_CLASS' => $ss_phpbb->text_class, 'L_TITLE' => $lang['Admin_Stats'] ) ); $template->pparse( 'body' ); ?> --- NEW FILE: topreferers.php --- <?php /** ------------------------------------------------------------------------ * Subject : mxBB - a fully modular portal and CMS (for phpBB) * Author : Jon Ohlsson and the mxBB Team * Credits : The phpBB Group & Marc Morisette, Marc Ferran (www.phpmix.com) * Copyright : (C) 2002-2005 mxBB Portal, phpMiX (c) 2004 * Email : jo...@mx... * Project site : www.mxbb-portal.com * ------------------------------------------------------------------------- * * $Id: topreferers.php,v 1.1 2005/10/15 22:18:27 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. */ // -------------------------------------------------------------------------------- // Block Initialization // -------------------------------------------------------------------------------- if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt !!!" ); } // Include common module stuff... include_once( $module_root_path . 'includes/common.' . $phpEx ); $block_config = read_block_config( $block_id ); $title = !empty($lang[$block_config[$block_id]['block_title']]) ? $lang[$block_config[$block_id]['block_title']] : $block_config[$block_id]['block_title']; // -------------------------------------------------------------------------------- // Block Procedure // -------------------------------------------------------------------------------- // This is the template used to render this block. $template->set_filenames( array( 'body' => 'sitestats_topreferers_body.tpl' ) ); // Top Referers $sql = 'SELECT * FROM ' . SITESTATS_REFERER_TABLE . ( $sitestats_config['referers_show_disabled'] ? '' : ' WHERE enabled = 1' ) . ' ORDER BY hits DESC, lastvisit DESC LIMIT ' . $sitestats_config['referers_count']; if ( !( $result = $db->sql_query( $sql ) ) ) { message_die( GENERAL_ERROR, "Couldn't retrieve HTTP Referers data", '', __LINE__, __FILE__, $sql ); } $numrows = $db->sql_numrows( $result ); $rowset = $db->sql_fetchrowset( $result ); for( $i = 0; $i < $numrows; $i++ ) { $template->assign_block_vars( 'datarow', array( 'CLASS' => ( !( $i + 1 % 2 ) ) ? $theme['td_class2'] : $theme['td_class1'], 'L_HTTP_HOST' => $rowset[$i]['host'], 'U_HTTP_HOST' => 'http://' . $rowset[$i]['host'], 'L_HITS' => $rowset[$i]['hits'] ) ); } // Setup common template vars and display the block. $template->assign_vars( array( 'L_TITLE' => $lang['SiteStats_TopReferers'] ) ); $template->pparse( 'body' ); ?> --- NEW FILE: collector.php --- <?php /** ------------------------------------------------------------------------ * Subject : mxBB - a fully modular portal and CMS (for phpBB) * Author : Jon Ohlsson and the mxBB Team * Credits : The phpBB Group & Marc Morisette, Marc Ferran (www.phpmix.com) * Copyright : (C) 2002-2005 mxBB Portal, phpMiX (c) 2004 * Email : jo...@mx... * Project site : www.mxbb-portal.com * ------------------------------------------------------------------------- * * $Id: collector.php,v 1.1 2005/10/15 22:18:27 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. */ // Security check... if ( !defined( 'IN_PORTAL' ) && !defined( 'IN_PHPBB' ) ) { die( "Hacking attempt !!!" ); } // Common Includes and Read Static Module Settings define( '_SITESTATS_CONFIG', true ); $module_root_save = $module_root_path; $module_root_path = $mx_root_path . 'modules/mx_sitestats/'; include_once( $module_root_path . 'includes/common.' . $phpEx ); $block_config = read_block_config( $block_id ); $title = !empty($lang[$block_config[$block_id]['block_title']]) ? $lang[$block_config[$block_id]['block_title']] : $block_config[$block_id]['block_title']; $module_root_path = $module_root_save; // Update the Counters... $sitestats_counter = new sitestats_counter(); $sitestats_counter->readCounter( $board_config['sitename'] ); $sitestats_counter->incrementCounter(); if ( !$sitestats_counter->updateCounter() ) { if ( $userdata['user_level'] == ADMIN ) { // message_die(GENERAL_ERROR, "Could not update SiteStats counter information for page: " . $sitestats_counter->page, // "", __LINE__, __FILE__, $sitestats_counter->sql); } } // Update HTTP Referer... if ( $sitestats_config['referers_logging'] ) { if ( !$sitestats_counter->updateReferer() ) { if ( $userdata['user_level'] == ADMIN ) { // message_die(GENERAL_ERROR, "Couldn't insert new referer", "", __LINE__, __FILE__, $sql); } } } ?> --- NEW FILE: usersranks.php --- <?php /** ------------------------------------------------------------------------ * Subject : mxBB - a fully modular portal and CMS (for phpBB) * Author : Jon Ohlsson and the mxBB Team * Credits : The phpBB Group & Marc Morisette, Marc Ferran (www.phpmix.com) * based on : Users Ranks MOD v.1.3.1 by RustyDragon * Copyright : (C) 2002-2005 mxBB Portal, phpMiX (c) 2004 * Email : jo...@mx... * Project site : www.mxbb-portal.com * ------------------------------------------------------------------------- * * $Id: usersranks.php,v 1.1 2005/10/15 22:18:27 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. */ // -------------------------------------------------------------------------------- // Block Initialization // -------------------------------------------------------------------------------- if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt !!!" ); } // Include common module stuff... include_once( $module_root_path . 'includes/common.' . $phpEx ); $block_config = read_block_config( $block_id ); $title = !empty($lang[$block_config[$block_id]['block_title']]) ? $lang[$block_config[$block_id]['block_title']] : $block_config[$block_id]['block_title']; if ( !isset( $ss_phpbb ) ) { $ss_phpbb = new sitestats_phpbb(); } // -------------------------------------------------------------------------------- // Block Procedure // -------------------------------------------------------------------------------- // This is the template used to render this block. $template->set_filenames( array( 'body' => 'sitestats_usersranks_body.tpl' ) ); // Users Ranks $sql = 'SELECT * FROM ' . RANKS_TABLE . ' ORDER BY rank_min, rank_title'; if ( !$result = $db->sql_query( $sql ) ) { message_die( GENERAL_ERROR, "Couldn't retrieve ranks data", '', __LINE__, __FILE__, $sql ); } $ranks_count = $db->sql_numrows( $result ); $ranks_data = $db->sql_fetchrowset( $result ); $total_users = $ss_phpbb->get_db_stat( 'usercount' ); $firstcount = 0; for( $i = 0; $i < $ranks_count; $i++ ) { if ( $ranks_data[$i]['rank_special'] == 1 ) { $sql = 'SELECT COUNT(user_id) AS used_counter FROM ' . USERS_TABLE . ' WHERE user_rank = ' . $ranks_data[$i]['rank_id']; $ranks_data[$i]['posts_range'] = $lang['Special_Rank']; } else { $rank_min = $ranks_data[$i]['rank_min']; if ( $i == ( $ranks_count - 1 ) ) { $sql = 'SELECT COUNT(user_id) AS used_counter FROM ' . USERS_TABLE . ' WHERE user_posts >= ' . $rank_min; $ranks_data[$i]['posts_range'] = ' + ' . $rank_min; } else { $rank_max = $ranks_data[$i + 1]['rank_min']; $sql = 'SELECT COUNT(user_id) AS used_counter FROM ' . USERS_TABLE . ' WHERE user_posts >= ' . $rank_min . ' AND user_posts < ' . $rank_max; $ranks_data[$i]['posts_range'] = $rank_min . ' - ' . ( $rank_max - 1 ); } } if ( !$result = $db->sql_query( $sql ) ) { message_die( GENERAL_ERROR, "Couldn't retrieve users data", '', __LINE__, __FILE__, $sql ); } $user_data = $db->sql_fetchrowset( $result ); $user_count = $user_data[0]['used_counter']; $ranks_data[$i]['used_counter'] = $user_data[0]['used_counter']; if ( $firstcount < $ranks_data[$i]['used_counter'] ) { $firstcount = $ranks_data[$i]['used_counter']; } if ( $ranks_data[$i]['rank_image'] ) { $ranks_data[$i]['rank_img'] = '<img src="' . PHPBB_URL . $ranks_data[$i]['rank_image'] . '" border="0" alt="' . $ranks_data[$i]['rank_title'] . '" />'; } else { $ranks_data[$i]['rank_img'] = ''; } } for( $i = 0; $i < $ranks_count; $i++ ) { if ( $ranks_data[$i]['rank_special'] == 1 ) { $percent_array = $ss_phpbb->do_percent_math( $firstcount, $ranks_data[$i]['used_counter'], $total_users ); $template->assign_block_vars( 'datarow', array( 'RANK' => $i + 1, 'CLASS' => ( !( $i + 1 % 2 ) ) ? $theme['td_class2'] : $theme['td_class1'], 'RANK_TITLE_IMAGE' => $ranks_data[$i]['rank_title'] . '<br />' . $ranks_data[$i]['rank_img'], 'RANK_RANGE' => $ranks_data[$i]['posts_range'], 'USERS' => $ranks_data[$i]['used_counter'], 'PERCENTAGE' => $percent_array['percentage'], 'BAR' => $percent_array['bar_percent'] ) ); } } for( $i = ( $ranks_count-1 ); $i > 0; $i-- ) { if ( $ranks_data[$i]['rank_special'] != 1 ) { $percent_array = $ss_phpbb->do_percent_math( $firstcount, $ranks_data[$i]['used_counter'], $total_users ); $template->assign_block_vars( 'datarow', array( 'RANK' => $i + 1, 'CLASS' => ( !( $i + 1 % 2 ) ) ? $theme['td_class2'] : $theme['td_class1'], 'RANK_TITLE_IMAGE' => $ranks_data[$i]['rank_title'] . '<br />' . $ranks_data[$i]['rank_img'], 'RANK_RANGE' => $ranks_data[$i]['posts_range'], 'USERS' => $ranks_data[$i]['used_counter'], 'PERCENTAGE' => $percent_array['percentage'], 'BAR' => $percent_array['bar_percent'] ) ); } } // Setup voting bar images... $ss_phpbb->set_voting_bar(); // Setup common template vars and display the block. $template->assign_vars( array( 'L_RANK' => $lang['Rank'], 'L_RANK_TITLE_IMAGE' => $lang['Rank_Title_Image'], 'L_RANK_RANGE' => $lang['Rank_range'], 'L_USERS' => $lang['Uses'], 'L_PERCENTAGE' => $lang['Percent'], 'L_GRAPH' => $lang['Graph'], 'TEXT_CLASS' => $ss_phpbb->text_class, 'L_TITLE' => $lang['Users_Ranks'] ) ); $template->pparse( 'body' ); ?> --- NEW FILE: db_uninstall.php --- <?php /** ------------------------------------------------------------------------ * Subject : mxBB - a fully modular portal and CMS (for phpBB) * Author : Jon Ohlsson and the mxBB Team * Credits : The phpBB Group & Marc Morisette, Marc Ferran (www.phpmix.com) * Copyright : (C) 2002-2005 mxBB Portal, phpMiX (c) 2004 * Email : jo...@mx... * Project site : www.mxbb-portal.com * ------------------------------------------------------------------------- * * $Id: db_uninstall.php,v 1.1 2005/10/15 22:18:27 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. */ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $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 ); if ( !$userdata['session_logged_in'] ) { die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { die( "Hacking attempt(2)" ); } // End session management } // Read module constants... $module_root_path = dirname( __FILE__ ) . '/'; include_once( $module_root_path . 'includes/common.' . $phpEx ); if ( !defined( 'SITESTATS_COUNTER_TABLE' ) ) { message_die( GENERAL_ERROR, "Couldn't load file includes/common.$phpEx", "", __LINE__, __FILE__ ); } // SQL statements to drop module tables... $sql = array( "DROP TABLE " . SITESTATS_COUNTER_TABLE, "DROP TABLE " . SITESTATS_REFERER_TABLE, "DROP TABLE " . SITESTATS_CONFIG_TABLE ); 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\">" . mx_do_install_upgrade( $sql ) . "</span></td></tr>"; echo "</table><br />"; ?> --- NEW FILE: topavatars.php --- <?php /** ------------------------------------------------------------------------ * Subject : mxBB - a fully modular portal and CMS (for phpBB) * Author : Jon Ohlsson and the mxBB Team * Credits : The phpBB Group & Marc Morisette, Marc Ferran (www.phpmix.com) * based on : Top Avatars v.1.5.0 MOD by RustyDragon * Copyright : (C) 2002-2005 mxBB Portal, phpMiX (c) 2004 * Email : jo...@mx... * Project site : www.mxbb-portal.com * ------------------------------------------------------------------------- * * $Id: topavatars.php,v 1.1 2005/10/15 22:18:27 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. */ // -------------------------------------------------------------------------------- // Block Initialization // -------------------------------------------------------------------------------- if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt !!!" ); } // Include common module stuff... include_once( $module_root_path . 'includes/common.' . $phpEx ); $block_config = read_block_config( $block_id ); $title = !empty($lang[$block_config[$block_id]['block_title']]) ? $lang[$block_config[$block_id]['block_title']] : $block_config[$block_id]['block_title']; if ( !isset( $ss_phpbb ) ) { $ss_phpbb = new sitestats_phpbb(); } // -------------------------------------------------------------------------------- // Block Procedure // -------------------------------------------------------------------------------- // This is the template used to render this block. $template->set_filenames( array( 'body' => 'sitestats_topavatars_body.tpl' ) ); // Top Avatars $sql = "SELECT COUNT(user_avatar) AS used_counter, user_avatar FROM " . USERS_TABLE . " WHERE user_avatar_type = " . USER_AVATAR_GALLERY . " GROUP BY user_avatar ORDER BY used_counter DESC LIMIT " . $ss_phpbb->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 ); $firstcount = $user_data[0]['used_counter']; for( $i = 0; $i < $user_count; $i++ ) { $percent_array = $ss_phpbb->do_percent_math( $firstcount, $user_data[$i]['used_counter'], $user_count ); $template->assign_block_vars( 'datarow', array( 'RANK' => $i + 1, 'CLASS' => ( !( $i + 1 % 2 ) ) ? $theme['td_class2'] : $theme['td_class1'], 'USES' => $user_data[$i]['used_counter'], 'PERCENTAGE' => $percent_array['percentage'], 'BAR' => $percent_array['bar_percent'], 'URL' => '<img src="' . PHPBB_URL . $board_config['avatar_gallery_path'] . '/' . $user_data[$i]['user_avatar'] . '" alt="' . $user_data[$i]['user_avatar'] . '" border="0" />' ) ); } // Setup voting bar images... $ss_phpbb->set_voting_bar(); // Setup common template vars and display the block. $template->assign_vars( array( 'L_USES' => $lang['Uses'], 'L_RANK' => $lang['Rank'], 'L_PERCENTAGE' => $lang['Percent'], 'L_GRAPH' => $lang['Graph'], 'L_AVATAR' => $lang['Avatar'], 'TEXT_CLASS' => $ss_phpbb->text_class, 'L_TITLE' => $lang['Top_Avatars'] ) ); $template->pparse( 'body' ); ?> --- NEW FILE: monthlytopics.php --- <?php /** ------------------------------------------------------------------------ * Subject : mxBB - a fully modular portal and CMS (for phpBB) * Author : Jon Ohlsson and the mxBB Team * Credits : The phpBB Group & Marc Morisette, Marc Ferran (www.phpmix.com) * based on : New Posts By Month MOD v.1.0.0 by Tommy Jensen * Copyright : (C) 2002-2005 mxBB Portal, phpMiX (c) 2004 * Email : jo...@mx... * Project site : www.mxbb-portal.com * ------------------------------------------------------------------------- * * $Id: monthlytopics.php,v 1.1 2005/10/15 22:18:27 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. */ // -------------------------------------------------------------------------------- // Block Initialization // -------------------------------------------------------------------------------- if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt !!!" ); } // Include common module stuff... include_once( $module_root_path . 'includes/common.' . $phpEx ); $block_config = read_block_config( $block_id ); $title = !empty($lang[$block_config[$block_id]['block_title']]) ? $lang[$block_config[$block_id]['block_title']] : $block_config[$block_id]['block_title']; if ( !isset( $ss_phpbb ) ) { $ss_phpbb = new sitestats_phpbb(); } // -------------------------------------------------------------------------------- // Block Procedure // -------------------------------------------------------------------------------- // This is the template used to render this block. $template->set_filenames( array( 'body' => 'sitestats_monthlystats_body.tpl' ) ); // Number of New Topics by Month $sql = 'SELECT YEAR(FROM_UNIXTIME(topic_time)) AS aar, MONTH(FROM_UNIXTIME(topic_time)) AS mnd, COUNT(*) AS ant FROM ' . TOPICS_TABLE . ' GROUP BY YEAR(FROM_UNIXTIME(topic_time)),MONTH(FROM_UNIXTIME(topic_time)) ORDER BY topic_time'; if ( !( $result = $db->sql_query( $sql ) ) ) { message_die( GENERAL_ERROR, "Couldn't retrieve topics data", '', __LINE__, __FILE__, $sql ); } $topics_count = $db->sql_numrows( $result ); $topics_data = $db->sql_fetchrowset( $result ); for( $i = 0; $i < $topics_count; $i = ( $i + $k ) ) { $year = $topics_data[$i]['aar']; $k = 0; for( $j = 0; $j < 12; $j++ ) { $m[$j + 1] = 0; } for( $j = 0; $j < 12; $j++ ) { if ( $year == $topics_data[$i + $j]['aar'] ) { $month = $topics_data[$i + $j]['mnd']; $m[$month] = $topics_data[$i + $j]['ant']; $k++; } } $template->assign_block_vars( 'datarow', array( 'CLASS' => ( !( $i + 1 % 2 ) ) ? $theme['td_class2'] : $theme['td_class1'], 'YEAR' => $year, 'M01' => $m[1], 'M02' => $m[2], 'M03' => $m[3], 'M04' => $m[4], 'M05' => $m[5], 'M06' => $m[6], 'M07' => $m[7], 'M08' => $m[8], 'M09' => $m[9], 'M10' => $m[10], 'M11' => $m[11], 'M12' => $m[12] ) ); } // Setup common template vars and display the block. $template->assign_vars( array( 'L_YEAR' => $lang['Year'], 'L_MONTH' => $lang['Month'], 'L_NUMBER' => $lang['Number'], 'L_JAN' => $lang['datetime']['Jan'], 'L_FEB' => $lang['datetime']['Feb'], 'L_MAR' => $lang['datetime']['Mar'], 'L_APR' => $lang['datetime']['Apr'], 'L_MAY' => $lang['datetime']['May'], 'L_JUN' => $lang['datetime']['Jun'], 'L_JUL' => $lang['datetime']['Jul'], 'L_AUG' => $lang['datetime']['Aug'], 'L_SEP' => $lang['datetime']['Sep'], 'L_OCT' => $lang['datetime']['Oct'], 'L_NOV' => $lang['datetime']['Nov'], 'L_DEC' => $lang['datetime']['Dec'], 'TEXT_CLASS' => $ss_phpbb->text_class, 'L_TITLE' => $lang['Monthly_Topics'] ) ); $template->pparse( 'body' ); ?> --- NEW FILE: topposters_tiny.php --- <?php /** ------------------------------------------------------------------------ * Subject : mxBB - a fully modular portal and CMS (for phpBB) * Author : Jon Ohlsson and the mxBB Team * Credits : The phpBB Group & Marc Morisette, Marc Ferran (www.phpmix.com) * Copyright : (C) 2002-2005 mxBB Portal, phpMiX (c) 2004 * Email : jo...@mx... * Project site : www.mxbb-portal.com * ------------------------------------------------------------------------- * * $Id: topposters_tiny.php,v 1.1 2005/10/15 22:18:27 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. */ // -------------------------------------------------------------------------------- // Block Initialization // -------------------------------------------------------------------------------- if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt !!!" ); } // Include common module stuff... include_once( $module_root_path . 'includes/common.' . $phpEx ); $block_config = read_block_config( $block_id ); $title = !empty($lang[$block_config[$block_id]['block_title']]) ? $lang[$block_config[$block_id]['block_title']] : $block_config[$block_id]['block_title']; if ( !isset( $ss_phpbb ) ) { $ss_phpbb = new sitestats_phpbb(); } // -------------------------------------------------------------------------------- // Block Procedure // -------------------------------------------------------------------------------- // This is the template used to render this block. $template->set_filenames( array( 'body' => 'sitestats_topposters_tiny.tpl' ) ); // Top Posters $sql = 'SELECT user_id, username, user_posts FROM ' . USERS_TABLE . ' WHERE (user_id <> ' . ANONYMOUS . ') AND (user_posts > 0) ORDER BY user_posts DESC, username ASC LIMIT ' . $ss_phpbb->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 ); for ( $i = 0; $i < $user_count; $i++ ) { $template->assign_block_vars( 'datarow', array( 'CLASS' => ( !( $i + 1 % 2 ) ) ? $theme['td_class2'] : $theme['td_class1'], 'USERNAME' => $user_data[$i]['username'], 'URL' => append_sid( PHPBB_URL . 'profile.php?mode=viewprofile&u=' . $user_data[$i]['user_id'] ), 'POSTS' => $user_data[$i]['user_posts'] ) ); } // Setup common template vars and display the block. $template->assign_vars( array( 'L_USERNAME' => $lang['Username'], 'L_POSTS' => $lang['Posts'], 'TEXT_CLASS' => $ss_phpbb->text_class, 'L_TITLE' => $lang['Top_Posters'] ) ); $template->pparse( 'body' ); ?> --- NEW FILE: toptopics.php --- <?php /** ------------------------------------------------------------------------ * Subject : mxBB - a fully modular portal and CMS (for phpBB) * Author : Jon Ohlsson and the mxBB Team * Credits : The phpBB Group & Marc Morisette, Marc Ferran (www.phpmix.com) * based on : Top Topics MOD v.2.1.0 by Nivisec, Acyd Burn * Copyright : (C) 2002-2005 mxBB Portal, phpMiX (c) 2004 * Email : jo...@mx... * Project site : www.mxbb-portal.com * ------------------------------------------------------------------------- * * $Id: toptopics.php,v 1.1 2005/10/15 22:18:27 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. */ // -------------------------------------------------------------------------------- // Block Initialization // -------------------------------------------------------------------------------- if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt !!!" ); } // Include common module stuff... include_once( $module_root_path . 'includes/common.' . $phpEx ); $block_config = read_block_config( $block_id ); $title = !empty($lang[$block_config[$block_id]['block_title']]) ? $lang[$block_config[$block_id]['block_title']] : $block_config[$block_id]['block_title']; if ( !isset( $ss_phpbb ) ) { $ss_phpbb = new sitestats_phpbb(); } // -------------------------------------------------------------------------------- // Block Procedure // -------------------------------------------------------------------------------- // This is the template used to render this block. $template->set_filenames( array( 'body' => 'sitestats_toptopics_body.tpl' ) ); // Retrieve list of Forums with View Permission... $auth_data_sql = get_auth_forum(); // Most Viewed Topics $sql = 'SELECT topic_id, topic_title, topic_views FROM ' . TOPICS_TABLE . ' WHERE forum_id IN (' . $auth_data_sql . ') AND (topic_status <> 2) AND (topic_views > 0) ORDER BY topic_views DESC LIMIT ' . $ss_phpbb->return_limit; if ( !( $result = $db->sql_query( $sql ) ) ) { message_die( GENERAL_ERROR, 'Couldn\'t retrieve topic data', '', __LINE__, __FILE__, $sql ); } $topic_count = $db->sql_numrows( $result ); $topic_data = $db->sql_fetchrowset( $result ); for( $i = 0; $i < $topic_count; $i++ ) { $class = ( !( $i + 1 % 2 ) ) ? $theme['td_class2'] : $theme['td_class1']; $template->assign_block_vars( 'datarow1', array( 'RANK' => $i + 1, 'CLASS' => $class, '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'] ) ) ); } // Most Active Topics $sql = 'SELECT topic_id, topic_title, topic_replies FROM ' . TOPICS_TABLE . ' WHERE forum_id IN (' . $auth_data_sql . ') AND (topic_status <> 2) AND (topic_replies > 0) ORDER BY topic_replies DESC LIMIT ' . $ss_phpbb->return_limit; if ( !( $result = $db->sql_query( $sql ) ) ) { message_die( GENERAL_ERROR, 'Couldn\'t retrieve topic data', '', __LINE__, __FILE__, $sql ); } $topic_count = $db->sql_numrows( $result ); $topic_data = $db->sql_fetchrowset( $result ); for( $i = 0; $i < $topic_count; $i++ ) { $class = ( !( $i + 1 % 2 ) ) ? $theme['td_class2'] : $theme['td_class1']; $template->assign_block_vars( 'datarow2', array( 'RANK' => $i + 1, 'CLASS' => $class, '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'] ) ) ); } // Setup common template vars and display the block. $template->assign_vars( array( 'L_RANK' => $lang['Rank'], 'L_VIEWS' => $lang['Views'], 'L_REPLIES' => $lang['Replies'], 'L_TOPIC' => $lang['Topic'], 'TEXT_CLASS' => $ss_phpbb->text_class, 'L_TITLE1' => $lang['Most_Viewed_Topics'], 'L_TITLE2' => $lang['Most_Active_Topics'] ) ); $template->pparse( 'body' ); ?> --- NEW FILE: db_upgrade.php --- <?php /** ------------------------------------------------------------------------ * Subject : mxBB - a fully modular portal and CMS (for phpBB) * Author : Jon Ohlsson and the mxBB Team * Credits : The phpBB Group & Marc Morisette, Marc Ferran (www.phpmix.com) * Copyright : (C) 2002-2005 mxBB Portal, phpMiX (c) 2004 * Email : jo...@mx... * Project site : www.mxbb-portal.com * ------------------------------------------------------------------------- * * $Id: db_upgrade.php,v 1.1 2005/10/15 22:18:27 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. */ define( 'IN_PORTAL', true ); if ( !defined( 'IN_ADMIN' ) ) { $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 ); if ( !$userdata['session_logged_in'] ) { die( "Hacking attempt(1)" ); } if ( $userdata['user_level'] != ADMIN ) { die( "Hacking attempt(2)" ); } // End session management } $mx_module_version = 'mxBB Sitestats Module 2.0.0'; $mx_module_copy = 'Written by <a href="http://www.phpmix.com" target="_phpbb" >Markus</a>'; $sql = array(); $message = "<b>You are upgrading the module!</b><br/><br/>"; $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: topposters.php --- <?php /** ------------------------------------------------------------------------ * Subject : mxBB - a fully modular portal and CMS (for phpBB) * Author : Jon Ohlsson and the mxBB Team * Credits : The phpBB Group & Marc Morisette, Marc Ferran (www.phpmix.com) * based on : Top Posters MOD v.2.1.0 by Nivisec, Acyd Burn * Copyright : (C) 2002-2005 mxBB Portal, phpMiX (c) 2004 * Email : jo...@mx... * Project site : www.mxbb-portal.com * ------------------------------------------------------------------------- * * $Id: topposters.php,v 1.1 2005/10/15 22:18:27 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. */ // -------------------------------------------------------------------------------- // Block Initialization // -------------------------------------------------------------------------------- if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt !!!" ); } // Include common module stuff... include_once( $module_root_path . 'includes/common.' . $phpEx ); $block_config = read_block_config( $block_id ); $title = !empty($lang[$block_config[$block_id]['block_title']]) ? $lang[$block_config[$block_id]['block_title']] : $block_config[$block_id]['block_title']; if ( !isset( $ss_phpbb ) ) { $ss_phpbb = new sitestats_phpbb(); } // -------------------------------------------------------------------------------- // Block Procedure // -------------------------------------------------------------------------------- // This is the template used to render this block. $template->set_filenames( array( 'body' => 'sitestats_topposters_body.tpl' ) ); // Top Posters $sql = 'SELECT user_id, username, user_posts FROM ' . USERS_TABLE . ' WHERE (user_id <> ' . ANONYMOUS . ') AND (user_posts > 0) ORDER BY user_posts DESC LIMIT ' . $ss_phpbb->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 ); $firstcount = $user_data[0]['user_posts']; $total_posts = $ss_phpbb->get_db_stat( 'postcount' ); for ( $i = 0; $i < $user_count; $i++ ) { $percent_array = $ss_phpbb->do_percent_math( $firstcount, $user_data[$i]['user_posts'], $total_posts ); $template->assign_block_vars( 'datarow', array( 'RANK' => $i + 1, 'CLASS' => ( !( $i + 1 % 2 ) ) ? $theme['td_class2'] : $theme['td_class1'], 'USERNAME' => $user_data[$i]['username'], 'PERCENTAGE' => $percent_array['percentage'], 'BAR' => $percent_array['bar_percent'], 'URL' => append_sid( PHPBB_URL . 'profile.php?mode=viewprofile&u=' . $user_data[$i]['user_id'] ), 'POSTS' => $user_data[$i]['user_posts'] ) ); } // Setup voting bar images... $ss_phpbb->set_voting_bar(); // Setup common template vars and display the block. $template->assign_vars( array( 'L_POSTS' => $lang['Posts'], 'L_RANK' => $lang['Rank'], 'L_PERCENTAGE' => $lang['Percent'], 'L_GRAPH' => $lang['Graph'], 'L_USERNAME' => $lang['Username'], 'TEXT_CLASS' => $ss_phpbb->text_class, 'L_TITLE' => $lang['Top_Posters'] ) ); $template->pparse( 'body' ); ?> --- NEW FILE: sitestaff.php --- <?php /** ------------------------------------------------------------------------ * Subject : mxBB - a fully modular portal and CMS (for phpBB) * Author : Jon Ohlsson and the mxBB Team * Credits : The phpBB Group & Marc Morisette, Marc Ferran (www.phpmix.com) * based on : Staff MOD v.2.0.3 by Acid * Copyright : (C) 2002-2005 mxBB Portal, phpMiX (c) 2004 * Email : jo...@mx... * Project site : www.m... [truncated message content] |