|
From: Jon O. <jon...@us...> - 2006-06-29 19:08:09
|
Update of /cvsroot/mxbb/mx_sitestats/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19996/modules/mx_sitestats/admin Modified Files: admin_counter.php admin_referers.php admin_sitestats.php Log Message: code cleanup Index: admin_referers.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/admin/admin_referers.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** admin_referers.php 2 May 2006 23:29:13 -0000 1.6 --- admin_referers.php 29 Jun 2006 19:08:03 -0000 1.7 *************** *** 13,18 **** // ====================================================== // This is how we add an entry to the phpBB Administration Control Panel... ! if ( !empty( $setmodules ) ) { --- 13,19 ---- // ====================================================== + // // This is how we add an entry to the phpBB Administration Control Panel... ! // if ( !empty( $setmodules ) ) { *************** *** 21,45 **** } // Setup basic portal stuff... ! define( 'IN_PORTAL', 1 ); $mx_root_path = '../../../'; $module_root_path = '../'; // Security and page header... ! $phpEx = substr(strrchr(__FILE__, '.'), 1); $no_page_header = true; require( $mx_root_path . 'admin/pagestart.' . $phpEx ); // Include common module stuff... ! require( $module_root_path . 'includes/common.' . $phpEx ); // ====================================================== // [ MAIN PROCESS ] // ====================================================== - // Get POST/GET variables... ! $start = intval( ( isset( $_POST['start'] ) ) ? $_POST['start'] : ( ( isset( $_GET['start'] ) ) ? $_GET['start'] : 0 ) ); $sort_method = ( ( isset( $_POST['sort'] ) ) ? $_POST['sort'] : ( ( isset( $_GET['sort'] ) ) ? $_GET['sort'] : 'hits' ) ); --- 22,49 ---- } + // // Setup basic portal stuff... ! // define( 'IN_PORTAL', 1 ); $mx_root_path = '../../../'; $module_root_path = '../'; + // // Security and page header... ! // $phpEx = substr(strrchr(__FILE__, '.'), 1); $no_page_header = true; require( $mx_root_path . 'admin/pagestart.' . $phpEx ); + // // Include common module stuff... ! // require( $module_root_path . 'includes/common.' . $phpEx ); + // ====================================================== // [ MAIN PROCESS ] // ====================================================== // Get POST/GET variables... ! // $start = intval( ( isset( $_POST['start'] ) ) ? $_POST['start'] : ( ( isset( $_GET['start'] ) ) ? $_GET['start'] : 0 ) ); $sort_method = ( ( isset( $_POST['sort'] ) ) ? $_POST['sort'] : ( ( isset( $_GET['sort'] ) ) ? $_GET['sort'] : 'hits' ) ); *************** *** 52,57 **** $id_list = ( !empty( $_POST['id_list'] ) ) ? $_POST['id_list'] : array(); // Check which mode we should operate in... ! if ( $enable ) { --- 56,62 ---- $id_list = ( !empty( $_POST['id_list'] ) ) ? $_POST['id_list'] : array(); + // // Check which mode we should operate in... ! // if ( $enable ) { *************** *** 87,92 **** // [ DEFAULT PROCESS ] // ====================================================== - // Get TopReferers Block Settings... $sql = "SELECT block_id FROM " . BLOCK_TABLE . " WHERE block_title = 'Top_Referers' LIMIT 1"; if ( !$result = $db->sql_query( $sql ) ) --- 92,97 ---- // [ DEFAULT PROCESS ] // ====================================================== // Get TopReferers Block Settings... + // $sql = "SELECT block_id FROM " . BLOCK_TABLE . " WHERE block_title = 'Top_Referers' LIMIT 1"; if ( !$result = $db->sql_query( $sql ) ) *************** *** 109,119 **** $rows_per_page *= 2; // Setup report variables... ! ! $a_sort_method = array( 'host' => $lang['Host'], 'hits' => $lang['Hits'], 'firstvisit' => $lang['First_visit'], 'lastvisit' => $lang['Last_visit'] ! ); $s_sort_method = ''; foreach( $a_sort_method as $s_value => $s_text ) --- 114,127 ---- $rows_per_page *= 2; + // // Setup report variables... ! // ! $a_sort_method = array( ! 'host' => $lang['Host'], 'hits' => $lang['Hits'], 'firstvisit' => $lang['First_visit'], 'lastvisit' => $lang['Last_visit'] ! ); ! $s_sort_method = ''; foreach( $a_sort_method as $s_value => $s_text ) *************** *** 123,136 **** } // Get total records count, for pagination... ! $total_rows = array(); $sql = 'SELECT COUNT(*) AS total FROM ' . SITESTATS_REFERER_TABLE . ' WHERE enabled = 0'; if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, "Couldn't query HTTP Referers Count", '', __LINE__, __FILE__, $sql ); } $row = $db->sql_fetchrow( $result ); $total_rows[0] = $row['total']; $sql = 'SELECT COUNT(*) AS total FROM ' . SITESTATS_REFERER_TABLE . ' WHERE enabled = 1'; if ( !$result = $db->sql_query( $sql ) ) --- 131,148 ---- } + // // Get total records count, for pagination... ! // $total_rows = array(); $sql = 'SELECT COUNT(*) AS total FROM ' . SITESTATS_REFERER_TABLE . ' WHERE enabled = 0'; + if ( !$result = $db->sql_query( $sql ) ) { mx_message_die( GENERAL_ERROR, "Couldn't query HTTP Referers Count", '', __LINE__, __FILE__, $sql ); } + $row = $db->sql_fetchrow( $result ); $total_rows[0] = $row['total']; + $sql = 'SELECT COUNT(*) AS total FROM ' . SITESTATS_REFERER_TABLE . ' WHERE enabled = 1'; if ( !$result = $db->sql_query( $sql ) ) *************** *** 138,147 **** mx_message_die( GENERAL_ERROR, "Couldn't query HTTP Referers Count", '', __LINE__, __FILE__, $sql ); } $row = $db->sql_fetchrow( $result ); $total_rows[1] = $row['total']; $total_now = ( $filter_flag == 'enabled' ) ? 1 : 0; // Default process is report... ! switch ( $sort_method ) { --- 150,161 ---- mx_message_die( GENERAL_ERROR, "Couldn't query HTTP Referers Count", '', __LINE__, __FILE__, $sql ); } + $row = $db->sql_fetchrow( $result ); $total_rows[1] = $row['total']; $total_now = ( $filter_flag == 'enabled' ) ? 1 : 0; + // // Default process is report... ! // switch ( $sort_method ) { *************** *** 160,163 **** --- 174,178 ---- break; } + $sql = 'SELECT * FROM ' . SITESTATS_REFERER_TABLE . ' WHERE enabled = ' . ( ( $filter_flag == 'enabled' ) ? 1 : 0 ) . ' ORDER BY ' . $order_by . ' LIMIT ' . $start . ', ' . $rows_per_page; if ( !$result = $db->sql_query( $sql ) ) *************** *** 168,175 **** $rowset_count = count( $rowset ); // Set template variables and send to browser... ! ! $template->set_filenames( array( 'body' => 'admin/sitestats_referers_admin.tpl' ) ! ); if ( $rowset_count > 0 ) --- 183,190 ---- $rowset_count = count( $rowset ); + // // Set template variables and send to browser... ! // ! $template->set_filenames( array( 'body' => 'admin/sitestats_referers_admin.tpl' ) ); if ( $rowset_count > 0 ) *************** *** 177,187 **** for( $i = 0; $i < $rowset_count; $i++ ) { ! $template->assign_block_vars( 'datarow', array( 'ROW_CLASS' => ( !( $i % 2 ) ) ? $theme['td_class1'] : $theme['td_class2'], ! 'ID' => $rowset[$i]['id'], ! 'HOST' => $rowset[$i]['host'], ! 'HITS' => $rowset[$i]['hits'], ! 'FIRST_VISIT' => create_date( 'Y-m-d H:i:s', $rowset[$i]['firstvisit'], $board_config['board_timezone'] ), ! 'LAST_VISIT' => create_date( 'Y-m-d H:i:s', $rowset[$i]['lastvisit'], $board_config['board_timezone'] ) ) ! ); } $template->assign_block_vars( 'ok_referers_sw', array() ); --- 192,203 ---- for( $i = 0; $i < $rowset_count; $i++ ) { ! $template->assign_block_vars( ! 'datarow', array( 'ROW_CLASS' => ( !( $i % 2 ) ) ? $theme['td_class1'] : $theme['td_class2'], ! 'ID' => $rowset[$i]['id'], ! 'HOST' => $rowset[$i]['host'], ! 'HITS' => $rowset[$i]['hits'], ! 'FIRST_VISIT' => create_date( 'Y-m-d H:i:s', $rowset[$i]['firstvisit'], $board_config['board_timezone'] ), ! 'LAST_VISIT' => create_date( 'Y-m-d H:i:s', $rowset[$i]['lastvisit'], $board_config['board_timezone'] ) ) ! ); } $template->assign_block_vars( 'ok_referers_sw', array() ); *************** *** 191,231 **** $template->assign_block_vars( 'no_referers_sw', array() ); } ! $template->assign_vars( array( 'L_TITLE' => $lang['Referers_Management'], ! 'L_EXPLAIN' => $lang['Referers_Management_explain'] . $lang['Enabled'] . '(' . $total_rows[1] . '), ' . $lang['Disabled'] . '(' . $total_rows[0] . ')', ! 'U_FORM_ACTION' => append_sid( @basename( __FILE__ ) ), ! 'L_SELECT_FILTER' => $lang['Select_filter'], ! 'L_ENABLED' => $lang['Enabled'], ! 'L_DISABLED' => $lang['Disabled'], ! 'L_GO' => $lang['Go'], ! 'ENABLED_SELECTED' => ( $filter_flag == 'enabled' ) ? 'checked="checked"' : '', ! 'DISABLED_SELECTED' => ( $filter_flag != 'enabled' ) ? 'checked="checked"' : '', ! 'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'], ! 'S_SORT_METHOD' => $s_sort_method, ! 'L_SORT' => $lang['Sort'], ! 'L_ORDER' => $lang['Order'], ! 'L_SORT_DESCENDING' => $lang['Sort_Descending'], ! 'L_SORT_ASCENDING' => $lang['Sort_Ascending'], ! 'ASC_SELECTED' => ( $sort_order != 'DESC' ) ? 'selected="selected"' : '', ! 'DESC_SELECTED' => ( $sort_order == 'DESC' ) ? 'selected="selected"' : '', ! 'L_REFERER_HOST' => $lang['Host'], ! 'L_REFERER_HITS' => $lang['Hits'], ! 'L_FIRST_VISIT' => $lang['First_visit'], ! 'L_LAST_VISIT' => $lang['Last_visit'], ! 'L_NO_REFERERS' => ( $filter_flag == 'enabled' ) ? $lang['No_Enabled_Referers'] : $lang['No_Disabled_Referers'], ! 'L_MARK' => $lang['Mark'], ! 'L_MARK_ALL' => $lang['Mark_all'], ! 'L_UNMARK_ALL' => $lang['Unmark_all'], ! 'L_ENABLE_MARKED' => ( $filter_flag == 'enabled' ) ? $lang['Disable_marked'] : $lang['Enable_marked'], ! 'L_DELETE_MARKED' => $lang['Delete_marked'], ! 'L_DELETE_ALL' => $lang['Delete_all'], ! 'L_NO_ITEMS_MARKED' => $lang['No_items_marked'], ! 'L_PLEASE_CONFIRM' => $lang['Please_confirm'], - 'PAGINATION' => generate_pagination( append_sid( @basename( __FILE__ ) . "?filter=$filter_flag&sort=$sort_method&order=$sort_order" ), $total_rows[$total_now], $rows_per_page, $start ), - 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $rows_per_page ) + 1 ), ceil( $total_rows[$total_now] / $rows_per_page ) ) - ) // end array - ); include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); $template->pparse( 'body' ); --- 207,248 ---- $template->assign_block_vars( 'no_referers_sw', array() ); } ! $template->assign_vars( array( ! 'L_TITLE' => $lang['Referers_Management'], ! 'L_EXPLAIN' => $lang['Referers_Management_explain'] . $lang['Enabled'] . '(' . $total_rows[1] . '), ' . $lang['Disabled'] . '(' . $total_rows[0] . ')', ! 'U_FORM_ACTION' => append_sid( @basename( __FILE__ ) ), ! 'L_SELECT_FILTER' => $lang['Select_filter'], ! 'L_ENABLED' => $lang['Enabled'], ! 'L_DISABLED' => $lang['Disabled'], ! 'L_GO' => $lang['Go'], ! 'ENABLED_SELECTED' => ( $filter_flag == 'enabled' ) ? 'checked="checked"' : '', ! 'DISABLED_SELECTED' => ( $filter_flag != 'enabled' ) ? 'checked="checked"' : '', ! 'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'], ! 'S_SORT_METHOD' => $s_sort_method, ! 'L_SORT' => $lang['Sort'], ! 'L_ORDER' => $lang['Order'], ! 'L_SORT_DESCENDING' => $lang['Sort_Descending'], ! 'L_SORT_ASCENDING' => $lang['Sort_Ascending'], ! 'ASC_SELECTED' => ( $sort_order != 'DESC' ) ? 'selected="selected"' : '', ! 'DESC_SELECTED' => ( $sort_order == 'DESC' ) ? 'selected="selected"' : '', ! 'L_REFERER_HOST' => $lang['Host'], ! 'L_REFERER_HITS' => $lang['Hits'], ! 'L_FIRST_VISIT' => $lang['First_visit'], ! 'L_LAST_VISIT' => $lang['Last_visit'], ! 'L_NO_REFERERS' => ( $filter_flag == 'enabled' ) ? $lang['No_Enabled_Referers'] : $lang['No_Disabled_Referers'], ! 'L_MARK' => $lang['Mark'], ! 'L_MARK_ALL' => $lang['Mark_all'], ! 'L_UNMARK_ALL' => $lang['Unmark_all'], ! 'L_ENABLE_MARKED' => ( $filter_flag == 'enabled' ) ? $lang['Disable_marked'] : $lang['Enable_marked'], ! 'L_DELETE_MARKED' => $lang['Delete_marked'], ! 'L_DELETE_ALL' => $lang['Delete_all'], ! 'L_NO_ITEMS_MARKED' => $lang['No_items_marked'], ! 'L_PLEASE_CONFIRM' => $lang['Please_confirm'], ! ! 'PAGINATION' => generate_pagination( append_sid( @basename( __FILE__ ) . "?filter=$filter_flag&sort=$sort_method&order=$sort_order" ), $total_rows[$total_now], $rows_per_page, $start ), ! 'PAGE_NUMBER' => sprintf( $lang['Page_of'], ( floor( $start / $rows_per_page ) + 1 ), ceil( $total_rows[$total_now] / $rows_per_page ) ) ! ) ); include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); $template->pparse( 'body' ); *************** *** 238,241 **** include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); exit; - ?> \ No newline at end of file --- 255,257 ---- Index: admin_sitestats.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/admin/admin_sitestats.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** admin_sitestats.php 2 May 2006 23:29:13 -0000 1.5 --- admin_sitestats.php 29 Jun 2006 19:08:03 -0000 1.6 *************** *** 13,18 **** // ====================================================== // Add our entry to the Administration Control Panel... ! if ( !empty( $setmodules ) ) { --- 13,19 ---- // ====================================================== + // // Add our entry to the Administration Control Panel... ! // if ( !empty( $setmodules ) ) { *************** *** 21,37 **** } // Setup basic portal stuff... ! define( 'IN_PORTAL', true ); $mx_root_path = '../../../'; $module_root_path = "../"; // Security and page header... ! $phpEx = substr(strrchr(__FILE__, '.'), 1); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); // Include common module stuff... ! require( $module_root_path . 'includes/common.' . $phpEx ); $sitestats_counter = new sitestats_counter(); --- 22,41 ---- } + // // Setup basic portal stuff... ! // define( 'IN_PORTAL', true ); $mx_root_path = '../../../'; $module_root_path = "../"; + // // Security and page header... ! // $phpEx = substr(strrchr(__FILE__, '.'), 1); require( $mx_root_path . '/admin/pagestart.' . $phpEx ); + // // Include common module stuff... ! // require( $module_root_path . 'includes/common.' . $phpEx ); $sitestats_counter = new sitestats_counter(); *************** *** 39,51 **** $sitestats_digary = $sitestats_counter->getDigitStyles( $digits_path ); // Send page header... ! include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); // ====================================================== // [ MAIN PROCESS ] // ====================================================== - // Read the module settings... ! $sql = "SELECT * FROM " . SITESTATS_CONFIG_TABLE; if ( !$result = $db->sql_query( $sql ) ) --- 43,56 ---- $sitestats_digary = $sitestats_counter->getDigitStyles( $digits_path ); + // // Send page header... ! // include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); + // ====================================================== // [ MAIN PROCESS ] // ====================================================== // Read the module settings... ! // $sql = "SELECT * FROM " . SITESTATS_CONFIG_TABLE; if ( !$result = $db->sql_query( $sql ) ) *************** *** 70,75 **** } // If the form was submitted, display the update successful message... ! if ( isset( $HTTP_POST_VARS['submit'] ) ) { --- 75,81 ---- } + // // If the form was submitted, display the update successful message... ! // if ( isset( $HTTP_POST_VARS['submit'] ) ) { *************** *** 80,90 **** } // Prepare the Settings form... ! $template->set_filenames( array( 'body' => 'admin/sitestats_settings.tpl' ) ! ); ! // Counter Settings... ! $select_class_ary = array( 'cattitle', 'gen', 'genmed', 'gensmall', 'maintitle', 'postbody', 'topictitle' ); $select_text_class = ''; --- 86,97 ---- } + // // Prepare the Settings form... + // + $template->set_filenames( array( 'body' => 'admin/sitestats_settings.tpl' ) ); ! // // Counter Settings... ! // $select_class_ary = array( 'cattitle', 'gen', 'genmed', 'gensmall', 'maintitle', 'postbody', 'topictitle' ); $select_text_class = ''; *************** *** 137,142 **** $counters_toshow_sess = ( $new['counters_toshow'] == 2 ) ? 'checked="checked"' : ''; // Referers Settings... ! $referers_logging_off = ( !$new['referers_logging'] ) ? 'checked="checked"' : ''; $referers_logging_on = ( $new['referers_logging'] ) ? 'checked="checked"' : ''; --- 144,150 ---- $counters_toshow_sess = ( $new['counters_toshow'] == 2 ) ? 'checked="checked"' : ''; + // // Referers Settings... ! // $referers_logging_off = ( !$new['referers_logging'] ) ? 'checked="checked"' : ''; $referers_logging_on = ( $new['referers_logging'] ) ? 'checked="checked"' : ''; *************** *** 145,212 **** $referers_showdis_on = ( $new['referers_show_disabled'] ) ? 'checked="checked"' : ''; // Setup template vars and send the HTML... ! $template->assign_vars( array( 'S_ACTION' => append_sid( @basename( __FILE__ ) ), ! 'L_SITESTATS_SETTINGS' => $lang['SiteStats_Settings'], ! 'L_SITESTATS_SETTINGS_EXPLAIN' => $lang['SiteStats_Settings_explain'], ! ! 'DIGITS_PATH' => $digits_path, ! 'SAMPLE_DIGITS' => $sample_digits, ! 'SPACER' => $images['mx_spacer'], ! 'L_COUNTER_SETTINGS' => $lang['Counter_Settings'], ! 'L_COUNTER_TYPE' => $lang['SiteStats_Counter_Type'], ! 'L_COUNTER_TYPE_EXPLAIN' => $lang['SiteStats_Counter_Typeinfo'], ! 'SELECT_COUNTER_TYPE' => $select_counter_type, ! 'L_TEXT_CLASS' => $lang['SiteStats_Text_Class'], ! 'L_TEXT_CLASS_EXPLAIN' => $lang['SiteStats_Text_Classinfo'], ! 'SELECT_TEXT_CLASS' => $select_text_class, ! 'L_COUNTER_CLASS' => $lang['SiteStats_Counter_Class'], ! 'L_COUNTER_CLASS_EXPLAIN' => $lang['SiteStats_Counter_Classinfo'], ! 'SELECT_COUNTER_CLASS' => $select_counter_class, ! 'L_COUNTER_STYLE' => $lang['SiteStats_Counter_Style'], ! 'L_COUNTER_STYLE_EXPLAIN' => $lang['SiteStats_Counter_Styleinfo'], ! 'COUNTER_STYLE' => $new['counter_style'], ! 'L_COUNTER_SIZE' => $lang['SiteStats_Counter_Size'], ! 'L_COUNTER_SIZE_EXPLAIN' => $lang['SiteStats_Counter_Sizeinfo'], ! 'COUNTER_SIZE' => $new['counter_size'], ! 'L_COUNTER_TOSHOW' => $lang['SiteStats_Counter_ToShow'], ! 'L_COUNTER_TOSHOW_EXPLAIN' => $lang['SiteStats_Counter_ToShowinfo'], ! 'COUNTER_TOSHOW' => $new['counters_toshow'], ! 'COUNTER_TOSHOW_HITS' => $counters_toshow_hits, ! 'COUNTER_TOSHOW_SESS' => $counters_toshow_sess, ! 'COUNTER_TOSHOW_BOTH' => $counters_toshow_both, ! 'L_MORE_STATS_PAGE' => $lang['SiteStats_MoreStats_Page'], ! 'L_MORE_STATS_PAGE_EXPLAIN' => $lang['SiteStats_MoreStats_Pageinfo'], ! 'MORE_STATS_PAGE' => $new['more_stats_page'], ! 'L_REFERERS_SETTINGS' => $lang['Referers_Settings'], ! 'L_REFERERS_LOGGING' => $lang['Referers_Logging'], ! 'L_REFERERS_LOGGING_EXPLAIN' => $lang['Referers_Logginginfo'], ! 'REFERERS_LOGGING' => $new['referers_logging'], ! 'REFERERS_LOGGING_ON' => $referers_logging_on, ! 'REFERERS_LOGGING_OFF' => $referers_logging_off, ! 'L_REFERERS_COUNT' => $lang['SiteStats_TopReferers_Count'], ! 'L_REFERERS_COUNT_EXPLAIN' => $lang['SiteStats_TopReferers_Countinfo'], ! 'REFERERS_COUNT' => $new['referers_count'], ! 'L_REFERERS_SHOWDIS' => $lang['SiteStats_TopReferers_ShowDisabled'], ! 'L_REFERERS_SHOWDIS_EXPLAIN' => $lang['SiteStats_TopReferers_ShowDisabledinfo'], ! 'REFERERS_SHOWDIS' => $new['referers_show_disabled'], ! 'REFERERS_SHOWDIS_ON' => $referers_showdis_on, ! 'REFERERS_SHOWDIS_OFF' => $referers_showdis_off, ! 'L_HITS' => $lang['SiteStats_Counter_hits'], ! 'L_SESSIONS' => $lang['SiteStats_Counter_sess'], ! 'L_BOTH' => $lang['Both'], ! 'L_ON' => $lang['On'], ! 'L_OFF' => $lang['Off'], ! 'L_SUBMIT' => $lang['Submit'], ! 'L_RESET' => $lang['Reset'] ) ! ); $template->pparse( 'body' ); - include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); - ?> \ No newline at end of file --- 153,220 ---- $referers_showdis_on = ( $new['referers_show_disabled'] ) ? 'checked="checked"' : ''; + // // Setup template vars and send the HTML... + // + $template->assign_vars( array( + 'S_ACTION' => append_sid( @basename( __FILE__ ) ), + 'L_SITESTATS_SETTINGS' => $lang['SiteStats_Settings'], + 'L_SITESTATS_SETTINGS_EXPLAIN' => $lang['SiteStats_Settings_explain'], ! 'DIGITS_PATH' => $digits_path, ! 'SAMPLE_DIGITS' => $sample_digits, ! 'SPACER' => $images['mx_spacer'], ! 'L_COUNTER_SETTINGS' => $lang['Counter_Settings'], ! 'L_COUNTER_TYPE' => $lang['SiteStats_Counter_Type'], ! 'L_COUNTER_TYPE_EXPLAIN' => $lang['SiteStats_Counter_Typeinfo'], ! 'SELECT_COUNTER_TYPE' => $select_counter_type, ! 'L_TEXT_CLASS' => $lang['SiteStats_Text_Class'], ! 'L_TEXT_CLASS_EXPLAIN' => $lang['SiteStats_Text_Classinfo'], ! 'SELECT_TEXT_CLASS' => $select_text_class, ! 'L_COUNTER_CLASS' => $lang['SiteStats_Counter_Class'], ! 'L_COUNTER_CLASS_EXPLAIN' => $lang['SiteStats_Counter_Classinfo'], ! 'SELECT_COUNTER_CLASS' => $select_counter_class, ! 'L_COUNTER_STYLE' => $lang['SiteStats_Counter_Style'], ! 'L_COUNTER_STYLE_EXPLAIN' => $lang['SiteStats_Counter_Styleinfo'], ! 'COUNTER_STYLE' => $new['counter_style'], ! 'L_COUNTER_SIZE' => $lang['SiteStats_Counter_Size'], ! 'L_COUNTER_SIZE_EXPLAIN' => $lang['SiteStats_Counter_Sizeinfo'], ! 'COUNTER_SIZE' => $new['counter_size'], ! 'L_COUNTER_TOSHOW' => $lang['SiteStats_Counter_ToShow'], ! 'L_COUNTER_TOSHOW_EXPLAIN' => $lang['SiteStats_Counter_ToShowinfo'], ! 'COUNTER_TOSHOW' => $new['counters_toshow'], ! 'COUNTER_TOSHOW_HITS' => $counters_toshow_hits, ! 'COUNTER_TOSHOW_SESS' => $counters_toshow_sess, ! 'COUNTER_TOSHOW_BOTH' => $counters_toshow_both, ! 'L_MORE_STATS_PAGE' => $lang['SiteStats_MoreStats_Page'], ! 'L_MORE_STATS_PAGE_EXPLAIN' => $lang['SiteStats_MoreStats_Pageinfo'], ! 'MORE_STATS_PAGE' => $new['more_stats_page'], ! 'L_REFERERS_SETTINGS' => $lang['Referers_Settings'], ! 'L_REFERERS_LOGGING' => $lang['Referers_Logging'], ! 'L_REFERERS_LOGGING_EXPLAIN' => $lang['Referers_Logginginfo'], ! 'REFERERS_LOGGING' => $new['referers_logging'], ! 'REFERERS_LOGGING_ON' => $referers_logging_on, ! 'REFERERS_LOGGING_OFF' => $referers_logging_off, ! 'L_REFERERS_COUNT' => $lang['SiteStats_TopReferers_Count'], ! 'L_REFERERS_COUNT_EXPLAIN' => $lang['SiteStats_TopReferers_Countinfo'], ! 'REFERERS_COUNT' => $new['referers_count'], ! 'L_REFERERS_SHOWDIS' => $lang['SiteStats_TopReferers_ShowDisabled'], ! 'L_REFERERS_SHOWDIS_EXPLAIN' => $lang['SiteStats_TopReferers_ShowDisabledinfo'], ! 'REFERERS_SHOWDIS' => $new['referers_show_disabled'], ! 'REFERERS_SHOWDIS_ON' => $referers_showdis_on, ! 'REFERERS_SHOWDIS_OFF' => $referers_showdis_off, ! 'L_HITS' => $lang['SiteStats_Counter_hits'], ! 'L_SESSIONS' => $lang['SiteStats_Counter_sess'], ! 'L_BOTH' => $lang['Both'], ! 'L_ON' => $lang['On'], ! 'L_OFF' => $lang['Off'], ! 'L_SUBMIT' => $lang['Submit'], ! 'L_RESET' => $lang['Reset'] ) ! ); $template->pparse( 'body' ); include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); ?> \ No newline at end of file Index: admin_counter.php =================================================================== RCS file: /cvsroot/mxbb/mx_sitestats/admin/admin_counter.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** admin_counter.php 2 May 2006 23:29:13 -0000 1.4 --- admin_counter.php 29 Jun 2006 19:08:03 -0000 1.5 *************** *** 13,18 **** // ====================================================== // This is how we add an entry to the phpBB Administration Control Panel... ! if ( !empty( $setmodules ) ) { --- 13,19 ---- // ====================================================== + // // This is how we add an entry to the phpBB Administration Control Panel... ! // if ( !empty( $setmodules ) ) { *************** *** 21,39 **** } // Setup basic portal stuff... ! define( 'IN_PORTAL', 1 ); $mx_root_path = '../../../'; $module_root_path = "../"; // Security and page header... ! $phpEx = substr(strrchr(__FILE__, '.'), 1); $no_page_header = true; require( $mx_root_path . 'admin/pagestart.' . $phpEx ); // Include common module stuff... ! require( $module_root_path . 'includes/common.' . $phpEx ); // ====================================================== // [ GLOBAL DATA ] --- 22,44 ---- } + // // Setup basic portal stuff... ! // define( 'IN_PORTAL', 1 ); $mx_root_path = '../../../'; $module_root_path = "../"; + // // Security and page header... ! // $phpEx = substr(strrchr(__FILE__, '.'), 1); $no_page_header = true; require( $mx_root_path . 'admin/pagestart.' . $phpEx ); + // // Include common module stuff... ! // require( $module_root_path . 'includes/common.' . $phpEx ); + // ====================================================== // [ GLOBAL DATA ] *************** *** 41,57 **** $my_script_name = basename( __FILE__ ); $my_script_title = $lang['SiteStats'] . ': ' . $lang['Counter_Management']; // ====================================================== // [ MAIN PROCESS ] // ====================================================== - // Send page header and set the main template... ! include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); ! $template->set_filenames( array( "body" => "admin/sitestats_counter_admin.tpl" ) ! ); // Check out which mode we operate in... ! if ( isset( $_POST['cancel'] ) ) { --- 46,62 ---- $my_script_name = basename( __FILE__ ); $my_script_title = $lang['SiteStats'] . ': ' . $lang['Counter_Management']; + // ====================================================== // [ MAIN PROCESS ] // ====================================================== // Send page header and set the main template... ! // include_once( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); ! $template->set_filenames( array( "body" => "admin/sitestats_counter_admin.tpl" ) ); + // // Check out which mode we operate in... ! // if ( isset( $_POST['cancel'] ) ) { *************** *** 67,72 **** } // Deal with each mode of operation... ! switch ( $mode ) { --- 72,78 ---- } + // // Deal with each mode of operation... ! // switch ( $mode ) { *************** *** 110,115 **** } // Display counter report... ! $sql = "SELECT * FROM " . SITESTATS_COUNTER_TABLE . " ORDER BY page"; if ( !$result = $db->sql_query( $sql ) ) --- 116,122 ---- } + // // Display counter report... ! // $sql = "SELECT * FROM " . SITESTATS_COUNTER_TABLE . " ORDER BY page"; if ( !$result = $db->sql_query( $sql ) ) *************** *** 123,156 **** $get_vars = '&id=' . $rs_counter[$i]['id'] . '&pg=' . $rs_counter[$i]['page'] . '&ch=' . $rs_counter[$i]['hits_counter'] . '&cs=' . $rs_counter[$i]['sess_counter']; ! $template->assign_block_vars( "counter_rows", array( 'COUNTER_ID' => $rs_counter[$i]['id'], ! 'COUNTER_PAGE' => $rs_counter[$i]['page'], ! 'COUNTER_HITS' => $rs_counter[$i]['hits_counter'], ! 'COUNTER_SESS' => $rs_counter[$i]['sess_counter'], ! 'U_EDIT' => append_sid( $my_script_name . '?mode=edit' . $get_vars ), ! 'U_DELETE' => append_sid( $my_script_name . '?mode=delete' . $get_vars ) ) ! ); } ! $template->assign_vars( array( 'L_PAGE_TITLE' => $my_script_title, ! 'L_PAGE_EXPLAIN' => $lang['Counter_Management_explain'], ! 'L_COUNTER_ID' => $lang['SiteStats_Counter_id'], ! 'L_COUNTER_PAGE' => $lang['SiteStats_Counter_page'], ! 'L_COUNTER_HITS' => $lang['SiteStats_Counter_hits'], ! 'L_COUNTER_SESS' => $lang['SiteStats_Counter_sess'], ! 'L_ADD' => $lang['Add'], ! 'U_ADD' => append_sid( $my_script_name . '?mode=add' ), ! 'L_EDIT' => $lang['Edit'], ! 'L_DELETE' => $lang['Delete'], ! 'L_ACTION' => $lang['Action'] ) ! ); // Send page body/footer and exit... ! $template->pparse( "body" ); include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); exit; // ====================================================== // [ FUNCTIONS ] --- 130,167 ---- $get_vars = '&id=' . $rs_counter[$i]['id'] . '&pg=' . $rs_counter[$i]['page'] . '&ch=' . $rs_counter[$i]['hits_counter'] . '&cs=' . $rs_counter[$i]['sess_counter']; ! $template->assign_block_vars( "counter_rows", array( ! 'COUNTER_ID' => $rs_counter[$i]['id'], ! 'COUNTER_PAGE' => $rs_counter[$i]['page'], ! 'COUNTER_HITS' => $rs_counter[$i]['hits_counter'], ! 'COUNTER_SESS' => $rs_counter[$i]['sess_counter'], ! 'U_EDIT' => append_sid( $my_script_name . '?mode=edit' . $get_vars ), ! 'U_DELETE' => append_sid( $my_script_name . '?mode=delete' . $get_vars ) ) ! ); } ! $template->assign_vars( array( ! 'L_PAGE_TITLE' => $my_script_title, ! 'L_PAGE_EXPLAIN' => $lang['Counter_Management_explain'], ! 'L_COUNTER_ID' => $lang['SiteStats_Counter_id'], ! 'L_COUNTER_PAGE' => $lang['SiteStats_Counter_page'], ! 'L_COUNTER_HITS' => $lang['SiteStats_Counter_hits'], ! 'L_COUNTER_SESS' => $lang['SiteStats_Counter_sess'], ! 'L_ADD' => $lang['Add'], ! 'U_ADD' => append_sid( $my_script_name . '?mode=add' ), ! 'L_EDIT' => $lang['Edit'], ! 'L_DELETE' => $lang['Delete'], ! 'L_ACTION' => $lang['Action'] ) ! ); + // // Send page body/footer and exit... ! // $template->pparse( "body" ); include_once( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); exit; + // ====================================================== // [ FUNCTIONS ] *************** *** 159,162 **** --- 170,179 ---- // Dialogs (without templates =:-P) ... + /** + * Enter description here... + * + * @param unknown_type $newmode + * @param unknown_type $errmsg + */ function dialog_addedit( $newmode, $errmsg = '' ) { *************** *** 180,183 **** --- 197,204 ---- } + /** + * Enter description here... + * + */ function dialog_confirm_delete() { *************** *** 194,197 **** --- 215,223 ---- } + /** + * Enter description here... + * + * @param unknown_type $mode + */ function dialog_updated( $mode ) { *************** *** 210,213 **** mx_message_die( GENERAL_MESSAGE, $message, $my_script_title ); } - ?> \ No newline at end of file --- 236,238 ---- |