|
From: Jon O. <jon...@us...> - 2006-06-29 19:08:51
|
Update of /cvsroot/mxbb/mx_sitestats/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19996/modules/mx_sitestats/includes Modified Files: common.php Log Message: code cleanup Index: common.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/includes/common.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** common.php 17 Jun 2006 20:51:08 -0000 1.6 --- common.php 29 Jun 2006 19:08:04 -0000 1.7 *************** *** 16,21 **** define( '_SITESTATS_VERSION', 'v1.3.0' ); // Define table names. ! if ( empty( $mx_table_prefix ) ) { --- 16,22 ---- define( '_SITESTATS_VERSION', 'v1.3.0' ); + // // Define table names. ! // if ( empty( $mx_table_prefix ) ) { *************** *** 34,43 **** $mx_table_prefix = get_mx_table_prefix( $mx_root_path ); } define( 'SITESTATS_CONFIG_TABLE', $mx_table_prefix . 'sitestats_config' ); define( 'SITESTATS_COUNTER_TABLE', $mx_table_prefix . 'sitestats_counter' ); define( 'SITESTATS_REFERER_TABLE', $mx_table_prefix . 'sitestats_referer' ); // Load language files. ! if ( file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) ) { --- 35,49 ---- $mx_table_prefix = get_mx_table_prefix( $mx_root_path ); } + + // + // Definitions + // define( 'SITESTATS_CONFIG_TABLE', $mx_table_prefix . 'sitestats_config' ); define( 'SITESTATS_COUNTER_TABLE', $mx_table_prefix . 'sitestats_counter' ); define( 'SITESTATS_REFERER_TABLE', $mx_table_prefix . 'sitestats_referer' ); + // // Load language files. ! // if ( file_exists( $module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) ) { *************** *** 57,66 **** include_once( $module_root_path . 'language/lang_english/lang_main.' . $phpEx ); } // ================================================================================ // [ SITESTATS CONFIG ] // ================================================================================ - // Get SiteStats Settings from config table ! if ( defined( '_SITESTATS_CONFIG' ) ) { --- 63,72 ---- include_once( $module_root_path . 'language/lang_english/lang_main.' . $phpEx ); } + // ================================================================================ // [ SITESTATS CONFIG ] // ================================================================================ // Get SiteStats Settings from config table ! // if ( defined( '_SITESTATS_CONFIG' ) ) { *************** *** 80,85 **** } // Set Default Configuration (safety)... ! if ( empty( $sitestats_config['text_class'] ) ) { --- 86,92 ---- } + // // Set Default Configuration (safety)... ! // if ( empty( $sitestats_config['text_class'] ) ) { *************** *** 111,117 **** // Site Statistics Classes ! // Base class with DB Utilities ! class sitestats { --- 118,124 ---- // Site Statistics Classes ! // // Base class with DB Utilities ! // class sitestats { *************** *** 125,128 **** --- 132,136 ---- return $result; } + function dbFetchRow( $sql ) { *************** *** 135,138 **** --- 143,147 ---- return $row; } + function dbMaxId( $table_name, $table_key ) { *************** *** 150,156 **** class sitestats_counter extends sitestats { ! // Public Properties ! var $id, // Internal page identifier. $page, // Human page identifier. --- 159,165 ---- class sitestats_counter extends sitestats { ! // // Public Properties ! // var $id, // Internal page identifier. $page, // Human page identifier. *************** *** 161,167 **** $digits_ext; // File Extension for current digit images. ! // Constructor... ! function sitestats_counter() { --- 170,176 ---- $digits_ext; // File Extension for current digit images. ! // // Constructor... ! // function sitestats_counter() { *************** *** 182,187 **** } // Public Methods related to the Counter... ! function readCounter( $page ) { --- 191,197 ---- } + // // Public Methods related to the Counter... ! // function readCounter( $page ) { *************** *** 201,204 **** --- 211,215 ---- return true; } + function incrementCounter() { *************** *** 212,222 **** } } function updateCounter() { if ( $this->id == 0 ) { ! // There is still no counter for this page? ! $this->id = $this->dbMaxId( SITESTATS_COUNTER_TABLE, 'id' ); if ( empty( $this->id ) ) --- 223,234 ---- } } + function updateCounter() { if ( $this->id == 0 ) { ! // // There is still no counter for this page? ! // $this->id = $this->dbMaxId( SITESTATS_COUNTER_TABLE, 'id' ); if ( empty( $this->id ) ) *************** *** 227,237 **** else { ! // Update the hits counter for this page... ! $sql = 'UPDATE ' . SITESTATS_COUNTER_TABLE . " SET page = '" . $this->page . "' , " . ' hits_counter = ' . $this->hits_counter . ' , ' . ' sess_counter = ' . $this->sess_counter . ' WHERE id = ' . $this->id; } return $this->dbQuery( $sql ) ? true : false; } function deleteCounter() { --- 239,250 ---- else { ! // // Update the hits counter for this page... ! // $sql = 'UPDATE ' . SITESTATS_COUNTER_TABLE . " SET page = '" . $this->page . "' , " . ' hits_counter = ' . $this->hits_counter . ' , ' . ' sess_counter = ' . $this->sess_counter . ' WHERE id = ' . $this->id; } return $this->dbQuery( $sql ) ? true : false; } + function deleteCounter() { *************** *** 240,245 **** } // Public Methods related to Counter Images... ! function _getDigitsExt() { --- 253,259 ---- } + // // Public Methods related to Counter Images... ! // function _getDigitsExt() { *************** *** 250,253 **** --- 264,268 ---- return ''; } + function setDigitParms( $digits_path, $digits_style ) { *************** *** 260,263 **** --- 275,279 ---- return true; } + function getCounterImages( $counter, $size, $get_image_size ) { *************** *** 279,282 **** --- 295,299 ---- return $r; } + function getDigitStyles( $digits_path ) { *************** *** 300,305 **** } // Public Methods related to HTTP Referer... ! function updateReferer() { --- 317,323 ---- } + // // Public Methods related to HTTP Referer... ! // function updateReferer() { *************** *** 337,342 **** var $text_class; // Constructor ! function sitestats_phpbb() { --- 355,361 ---- var $text_class; + // // Constructor ! // function sitestats_phpbb() { *************** *** 349,354 **** } // Basic phpBB statistics... ! function get_db_stat( $mode ) { --- 368,374 ---- } + // // Basic phpBB statistics... ! // function get_db_stat( $mode ) { *************** *** 360,365 **** } // Compute the percent math... ! function do_percent_math( $firstval, $value, $total ) { --- 380,386 ---- } + // // Compute the percent math... ! // function do_percent_math( $firstval, $value, $total ) { *************** *** 373,378 **** } // Get voting bar info and Set templates variables... ! function set_voting_bar() { --- 394,400 ---- } + // // Get voting bar info and Set templates variables... ! // function set_voting_bar() { *************** *** 392,395 **** $mxbb_footer_addup[] = 'mxBB Sitestats Module'; - ?> \ No newline at end of file --- 414,416 ---- |