|
From: Florin C B. <ory...@us...> - 2014-05-04 23:06:17
|
Update of /cvsroot/mxbb/mx_pjirc/includes In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18086/includes Modified Files: common.php functions.php Log Message: utf-8 update Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/mx_pjirc/includes/functions.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** functions.php 4 Jun 2008 00:09:11 -0000 1.1 --- functions.php 4 May 2014 23:06:15 -0000 1.2 *************** *** 2,6 **** /** * ! * @package MxPmodule_mx_pafileDB * @version $Id$ * @copyright (c) 2002-2006 [ory...@rd..., OryNider] MxP Project Team --- 2,6 ---- /** * ! * @package MxPmodule_mx_pjIRC * @version $Id$ * @copyright (c) 2002-2006 [ory...@rd..., OryNider] MxP Project Team *************** *** 9,15 **** */ ! if ( !defined( 'IN_PORTAL' ) ) { ! die( "Hacking attempt" ); } --- 9,15 ---- */ ! if (!defined('IN_PORTAL')) { ! die("Hacking attempt(0)"); } *************** *** 17,26 **** // [ COMMON FUNCTIONS ] // ================================================================================ ! ! function user_join($nick) { global $pjirc_config, $db; ! $current_time=date("U"); $sql = "DELETE FROM ".PJIRC_SESSION_TABLE." WHERE username = '".addslashes($nick)."'"; --- 17,25 ---- // [ COMMON FUNCTIONS ] // ================================================================================ ! function pjuser_join($nick) { global $pjirc_config, $db; ! $current_time = date("U"); $sql = "DELETE FROM ".PJIRC_SESSION_TABLE." WHERE username = '".addslashes($nick)."'"; *************** *** 32,36 **** $sql = "INSERT INTO ".PJIRC_SESSION_TABLE." (username, time)" . " VALUES ('" .addslashes($nick). "', ".$current_time.")"; ! if( !$result = $db->sql_query($sql) ) { die("SQL Error in function user_join(): INSERT<br />" . $sql); --- 31,35 ---- $sql = "INSERT INTO ".PJIRC_SESSION_TABLE." (username, time)" . " VALUES ('" .addslashes($nick). "', ".$current_time.")"; ! if(!$result = $db->sql_query($sql)) { die("SQL Error in function user_join(): INSERT<br />" . $sql); *************** *** 39,48 **** //Update user statue "chatting/not chatting" ! function update_user($nick,$time) { global $pjirc_config, $board_config, $db, $lang; ! ! $sql="update ".PJIRC_SESSION_TABLE." set time='$time' where username='$nick'"; ! if( !$result = $db->sql_query($sql) ) { --- 38,46 ---- //Update user statue "chatting/not chatting" ! function pjupdate_user($nick, $time) { global $pjirc_config, $board_config, $db, $lang; ! ! $sql="update ".PJIRC_SESSION_TABLE." set time='$time' where username='$nick'"; if( !$result = $db->sql_query($sql) ) { *************** *** 52,128 **** } ! function drop_users($period) { global $pjirc_config, $board_config, $db, $lang; ! $current_time=date("U"); //prevent delay ! $period=$period+2; // Calcul max_time ! $max_time=$current_time-$period; ! ! $sql="delete from ".PJIRC_SESSION_TABLE." where time<'$max_time'"; ! ! if( !$result = $db->sql_query($sql) ) ! { ! die("SQL Error in function drop_users()"); ! } } ! ! if ((include_once $mx_root_path . "modules/mx_online_adv/includes/functions.$phpEx") === false) { ! function online_spider_surfing($nick, $bot_id) { ! global $db; ! ! $current_time=date("U"); ! ! $sql = "DELETE FROM ".ONLINE_ADV_SESSION_TABLE." WHERE username = '".addslashes($nick)."'"; ! if( !$result = $db->sql_query($sql) ) ! { ! mx_message_die(GENERAL_ERROR, 'SQL Error in function online_spider_surfing()', '', __LINE__, __FILE__, $sql); ! } ! ! $sql = "INSERT INTO ".ONLINE_ADV_SESSION_TABLE." (username, time, bot_id)" . ! " VALUES ('" .addslashes($nick). "', '" .$current_time. "', '" .$bot_id. "')"; ! if( !$result = $db->sql_query($sql) ) ! { ! mx_message_die(GENERAL_ERROR, 'SQL Error in function online_spider_surfing()', '', __LINE__, __FILE__, $sql); ! } } ! ! function update_spiders_surfing($nick,$time,$bot_id) { ! global $board_config, $db, $lang; $sql="update ".ONLINE_ADV_SESSION_TABLE." SET time='$time', bot_id='$bot_id' WHERE username='$nick'"; ! ! if( !$result = $db->sql_query($sql) ) ! { ! mx_message_die(GENERAL_ERROR, 'SQL Error in function update_spiders_surfing()', '', __LINE__, __FILE__, $sql); ! } } ! function drop_spiders_surfing($period) ! { ! global $radio_config, $db, $lang; ! ! $current_time = date("U"); ! //Prevent delay ! $period = $period + 10; ! // Calcul max_time ! $max_time = $current_time - $period; ! $sql = "DELETE from " . ONLINE_ADV_SESSION_TABLE . " WHERE time < $max_time"; ! if(!$result = $db->sql_query($sql)) ! { ! //mx_message_die(CRITICAL_ERROR, 'SQL Error in function drop_spiders_surfing()', '', __LINE__, __FILE__, $sql); ! } } } ! ?> \ No newline at end of file --- 50,120 ---- } ! function pjdrop_users($period) { global $pjirc_config, $board_config, $db, $lang; ! $current_time = date("U"); //prevent delay ! $period = $period + 2; // Calcul max_time ! $max_time = $current_time - $period; ! ! $sql = "delete from ".PJIRC_SESSION_TABLE." where time < '$max_time'"; ! if(!$result = $db->sql_query($sql)) ! { ! die("SQL Error in function drop_users()"); ! } } ! //if ((include_once $mx_root_path . "modules/mx_online_adv/includes/functions.$phpEx") === true) ! //{ ! function pjonline_spider_surfing($nick, $bot_id) { ! global $db; ! $current_time = date("U"); ! ! $sql = "DELETE FROM ".ONLINE_ADV_SESSION_TABLE." WHERE username = '".addslashes($nick)."'"; ! if(!$result = $db->sql_query($sql)) { ! mx_message_die(GENERAL_ERROR, 'SQL Error in function online_spider_surfing()', '', __LINE__, __FILE__, $sql); } ! ! $sql = "INSERT INTO ".ONLINE_ADV_SESSION_TABLE." (username, time, bot_id)" . ! " VALUES ('" .addslashes($nick). "', '" .$current_time. "', '" .$bot_id. "')"; ! if(!$result = $db->sql_query($sql)) { ! //mx_message_die(GENERAL_ERROR, 'SQL Error in function online_spider_surfing()', '', __LINE__, __FILE__, $sql); ! } ! } + function pjupdate_spiders_surfing($nick,$time,$bot_id) + { + global $board_config, $db, $lang; + $sql="update ".ONLINE_ADV_SESSION_TABLE." SET time='$time', bot_id='$bot_id' WHERE username='$nick'"; ! if(!$result = $db->sql_query($sql)) ! { ! //mx_message_die(GENERAL_ERROR, 'SQL Error in function update_spiders_surfing()', '', __LINE__, __FILE__, $sql); } + } + function pjdrop_spiders_surfing($period) + { + global $radio_config, $db, $lang; ! $current_time = date("U"); ! //Prevent delay ! $period = $period + 10; ! // Calcul max_time ! $max_time = $current_time - $period; ! $sql = "DELETE from " . ONLINE_ADV_SESSION_TABLE . " WHERE time < $max_time"; ! if(!$result = $db->sql_query($sql)) ! { ! //mx_message_die(CRITICAL_ERROR, 'SQL Error in function drop_spiders_surfing()', '', __LINE__, __FILE__, $sql); } } ! //} ?> \ No newline at end of file Index: common.php =================================================================== RCS file: /cvsroot/mxbb/mx_pjirc/includes/common.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** common.php 24 Jan 2009 13:42:41 -0000 1.7 --- common.php 4 May 2014 23:06:15 -0000 1.8 *************** *** 24,28 **** if( !defined('IN_PORTAL') ) { ! die("Hacking attempt"); } --- 24,28 ---- if( !defined('IN_PORTAL') ) { ! die("Hacking attempt(0)"); } *************** *** 40,44 **** include_once($module_root_path . 'includes/functions.'.$phpEx); - $default_lang = ($mx_user->lang['default_lang']) ? $mx_user->decode_lang($mx_user->lang['default_lang']) : $board_config['default_lang']; --- 40,43 ---- *************** *** 61,75 **** // $cfg_chatname = $board_config['sitename'] . ' -> ' . 'Pjirc'; - - // ================================================================================ // [ PJIRC CONFIG ] // ================================================================================ - // // Get Pjirc Settings from config table // ! if( defined('_PJIRC_CONFIG') ) { $pjirc_config = array(); --- 60,71 ---- // $cfg_chatname = $board_config['sitename'] . ' -> ' . 'Pjirc'; // ================================================================================ // [ PJIRC CONFIG ] // ================================================================================ // // Get Pjirc Settings from config table // ! if(defined('_PJIRC_CONFIG')) { $pjirc_config = array(); *************** *** 102,136 **** //Get The User Agent // ! global $_SERVER, $HTTP_USER_AGENT, $HTTP_SERVER_VARS; ! ! if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) ) ! { ! $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT']; ! } ! else if ( !empty( $HTTP_SERVER_VARS['HTTP_USER_AGENT'] ) ) ! { ! $HTTP_USER_AGENT = $HTTP_SERVER_VARS['HTTP_USER_AGENT']; ! } ! else if ( !isset( $HTTP_USER_AGENT ) ) ! { ! $HTTP_USER_AGENT = ''; ! } ! if ( empty( $user_agent ) ) ! { ! $user_agent = $HTTP_USER_AGENT; ! } ! $user_agent = strtolower( $user_agent ); ! // Determine browser and version ! // The order in which we test the agents patterns is important ! // Intentionally ignore Konquerer. It should show up as Mozilla. ! // post-Netscape Mozilla versions using Gecko show up as Mozilla 5.0 ! // known browsers, list will be updated routinely, check back now and then ! // covers Netscape 6-7, K-Meleon, Most linux versions, uses moz array below ! // search engine spider bots: ! // various http utility libaries ! // download apps if ( preg_match( '/(googlebot |google\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; --- 98,131 ---- //Get The User Agent // + global $_SERVER, $HTTP_USER_AGENT, $HTTP_SERVER_VARS; ! if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) ) ! { ! $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT']; ! } ! else if ( !empty( $HTTP_SERVER_VARS['HTTP_USER_AGENT'] ) ) ! { ! $HTTP_USER_AGENT = $HTTP_SERVER_VARS['HTTP_USER_AGENT']; ! } ! else if ( !isset( $HTTP_USER_AGENT ) ) ! { ! $HTTP_USER_AGENT = ''; ! } ! if ( empty( $user_agent ) ) ! { ! $user_agent = $HTTP_USER_AGENT; ! } ! $user_agent = strtolower( $user_agent ); ! // Determine browser and version ! // The order in which we test the agents patterns is important ! // Intentionally ignore Konquerer. It should show up as Mozilla. ! // post-Netscape Mozilla versions using Gecko show up as Mozilla 5.0 ! // known browsers, list will be updated routinely, check back now and then ! // covers Netscape 6-7, K-Meleon, Most linux versions, uses moz array below ! // search engine spider bots: ! // various http utility libaries ! // download apps if ( preg_match( '/(googlebot |google\/)([0-9]*).([0-9]{1,2})/', $user_agent, $matches ) ) ; *************** *** 388,392 **** { //$current_time = date("U"); ! online_spider_surfing($agent, $bot_id); } else --- 383,387 ---- { //$current_time = date("U"); ! pjonline_spider_surfing($agent, $bot_id); } else |