# ############################################################ ### Templates define('C_TEMP','default'); // Template name define('C_FROMM','helena@50pluscontact.nl'); // "Email From" for forgot password define('C_LASTREG','25');// Last C_LASTREG registered users define('C_APAGE','25');// Count of users on default in admin page define('C_CPAGE','5');// Search page links number 12345... ### Profiles automatic allows define('C_CHECK_REGISTER','3'); /* '0' - Automatically allow all profiles to database '1' - Add profiles after confirm from user email '2' - Add profiles after admin checking '3' - Add profiles after confirm from user email and after admin checking */ define('C_REG_DAYS','7'); // Number of days for waiting user mail autorization (If C_CHECK_REGISTER '2' and '4') define('C_UPDATE_ALLOW','0'); // Allow profile after update? 0 - Don`t allow - send for admin check, 1 - allow define('C_REMOVE_ALLOW','3'); /* '0' - Disable remove profile for user '1' - Remove profile after admin check (Show profile while admin don`t checked) '2' - Remove profile after admin check (Don`t show profile while admin don`t checked) '3' - Automatically remove profile from database */ define('C_SHOW_LANG','2'); // Show other languages??? /* 0 - Don`t show - use only default language 1 - Don`t show - use user browser language 2 - Show languages only if language don`t selected by user - else don`t show // Recommended 3 - Always show languages */ define('C_MULTLANG_DEF','1'); // Default language for multilanguage (C_SHOW_LANG = 2 or 3) work /* 0 - Use language from default file 1 - detect user language from browser and use it (use default language if language no detect, or have`nt this language dir) */ ### Firstname biggest and smaller length, and requirements define('C_FIRSTNB','16'); // Max chars in firstname(no more 16) define('C_FIRSTNS','2'); // Min chars in firstname ### Lastname biggest and smaller length, and requirements define('C_LASTNB','30'); // Max chars in lastname(no more 30) define('C_LASTNS','2'); // Min chars in lastname ### Biggest and smaller ages define('C_AGES','50'); // Age from! define('C_AGEB','99'); // Age to! ### Password largest and smaller length define('C_PASSB','16'); // Max chars in password(no more 16) define('C_PASSS','2'); // Min chars in password ### Other require questions! define('C_FIRSTNR','1'); // Firstname require? Recommended set to '1' define('C_LASTNR','0'); // Lastname require? Recommended set to '1' define('C_BIRTHR','1'); // Birthday require? Recommended set to '1' define('C_GENDR','1'); // Gender require? Recommended set to '1' define('C_CNTRR','1'); // Country require? define('C_CITYR','0'); // City require? define('C_PURPR','1'); // Purpose require? Recommended set to '1' define('C_MARSR','0'); // Marital status require? define('C_HOBBR','0'); // Hobby require? define('C_WGHTR','0'); // Require weight? define('C_HGHTR','0'); // Require height? define('C_CHILDR','0'); // Children require? define('C_HAIRR','0'); // Hair color require? define('C_EYER','0'); // Eyes color require? define('C_ETNR','0'); // Etnicity require? define('C_RELR','0'); // Religion require? define('C_SMOKER','0'); // Smoke require? define('C_DRINKR','0'); // Drink require? define('C_EDUCR','0'); // Education require? define('C_JOBR','0'); // Job require? define('C_PHOTOR','0'); // Photo require? define('C_PHONER','0'); // Phone require? define('C_HDYFUR','0'); // "How did you find us?" require? define('C_SETNR','0'); // Seeking for etnicity require? define('C_SGENDR','0'); // Seeking for gender require? define('C_SRELR','0'); // Seeking for religion require? define('C_SAGER','0'); // age require seek from define('C_SWGHTR','0'); // Require seek weight? define('C_SHGHTR','0'); // Require seek height? define('C_AGR','1'); // Agreement is require? // Show in view profile? [view.php] define('C_HOROSH','1'); // Show horoscope? define('C_EMAILSH','0'); // Show email? - Not recommended - set to 0 define('C_URLSH','1'); // Show webpage? define('C_ICQSH','1'); // Show icq? define('C_AIMSH','1'); // Show AIM? define('C_PHONESH','1'); // Show phone number? define('C_REGDATE','1'); // Show register date? define('C_ACCDATE','1'); // Show update info date? define('C_MAILSH','1'); // Show "mail to user" link? ### City largest length define('C_CITYB','32'); // No more 32 ### Hobby largest word size and length, and require define('C_HOBBW','40'); define('C_HOBBB','255'); ### Description largest word size and length define('C_DESCW','40'); define('C_DESCB','2000'); ### Max image size (kb), image width and height define('C_MAXSZ','300'); define('C_MAXWD','800'); define('C_MAXHG','800'); define('C_IMG_ERR','1'); ### AntiHack checks - recommend set to '1' for secure reasons define('C_HACK1', '1'); // Check for numeric select define('C_HACK2', '1'); // Check for numeric select for normal value define('C_HACK3', '0'); // Check for image weight and height (set to 0 if give Warning: 'open_basedir restriction in effect') ### Members features define('C_FEEDBACK','0'); // Feedback only for members? define('C_FEEDBACK_MAIL','1'); // Can registered user specify another email for reply in send feedback? define('C_SEARCH','0'); //Search only for members? define('C_VIEW','0'); //View users only for members? define('C_MAIL','1'); //Mail to users only for members? define('C_ANOTHER_MAIL','1'); // Can registered user specify another email for reply in send mail? ### Login define('C_ID','2'); // Login by ID? /* 0 - Login by username [Only for Platinum version] 1 - Login by ID 2 - Login by email */ ### Don`t change anything below ### Other - DON`T change for secure reasons!!! define('C_MUST','1'); // Must be login! define('C_SESS','0'); // Don`t working if cookies disabled! define('C_UNICM','1'); // Use unique email for each user? Very recommended set it to 1 - Don`t change ?> # ############################################################ @mysql_connect(C_HOST, C_USER, C_PASS) or die($w[113]); @mysql_select_db(C_BASE) or die($w[114]); function printm($tmp,$v=NULL) { global $stime,$w; if (($v==1)||($v==NULL)) $e=C_EBOT; else $e=C_SBOT; echo C_ETOP.$tmp.$e; include_once C_PATH.'/templates/'.C_TEMP.'/footer.php'; die; } function mes($tmp) { echo C_ETOP.$tmp.C_SBOT; } function smes($tmp) { echo $tmp; } function sprintm($tmp) { global $w; echo '


