$reason\n"; return mysql_query($query, $hand); } } function ChatVerifyLogin($username, $password, $chatpath) { global $handler, $master_name_filter; $username = strtolower($username); $username = eregi_replace($master_name_filter, "", $username); if ($username == 'tino didriksen' && !preg_match('/^130\.22(5|6)/', $_SERVER['REMOTE_ADDR'])) { return -1; } $result = @count_mysql_query("SELECT username,password,flags,uid FROM uo_chat_database WHERE chat='$chatpath' AND username='$username'", $handler, "helpers.php: ChatVerifyLogin() 1/1"); $cuser = mysql_fetch_array($result); $GLOBALS['biglog']['user_name'] = $username; $GLOBALS['biglog']['user_id'] = intval($cuser['uid']+0); mysql_free_result($result); unset($result); unset($username); unset($chatpath); if (empty($cuser[0])) return 0; if (empty($_REQUEST['xml'])) { $password = md5($password); } $_REQUEST['error']['pwds'] = "{$cuser[1]} : ".$password; if ($password == $cuser[1]) { unset($password); if (!empty($cuser[2])) { return '1'.$cuser[2]; } else { unset($cuser); return 1; } } else { unset($password); unset($cuser); return -1; } unset($password); unset($cuser); return 0; } function ChatVerifyLoginFetch($username, $password, $chatpath) { global $handler, $master_name_filter; $username = strtolower($username); $username = eregi_replace($master_name_filter, "", $username); if ($username == 'tino didriksen' && !preg_match('/^130\.22(5|6)/', $_SERVER['REMOTE_ADDR'])) { return -1; } $result = @count_mysql_query("SELECT username,password,flags,faction,prefs,icon,chain,picon,pimage,plink,pcolor,uid FROM uo_chat_database WHERE chat='$chatpath' AND username='$username'", $handler, "helpers.php: ChatVerifyFetchLogin() 1/1"); $cuser = mysql_fetch_array($result); $GLOBALS['biglog']['user_name'] = $username; $GLOBALS['biglog']['user_id'] = intval($cuser['uid']+0); mysql_free_result($result); unset($result); unset($chatpath); $_REQUEST['error']['pwds'] = "{$cuser['password']} : ".md5($password); if ($cuser['username'] == $username) { if ($cuser['password'] == md5($password)) { unset($password); unset($username); $_REQUEST['error']['sts'] = 1; $cuser['status'] = 1; $cuser['flags'] .= '1'; return $cuser; } else { unset($password); unset($cuser); $_REQUEST['error']['sts'] = -1; return array('status' => '-1'); } } unset($password); unset($cuser); $_REQUEST['error']['sts'] = 0; return array('status' => '0'); } function GetPrefs($username, $chatpath) { global $handler; $result = @count_mysql_query("SELECT prefs FROM uo_chat_database WHERE chat='$chatpath' AND username='$username'", $handler, $handler, "helpers.php: GetPrefs() 1/1"); $cuser = mysql_fetch_row($result); mysql_free_result($result); unset($username); unset($chatpath); unset($result); return $cuser[0]; } function GetChatPrefs($chatpath) { global $handler; $result = @count_mysql_query("SELECT prefs,chat_id FROM uo_chat_last WHERE chat='$chatpath'", $handler, "helpers.php: GetChatPrefs() 1/1"); $cuser = @mysql_fetch_array($result); $GLOBALS['biglog']['chat_path'] = substr($chatpath, 4); $GLOBALS['biglog']['chat_id'] = intval($cuser['chat_id']+0); @mysql_free_result($result); unset($chatpath); unset($result); return $cuser[0]; } function GetFlags($username, $chatpath) { global $handler; $result = @count_mysql_query("SELECT flags FROM uo_chat_database WHERE chat='$chatpath' AND username='$username'", $handler, "helpers.php: GetFlags() 1/1"); $cuser = mysql_fetch_row($result); mysql_free_result($result); unset($username); unset($chatpath); unset($result); return $cuser[0]; } function CheckFlags($aflag, $flags) { for ($cc=0;$cc"; include("../common/image.php"); $usels = array(); $query = ""; $result = @count_mysql_query("SELECT chat,ident,username,link,image,utime FROM uo_chat_ulist WHERE chat='$chatpath' ORDER BY utime DESC", $handler, "helpers.php: ShowList() 2/4"); while ($usel = @mysql_fetch_row($result)) { $usel[2] = str_replace('_', ' ', $usel[2]); $usels[] = $usel; $query .= "username='".(trim(eregi_replace($master_name_filter, "", strtolower($usel[2]))))."' OR "; } @mysql_free_result($result); if (count($usels) < 1) return 1; $cpref = GetChatPrefs($chatpath); $query = "(".ereg_replace("(.*) OR $","\\1", $query).")"; $rez = @count_mysql_query("SELECT username FROM uo_chat_database WHERE chat='$chatpath' AND $query AND profile!=''", $handler, "helpers.php: ShowList() 3/4"); $profs = ""; while ($usel = @mysql_fetch_row($rez)) { $profs .= "$usel[0]|"; } @mysql_free_result($rez); $rez = @count_mysql_query("SELECT prefs,email,aim,icq,ym,msn,site,username,skype FROM uo_chat_database WHERE chat='$chatpath' AND $query", $handler, "helpers.php: ShowList() 4/4"); $prefs = array(); while ($usel = @mysql_fetch_row($rez)) { $prefs[] = $usel; } @mysql_free_result($rez); for($ix=0;$ix\n"; $usel[3] = str_replace("´","'",$usel[3]); $usel[4] = trim(str_replace("´","'",$usel[4])); $usel[2] = str_replace("´","'",$usel[2]); if (($usel[4]) && ($usel[3])) if ($_REQUEST['noimg'] > 0) { echo "[Open Image]
$usel[2]
\n"; } else { echo "
$usel[2]

\n"; } else if ($usel[4]) { if ($_REQUEST['noimg'] > 0) { echo "[Open Image]
$usel[2]
\n"; } else { echo "
$usel[2]
\n"; } } else if ($usel[3]) echo "$usel[2]
\n"; else echo "$usel[2]
\n"; if (!CheckFlags("m", $cpref)) { unset($upref); for($ig=0;$igProfile"; if (CheckFlags("M", $upref[0]) && ($upref[1] != "")) { echo "Email"; } $upref[2] = str_replace(" ", "", $upref[2]); if (CheckFlags("a", $upref[0]) && ($upref[2] != "")) { echo ""; //echo "AIM"; echo "AIM"; echo ""; } if (CheckFlags("Q", $upref[0]) && ($upref[3] != "0") && ($upref[3] != "")) { echo ""; echo "ICQ"; echo ""; } if (CheckFlags("y", $upref[0]) && ($upref[4] != "")) { echo ""; echo "YM"; echo ""; } if (CheckFlags("s", $upref[0]) && ($upref[5] != "")) { echo ""; echo "MSN"; echo ""; } if (!empty($upref[8])) { echo ""; echo "Skype"; echo ""; } if ($upref[6] != "") { echo ""; echo "Homepage"; echo ""; } } echo "
$usel[1]
\n"; $dtstring = date("g:i:sa", $usel[5]+($tzone*3600)); echo "Posted: $dtstring\n"; unset($usel); } return 1; } function ParseSpecial($mline) { $mline = " ".$mline." "; $mline = ereg_replace(" /([^/[:space:]]+)/ ", " \\1 ", $mline); $mline = ereg_replace(" _([^_[:space:]]+)_ ", " \\1 ", $mline); $mline = ereg_replace(" -([^-[:space:]]+)- ", " \\1 ", $mline); $mline = eregi_replace("((f|ht)tps?://[^[:space:]\r]*[^[:space:]\r,.:!?)])", "\\1", $mline); $mline = eregi_replace("(irc://[^[:space:]\r]*[^[:space:]\r,.:!?)])", "\\1", $mline); $mline = eregi_replace("(aim:[^[:space:]\r]*[^[:space:]\r,.:!?)])", "\\1", $mline); $mline = eregi_replace("(callto:[^[:space:]\r]*[^[:space:]\r,.:!?)])", "\\1", $mline); return trim($mline); } function FilterWords($message) { global $banwords; $banwords['geocities.com/sdarkfalls'] = '[blocked by TD]'; while ($filter = each($banwords)) { $filter[0] = preg_quote($filter[0], '@'); $message = preg_replace("@{$filter[0]}@i", $filter[1], $message); } return $message; } function GetFactionDetails($chatpath, $faction) { global $handler; $result = @count_mysql_query("SELECT chat,id,name,icon FROM uo_chat_faction WHERE chat='$chatpath' AND id='$faction'", $handler, "helpers.php: GetFactionDetails() 1/1"); $cuser = mysql_fetch_row($result); mysql_free_result($result); return $cuser; } function ParseMotD($file = "register/motd.dat") { global $handler; /* [C=chat] [V=chat] [CV=chat] */ $fz = fopen($file, "rb"); $motd = fread($fz, filesize($file)); fclose($fz); if (strstr($motd, "]") && (stristr($motd, "[C=") || stristr($motd, "[A=") || stristr($motd, "[V=") || stristr($motd, "[CV="))) { $regs = array(); if (preg_match_all("/\\[[CVA]+=([-[:alnum:]_]+)\\]/i", $motd, $regs) > 0) { $regs = array_unique($regs[1]); sort($regs); $chatters = array(); $viewers = array(); for ($cc=0;$cc={$time} AND ("; for ($cc=0;$cc