|
From: OryNider <ory...@us...> - 2007-06-06 23:49:18
|
Update of /cvsroot/mxbb/mx_counter/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31579/includes Added Files: counter_common.php counter_constants.php index.htm Log Message: --- NEW FILE: counter_common.php --- <?php /** * * @package mxBB Portal Module - mx_counter * @version $Id: counter_common.php,v 1.1 2007/06/06 23:49:13 orynider Exp $ * @copyright (c) 2004-2006 OryNider * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ // // Security check // if( !defined('IN_PORTAL') ) { die("Hacking attempt"); } // // Load language files. // if( file_exists($module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx) ) { include($module_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx); } else { include($module_root_path . 'language/lang_english/lang_main.' . $phpEx); } // // Define table names. // require($module_root_path . 'includes/counter_constants.'.$phpEx); // ================================================================================ // [ COMMON CONFIG ] // ================================================================================ // // Get Counter Settings from config table // $counter_config = array(); $sql = "SELECT * FROM ".COUNTER_CONFIG_TABLE; $result = $db->sql_query($sql); if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Couldn't query counter config table", "", __LINE__, __FILE__, $sql); } else { while( $row = $db->sql_fetchrow($result) ) { $counter_config[$row['config_name']] = $row['config_value']; } } // ================================================================================ // [ COMMON FUNCTIONS ] // ================================================================================ //Update counter statue function update_count($newcount) { global $counter_config, $board_config, $db, $lang; $sql = "UPDATE ". COUNTER_SESSION_TABLE ." SET currentcount = '$newcount' WHERE count_id = 1"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "SQL Error in function update_count()", "", __LINE__, __FILE__, $sql); } } ?> --- NEW FILE: counter_constants.php --- <?php /** * * @package mxBB Portal Module - mx_counter * @version $Id: counter_constants.php,v 1.1 2007/06/06 23:49:14 orynider Exp $ * @copyright (c) 2006 [ory...@rd..., OryNider] mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ if ( !defined('IN_PORTAL') ) { die('Hacking attempt'); } // // Define table names. // !defined('COUNTER_CONFIG_TABLE') ? define('COUNTER_CONFIG_TABLE', $mx_table_prefix.'counter_config') : false; !defined('COUNTER_SESSION_TABLE') ? define('COUNTER_SESSION_TABLE', $mx_table_prefix.'counter_session') : false; ?> --- NEW FILE: index.htm --- <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> </body> </html> |