Update of /cvsroot/mxbb/mx_sitestats In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19996/modules/mx_sitestats Modified Files: 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 sitestaff.php topavatars.php topposters.php topposters_tiny.php topreferers.php topsmilies.php topstarters.php toptopics.php topwords.php usersranks.php Log Message: code cleanup Index: topwords.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/topwords.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** topwords.php 5 Apr 2006 23:03:45 -0000 1.4 --- topwords.php 29 Jun 2006 19:08:04 -0000 1.5 *************** *** 23,28 **** } // Include common module stuff... ! include_once( $module_root_path . 'includes/common.' . $phpEx ); --- 23,29 ---- } + // // Include common module stuff... ! // include_once( $module_root_path . 'includes/common.' . $phpEx ); *************** *** 36,55 **** $ss_phpbb = new sitestats_phpbb(); } // -------------------------------------------------------------------------------- // Block Procedure // -------------------------------------------------------------------------------- // This is the template used to render this block. ! $template->set_filenames( array( 'body' => 'sitestats_topwords_body.tpl' ) ! ); ! // Top Words ! $sql = 'SELECT COUNT( word_id ) AS total_words FROM ' . SEARCH_MATCH_TABLE; if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, "Couldn't retrieve words data", "", __LINE__, __FILE__, $sql ); } $words_data = $db->sql_fetchrowset( $result ); $total_words = $words_data[0]['total_words']; --- 37,60 ---- $ss_phpbb = new sitestats_phpbb(); } + // -------------------------------------------------------------------------------- // Block Procedure // -------------------------------------------------------------------------------- + // // This is the template used to render this block. + // + $template->set_filenames( array( 'body' => 'sitestats_topwords_body.tpl' ) ); ! // // Top Words ! // $sql = 'SELECT COUNT( word_id ) AS total_words FROM ' . SEARCH_MATCH_TABLE; + if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, "Couldn't retrieve words data", "", __LINE__, __FILE__, $sql ); } + $words_data = $db->sql_fetchrowset( $result ); $total_words = $words_data[0]['total_words']; *************** *** 60,67 **** --- 65,74 ---- ORDER BY word_count DESC LIMIT ' . $ss_phpbb->return_limit * 10; + if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, "Couldn't retrieve words data", "", __LINE__, __FILE__, $sql ); } + $words_count = $db->sql_numrows( $result ); $words_data = $db->sql_fetchrowset( $result ); *************** *** 91,101 **** $percent_array = $ss_phpbb->do_percent_math( $firstcount, $words_data[$i]['word_count'], $total_words ); ! $template->assign_block_vars( 'datarow', array( 'RANK' => $j, ! 'CLASS' => ( !( $j + 1 % 2 ) ) ? $theme['td_class2'] : $theme['td_class1'], ! 'USES' => $words_data[$i]['word_count'], ! 'PERCENTAGE' => $percent_array['percentage'], ! 'BAR' => $percent_array['bar_percent'], ! 'WORD' => $words_data[$i]['word_text'] ) ! ); $j++; } --- 98,109 ---- $percent_array = $ss_phpbb->do_percent_math( $firstcount, $words_data[$i]['word_count'], $total_words ); ! $template->assign_block_vars( 'datarow', array( ! 'RANK' => $j, ! 'CLASS' => ( !( $j + 1 % 2 ) ) ? $theme['td_class2'] : $theme['td_class1'], ! 'USES' => $words_data[$i]['word_count'], ! 'PERCENTAGE' => $percent_array['percentage'], ! 'BAR' => $percent_array['bar_percent'], ! 'WORD' => $words_data[$i]['word_text'] ) ! ); $j++; } *************** *** 107,120 **** // 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_WORD' => $lang['Word'], ! 'TEXT_CLASS' => $ss_phpbb->text_class, ! 'L_TITLE' => $lang['Top_Words'] ) ! ); ! $template->pparse( 'body' ); ! ?> --- 115,129 ---- // 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_WORD' => $lang['Word'], ! 'TEXT_CLASS' => $ss_phpbb->text_class, ! 'L_TITLE' => $lang['Top_Words'] ) ! ); ! $template->pparse( 'body' ); ! ?> \ No newline at end of file Index: usersranks.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/usersranks.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** usersranks.php 2 May 2006 23:29:13 -0000 1.5 --- usersranks.php 29 Jun 2006 19:08:04 -0000 1.6 *************** *** 23,28 **** } // Include common module stuff... ! include_once( $module_root_path . 'includes/common.' . $phpEx ); --- 23,29 ---- } + // // Include common module stuff... ! // include_once( $module_root_path . 'includes/common.' . $phpEx ); *************** *** 36,56 **** $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 ) ) { mx_message_die( GENERAL_ERROR, "Couldn't retrieve ranks data", '', __LINE__, __FILE__, $sql ); } $ranks_count = $db->sql_numrows( $result ); $ranks_data = $db->sql_fetchrowset( $result ); --- 37,61 ---- $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 ) ) { mx_message_die( GENERAL_ERROR, "Couldn't retrieve ranks data", '', __LINE__, __FILE__, $sql ); } + $ranks_count = $db->sql_numrows( $result ); $ranks_data = $db->sql_fetchrowset( $result ); *************** *** 113,124 **** { $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'] ) ! ); } } --- 118,131 ---- { $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'] ) ! ); } } *************** *** 128,159 **** { $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' ); ! ! ?> --- 135,171 ---- { $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' ); ! ?> \ No newline at end of file Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/db_upgrade.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** db_upgrade.php 2 May 2006 23:29:13 -0000 1.4 --- db_upgrade.php 29 Jun 2006 19:08:04 -0000 1.5 *************** *** 30,33 **** --- 30,36 ---- } + // + // + // $mx_module_version = '2.0.0'; $mx_module_copy = 'Original mxBB <i>SiteStats</i> module by <a href="http://www.phpmix.com" target="_blank">Markus</a>'; *************** *** 50,53 **** echo "<tr><td class=\"row1\" align=\"left\"><span class=\"gen\">" . $message . "</span></td></tr>"; echo "</table><br />"; - ?> \ No newline at end of file --- 53,55 ---- Index: topstarters.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/topstarters.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** topstarters.php 2 May 2006 23:29:13 -0000 1.5 --- topstarters.php 29 Jun 2006 19:08:04 -0000 1.6 *************** *** 23,28 **** } // Include common module stuff... ! include_once( $module_root_path . 'includes/common.' . $phpEx ); --- 23,29 ---- } + // // Include common module stuff... ! // include_once( $module_root_path . 'includes/common.' . $phpEx ); *************** *** 36,50 **** $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 --- 37,53 ---- $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 *************** *** 52,59 **** --- 55,64 ---- GROUP BY t.topic_poster ORDER BY num_topics DESC LIMIT ' . $ss_phpbb->return_limit; + if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't retrieve users data", '', __LINE__, __FILE__, $sql ); } + $user_count = $db->sql_numrows( $result ); $user_data = $db->sql_fetchrowset( $result ); *************** *** 67,96 **** $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' ); ! ! ?> --- 72,105 ---- $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' ); ! ?> \ No newline at end of file Index: topavatars.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/topavatars.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** topavatars.php 5 Apr 2006 23:03:45 -0000 1.4 --- topavatars.php 29 Jun 2006 19:08:04 -0000 1.5 *************** *** 23,28 **** } // Include common module stuff... ! include_once( $module_root_path . 'includes/common.' . $phpEx ); --- 23,29 ---- } + // // Include common module stuff... ! // include_once( $module_root_path . 'includes/common.' . $phpEx ); *************** *** 36,58 **** $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 ) ) { mx_message_die( GENERAL_ERROR, "Couldn't retrieve users data", "", __LINE__, __FILE__, $sql ); } $user_count = $db->sql_numrows( $result ); $user_data = $db->sql_fetchrowset( $result ); --- 37,63 ---- $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 ) ) { mx_message_die( GENERAL_ERROR, "Couldn't retrieve users data", "", __LINE__, __FILE__, $sql ); } + $user_count = $db->sql_numrows( $result ); $user_data = $db->sql_fetchrowset( $result ); *************** *** 63,91 **** $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' ); ! ! ?> --- 68,100 ---- $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' ); ! ?> \ No newline at end of file Index: collector.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/collector.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** collector.php 5 Apr 2006 23:03:45 -0000 1.4 --- collector.php 29 Jun 2006 19:08:04 -0000 1.5 *************** *** 14,19 **** */ // Security check... ! if ( !defined( 'IN_PORTAL' ) && !defined( 'IN_PHPBB' ) || !is_object($mx_block) ) { --- 14,20 ---- */ + // // Security check... ! // if ( !defined( 'IN_PORTAL' ) && !defined( 'IN_PHPBB' ) || !is_object($mx_block) ) { *************** *** 21,26 **** } // Common Includes and Read Static Module Settings ! define( '_SITESTATS_CONFIG', true ); $module_root_save = $module_root_path; --- 22,28 ---- } + // // Common Includes and Read Static Module Settings ! // define( '_SITESTATS_CONFIG', true ); $module_root_save = $module_root_path; *************** *** 35,40 **** $module_root_path = $module_root_save; // Update the Counters... ! $sitestats_counter = new sitestats_counter(); $sitestats_counter->readCounter( $board_config['sitename'] ); --- 37,43 ---- $module_root_path = $module_root_save; + // // Update the Counters... ! // $sitestats_counter = new sitestats_counter(); $sitestats_counter->readCounter( $board_config['sitename'] ); *************** *** 49,54 **** } // Update HTTP Referer... ! if ( $sitestats_config['referers_logging'] ) { --- 52,58 ---- } + // // Update HTTP Referer... ! // if ( $sitestats_config['referers_logging'] ) { *************** *** 61,64 **** } } - ?> \ No newline at end of file --- 65,67 ---- Index: db_uninstall.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/db_uninstall.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** db_uninstall.php 2 May 2006 23:29:13 -0000 1.5 --- db_uninstall.php 29 Jun 2006 19:08:04 -0000 1.6 *************** *** 30,34 **** --- 30,36 ---- } + // // Read module constants... + // $module_root_path = dirname( __FILE__ ) . '/'; include_once( $module_root_path . 'includes/common.' . $phpEx ); Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/db_install.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** db_install.php 2 May 2006 23:29:13 -0000 1.6 --- db_install.php 29 Jun 2006 19:08:04 -0000 1.7 *************** *** 33,37 **** --- 33,39 ---- $mx_module_copy = 'Original mxBB <i>SiteStats</i> module by <a href="http://www.phpmix.com" target="_blank">Markus</a>'; + // // Read module constants... + // $module_root_path = dirname( __FILE__ ) . '/'; include_once( $module_root_path . 'includes/common.' . $phpEx ); Index: topsmilies.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/topsmilies.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** topsmilies.php 2 May 2006 23:29:13 -0000 1.5 --- topsmilies.php 29 Jun 2006 19:08:04 -0000 1.6 *************** *** 23,28 **** } // Include common module stuff... ! include_once( $module_root_path . 'includes/common.' . $phpEx ); --- 23,29 ---- } + // // Include common module stuff... ! // include_once( $module_root_path . 'includes/common.' . $phpEx ); *************** *** 36,58 **** $ss_phpbb = new sitestats_phpbb(); } // -------------------------------------------------------------------------------- // Block Procedure // -------------------------------------------------------------------------------- // This is the template used to render this block. ! $template->set_filenames( array( 'body' => 'sitestats_topsmilies_body.tpl' ) ! ); ! // Top Smilies ! ! // Set smile_pref to 0, if you want that smilies are only counted once per post. // This means that, if the same smilie is entered ten times in a message, only one is counted in that message. ! $smile_pref = 1; // sort multi-dimensional array - from File Attachment Mod ! function smilies_sort_multi_array_attachment ( $sort_array, $key, $sort_order ) { --- 37,62 ---- $ss_phpbb = new sitestats_phpbb(); } + // -------------------------------------------------------------------------------- // Block Procedure // -------------------------------------------------------------------------------- + // // This is the template used to render this block. + // + $template->set_filenames( array( 'body' => 'sitestats_topsmilies_body.tpl' ) ); ! // // Top Smilies ! // ! // // Set smile_pref to 0, if you want that smilies are only counted once per post. // This means that, if the same smilie is entered ten times in a message, only one is counted in that message. ! // $smile_pref = 1; + // // sort multi-dimensional array - from File Attachment Mod ! // function smilies_sort_multi_array_attachment ( $sort_array, $key, $sort_order ) { *************** *** 65,72 **** for( $j = 0; $j < $num_iterations; $j++ ) { ! $next = 0; ! // do checks based on key ! $switch = false; if ( !( $string_sort ) ) --- 69,76 ---- for( $j = 0; $j < $num_iterations; $j++ ) { ! $next = 0; ! // do checks based on key ! $switch = false; if ( !( $string_sort ) ) *************** *** 95,100 **** } // Most used smilies ! $sql = 'SELECT smile_url FROM ' . SMILIES_TABLE . ' GROUP BY smile_url'; if ( !( $result = $db->sql_query( $sql ) ) ) --- 99,105 ---- } + // // Most used smilies ! // $sql = 'SELECT smile_url FROM ' . SMILIES_TABLE . ' GROUP BY smile_url'; if ( !( $result = $db->sql_query( $sql ) ) ) *************** *** 147,151 **** --- 152,159 ---- } } + + // // Sort array + // $all_smilies = smilies_sort_multi_array_attachment( $all_smilies, 'count', 'DESC' ); *************** *** 158,189 **** $percent_array = $ss_phpbb->do_percent_math( $all_smilies[0]['count'], $all_smilies[$i]['count'], $total_smilies ); ! $template->assign_block_vars( 'datarow', array( 'RANK' => $i + 1, ! 'CLASS' => ( !( $i + 1 % 2 ) ) ? $theme['td_class2'] : $theme['td_class1'], ! 'CODE' => $all_smilies[$i]['code'], ! 'USES' => $all_smilies[$i]['count'], ! 'PERCENTAGE' => $percent_array['percentage'], ! 'BAR' => $percent_array['bar_percent'], ! 'URL' => '<img src="' . PHPBB_URL . $board_config['smilies_path'] . '/' . $all_smilies[$i]['smile_url'] . '" alt="' . $all_smilies[$i]['smile_url'] . '" 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_IMAGE' => $lang['Smile'], ! 'L_CODE' => $lang['smiley_code'], - 'TEXT_CLASS' => $ss_phpbb->text_class, - 'L_TITLE' => $lang['Top_Smilies'] ) - ); $template->pparse( 'body' ); ! ! ?> --- 166,201 ---- $percent_array = $ss_phpbb->do_percent_math( $all_smilies[0]['count'], $all_smilies[$i]['count'], $total_smilies ); ! $template->assign_block_vars( 'datarow', array( ! 'RANK' => $i + 1, ! 'CLASS' => ( !( $i + 1 % 2 ) ) ? $theme['td_class2'] : $theme['td_class1'], ! 'CODE' => $all_smilies[$i]['code'], ! 'USES' => $all_smilies[$i]['count'], ! 'PERCENTAGE' => $percent_array['percentage'], ! 'BAR' => $percent_array['bar_percent'], ! 'URL' => '<img src="' . PHPBB_URL . $board_config['smilies_path'] . '/' . $all_smilies[$i]['smile_url'] . '" alt="' . $all_smilies[$i]['smile_url'] . '" 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_IMAGE' => $lang['Smile'], + 'L_CODE' => $lang['smiley_code'], ! 'TEXT_CLASS' => $ss_phpbb->text_class, ! 'L_TITLE' => $lang['Top_Smilies'] ) ! ); $template->pparse( 'body' ); ! ?> \ No newline at end of file Index: monthlytopics.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/monthlytopics.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** monthlytopics.php 5 Apr 2006 23:03:45 -0000 1.4 --- monthlytopics.php 29 Jun 2006 19:08:04 -0000 1.5 *************** *** 23,28 **** } // Include common module stuff... ! include_once( $module_root_path . 'includes/common.' . $phpEx ); --- 23,29 ---- } + // // Include common module stuff... ! // include_once( $module_root_path . 'includes/common.' . $phpEx ); *************** *** 36,58 **** $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 ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't retrieve topics data", '', __LINE__, __FILE__, $sql ); } $topics_count = $db->sql_numrows( $result ); $topics_data = $db->sql_fetchrowset( $result ); --- 37,63 ---- $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 ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't retrieve topics data", '', __LINE__, __FILE__, $sql ); } + $topics_count = $db->sql_numrows( $result ); $topics_data = $db->sql_fetchrowset( $result ); *************** *** 75,118 **** } } ! $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' ); ! ! ?> --- 80,126 ---- } } ! $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' ); ! ?> \ No newline at end of file Index: topposters_tiny.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/topposters_tiny.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** topposters_tiny.php 5 Apr 2006 23:03:45 -0000 1.4 --- topposters_tiny.php 29 Jun 2006 19:08:04 -0000 1.5 *************** *** 22,27 **** } // Include common module stuff... ! include_once( $module_root_path . 'includes/common.' . $phpEx ); --- 22,28 ---- } + // // Include common module stuff... ! // include_once( $module_root_path . 'includes/common.' . $phpEx ); *************** *** 35,51 **** $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; --- 36,54 ---- $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; *************** *** 60,79 **** 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' ); - ?> \ No newline at end of file --- 63,85 ---- 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' ); ?> \ No newline at end of file Index: fastestusers.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/fastestusers.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** fastestusers.php 2 May 2006 23:29:13 -0000 1.5 --- fastestusers.php 29 Jun 2006 19:08:04 -0000 1.6 *************** *** 23,28 **** } // Include common module stuff... ! include_once( $module_root_path . 'includes/common.' . $phpEx ); --- 23,29 ---- } + // // Include common module stuff... ! // include_once( $module_root_path . 'includes/common.' . $phpEx ); *************** *** 40,50 **** // -------------------------------------------------------------------------------- // This is the template used to render this block. ! $template->set_filenames( array( 'body' => 'sitestats_fastestusers_body.tpl' ) ! ); ! // Fastest Users ! $currect_time = time(); $sql = "SELECT user_id, username, user_posts, user_regdate, --- 41,52 ---- // -------------------------------------------------------------------------------- + // // This is the template used to render this block. + // + $template->set_filenames( array( 'body' => 'sitestats_fastestusers_body.tpl' ) ); ! // // Fastest Users ! // $currect_time = time(); $sql = "SELECT user_id, username, user_posts, user_regdate, *************** *** 55,62 **** --- 57,66 ---- ORDER BY rate DESC LIMIT " . $ss_phpbb->return_limit; + if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't retrieve users data", '', __LINE__, __FILE__, $sql ); } + $user_count = $db->sql_numrows( $result ); $user_data = $db->sql_fetchrowset( $result ); *************** *** 68,98 **** for( $i = 0; $i < $user_count; $i++ ) { ! $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' => number_format( $user_data[$i]['rate'], 2 ), ! 'BAR' => round( $user_data[$i]['rate'] * $cst ), ! 'URL' => append_sid( PHPBB_URL . 'profile.php?mode=viewprofile&u=' . $user_data[$i]['user_id'] ), ! 'RATE' => round( $user_data[$i]['rate'], 2 ), ! 'TIME' => $user_data[$i]['time_on_forum'] ) ! ); } // 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_TIME' => $lang['time_on_forum'], ! 'L_POST_PER_DAY' => $lang['posts_day'], ! 'L_GRAPH' => $lang['Graph'], ! 'L_USERNAME' => $lang['Username'], - 'TEXT_CLASS' => $ss_phpbb->text_class, - 'L_TITLE' => $lang['Fastest_Users'] ) - ); $template->pparse( 'body' ); ! ! ?> --- 72,106 ---- for( $i = 0; $i < $user_count; $i++ ) { ! $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' => number_format( $user_data[$i]['rate'], 2 ), ! 'BAR' => round( $user_data[$i]['rate'] * $cst ), ! 'URL' => append_sid( PHPBB_URL . 'profile.php?mode=viewprofile&u=' . $user_data[$i]['user_id'] ), ! 'RATE' => round( $user_data[$i]['rate'], 2 ), ! 'TIME' => $user_data[$i]['time_on_forum'] ) ! ); } + // // 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_TIME' => $lang['time_on_forum'], + 'L_POST_PER_DAY' => $lang['posts_day'], + 'L_GRAPH' => $lang['Graph'], + 'L_USERNAME' => $lang['Username'], ! 'TEXT_CLASS' => $ss_phpbb->text_class, ! 'L_TITLE' => $lang['Fastest_Users'] ) ! ); $template->pparse( 'body' ); ! ?> \ No newline at end of file Index: topposters.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/topposters.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** topposters.php 5 Apr 2006 23:03:45 -0000 1.4 --- topposters.php 29 Jun 2006 19:08:04 -0000 1.5 *************** *** 23,28 **** } // Include common module stuff... ! include_once( $module_root_path . 'includes/common.' . $phpEx ); --- 23,29 ---- } + // // Include common module stuff... ! // include_once( $module_root_path . 'includes/common.' . $phpEx ); *************** *** 36,54 **** $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 ) ) ) { --- 37,58 ---- $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 ) ) ) { *************** *** 65,94 **** $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' ); ! ! ?> --- 69,102 ---- $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' ); ! ?> \ No newline at end of file Index: sitestaff.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/sitestaff.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sitestaff.php 5 Apr 2006 23:03:45 -0000 1.4 --- sitestaff.php 29 Jun 2006 19:08:04 -0000 1.5 *************** *** 23,28 **** } // Include common module stuff... ! include_once( $module_root_path . 'includes/common.' . $phpEx ); --- 23,29 ---- } + // // Include common module stuff... ! // include_once( $module_root_path . 'includes/common.' . $phpEx ); *************** *** 36,39 **** --- 37,41 ---- $ss_phpbb = new sitestats_phpbb(); } + // -------------------------------------------------------------------------------- // Block Procedure *************** *** 42,50 **** // This is the template used to render this block. ! $template->set_filenames( array( 'body' => 'sitestats_sitestaff_body.tpl' ) ! ); // forums ! $sql = "SELECT ug.user_id, f.forum_id, f.forum_name FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . FORUMS_TABLE . " f --- 44,52 ---- // This is the template used to render this block. ! $template->set_filenames( array( 'body' => 'sitestats_sitestaff_body.tpl' ) ); + // // forums ! // $sql = "SELECT ug.user_id, f.forum_id, f.forum_name FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . FORUMS_TABLE . " f *************** *** 52,59 **** --- 54,63 ---- AND ug.group_id = aa.group_id AND f.forum_id = aa.forum_id"; + if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, "Couldn't query forums.", '', __LINE__, __FILE__, $sql ); } + while ( $row = $db->sql_fetchrow( $result ) ) { *************** *** 62,67 **** } // main ! $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_level >= 1 --- 66,72 ---- } + // // main ! // $sql = "SELECT * FROM " . USERS_TABLE . " WHERE user_level >= 1 *************** *** 177,218 **** } ! $template->assign_block_vars( 'staff', array( 'AVATAR' => $avatar, ! 'RANK' => $rank, ! 'RANK_IMAGE' => $rank_image, ! 'U_NAME' => append_sid( PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$staff[user_id]" ), ! 'NAME' => $staff[username], ! 'LEVEL' => $level, ! 'FORUMS' => $forums, ! 'JOINED' => create_date( $board_config['default_dateformat'], $staff['user_regdate'], $board_config['board_timezone'] ), ! 'PERIOD' => sprintf( $lang['SiteStats_Staff_Period'], $memberdays ), ! 'POSTS' => $staff['user_posts'], ! 'POST_DAY' => sprintf( $lang['User_post_day_stats'], $posts_per_day ), ! 'POST_PERCENT' => sprintf( $lang['User_post_pct_stats'], $percentage ), ! 'LAST_POST' => $last_post, ! 'MAIL' => $mail, ! 'PM' => $pm, ! 'MSN' => $msn, ! 'YIM' => $yim, ! 'AIM' => $aim, ! 'ICQ' => $icq, ! 'WWW' => $www ) ! ); } // Setup common template vars and display the block. - $template->assign_vars( array( 'L_AVATAR' => $lang['Avatar'], - 'L_USERNAME' => $lang['Username'], - 'L_POSTS' => $lang['Posts'], - 'L_JOINED' => $lang['Joined'], - 'L_EMAIL' => $lang['Email'], - 'L_PM' => $lang['Private_Message'], - 'L_WWW' => $lang['Website'], - 'L_CONTACT' => $lang['Contact'], - 'L_FORUMS' => $lang['SiteStats_Staff_Forums'], - 'L_MESSENGER' => $lang['SiteStats_Staff_Messenger'], - 'L_TITLE' => $lang['SiteStats_Staff'] ) - ); $template->pparse( 'body' ); ! ! ?> --- 182,226 ---- } ! $template->assign_block_vars( 'staff', array( ! 'AVATAR' => $avatar, ! 'RANK' => $rank, ! 'RANK_IMAGE' => $rank_image, ! 'U_NAME' => append_sid( PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$staff[user_id]" ), ! 'NAME' => $staff[username], ! 'LEVEL' => $level, ! 'FORUMS' => $forums, ! 'JOINED' => create_date( $board_config['default_dateformat'], $staff['user_regdate'], $board_config['board_timezone'] ), ! 'PERIOD' => sprintf( $lang['SiteStats_Staff_Period'], $memberdays ), ! 'POSTS' => $staff['user_posts'], ! 'POST_DAY' => sprintf( $lang['User_post_day_stats'], $posts_per_day ), ! 'POST_PERCENT' => sprintf( $lang['User_post_pct_stats'], $percentage ), ! 'LAST_POST' => $last_post, ! 'MAIL' => $mail, ! 'PM' => $pm, ! 'MSN' => $msn, ! 'YIM' => $yim, ! 'AIM' => $aim, ! 'ICQ' => $icq, ! 'WWW' => $www ) ! ); } + // // Setup common template vars and display the block. + // + $template->assign_vars( array( + 'L_AVATAR' => $lang['Avatar'], + 'L_USERNAME' => $lang['Username'], + 'L_POSTS' => $lang['Posts'], + 'L_JOINED' => $lang['Joined'], + 'L_EMAIL' => $lang['Email'], + 'L_PM' => $lang['Private_Message'], + 'L_WWW' => $lang['Website'], + 'L_CONTACT' => $lang['Contact'], + 'L_FORUMS' => $lang['SiteStats_Staff_Forums'], + 'L_MESSENGER' => $lang['SiteStats_Staff_Messenger'], + 'L_TITLE' => $lang['SiteStats_Staff'] ) + ); $template->pparse( 'body' ); ! ?> \ No newline at end of file Index: monthlyposts.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/monthlyposts.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** monthlyposts.php 5 Apr 2006 23:03:45 -0000 1.4 --- monthlyposts.php 29 Jun 2006 19:08:04 -0000 1.5 *************** *** 23,28 **** } // Include common module stuff... ! include_once( $module_root_path . 'includes/common.' . $phpEx ); --- 23,29 ---- } + // // Include common module stuff... ! // include_once( $module_root_path . 'includes/common.' . $phpEx ); *************** *** 36,58 **** $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 ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't retrieve posts data", '', __LINE__, __FILE__, $sql ); } $posts_count = $db->sql_numrows( $result ); $posts_data = $db->sql_fetchrowset( $result ); --- 37,63 ---- $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 ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't retrieve posts data", '', __LINE__, __FILE__, $sql ); } + $posts_count = $db->sql_numrows( $result ); $posts_data = $db->sql_fetchrowset( $result ); *************** *** 88,118 **** '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' ); ! ! ?> --- 93,125 ---- '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' ); ! ?> \ No newline at end of file Index: adminstats.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/adminstats.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** adminstats.php 5 Apr 2006 23:03:45 -0000 1.4 --- adminstats.php 29 Jun 2006 19:08:03 -0000 1.5 *************** *** 23,28 **** } // Include common module stuff... ! include_once( $module_root_path . 'includes/common.' . $phpEx ); --- 23,29 ---- } + // // Include common module stuff... ! // include_once( $module_root_path . 'includes/common.' . $phpEx ); *************** *** 37,42 **** } // Load language files, required for several Administrative Statistics... ! if ( file_exists( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) ) { --- 38,44 ---- } + // // Load language files, required for several Administrative Statistics... ! // if ( file_exists( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) ) { *************** *** 47,50 **** --- 49,53 ---- include_once( $phpbb_root_path . 'language/lang_english/lang_admin.' . $phpEx ); } + // -------------------------------------------------------------------------------- // Block Procedure *************** *** 53,61 **** // 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 : ''; --- 56,64 ---- // 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 : ''; *************** *** 89,98 **** } } ! @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 ) { --- 92,101 ---- } } ! @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 ) { *************** *** 235,239 **** $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 ) ) ) --- 238,242 ---- $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 ) ) ) *************** *** 244,249 **** $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'"; --- 247,253 ---- $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'"; *************** *** 282,287 **** $lang['Most_Ever_Online_Date'], $lang['Most_Ever_Online'], ! $lang['Gzip_compression'] ! ); $value_array = array( $total_posts, $posts_per_day, --- 286,292 ---- $lang['Most_Ever_Online_Date'], $lang['Most_Ever_Online'], ! $lang['Gzip_compression'] ! ); ! $value_array = array( $total_posts, $posts_per_day, *************** *** 300,308 **** $most_users_date, $most_users, ! ( $board_config['gzip_compress'] ) ? $lang['Enabled'] : $lang['Disabled'] ! ); // Disk Usage, if Attachment Mod is installed ! if ( $attachment_mod_installed ) { --- 305,314 ---- $most_users_date, $most_users, ! ( $board_config['gzip_compress'] ) ? $lang['Enabled'] : $lang['Disabled'] ! ); + // // Disk Usage, if Attachment Mod is installed ! // if ( $attachment_mod_installed ) { *************** *** 317,333 **** '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' ); ! ! ?> --- 323,340 ---- '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' ); ! ?> \ No newline at end of file Index: topreferers.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/topreferers.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** topreferers.php 5 Apr 2006 23:03:45 -0000 1.4 --- topreferers.php 29 Jun 2006 19:08:04 -0000 1.5 *************** *** 22,27 **** } // Include common module stuff... ! include_once( $module_root_path . 'includes/common.' . $phpEx ); --- 22,28 ---- } + // // Include common module stuff... ! // include_once( $module_root_path . 'includes/common.' . $phpEx ); *************** *** 35,51 **** // -------------------------------------------------------------------------------- // This is the template used to render this block. ! $template-... [truncated message content] |