=0;$cc--) { $fcac .= str_replace("´", "'", $lines[$cc])."\n"; } MMC_Set("$realpath.rache", $fcac, 60); if ($exit == 0) { echo ""; echo ""; } } require_once("../common/session.php"); require_once("../../chatv3/_inc/mmcache.php"); require_once("settings.php"); require_once("options.php"); require_once("../mysql.php"); require_once("../setup.php"); require_once("../common/language.php"); if (file_exists("language.php")) require_once("language.php"); $realpath = ereg_replace(".*/([^/]+)/sendmsg.php$", "chat\\1", $_SERVER['PHP_SELF']); if (($_SERVER['HTTP_HOST'] != 'v2.pjj.cc') && strpos($_SERVER['HTTP_HOST'], '.pjj.cc')) $realpath = preg_replace('/(.*?)\.pjj\.cc/is', 'chat\1', $_SERVER['HTTP_HOST']); echo "\n\n"; MMC_Lock("$realpath.lines"); if ($altdata != "") $chatpath = $altdata; else $chatpath = $realpath; $newpath = substr($chatpath, 4); if ($_SERVER['HTTP_HOST']) { $cpath = "http://".$_SERVER['HTTP_HOST'].ereg_replace("(.*)/sendmsg.php", "\\1", $_SERVER['PHP_SELF']); } else { $cpath = "http://".$_SERVER['SERVER_NAME'].ereg_replace("(.*)/sendmsg.php", "\\1", $_SERVER['PHP_SELF']); } $ident = substr(md5($_SERVER['REMOTE_ADDR'].$realpath), 0, $identlenght); $undoable = true; if (empty($dtcalc)) { $dtcalc = 'g:ia, F d (T)'; } $xcnt = count($banip); for ($cc=0;$cc<$xcnt;$cc++) { if ( ($ident == $banip[$cc]) || (strncmp($_SERVER['REMOTE_ADDR'], $banip[$cc], strlen($banip[$cc])) == 0) || (strncmp($_SERVER['HTTP_X_FORWARDED_FOR'], $banip[$cc], strlen($banip[$cc])) == 0) ) { echo "\n$cbodytag"; echo sprintf($banguage[4], $ident); echo ""; exit(); } else if (strpos($banip[$cc], '.') !== false || strpos($banip[$cc], '*') !== false) { $banip[$cc] = str_replace('\\*', '.*', preg_quote($banip[$cc])); if (preg_match('/^'.$banip[$cc].'$/is', gethostbyaddr($_SERVER['REMOTE_ADDR']))) { echo "\n$cbodytag"; echo sprintf($banguage[4], $ident); echo ""; exit(); } } } require_once("../common/proxy.php"); /* $bl = Proxy_IsProxy($_SERVER['REMOTE_ADDR']); if ($bl !== false) { @count_mysql_query("INSERT DELAYED INTO uo_chat_ips (ip,proxy) VALUES ('{$_SERVER['REMOTE_ADDR']}', 'yes')", $handler); } else { @count_mysql_query("INSERT DELAYED INTO uo_chat_ips (ip,proxy) VALUES ('{$_SERVER['REMOTE_ADDR']}', 'no')", $handler); } /*/ if ($proxyblock == 1) { $bl = Proxy_IsProxy($_SERVER['REMOTE_ADDR']); if ($bl !== false) { @count_mysql_query("INSERT DELAYED INTO uo_chat_ips (ip,proxy) VALUES ('{$_SERVER['REMOTE_ADDR']}', 'yes')", $handler); echo ""; echo "This chat blocks open proxies, and you are using one. You have been banned for 8 hours."; echo "
The list that caught you is: $bl"; echo ""; AddBan($ident, time()+28800, '[proxy]', $chatpath); setcookie("pJJChat_Banned", "$ident", time()+604800); die(); } @count_mysql_query("INSERT DELAYED INTO uo_chat_ips (ip,proxy) VALUES ('{$_SERVER['REMOTE_ADDR']}', 'no')", $handler); } //*/ $oldident = $ident; if ($_COOKIE['pJJChat_Banned'] != "") { $ident = $_COOKIE['pJJChat_Banned']; } $ooc_r = str_replace("\"", "´", $_REQUEST['ooc_r']); $ooc_r = str_replace("\'", "´", $ooc_r); $ooc_l = str_replace("\"", "´", $_REQUEST['ooc_l']); $ooc_l = str_replace("\'", "´", $ooc_l); if ($ooc_l == "") $ooc_l = "(("; if ($ooc_r == "") $ooc_r = "))"; $write_me = ""; require_once("../common/helpers.php"); require_once("../common/banhelp.php"); require_once("../common/ignore.php"); require_once("../common/faction_help.php"); $cpref = GetChatPrefs($chatpath); if (!$_REQUEST['color']) $_REQUEST['color'] = $servcol; $color = str_replace("#", "", $_REQUEST['color']); $color = stripslashes(trim(substr($color, 0, 6))); if ($color == 'random') $color = ''.str_pad(dechex(mt_rand(0,255)), 2, '0', STR_PAD_LEFT).str_pad(dechex(mt_rand(0,255)), 2, '0', STR_PAD_LEFT).str_pad(dechex(mt_rand(0,255)), 2, '0', STR_PAD_LEFT).''; if (!$_REQUEST['cspeed']) $_REQUEST['cspeed'] = $respeed; else if ($_REQUEST['cspeed'] < 7) $_REQUEST['cspeed'] = 7; else if ($_REQUEST['cspeed'] > 120) $_REQUEST['cspeed'] = 120; $cspeed = $_REQUEST['cspeed']; if ($max_nick < 10) $max_nick = 40; else if ($max_nick > 63) $max_nick = 63; $handle = stripslashes(trim(substr($_REQUEST['handle'], 0, $max_nick))); $handle = str_replace('_', ' ', $handle); if (CheckFlags("L", $cpref)) $_REQUEST['link'] = ""; else $_REQUEST['link'] = stripslashes(trim(substr($_REQUEST['link'], 0, 256))); $link = $_REQUEST['link']; if (CheckFlags("i", $cpref)) $_REQUEST['image'] = ""; else $_REQUEST['image'] = stripslashes(trim(substr($_REQUEST['image'], 0, 256))); $image = trim($_REQUEST['image']); if (!$handle) $handle = $noname; $link = str_replace("'", "", $link); $image = str_replace("'", "", $image); $link = str_replace("\\", "", $link); $image = str_replace("\\", "", $image); /* $handle = str_replace("_", " ", $handle); $handle = str_replace($regident, "", $handle); $handle = str_replace($oocident, "", $handle); $handle = str_replace($modident, "", $handle); $handle = str_replace($adminident, "", $handle); */ $fixhandle = strtolower(ereg_replace($master_name_filter, "", $handle)); $client = ChatVerifyLoginFetch($fixhandle, $_REQUEST['password'], $chatpath); $falselog = ""; if ($client['status'] <= -1) { $falselog = $handle; $handle = $noname; $client = array('status' => 0); $fixhandle = strtolower(ereg_replace($master_name_filter, "", $handle)); /* $fz = fopen('/www/pjj.false.log', 'ab'); fwrite($fz, var_export($_REQUEST, TRUE)."\n\n"); fclose($fz); //*/ } $_REQUEST['oldhandle'] = $handle; $_SESSION[$realpath]['flags'] = $client['flags']; if ((empty($client['username'])) && (CheckFlags("n", $cpref))) $image = ''; require_once('iconlist.php'); if (empty($picons)) $picons = array(); $facticon = ''; if (!empty($client['faction'])) { $facticon = GetFactionIcon($chatpath, $client['faction']); } $icon = $_REQUEST['icon']; if (CheckFlags("C", $cpref)) $icon = ""; else if ($icon) { $contents = implode('', $picons).$facticon; if (($client['password']) && (!CheckFlags("z", $client['flags']))) { $contents .= implode('', $icons); $contents .= $client['icon']; } if (stristr($contents, $icon) === false) { $icon = ''; } } if (($memonly >= 1) && ($client['status'] <= 0) && !CheckFlags("MmZXxzpADRPFfsoiIOCBbralVL1", $client['flags'])) { echo "$bodytag"; echo $language[0]; echo ""; exit(); } $message = $_REQUEST['message']; if (CheckFlags("aXZmM", $client['flags']) && (substr($message, 0, 5) == "/raw ")) { $write_me .= substr($message, 5); unset($message); } $message = substr($message, 0, 10240); if ($_REQUEST['channel'] == '*') { unset($_REQUEST['channel']); } if (!empty($_REQUEST['channel']) && !empty($message)) { $message = '/msg '.str_replace(' ', '_', $_REQUEST['channel']).' '.$message; } $xml = array(); $xml['private'] = false; $xml['rawpost'] = trim($message); if ($handle) { setcookie("pJJChat_NoColor",$_REQUEST['mode_nocol'],time()+2592000); if ($_REQUEST['styled'] == "D") setcookie("pJJChat_Styled","",0); else if ($_REQUEST['styled'] != "") setcookie("pJJChat_Styled",$_REQUEST['styled'],time()+2592000); else if ($_COOKIE['pJJChat_Styled'] != "") setcookie("pJJChat_Styled",$_COOKIE['pJJChat_Styled'],time()+2592000); if ($_REQUEST['firstmsg'] != 1) { $checkmsg = 1; $ident = $oldident; if ((CheckFlags("lZmM", $client['flags']) == 0) && (!CheckFlags("J", $cpref)) && (CheckBan($ident, $chatpath) == 0)) { $write_me .= sprintf($language[1], $handle); AddUser($handle, $ident, time(), $link, $image, $realpath); } $_REQUEST['firstmsg'] = 1; if ($_REQUEST['autolog'] == "on") $_REQUEST['iwantcookie'] = "on"; $newcookie = array(); $newcookie['iwantcookie'] = $_REQUEST['iwantcookie']; $newcookie['reload'] = $_REQUEST['reload']; $newcookie['handle'] = $handle; $newcookie['password'] = $_REQUEST['password']; $newcookie['color'] = $color; $newcookie['icon'] = $icon; $newcookie['link'] = $link; $newcookie['image'] = $image; $newcookie['autologin'] = $_REQUEST['autolog']; setcookie("pJJChat", serialize($newcookie), time()+2592000); /* $newcookie = "{$_REQUEST['iwantcookie']}*{$_REQUEST['reload']}"; if ($_REQUEST['iwantcookie'] == "on") { $newcookie .= "*$handle*{$_REQUEST['password']}*$color*$icon*$link*$image*{$_REQUEST['autolog']}"; } else { $newcookie .= "*******"; } setcookie("pJJChat", $newcookie, time()+2592000); //*/ } $motd = $_REQUEST['motd']; if (($handle != $noname) && ($_REQUEST['reload'] == "on")) { $link = $client['plink']; $image = $client['pimage']; $color = $client['pcolor']; $icon = $client['picon']; if (CheckFlags("A", $client['prefs'])) $_REQUEST['mode_advanced'] = "on"; if (CheckFlags("S", $client['prefs'])) $_REQUEST['mode_simple'] = "on"; if (CheckFlags("O", $client['prefs'])) $motd = ""; if (CheckFlags("b", $client['prefs'])) $_REQUEST['st_bold'] = "on"; if (CheckFlags("u", $client['prefs'])) $_REQUEST['st_ulined'] = "on"; if (CheckFlags("i", $client['prefs'])) $_REQUEST['st_italic'] = "on"; if (CheckFlags("t", $client['prefs'])) $_REQUEST['st_tt'] = "on"; if (CheckFlags("R", $client['prefs'])) $_REQUEST['st_rev'] = "on"; } $handle = preg_replace('@geocities\.com/sdarkfalls@i', '[blocked by TD]', $handle); $xml['username'] = $handle; $message = trim($message); if (!empty($message)) { $message = str_replace('<', '<', $message); $message = str_replace('>', '>', $message); $message = eregi_replace("\\[i\\]([^[]*[^/]*[^i]*[^]]*)\\[/i\\]", "\\1", $message); $message = eregi_replace("\\[u\\]([^[]*[^/]*[^u]*[^]]*)\\[/u\\]", "\\1", $message); $message = eregi_replace("\\[b\\]([^[]*[^/]*[^b]*[^]]*)\\[/b\\]", "\\1", $message); $message = eregi_replace("\\[s\\]([^[]*[^/]*[^s]*[^]]*)\\[/s\\]", "\\1", $message); $message = eregi_replace("\\[t\\]([^[]*[^/]*[^t]*[^]]*)\\[/t\\]", "\\1", $message); if (CheckFlags("c", $cpref) == 0) { $message = eregi_replace("\\[c([[:alnum:]]*)\\]([^[]*[^/]*[^c]*[^]]*)\\[/c\\]", "\\2", $message); } if (substr($message, 0, 1) != "/") { if ($_REQUEST['st_bold'] == "on") $message = "".$message; if ($_REQUEST['st_italic'] == "on") $message = "".$message; if ($_REQUEST['st_ulined'] == "on") $message = "".$message; if ($_REQUEST['st_tt'] == "on") $message = "".$message; } $message = str_replace("¥", "", $message); $exit = 0; $addok = 1; if (((stristr(substr($message, 0, 5), "/exit")) || (stristr(substr($message, 0, 5), "/quit"))) && (CheckBan($ident, $chatpath) == 0)) { $addok = 0; $ident = $oldident; if ((!CheckFlags("lZmM", $client['flags']) && !CheckFlags("J", $cpref)) || (stristr(substr($message, 0, 5), "/quit"))) { $finalword = substr($message, 6); $finalword = FilterWords($finalword); $xml['post'] = $finalword; $write_me .= sprintf($language[2], $handle, $finalword); } $exit = 1; } else if ((stristr(substr($message, 0, 3), "/me")) && !CheckBan($ident, $chatpath)) { $ident = $oldident; $outputme = ""; if ($icon != "") { if (($client['password']) && (!CheckFlags("z", $client['flags']))) $outputme = sprintf("", urlencode($handle), $icon); else $outputme = sprintf("", $icon); } $message = FilterWords($message); $xml['post'] = $message; $write_me .= sprintf("     $outputme %s %s
\n", $color, $handle, substr($message, 4)); } else if ((stristr(substr($message, 0, 5), "/undo")) && !CheckFlags("U", $cpref)) { $addok = 0; $ident = $oldident; $result = count_mysql_query("SELECT id FROM uo_chat_log WHERE chat='$realpath' AND ident='$ident' AND ip='{$_SERVER['REMOTE_ADDR']}' ORDER BY id ASC", $handler, "sendmsg.php: /undo 1/2"); $row = mysql_fetch_row($result); mysql_free_result($result); count_mysql_query("DELETE FROM uo_chat_log WHERE chat='$realpath' AND ident='$ident' AND ip='{$_SERVER['REMOTE_ADDR']}' AND id='$row[0]'", $handler, "sendmsg.php: /undo 2/2"); } else if (stristr(substr($message, 0, 7), "/strike")) { $reminf = str_replace("'", "´", substr($message, 8)); $result = count_mysql_query("SELECT line FROM uo_chat_log WHERE chat='$realpath' AND ident='$ident'", $handler, "sendmsg.php: /strike 1/2"); while($row = mysql_fetch_row($result)) { $eline = addslashes($row[0]); if ($master_zlib == 0) $row[0] = stripslashes($row[0]); else $row[0] = stripslashes(gzuncompress($row[0])); if (($reminf != "") && (stristr($row[0], $reminf))) { if ($master_zlib != 0) $row[0] = addslashes(gzcompress("$row[0]", 9)); else $row[0] = addslashes("$row[0]"); count_mysql_query("UPDATE uo_chat_log SET line='$row[0]' WHERE chat='$realpath' AND line='$eline'", $handler, "sendmsg.php: /strike 2/2"); } } mysql_free_result($result); unset($eline); unset($row); unset($reminf); unset($result); unset($rez); unset($message); } else if (stristr(substr($message, 0, 4), "/rem")) { $addok = 0; if (CheckFlags("rxXZmM", $client['flags'])) { $reminf = str_replace("'", "´", substr($message, 5)); $result = count_mysql_query("SELECT line FROM uo_chat_log WHERE chat='$realpath'", $handler, "sendmsg.php: /rem 1/2"); while($row = mysql_fetch_row($result)) { $eline = addslashes($row[0]); if ($master_zlib == 0) $row[0] = stripslashes($row[0]); else $row[0] = stripslashes(gzuncompress($row[0])); if (stristr($row[0], $reminf)) { count_mysql_query("DELETE FROM uo_chat_log WHERE chat='$realpath' AND line='$eline'", $handler, "sendmsg.php: /rem 2/2"); } } mysql_free_result($result); unset($eline); } } else if ((stristr(substr($message, 0, 4), "/ban")) && !CheckFlags("B", $cpref)) { if (CheckFlags("BxXZmM", $client['flags'])) { $banid = substr($message, 5, $identlenght); $bantime = substr($message, 5+$identlenght+1); if (($bantime+0) > 604800) $bantime = 604800; AddBan($banid, $bantime+time(), $fixhandle, $chatpath); $xml['post'] = $message; $write_me .= sprintf($language[3], $color, $handle, $banid, $bantime); } } else if ((stristr(substr($message, 0, 6), "/unban")) && !CheckFlags("B", $cpref)) { if (CheckFlags("BxXZmM", $client['flags'])) { $banid = substr($message, 7, $identlenght); DeleteBan($banid, $chatpath); $xml['post'] = $message; $write_me .= sprintf($language[6], $color, $handle, $banid); } } else if ((stristr(substr($message, 0, 7), "/ignore")) && !CheckFlags("I", $cpref)) { $banid = substr($message, 8, $identlenght); $bantime = substr($message, 8+$identlenght+1); if (($bantime+0) > 172800) $bantime = 172800; AddIgnore($banid, $bantime+time(), $ident, $chatpath); $xml['post'] = $message; $write_me .= sprintf($language[4], $color, $handle, $banid, $bantime); } else if ((stristr(substr($message, 0, 9), "/unignore")) && !CheckFlags("I", $cpref)) { $banid = substr($message, 10, $identlenght); DeleteIgnore($banid, $chatpath, $ident); $xml['post'] = $message; $write_me .= sprintf($language[5], $color, $handle, $banid); } else if (stristr(substr($message, 0, 8), "/packlog")) { $addok = 0; if (CheckFlags("M", $client['flags'])) { require_once('../common/zlib.php'); PackLog(substr($realpath, 4)); } } else if (stristr(substr($message, 0, 5), "/sban")) { $addok = 0; if (CheckFlags("mM", $client['flags'])) { $banid = substr($message, 6, $identlenght); $bantime = substr($message, 6+$identlenght+1); if (($bantime+0) > 604800) $bantime = 604800; AddBan($banid, $bantime+time(), $fixhandle, $chatpath); } } else if (((stristr(substr($message, 0, 5), "/nick")) || (stristr(substr($message, 0, 5), "/name"))) && !CheckBan($ident, $chatpath)) { $ident = $oldident; $message = str_replace("_", " ", $message); $message = str_replace(":", " ", $message); $message = str_replace("'", "'", $message); $message = str_replace("\"", "'", $message); $newhandle = substr($message, 6, 40); $xml['post'] = $message; $write_me .= sprintf($language[7], $handle, $newhandle); $handle = $newhandle; } else if ((stristr(substr($message, 0, 5), "/link")) && !CheckBan($ident, $chatpath)) { $addok = 0; $ident = $oldident; $link = substr($message, 6); $link = str_replace("'", "'", $link); } else if ((stristr(substr($message, 0, 5), "/dice")) && !CheckBan($ident, $chatpath)) { $undoable = false; $ident = $oldident; $dice = substr($message, 6); $val = explode("d", $dice); $val[0] = $val[0]+0; $val[1] = $val[1]+0; if ($val[0] > 100) $val[0] = 100; if ($val[1] > 10000) $val[1] = 10000; $results = array(); $rest = 0; for ($dc=0;$dc<$val[0];$dc++) { $resta = mt_rand(1, $val[1]); $rest += $resta; $results[] = $resta; } $results = implode(", ", $results); $results .= " = $rest"; $xml['post'] = $message; $write_me .= sprintf($banguage[6], $color, $handle, $results, implode("d", $val)); } else if (stristr(substr($message, 0, 6), "/image")) { $addok = 0; $ident = $oldident; $image = substr($message, 7); } else if ((stristr(substr($message, 0, 6), "/muban")) && !CheckFlags("B", $cpref)) { $addok = 0; if (CheckFlags("bXZmM", $client['flags'])) { @count_mysql_query("DELETE FROM uo_chat_ban WHERE chat='$chatpath'", $handler, "sendmsg.php: /muban 1/1"); } } else if ((stristr(substr($message, 0, 4), "/msg")) && !CheckBan($ident, $chatpath) && !CheckFlags("P", $cpref)) { $ident = $oldident; $recipient = eregi_replace("^/msg[[:space:]]*([^[:space:]]+)[[:space:]]*.*$", "\\1", $message); $message = eregi_replace("^/msg[[:space:]]*[^[:space:]]+[[:space:]]*(.*)$", "\\1", $message); $message = FilterWords($message); $xml['private'] = true; $xml['rawpost'] = '[Private Message from "'.$handle.'" to "'.$recipient.'"]'; $recipient = strtolower($recipient); $recipient = trim(str_replace("_", " ", $recipient)); $recipient = ereg_replace($master_name_filter, "", $recipient); $auth = mysql_escape_string($handle); $result = @count_mysql_query("SELECT username FROM uo_chat_database WHERE username='$recipient' AND chat='$chatpath'", $handler, "sendmsg.php: /msg 1/4"); $row = @mysql_fetch_row($result); @mysql_free_result($result); if ($row[0] != "") { $time = time(); $message = mysql_escape_string(stripslashes($message)); @count_mysql_query("INSERT INTO uo_chat_message (chat,username,msg,auth,utime,unread) VALUES ('$chatpath','$recipient','$message', '$auth', '$time', 'yes')", $handler, "sendmsg.php: 2/4"); $output = sprintf($banguage[2], $handle, ucwords($recipient)); } else { $result = @count_mysql_query("SELECT username FROM uo_chat_database WHERE username LIKE '%$recipient%' AND chat='$chatpath'", $handler, "sendmsg.php: 3/4"); $row = @mysql_fetch_row($result); @mysql_free_result($result); if ($row[0] != "") { $recipient = $row[0]; $time = time(); $message = mysql_escape_string(stripslashes($message)); @count_mysql_query("INSERT INTO uo_chat_message (chat,username,msg,auth,utime,unread) VALUES ('$chatpath','$recipient','$message', '$auth', '$time', 'yes')", $handler, "sendmsg.php: 4/4"); $output = sprintf($banguage[2], $handle, ucwords($recipient)); } else $output = sprintf($banguage[3], $handle, ucwords($recipient)." (not registered)"); } $xml['post'] = $output; $write_me .= $output; } else if ((stristr(substr($message, 0, 6), "/whois")) && !CheckBan($ident, $chatpath) && !CheckFlags("W", $cpref)) { $ident = $oldident; $recipient = trim(substr($message, 7)); unset($message); $recipient = str_replace("_", " ", strtolower($recipient)); $recipient = ereg_replace($master_name_filter, "", $recipient); $result = @count_mysql_query("SELECT lastlogin FROM uo_chat_database WHERE chat='$chatpath' AND username LIKE '%$recipient%'", $handler, "sendmsg.php: /whois 1/1"); $lastlogin = @mysql_fetch_row($result); @mysql_free_result($result); if ($lastlogin[0] > 0) $output = sprintf($language[9], ucwords($recipient), date($dtcalc, $lastlogin[0]+($tzone*3600))); else $output = sprintf($language[8], ucwords($recipient)); $xml['post'] = $output; $write_me .= $output; } else if (stristr(substr($message, 0, 6), "/clear")) { $addok = 0; if (CheckFlags("CXZmM", $client['flags'])) { @count_mysql_query("DELETE FROM uo_chat_ulist WHERE chat='$realpath'", $handler, "sendmsg.php: /clear 1/2"); @count_mysql_query("DELETE FROM uo_chat_log WHERE chat='$realpath'", $handler, "sendmsg.php: /clear 2/2"); $write_me .= sprintf($language[10], $handle); $cleared = 1; } } else if (CheckBan($ident, $chatpath) == 0) { $ident = $oldident; if (CheckFlags("M", $client['flags'])) $tag = ""; else if (CheckFlags("ADpRfXZm", $client['flags'])) $tag = $adminident; else if (CheckFlags("Brx", $client['flags'])) $tag = $modident; else if (CheckFlags("z", $client['flags'])) $tag = $oocident; else if ($client['password']) $tag = $regident; else $tag = ""; $message = ParseSpecial($message); $message = FilterWords($message); if ($st_ooc == "on") $message = $ooc_l.$message.$ooc_r; if ($link) $postname = "".$handle.""; else $postname = $handle; $xml['post'] = $message; if ($icon != "") { if (($client['password']) && (!CheckFlags("z", $client['flags']))) $output = sprintf($banguage[0], $ident, $tag, $postname, $cpath, urlencode($handle), $icon, $color, $message); else $output = sprintf($banguage[0], $ident, $tag, $postname, $cpath, "", $icon, $color, $message); } else $output = sprintf($banguage[1], $ident, $tag, $postname, $color, $message); $write_me .= $output; } if ($image) { if (substr($image, 0, 7) != "http://") $image = "http://".$image; } if (($addok == 1) && ($cleared != 1)) AddUser($handle, $ident, time(), $link, $image, $realpath); if ($addok == 1) { require_once("../common/lastmsg.php"); SetLastMsg($realpath); $currentday = date('Y-m-d'); $currenthour = date('H'); $currenthour = "h{$currenthour}=h{$currenthour}+1"; count_mysql_query("UPDATE uo_chat_stats SET {$currenthour} WHERE chat='$realpath' AND date='{$currentday}'", $handler, "sendmsg.php: Updated 'stats' 1/3"); if (mysql_affected_rows($handler) < 1) count_mysql_query("INSERT INTO uo_chat_stats SET chat='$realpath', date='{$currentday}', {$currenthour}", $handler, "sendmsg.php: Updated 'stats' 2/3"); count_mysql_query("DELETE FROM uo_chat_stats WHERE date<=DATE_SUB(NOW(), INTERVAL 28 DAY)", $handler, "sendmsg.php: Updated 'stats' 3/3"); } if ($client['password']) { @count_mysql_query("UPDATE uo_chat_database SET lastlogin='".(time())."',plink='".(mysql_escape_string($link))."',pimage='".mysql_escape_string($image)."',picon='".mysql_escape_string($icon)."',pcolor='$color' WHERE chat='$chatpath' AND username='$fixhandle'", $handler, "sendmsg.php: Updated 'reload' 1/1"); } } $ident = $oldident; if ($maxlines > 256) $maxlines = 256; if ($write_me != "") { if ($master_zlib == 0) $tpack = mysql_escape_string($write_me); else $tpack = mysql_escape_string(gzcompress($write_me, 9)); if (empty($_SERVER['HTTP_X_FORWARDED_FOR'])) $proxyip = 'NULL'; else $proxyip = "'".mysql_escape_string(preg_replace('@([0-9.]+)(.*?)@', '\1', $_SERVER['HTTP_X_FORWARDED_FOR']))."'"; $oldident = $ident; if (!$undoable) { $ident = 'U-'.$ident; } count_mysql_query("UPDATE uo_chat_log SET id=(id+1) WHERE chat='$realpath'", $handler, "sendmsg.php: Post 1/3"); count_mysql_query("INSERT INTO uo_chat_log (chat,ident,line,username,ip,csig,proxyip,ip_n,posttime, rawpost,xmlpost,color ) VALUES ('$realpath','$ident','$tpack','".mysql_escape_string($handle)."','{$_SERVER['REMOTE_ADDR']}','". md5($_SERVER['HTTP_USER_AGENT'].$_SERVER['HTTP_ACCEPT_LANGUAGE'].$_SERVER['HTTP_ACCEPT'].$_SERVER['HTTP_ACCEPT_CHARSET']). "',{$proxyip},INET_ATON('{$_SERVER['REMOTE_ADDR']}'), now(), '".mysql_escape_string($xml['rawpost'])."', '".mysql_escape_string($xml['post'])."', '".mysql_escape_string($color)."' )", $handler, "sendmsg.php: Post 2/3"); count_mysql_query("DELETE FROM uo_chat_log WHERE chat='$realpath' AND id>'$maxlines'", $handler, "sendmsg.php: Post 3/3"); count_mysql_query("INSERT DELAYED INTO uo_chat_biglog (chat_id,user,user_id,ident,message,stamp) VALUES ( {$GLOBALS['biglog']['chat_id']}, '".mysql_escape_string($GLOBALS['biglog']['user_name'])."', {$GLOBALS['biglog']['user_id']}, '{$oldident}', COMPRESS('".mysql_escape_string($write_me)."'), now() )", $handler, "sendmsg.php: Biglog 1/1"); if (!$undoable) { $ident = $oldident; } /* $fd = @fopen("complete.log", "a"); @fwrite($fd, date("[d-H:i]", time())." ".stripslashes($write_me)."\n"); @fclose($fd); @chmod("complete.log", 0666); //*/ } $c = count($images); for($i=0;$i<$c;$i++) { if (strstr($images[$i], '../master/')) $images[$i] = str_replace('../master/', 'http://master.pjj.cc/', $images[$i]); if (strstr($images[$i], '../')) $images[$i] = str_replace('../', 'http://pjj.cc/', $images[$i]); } if ($exit == 0) { $_REQUEST['oldhandle'] = htmlentities($_REQUEST['oldhandle']); $handle = htmlentities($handle); echo " $ctitle $bodytag"; if ($falselog!="") echo "Wrong password for $falselog (Have you lost it? Click here.).
"; echo "
"; } echo "
"; //* //if ($client['password']) { $rez = count_mysql_query("SELECT username FROM uo_chat_database WHERE chat='{$realpath}' AND username!='{$fixhandle}' AND lastlogin>UNIX_TIMESTAMP()-2592000 ORDER BY username ASC", $handler, 'sendmsg.php: Msglist 1/1'); if (mysql_num_rows($rez) > 0) { echo ""; if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) echo ""; echo " "; } mysql_free_result($rez); //} //*/ //echo ''; echo ''; if ($_REQUEST['mode_simple'] != "on") { echo "A "; } if ($_REQUEST['mode_advanced'] != "on") { echo "S"; } echo "C"; echo ''; echo "
"; if ($_REQUEST['color'] == 'random') $color = 'random'; if ($_REQUEST['mode_simple'] != "on") { if (!CheckFlags("L", $client['prefs'])) echo ""; else echo ""; //if ($client['password']) { if (!CheckFlags("c", $client['prefs'])) { echo ""; } else echo ""; //} if (!CheckFlags("T", $client['prefs'])) { echo " B I U"; echo " T"; echo " O"; echo " R"; } else { echo " "; } } else { echo " "; } echo "
"; if (!CheckFlags("X", $client['prefs'])) { echo ""; echo " UndoRefreshUserlist Manual"; if ($client['password']) { echo "Members"; } echo "
"; if ($_REQUEST['mode_advanced'] == "on") { echo "
"; } else { echo " "; if (!CheckFlags("N", $client['prefs'])) echo ""; echo "
".(sprintf($language[11], $handle))." "; if (($_REQUEST['mode_simple'] != "on") && !CheckFlags("C", $client['prefs'])) { if ($handle != $noname) { echo"
"; } } echo "
"; if (($_REQUEST['mode_simple'] != "on") && !CheckFlags("C", $client['prefs'])) { echo "
Refresh
"; } echo "
"; } echo "
Profiles

"; if ($client['password']) { //if ($checkmsg == 1) { $result = @count_mysql_query("SELECT count(*) as cnt FROM uo_chat_message WHERE username='$fixhandle' AND chat='$chatpath' AND deleted='no'", $handler, "sendmsg.php: Check 'private msg' 1/1"); $nmsg = mysql_fetch_assoc($result); $xmsg = $msgs = intval($nmsg['cnt']); mysql_free_result($result); $result = @count_mysql_query("SELECT count(*) as cnt FROM uo_chat_message WHERE username='$fixhandle' AND chat='$chatpath' AND deleted='no' AND unread='yes'", $handler, "sendmsg.php: Check 'private msg' 1/1"); $nmsg = mysql_fetch_assoc($result); $msgs = intval($nmsg['cnt']).'/'.$msgs; mysql_free_result($result); if (!empty($xmsg)) echo "[$msgs] "; //} echo "Messages"; echo "

"; } if ($musiclink != "") { echo "Misc

"; } echo "Exit
"; echo "
"; flush(); CacheChatLines(); echo "
Terms of Service
"; } else { CacheChatLines(); flush(); DeleteUser($ident, $realpath); unset($color); unset($handle); unset($ident); $logout = 1; require_once("login.php"); flush(); } } MMC_Unlock("$realpath.lines"); //require_once('../common/zlib.php'); //PackNewLog(substr($realpath, 4)); ?>