'.$tmp.'


'; include_once C_PATH.'/templates/'.C_TEMP.'/sfooter.php'; die; } function code_gen() { $passgen = preg_replace("/(.)/e","chr(rand(ord('a'),ord('z')))",str_repeat('.',10)); $passgen=md5($passgen); return $passgen; } function not_empty($var1,$var2,$var3) { if(!empty($var1)) echo $var1; elseif(!empty($var2)) echo $var2; elseif(!empty($var3)) echo $var3; else echo 'Unknown Error'; } function pages($from,$step,$count,$param,$colspan) { $str='';global $w; if ($step < $count) { $str=''.$w[115]; $mesdisp = $step;$max = $count; $from = ($from > $count) ? $count : $from; $from = ( floor( $from / $mesdisp ) ) * $mesdisp; if ((C_CPAGE % 2) == 1) $pc = (int)((C_CPAGE - 1) / 2); else $pc = (int)(C_CPAGE / 2); if ($from > $mesdisp * $pc) $str.= "1 "; if ($from > $mesdisp * ($pc + 1)) $str.= " . . . "; for ($nCont=$pc; $nCont >= 1; $nCont--) if ($from >= $mesdisp * $nCont) { $tmpStart = $from - $mesdisp * $nCont; $tmpPage = $tmpStart / $mesdisp + 1; $str.= "".$tmpPage." "; } $tmpPage = $from / $mesdisp + 1;$str.= " [".$tmpPage."] "; $tmpMaxPages = (int)(($max - 1) / $mesdisp) * $mesdisp; for ($nCont=1; $nCont <= $pc; $nCont++) if ($from + $mesdisp * $nCont <= $tmpMaxPages) { $tmpStart = $from + $mesdisp * $nCont; $tmpPage = $tmpStart / $mesdisp + 1; $str.= "".$tmpPage." ";} if (($from + $mesdisp * ($pc + 1)) < $tmpMaxPages) $str.= " . . . "; if (($from + $mesdisp * $pc) < $tmpMaxPages) { $tmpPage = $tmpMaxPages / $mesdisp + 1; $str.= "".$tmpPage." "; } $str.=""; } return $str; } function horo($m, $d) { // Return number of horoscope switch($m) { case "1": $d > 19 ? $h = 2 : $h = 1; break; case "2": $d > 18 ? $h = 3 : $h = 2; break; case "3": $d > 20 ? $h = 4 : $h = 3; break; case "4": $d > 19 ? $h = 5 : $h = 4; break; case "5": $d > 20 ? $h = 6 : $h = 5; break; case "6": $d > 20 ? $h = 7 : $h = 6; break; case "7": $d > 22 ? $h = 8 : $h = 7; break; case "8": $d > 22 ? $h = 9 : $h = 8; break; case "9": $d > 22 ? $h = 10 : $h = 9; break; case "10": $d > 22 ? $h = 11 : $h = 10; break; case "11": $d > 21 ? $h = 12 : $h = 11; break; case "12": $d > 21 ? $h = 1 : $h = 12; break; default: $h = 0; break; } return $h; } function cb($ss) {$ss = htmlspecialchars(stripslashes($ss)); $ss = str_replace("\r\n","
","$ss"); $ss = str_replace("\\","","$ss"); $ss = str_replace("'","’","$ss"); $ss = str_replace('"',""","$ss"); $ss = trim($ss); return $ss; } function cbmail($ss) {$ss = htmlspecialchars(stripslashes($ss)); $ss = str_replace("\\","","$ss"); $ss = str_replace("'","’","$ss"); $ss = str_replace('"',""","$ss"); $ss = trim($ss); return $ss; } function tb($ss) { $ss = str_replace("
","\r\n","$ss"); $ss = str_replace("’","'","$ss"); $ss = str_replace('"','"',"$ss"); $ss = str_replace("<","<","$ss"); $ss = str_replace(">",">","$ss"); return $ss; } function search_results($from,$step,$count) { global $w;$str=$w[116].' '; $m=(($from+$step)>$count) ? $count : ($from+$step); $str.=$from.' - '.$m.' ['.$w[117].' '.$count.']'; return $str; } function template($text,$vars) { $msg = preg_replace("/{(\w+)}/e", "\$vars['\\1']", $text); return $msg; } function security($var,$error) { unset($s);unset($m);global $stime,$w,$l; if( ($var)&& ((!isset($_SESSION['s']))||(!isset($_SESSION['m']))||(!isset($_SESSION['o']))||(!is_numeric($_SESSION['m'])))) { @session_destroy();unset($s);unset($m); include_once C_PATH.'/templates/'.C_TEMP.'/header.php'; printm($error);} } function ssecurity($var,$error) { global $stime,$w,$l; if(($var)&&((!isset($_SESSION['s']))||(!isset($_SESSION['m']))||(!isset($_SESSION['o']))||(!is_numeric($_SESSION['m'])))) { @session_destroy();unset($s);unset($m); include_once C_PATH.'/templates/'.C_TEMP.'/sheader.php'; sprintm($error);} } function admin_security($error) { global $stime,$w,$l,$x; if((!isset($_SESSION['adminlogin']))||(!isset($_SESSION['adminpass']))||($_SESSION['adminlogin'] != md5(C_ADMINL))||($_SESSION['adminpass'] != md5(C_ADMINP))) { session_destroy();unset($adminlogin);unset($adminpass);unset($adminip); include_once C_PATH.'/templates/'.C_TEMP.'/header.php'; printm($error);} } function login($num) { global $w; switch ($num) { case '2':return $w[60];break; default:return $w[172];break; // By default login by ID } } function crm($m,$s) { $mc='';for ($i=0; $i < strlen($m); $i++) { $mc .= "&#".ord(substr($m,$i)).";";} $mc = "".$mc.""; return $mc;} function c_email($email) { if (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email)) { return 1;} else { return 0;} } function pregtrim($str) { return preg_replace("/[^\x20-\xFF]/","",@strval($str)); } function checkurl($urll) { $urll=trim(pregtrim($urll)); if (strlen($urll)==0) return 1; if (!preg_match("~^(?:(?:https?|ftp|telnet)://(?:[a-z0-9_-]{1,32}"."(?::[a-z0-9_-]{1,32})?@)?)?(?:(?:[a-z0-9-]{1,128}\.)+(?:com|net|"."org|mil|edu|arpa|gov|biz|info|aero|inc|name|[a-z]{2})|(?!0)(?:(?"."!0[^.]|255)[0-9]{1,3}\.){3}(?!0|255)[0-9]{1,3})(?:/[a-z0-9.,_@%&"."?+=\~/-]*)?(?:#[^ '\"&<>]*)?$~i",$urll,$ok)) return -1; if (!strstr($urll,"://")) $urll="http://".$urll; $urll=preg_replace("~^[a-z]+~ie","strtolower('\\0')",$urll); return $urll; } function mysql2data($sqldata,$b=NULL) { global $wmm; $sqldata=str_replace(' ','-',$sqldata); $val = explode('-', $sqldata); if($b==NULL) { $data= substr($wmm[intval($val[1])],0,3).' '.$val[2].' '.$val[0]; } else { $bd=$val[0].$val[1].$val[2];$dat=date("Ymd",time()); $data=intval(($dat - $bd) / 10000); } return $data; } function ip() { global $REMOTE_ADDR; global $HTTP_X_FORWARDED_FOR, $HTTP_X_FORWARDED, $HTTP_FORWARDED_FOR, $HTTP_FORWARDED; global $HTTP_VIA, $HTTP_X_COMING_FROM, $HTTP_COMING_FROM; global $HTTP_SERVER_VARS, $HTTP_ENV_VARS; if (empty($REMOTE_ADDR)) { if (!empty($_SERVER) && isset($_SERVER['REMOTE_ADDR'])) { $REMOTE_ADDR = $_SERVER['REMOTE_ADDR']; } else if (!empty($_ENV) && isset($_ENV['REMOTE_ADDR'])) { $REMOTE_ADDR = $_ENV['REMOTE_ADDR']; } else if (!empty($HTTP_SERVER_VARS) && isset($HTTP_SERVER_VARS['REMOTE_ADDR'])) { $REMOTE_ADDR = $HTTP_SERVER_VARS['REMOTE_ADDR']; } else if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['REMOTE_ADDR'])) { $REMOTE_ADDR = $HTTP_ENV_VARS['REMOTE_ADDR']; } else if (@getenv('REMOTE_ADDR')) { $REMOTE_ADDR = getenv('REMOTE_ADDR'); } } if (empty($HTTP_X_FORWARDED_FOR)) { if (!empty($_SERVER) && isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $HTTP_X_FORWARDED_FOR = $_SERVER['HTTP_X_FORWARDED_FOR']; } else if (!empty($_ENV) && isset($_ENV['HTTP_X_FORWARDED_FOR'])) { $HTTP_X_FORWARDED_FOR = $_ENV['HTTP_X_FORWARDED_FOR']; } else if (!empty($HTTP_SERVER_VARS) && isset($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'])) { $HTTP_X_FORWARDED_FOR = $HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR']; } else if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['HTTP_X_FORWARDED_FOR'])) { $HTTP_X_FORWARDED_FOR = $HTTP_ENV_VARS['HTTP_X_FORWARDED_FOR']; } else if (@getenv('HTTP_X_FORWARDED_FOR')) { $HTTP_X_FORWARDED_FOR = getenv('HTTP_X_FORWARDED_FOR'); } } // end if if (empty($HTTP_X_FORWARDED)) { if (!empty($_SERVER) && isset($_SERVER['HTTP_X_FORWARDED'])) { $HTTP_X_FORWARDED = $_SERVER['HTTP_X_FORWARDED']; } else if (!empty($_ENV) && isset($_ENV['HTTP_X_FORWARDED'])) { $HTTP_X_FORWARDED = $_ENV['HTTP_X_FORWARDED']; } else if (!empty($HTTP_SERVER_VARS) && isset($HTTP_SERVER_VARS['HTTP_X_FORWARDED'])) { $HTTP_X_FORWARDED = $HTTP_SERVER_VARS['HTTP_X_FORWARDED']; } else if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['HTTP_X_FORWARDED'])) { $HTTP_X_FORWARDED = $HTTP_ENV_VARS['HTTP_X_FORWARDED']; } else if (@getenv('HTTP_X_FORWARDED')) { $HTTP_X_FORWARDED = getenv('HTTP_X_FORWARDED'); } } if (empty($HTTP_FORWARDED_FOR)) { if (!empty($_SERVER) && isset($_SERVER['HTTP_FORWARDED_FOR'])) { $HTTP_FORWARDED_FOR = $_SERVER['HTTP_FORWARDED_FOR']; } else if (!empty($_ENV) && isset($_ENV['HTTP_FORWARDED_FOR'])) { $HTTP_FORWARDED_FOR = $_ENV['HTTP_FORWARDED_FOR']; } else if (!empty($HTTP_SERVER_VARS) && isset($HTTP_SERVER_VARS['HTTP_FORWARDED_FOR'])) { $HTTP_FORWARDED_FOR = $HTTP_SERVER_VARS['HTTP_FORWARDED_FOR']; } else if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['HTTP_FORWARDED_FOR'])) { $HTTP_FORWARDED_FOR = $HTTP_ENV_VARS['HTTP_FORWARDED_FOR']; } else if (@getenv('HTTP_FORWARDED_FOR')) { $HTTP_FORWARDED_FOR = getenv('HTTP_FORWARDED_FOR'); } } if (empty($HTTP_FORWARDED)) { if (!empty($_SERVER) && isset($_SERVER['HTTP_FORWARDED'])) { $HTTP_FORWARDED = $_SERVER['HTTP_FORWARDED']; } else if (!empty($_ENV) && isset($_ENV['HTTP_FORWARDED'])) { $HTTP_FORWARDED = $_ENV['HTTP_FORWARDED']; } else if (!empty($HTTP_SERVER_VARS) && isset($HTTP_SERVER_VARS['HTTP_FORWARDED'])) { $HTTP_FORWARDED = $HTTP_SERVER_VARS['HTTP_FORWARDED']; } else if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['HTTP_FORWARDED'])) { $HTTP_FORWARDED = $HTTP_ENV_VARS['HTTP_FORWARDED']; } else if (@getenv('HTTP_FORWARDED')) { $HTTP_FORWARDED = getenv('HTTP_FORWARDED'); } } if (empty($HTTP_VIA)) { if (!empty($_SERVER) && isset($_SERVER['HTTP_VIA'])) { $HTTP_VIA = $_SERVER['HTTP_VIA']; } else if (!empty($_ENV) && isset($_ENV['HTTP_VIA'])) { $HTTP_VIA = $_ENV['HTTP_VIA']; } else if (!empty($HTTP_SERVER_VARS) && isset($HTTP_SERVER_VARS['HTTP_VIA'])) { $HTTP_VIA = $HTTP_SERVER_VARS['HTTP_VIA']; } else if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['HTTP_VIA'])) { $HTTP_VIA = $HTTP_ENV_VARS['HTTP_VIA']; } else if (@getenv('HTTP_VIA')) { $HTTP_VIA = getenv('HTTP_VIA'); } } if (empty($HTTP_X_COMING_FROM)) { if (!empty($_SERVER) && isset($_SERVER['HTTP_X_COMING_FROM'])) { $HTTP_X_COMING_FROM = $_SERVER['HTTP_X_COMING_FROM']; } else if (!empty($_ENV) && isset($_ENV['HTTP_X_COMING_FROM'])) { $HTTP_X_COMING_FROM = $_ENV['HTTP_X_COMING_FROM']; } else if (!empty($HTTP_SERVER_VARS) && isset($HTTP_SERVER_VARS['HTTP_X_COMING_FROM'])) { $HTTP_X_COMING_FROM = $HTTP_SERVER_VARS['HTTP_X_COMING_FROM']; } else if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['HTTP_X_COMING_FROM'])) { $HTTP_X_COMING_FROM = $HTTP_ENV_VARS['HTTP_X_COMING_FROM']; } else if (@getenv('HTTP_X_COMING_FROM')) { $HTTP_X_COMING_FROM = getenv('HTTP_X_COMING_FROM'); } } if (empty($HTTP_COMING_FROM)) { if (!empty($_SERVER) && isset($_SERVER['HTTP_COMING_FROM'])) { $HTTP_COMING_FROM = $_SERVER['HTTP_COMING_FROM']; } else if (!empty($_ENV) && isset($_ENV['HTTP_COMING_FROM'])) { $HTTP_COMING_FROM = $_ENV['HTTP_COMING_FROM']; } else if (!empty($HTTP_COMING_FROM) && isset($HTTP_SERVER_VARS['HTTP_COMING_FROM'])) { $HTTP_COMING_FROM = $HTTP_SERVER_VARS['HTTP_COMING_FROM']; } else if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['HTTP_COMING_FROM'])) { $HTTP_COMING_FROM = $HTTP_ENV_VARS['HTTP_COMING_FROM']; } else if (@getenv('HTTP_COMING_FROM')) { $HTTP_COMING_FROM = getenv('HTTP_COMING_FROM'); } } if (!empty($REMOTE_ADDR)) { $direct_ip = $REMOTE_ADDR; } $proxy_ip = ''; if (!empty($HTTP_X_FORWARDED_FOR)) { $proxy_ip = $HTTP_X_FORWARDED_FOR; } else if (!empty($HTTP_X_FORWARDED)) { $proxy_ip = $HTTP_X_FORWARDED; } else if (!empty($HTTP_FORWARDED_FOR)) { $proxy_ip = $HTTP_FORWARDED_FOR; } else if (!empty($HTTP_FORWARDED)) { $proxy_ip = $HTTP_FORWARDED; } else if (!empty($HTTP_VIA)) { $proxy_ip = $HTTP_VIA; } else if (!empty($HTTP_X_COMING_FROM)) { $proxy_ip = $HTTP_X_COMING_FROM; } else if (!empty($HTTP_COMING_FROM)) { $proxy_ip = $HTTP_COMING_FROM; } if (empty($proxy_ip)) { return $direct_ip; } else { $is_ip = ereg('^([0-9]{1,3}\.){3,3}[0-9]{1,3}', $proxy_ip, $regs); if ($is_ip && (count($regs) > 0)) { return $regs[0]; } else { return '0.0.0.0'; } } } function agent() { $agent = (getenv('HTTP_USER_AGENT')) ? getenv('HTTP_USER_AGENT') : 'Unknown'; return $agent; } function sendmail($from,$to,$sub,$mes,$type) { switch ($type) { case 'html':$h='text/html';break; case "text":$h="text/plain";break; default:$h="text/plain";break;} $head="MIME-Version: 1.0\r\nContent-Type: ".$h."; charset=".C_CHARSET."\r\nFrom: ".$from."\r\nReply-To: ".$from."\r\nX-Mailer: ".C_SNAME; @mail($to,$sub,$mes,$head); } function int2ip($i) { $d[0]=(int)($i/256/256/256); $d[1]=(int)(($i-$d[0]*256*256*256)/256/256); $d[2]=(int)(($i-$d[0]*256*256*256-$d[1]*256*256)/256); $d[3]=$i-$d[0]*256*256*256-$d[1]*256*256-$d[2]*256; return "$d[0].$d[1].$d[2].$d[3]"; } function ip2int($ip) { $a = explode(".", $ip); return $a[0] * 256 * 256 * 256+$a[1] * 256 * 256+$a[2] * 256+$a[3]; } function all_online_users() { $sec = 300; if(isset($_SESSION['m'])) { $user = is_numeric($_SESSION['m']) ? $_SESSION['m'] : 0; $MyAccess = 0; } else { $user = 0; $MyAccess = -1; } $ip = ($user == 0) ? ip2int(ip()) : 0; @mysql_query("DELETE FROM ".C_MYSQL_ONLINE_USERS." WHERE (time < DATE_SUB(NOW(), INTERVAL ".$sec." SECOND) AND NOW() > ".$sec.") or time > NOW()"); $result = @mysql_query("SELECT * FROM ".C_MYSQL_ONLINE_USERS); $cnt=array();$adduser=1;$addguest=1;$users=0; while($i = mysql_fetch_array($result)) { $cnt[$i['usertype']] = (isset($cnt[$i['usertype']])) ? $cnt[$i['usertype']] + 1 : 1; If(($MyAccess >= 0) && ($user == $i['user'])) { $adduser=$addguest=0; } If(($MyAccess < 0) && ($ip == $i['ip'])) { $adduser=$addguest=0; } } if($adduser || $addguest) { @mysql_query("INSERT INTO ".C_MYSQL_ONLINE_USERS." VALUES (NOW(),'".$user."','".$MyAccess."','".$ip."')"); $cnt[$MyAccess] = (isset($cnt[$MyAccess])) ? $cnt[$MyAccess] + 1 : 1; } $k=0;while(isset($cnt[$k])) { $users = $cnt[$k] + $users; $k++; } if(isset($cnt['-1'])) define('ONLINE_GUESTS',$cnt['-1']); else define('ONLINE_GUESTS','0'); define('ONLINE_USERS',$users); } all_online_users(); function online_users() { return ONLINE_USERS; } function online_quests() { return ONLINE_GUESTS; } if (isset($_POST)) {while(list($name,$value) = each($_POST)) {$$name = $value;};}; if (isset($_GET)) {while(list($name,$value) = each($_GET)) {$$name = $value;};}; // Don`t working from 2.0.5 function filename() {return $_ENV['PHP_SELF'];} function s() {return $SID = C_SESS ? SID : '';} ?>