Continue..
$this->bbcode_second_pass_code('', '
function popup_header($title="Legend of the Green Dragon"){
global $header;
$header.="<html><head><title>$title</title>";
$header.="<link href=\"newstyle.css\" rel=\"stylesheet\" type=\"text/css\">";
$header.="</head><body bgcolor='#000000' text='#CCCCCC'><table cellpadding=5 cellspacing=0 width='100%'>";
$header.="<tr><td class='popupheader'><b>$title</b></td></tr>";
$header.="<tr><td valign='top' width='100%'>";
}
function popup_footer(){
global $output,$nestedtags,$header,$nav,$session;
while (list($key,$val)=each($nestedtags)){
$output.="</$key>";
unset($nestedtags[$key]);
}
$output.="</td></tr><tr><td bgcolor='#330000' align='center'>Copyright 2002, Eric Stevens</td></tr></table></body></html>";
$output=$header.$output;
//$session[output]=$output;
saveuser();
echo $output;
exit();
}
function clearoutput(){
global $output,$nestedtags,$header,$nav,$session;
$session[allowednavs]="";
$output="";
unset($nestedtags);
$header="";
$nav="";
}
function soap($input){
if (getsetting("soap",1)){
$sql = "SELECT * FROM nastywords";
$result = db_query($sql);
$row = db_fetch_assoc($result);
$search = $row['words'];
$search = str_replace("a",'[a4@]',$search);
$search = str_replace("l",'[l1!]',$search);
$search = str_replace("i",'[li1!]',$search);
$search = str_replace("e",'[e3]',$search);
$search = str_replace("t",'[t7+]',$search);
$search = str_replace("o",'[o0]',$search);
$search = str_replace("s",'[sz$]',$search);
$search = str_replace("k",'c',$search);
$search = str_replace("c",'[c(k]',$search);
$start = "'(\s|\A)";
$end = "(\s|\Z)'iU";
$search = str_replace("*","([[:alnum:]]*)",$search);
$search = str_replace(" ","$end $start", $search);
$search = "$start".$search."$end";
//echo $search;
$search = split(" ",$search);
//$input = " $input ";
return preg_replace($search,"\\1`i$@#%`i\\2",$input);
}else{
return $input;
}
}
function saveuser(){
global $session,$dbqueriesthishit;
// $cmd = date("Y-m-d H:i:s")." $dbqueriesthishit ".$_SERVER['REQUEST_URI'];
// @exec("echo $cmd >> /home/groups/l/lo/lotgd/sessiondata/data/queryusage-".$session['user']['login'].".txt");
if ($session[loggedin] && $session[user][acctid]!=""){
$session[user][output]=$session[output];
$session[user][allowednavs]=serialize($session[allowednavs]);
$session[user][bufflist]=serialize($session[bufflist]);
if (is_array($session[user][prefs])) $session[user][prefs]=serialize($session[user][prefs]);
if (is_array($session[user][dragonpoints])) $session[user][dragonpoints]=serialize($session[user][dragonpoints]);
//$session[user][laston] = date("Y-m-d H:i:s");
$sql="UPDATE accounts SET ";
reset($session[user]);
while(list($key,$val)=each($session[user])){
if (is_array($val)){
$sql.="$key='".addslashes(serialize($val))."', ";
}else{
$sql.="$key='".addslashes($val)."', ";
}
}
$sql = substr($sql,0,strlen($sql)-2);
$sql.=" WHERE acctid = ".$session[user][acctid];
db_query($sql);
}
}
function createstring($array){
if (is_array($array)){
reset($array);
while (list($key,$val)=each($array)){
$output.=rawurlencode( rawurlencode($key)."\"".rawurlencode($val) )."\"";
}
$output=substr($output,0,strlen($output)-1);
}
return $output;
}
function createarray($string){
$arr1 = split("\"",$string);
$output = array();
while (list($key,$val)=each($arr1)){
$arr2=split("\"",rawurldecode($val));
$output[rawurldecode($arr2[0])] = rawurldecode($arr2[1]);
}
return $output;
}
function output_array($array,$prefix=""){
while (list($key,$val)=@each($array)){
$output.=$prefix."[$key] = ";
if (is_array($val)){
$output.="array{\n".output_array($val,$prefix."[$key]")."\n}\n";
}else{
$output.=$val."\n";
}
}
return $output;
}
function dump_item($item){
$output = "";
if (is_array($item)) $temp = $item;
else $temp = unserialize($item);
if (is_array($temp)) {
$output .= "array(" . count($temp) . ") {<blockquote>";
while(list($key, $val) = @each($temp)) {
$output .= "'$key' = '" . dump_item($val) . "'`n";
}
$output .= "</blockquote>}";
} else {
$output .= $item;
}
return $output;
}
function addnews($news){
global $session;
$sql = "INSERT INTO news(newstext,newsdate,accountid) VALUES ('".addslashes($news)."',NOW(),".$session[user][acctid].")";
return db_query($sql) or die(db_error($link));
}
function checkday() {
global $session,$revertsession,$REQUEST_URI;
//output("`#`iChecking to see if you're due for a new day: ".$session[user][laston].", ".date("Y-m-d H:i:s")."`i`n`0");
if ($session['user']['loggedin']){
output("<!--CheckNewDay()-->",true);
if(is_new_day()){
$session=$revertsession;
$session[user][restorepage]=$REQUEST_URI;
$session[allowednavs]=array();
addnav("","newday.php");
redirect("newday.php");
}
}
}
function is_new_day(){
global $session;
$t1 = gametime();
$t2 = convertgametime(strtotime($session[user][lasthit]));
$d1 = date("Y-m-d",$t1);
$d2 = date("Y-m-d",$t2);
if ($d1!=$d2){
return true;
}else{
return false;
}
}
function getgametime(){
// return date("g:i a",gametime());
return date(getsetting('gametimeformat','g:i a'),gametime());
}
// Gamedate-Mod by Chaosmaker
function getgamedate() {
$date = explode('-',getsetting('gamedate','0005-01-01'));
$find = array('%Y','%y','%m','%n','%d','%j');
$replace = array($date[0],sprintf('%02d',$date[0]%100),sprintf('%02d',$date[1]),(int)$date[1],sprintf('%02d',$date[2]),(int)$date[2]);
return str_replace($find,$replace,getsetting('gamedateformat','%Y-%m-%d'));
}
function gametime(){
$time = convertgametime(strtotime(date("r")));
return $time;
}
function convertgametime($intime){
// Hehe, einen hamwa noch, einen hamwa noch: by JT & anpera
$multi = getsetting("daysperday",4);
$offset = getsetting("gameoffsetseconds",0);
$fixtime = mktime(0,0,0-$offset,date("m")-$multi,date("d"),date("Y"));
$time=$multi*(strtotime(date("Y-m-d H:i:s",$intime))-$fixtime);
$time=strtotime(date("Y-m-d H:i:s",$time)."+".($multi*date("I",$intime))." hour");
$time=strtotime(date("Y-m-d H:i:s",$time)."-".date("I",$time). " hour");
$time=strtotime(date("Y-m-d H:i:s",$time)."+".(23-$multi)." hour");
return $time;
}
function sql_error($sql){
global $session;
return output_array($session)."SQL = <pre>$sql</pre>".db_error(LINK);
}
function ordinal($val){
$exceptions = array(1=>"ten",2=>"ten",3=>"ten",11=>"ten",12=>"ten",13=>"ten");
$x = ($val % 100);
if (isset($exceptions[$x])){
return $val.$exceptions[$x];
}else{
$x = ($val % 10);
if (isset($exceptions[$x])){
return $val.$exceptions[$x];
}else{
return $val."ten";
}
}
}
function addcommentary() {
global $HTTP_POST_VARS,$session,$REQUEST_URI,$HTTP_GET_VARS,$doublepost;
$doublepost=0;
$section=$HTTP_POST_VARS['section'];
$talkline=$HTTP_POST_VARS['talkline'];
if ($HTTP_POST_VARS[insertcommentary][$section]!==NULL &&
trim($HTTP_POST_VARS[insertcommentary][$section])!="") {
$commentary = str_replace("`n","",soap($HTTP_POST_VARS[insertcommentary][$section]));
$y = strlen($commentary);
for ($x=0;$x<$y;$x++){
if (substr($commentary,$x,1)=="`"){
$colorcount++;
if ($colorcount>=getsetting("maxcolors",10)){
$commentary = substr($commentary,0,$x).preg_replace("'[`].'","",substr($commentary,$x));
$x=$y;
}
$x++;
}
}
if (substr($commentary,0,1)!=":" &&
substr($commentary,0,2)!="::" &&
substr($commentary,0,3)!="/me" &&
$session['user']['drunkenness']>0) {
//drunk people shouldn't talk very straight.
$straight = $commentary;
$replacements=0;
while ($replacements/strlen($straight) < ($session['user']['drunkenness'])/500 ){
$slurs = array("a"=>"aa","e"=>"ee","f"=>"ff","h"=>"hh","i"=>"ij","l"=>"ll","m"=>"mm","n"=>"nn","o"=>"oo","r"=>"rr","s"=>"sh","u"=>"uu","v"=>"vv","w"=>"ww","y"=>"yy","z"=>"zz");
if (e_rand(0,9)) {
srand(e_rand());
$letter = array_rand($slurs);
$x = strpos(strtolower($commentary),$letter);
if ($x!==false &&
substr($comentary,$x,5)!="*hic*" &&
substr($commentary,max($x-1,0),5)!="*hic*" &&
substr($commentary,max($x-2,0),5)!="*hic*" &&
substr($commentary,max($x-3,0),5)!="*hic*" &&
substr($commentary,max($x-4,0),5)!="*hic*"
){
if (substr($commentary,$x,1)<>strtolower($letter)) $slurs[$letter] = strtoupper($slurs[$letter]); else $slurs[$letter] = strtolower($slurs[$letter]);
$commentary = substr($commentary,0,$x).$slurs[$letter].substr($commentary,$x+1);
$replacements++;
}
}else{
$x = e_rand(0,strlen($commentary));
if (substr($commentary,$x,5)=="*hic*") {$x+=5; } //output("moved 5 to $x ");
if (substr($commentary,max($x-1,0),5)=="*hic*") {$x+=4; } //output("moved 4 to $x ");
if (substr($commentary,max($x-2,0),5)=="*hic*") {$x+=3; } //output("moved 3 to $x ");
if (substr($commentary,max($x-3,0),5)=="*hic*") {$x+=2; } //output("moved 2 to $x ");
if (substr($commentary,max($x-4,0),5)=="*hic*") {$x+=1; } //output("moved 1 to $x ");
$commentary = substr($commentary,0,$x)."*hic*".substr($commentary,$x);
//output($commentary."`n");
$replacements++;
}//end if
}//end while
//output("$replacements replacements (".($replacements/strlen($straight)).")`n");
while (strpos($commentary,"*hic**hic*"))
$commentary = str_replace("*hic**hic*","*hic*hic*",$commentary);
}//end if
$commentary = preg_replace("'([^[:space:]]{45,45})([^[:space:]])'","\\1 \\2",$commentary);
if ($session['user']['drunkenness']>50) $talkline = "lallt";
$talkline = translate($talkline);
if ($talkline!="sagt" // do an emote if the area has a custom talkline and the user isn't trying to emote already.
&& substr($commentary,0,1)!=":"
&& substr($commentary,0,2)!="::"
&& substr($commentary,0,3)!="/me")
$commentary = ":`3$talkline: \\\"`#$commentary`3\\\"";
$sql = "SELECT commentary.comment,commentary.author FROM commentary WHERE section='$section' ORDER BY commentid DESC LIMIT 1";
$result = db_query($sql) or die(db_error(LINK));
$row = db_fetch_assoc($result);
db_free_result($result);
if ($row[comment]!=stripslashes($commentary) || $row[author]!=$session[user][acctid]){
// if ($row[comment]!=$commentary || $row[author]!=$session[user][acctid]){
$sql = "INSERT INTO commentary (postdate,section,author,comment) VALUES (now(),'$section',".$session[user][acctid].",\"$commentary\")";
db_query($sql) or die(db_error(LINK));
return true;
} else {
$doublepost = 1;
}
}
return false;
}
function viewcommentary($section,$message="Kommentar hinzufügen?",$limit=10,$talkline="sagt") { global $HTTP_POST_VARS,$session,$REQUEST_URI,$HTTP_GET_VARS, $doublepost,$appoencode_str;
$nobios = array("motd.php"=>true);
if ($nobios[basename($_SERVER['SCRIPT_NAME'])]) $linkbios=false; else $linkbios=true;
//output("`b".basename($_SERVER['SCRIPT_NAME'])."`b`n");
if ($doublepost) output("`\$`bDoppelpost?`b`0`n");
$message = translate($message);
$com=(int)$HTTP_GET_VARS[comscroll];
$sql = "SELECT commentary.*,
accounts.name,
accounts.login,
accounts.loggedin,
accounts.location,
accounts.laston
FROM commentary
INNER JOIN accounts
ON accounts.acctid = commentary.author
WHERE section = '$section'
AND accounts.locked=0
ORDER BY commentid DESC
LIMIT ".($com*$limit).",$limit";
$result = db_query($sql) or die(db_error(LINK));
$counttoday=0;
for ($i=0;$i < db_num_rows($result);$i++){
$row = db_fetch_assoc($result);
$row[comment]=preg_replace("'[`][^".$appoencode_str."`]'","",$row[comment]);
$commentids[$i] = $row[commentid];
/* limit posts
if (date("Y-m-d",strtotime($row[postdate]))==date("Y-m-d")){
// if ($row[name]==$session[user][name] && substr($section,0,5)!="house") $counttoday++;
}
*/
$x=0;
$ft="";
for ($x=0;strlen($ft)<3 && $x<strlen($row[comment]);$x++){
if (substr($row[comment],$x,1)=="`" && strlen($ft)==0) {
$x++;
}else{
$ft.=substr($row[comment],$x,1);
}
}
$link = "bio.php?char=".rawurlencode($row[login]) . "&ret=".URLEncode($_SERVER['REQUEST_URI']);
if (substr($ft,0,2)=="::") $ft = substr($ft,0,2);
else
if (substr($ft,0,1)==":") $ft = substr($ft,0,1);
if ($ft=="::" || $ft=="/me" || $ft==":"){
$x = strpos($row[comment],$ft);
if ($x!==false){
if ($linkbios)
$op[$i] = str_replace("&","&",HTMLEntities(substr($row[comment],0,$x)))
."`0<a href='$link' style='text-decoration: none'>\n`&$row[name]`0</a>\n`& "
.str_replace("&","&",HTMLEntities(substr($row[comment],$x+strlen($ft))))
."`0`n";
else
$op[$i] = str_replace("&","&",HTMLEntities(substr($row[comment],0,$x)))
."`0\n`&$row[name]`0\n`& "
.str_replace("&","&",HTMLEntities(substr($row[comment],$x+strlen($ft))))
."`0`n";
}
}
if ($op[$i]=="")
if ($linkbios)
$op[$i] = "`0<a href='$link' style='text-decoration: none'>`&$row[name]`0</a>`3 sagt: \"`#"
.str_replace("&","&",HTMLEntities($row[comment]))."`3\"`0`n";
else
$op[$i] = "`0`&$row[name]`0`3 sagt: \"`#"
.str_replace("&","&",HTMLEntities($row[comment]))."`3\"`0`n";
if ($message=="X") $op[$i]="`0($row[section]) ".$op[$i];
$loggedin=(date("U") - strtotime($row[laston]) < getsetting("LOGINTIMEOUT",900) && $row[loggedin] && $row[location]==0);
if ($row['postdate']>=$session['user']['recentcomments']) $op[$i]=($loggedin?"<img src='images/new-online.gif' alt='>' width='3' height='5' align='absmiddle'> ":"<img src='images/new.gif' alt='>' width='3' height='5' align='absmiddle'> ").$op[$i];
addnav("",$link);
}
$i--;
$outputcomments=array();
$sect="x";
for (;$i>=0;$i--){
$out="";
if ($session[user][superuser]>=3 && $message=="X"){
$out.="`0[ <a href='superuser.php?op=commentdelete&commentid=$commentids[$i]&return=".URLEncode($_SERVER['REQUEST_URI'])."'>Löschen</a> ] ";
addnav("","superuser.php?op=commentdelete&commentid=$commentids[$i]&return=".URLEncode($_SERVER['REQUEST_URI']));
$matches=array();
preg_match("/[(][^)]*[)]/",$op[$i],$matches);
$sect=$matches[0];
}
//output($op[$i],true);
$out.=$op[$i];
if (!is_array($outputcomments[$sect])) $outputcomments[$sect]=array();
array_push($outputcomments[$sect],$out);
}
ksort($outputcomments);
reset($outputcomments);
while (list($sec,$v)=each($outputcomments)){
if ($sec!="x") output("`n`b$sec`b`n");
output(implode('',$v),true);
}
if ($session[user][loggedin]) {
//if ($counttoday<($limit/2) || $session['user']['superuser']>=2){
if ($message!="X"){
if ($talkline!="says") $tll = strlen($talkline)+11; else $tll=0;
output("<form action=\"$REQUEST_URI\" method='POST'>`@$message`n<input name='insertcommentary[$section]' size='40' maxlength='".(200-$tll)."'><input type='hidden' name='talkline' value='$talkline'><input type='hidden' name='section' value='$section'><input type='submit' class='button' value='Hinzufügen'>`n".(round($limit/2,0)-$counttoday<3?"`)(Du hast noch ".(round($limit/2,0)-$counttoday)." Beiträge für heute übrig)":"")."`0`n</form>",true);
addnav("",$REQUEST_URI);
}
// }else{
// output("`@$message`nSorry, du hast deine Beiträge in dieser Region für heute aufgebraucht.`0`n");
// }
}
if (db_num_rows($result)>=$limit){
$req = preg_replace("'[&]?c(omscroll)?=([[:digit:]-])*'","",$REQUEST_URI)."&comscroll=".($com+1);
//$req = substr($REQUEST_URI,0,strpos($REQUEST_URI,"c="))."&c=$HTTP_GET_VARS[c]"."&comscroll=".($com+1);
$req = str_replace("?&","?",$req);
if (!strpos($req,"?")) $req = str_replace("&","?",$req);
output("<a href=\"$req\"><< Vorherige</a>",true);
addnav("",$req);
}
$req = preg_replace("'[&]?c(omscroll)?=([[:digit:]]|-)*'","",$REQUEST_URI)."&comscroll=0";
//$req = substr($REQUEST_URI,0,strpos($REQUEST_URI,"c="))."&c=$HTTP_GET_VARS[c]"."&comscroll=".($com-1);
$req = str_replace("?&","?",$req);
if (!strpos($req,"?")) $req = str_replace("&","?",$req);
output(" <a href=\"$req\">Aktualisieren</a> ",true);
addnav("",$req);
if ($com>0){
$req = preg_replace("'[&]?c(omscroll)?=([[:digit:]]|-)*'","",$REQUEST_URI)."&comscroll=".($com-1);
//$req = substr($REQUEST_URI,0,strpos($REQUEST_URI,"c="))."&c=$HTTP_GET_VARS[c]"."&comscroll=".($com-1);
$req = str_replace("?&","?",$req);
if (!strpos($req,"?")) $req = str_replace("&","?",$req);
output(" <a href=\"$req\">Nächste >></a>",true);
addnav("",$req);
}
db_free_result($result);
}
function dhms($secs,$dec=false){
if ($dec===false) $secs=round($secs,0);
return (int)($secs/86400)."d".(int)($secs/3600%24)."h".(int)($secs/60%60)."m".($secs%60).($dec?substr($secs-(int)$secs,1):"")."s";
}
function getmount($horse=0) {
$sql = "SELECT * FROM mounts WHERE mountid='$horse'";
$result = db_query($sql);
if (db_num_rows($result)>0){
return db_fetch_assoc($result);
}else{
return array();
}
}
function debuglog($message,$target=0){
global $session;
$sql = "DELETE from debuglog WHERE date <'".date("Y-m-d H:i:s",strtotime(date("r")."-".(getsetting("expirecontent",180)/10)." days"))."'";
db_query($sql);
$sql = "INSERT INTO debuglog VALUES(0,now(),{$session['user']['acctid']},$target,'".addslashes($message)."')";
db_query($sql);
}
// exp bar mod coded by: dvd871 with modifications by: anpera
function expbar() {
global $session;
$exparray=array(1=>100,400,1002,1912,3140,4707,6641,8985,11795,15143,19121,23840,29437,36071,43930,55000);
while (list($key,$val)=each($exparray)){
$exparray[$key]= round($val + ($session['user']['dragonkills']/4) * $key * 100,0);
}
$exp = $session[user][experience]-$exparray[$session[user][level]-1];
$req=$exparray[$session[user][level]]-$exparray[$session[user][level]-1];
$u="<font face=\"verdana\" size=1>".$session[user][experience]."<br>".grafbar($req,$exp)."</font>";
return($u);
}
// end exp bar mod
function grafbar($full,$left,$width=70,$height=5) {
$col2="#000000";
if ($left<=0){
$col="#000000";
}else if ($left<$full/4){
$col="#FF0000";
}else if ($left<$full/2){
$col="yellow";
}else if ($left>=$full){
$col="#00AA00";
$col2="#00AA00";
}else{
$col="#00FF00";
}
if ($full==0) $full=1;
$u = "<table cellspacing=\"0\" style=\"border: solid 1px #000000\" width=\"$width\" height=\"$height\"><tr><td width=\"" . ($left / $full * 100) . "%\" bgcolor=\"$col\"></td><td width=\"".(100-($left / $full * 100)) ."%\" bgcolor=\"$col2\"></td></tr></table>";
return($u);
}
if (file_exists("dbconnect.php")){
require_once "dbconnect.php";
}else{
echo "Du must die benötigten Informationen in die Datei \"dbconnect.php.dist\" eintragen und sie unter dem Namen \"dbconnect.php\" speichern.".
exit();
}
$link = db_pconnect($DB_HOST, $DB_USER, $DB_PASS) or die (db_error($link));
db_select_db ($DB_NAME) or die (db_error($link));
define("LINK",$link); $appoencode = Load_Tags(); $appoencode_str = Get_Allowed_Tags();
require_once "translator.php";
session_register("session");
function register_global(&$var){
@reset($var);
while (list($key,$val)=@each($var)){
global $$key;
$$key = $val;
}
@reset($var);
}
$session =& $_SESSION['session'];
//echo nl2br(htmlentities(output_array($session)));
//register_global($_SESSION);
register_global($_SERVER);
if (strtotime(date("r")."-".getsetting("LOGINTIMEOUT",900)." seconds") > $session['lasthit'] && $session['lasthit']>0 && $session[loggedin]){
//force the abandoning of the session when the user should have been sent to the fields.
//echo "Session abandon:".(strtotime("now")-$session[lasthit]);
$session=array();
$session['message'].="`nDeine Session ist abgelaufen!`n";
}
$session[lasthit]=strtotime(date("r"));
$revertsession=$session;
if ($PATH_INFO != "") {
$SCRIPT_NAME=$PATH_INFO;
$REQUEST_URI="";
}
if ($REQUEST_URI==""){
//necessary for some IIS installations (CGI in particular)
if (is_array($_GET) && count($_GET)>0){
$REQUEST_URI=$SCRIPT_NAME."?";
reset($_GET);
$i=0;
while (list($key,$val)=each($_GET)){
if ($i>0) $REQUEST_URI.="&";
$REQUEST_URI.="$key=".URLEncode($val);
$i++;
}
}else{
$REQUEST_URI=$SCRIPT_NAME;
}
$_SERVER['REQUEST_URI'] = $REQUEST_URI;
}
$SCRIPT_NAME=substr($SCRIPT_NAME,strrpos($SCRIPT_NAME,"/")+1);
if (strpos($REQUEST_URI,"?")){
$REQUEST_URI=$SCRIPT_NAME.substr($REQUEST_URI,strpos($REQUEST_URI,"?"));
}else{
$REQUEST_URI=$SCRIPT_NAME;
}
$allowanonymous=array("index.php"=>true,"login.php"=>true,"create.php"=>true,"about.php"=>true,"list.php"=>true,"petition.php"=>true,"connector.php"=>true,"logdnet.php"=>true,"referral.php"=>true,"news.php"=>true,"motd.php"=>true,"topwebvote.php"=>true,"source.php"=>true);
$allownonnav = array("badnav.php"=>true,"motd.php"=>true,"petition.php"=>true,"mail.php"=>true,"topwebvote.php"=>true,"chat.php"=>true,"source.php"=>true);
if ($session[loggedin]){
$sql = "SELECT * FROM accounts WHERE acctid = '".$session[user][acctid]."'";
$result = db_query($sql);
if (db_num_rows($result)==1){
$session[user]=db_fetch_assoc($result);
$session[output]=$session[user][output];
$session[user][dragonpoints]=unserialize($session[user][dragonpoints]);
$session[user][prefs]=unserialize($session[user][prefs]);
if (!is_array($session[user][dragonpoints])) $session[user][dragonpoints]=array();
if (is_array(unserialize($session[user][allowednavs]))){
$session[allowednavs]=unserialize($session[user][allowednavs]);
}else{
//depreciated, left only for legacy support.
$session[allowednavs]=createarray($session[user][allowednavs]);
}
if (!$session[user][loggedin] || (0 && (date("U") - strtotime($session[user][laston])) > getsetting("LOGINTIMEOUT",900)) ){
$session=array();
redirect("index.php?op=timeout","Account ist nicht eingeloggt, aber die Session denkt, er ist es.");
}
}else{
$session=array();
$session[message]="`4Fehler! Dein Login war falsch.`0";
redirect("index.php","Account verschwunden!");
}
db_free_result($result);
if ($session[allowednavs][$REQUEST_URI] && !$allownonnav[$SCRIPT_NAME]){
$session[allowednavs]=array();
}else{
if (!$allownonnav[$SCRIPT_NAME]){
redirect("badnav.php","Navigation auf $REQUEST_URI nicht erlaubt");
}
}
}else{
//if ($SCRIPT_NAME!="index.php" && $SCRIPT_NAME!="login.php" && $SCRIPT_NAME!="create.php" && $SCRIPT_NAME!="about.php"){
if (!$allowanonymous[$SCRIPT_NAME]){
$session['message']="Du bist nicht eingeloggt. Wahrscheinlich ist deine Sessionzeit abgelaufen.";
redirect("index.php?op=timeout","Not logged in: $REQUEST_URI");
}
}
//if ($session[user][loggedin]!=true && $SCRIPT_NAME!="index.php" && $SCRIPT_NAME!="login.php" && $SCRIPT_NAME!="create.php" && $SCRIPT_NAME!="about.php"){
if ($session[user][loggedin]!=true && !$allowanonymous[$SCRIPT_NAME]){
redirect("login.php?op=logout");
}
$session[counter]++;
$nokeeprestore=array("newday.php"=>1,"badnav.php"=>1,"motd.php"=>1,"mail.php"=>1,"petition.php"=>1,"chat.php"=>1);
if (!$nokeeprestore[$SCRIPT_NAME]) { //strpos($REQUEST_URI,"newday.php")===false && strpos($REQUEST_URI,"badnav.php")===false && strpos($REQUEST_URI,"motd.php")===false && strpos($REQUEST_URI,"mail.php")===false
$session[user][restorepage]=$REQUEST_URI;
}else{
}
if ($session['user']['hitpoints']>0){
$session['user']['alive']=true;
}else{
$session['user']['alive']=false;
}
$session[bufflist]=unserialize($session[user][bufflist]);
if (!is_array($session[bufflist])) $session[bufflist]=array();
$session[user][lastip]=$REMOTE_ADDR;
if (strlen($_COOKIE[lgi])<32){
if (strlen($session[user][uniqueid])<32){
$u=md5(microtime());
setcookie("lgi",$u,strtotime(date("r")."+365 days"));
$_COOKIE['lgi']=$u;
$session[user][uniqueid]=$u;
}else{
setcookie("lgi",$session[user][uniqueid],strtotime(date("r")."+365 days"));
}
}else{
$session[user][uniqueid]=$_COOKIE[lgi];
}
$url = "http://".$_SERVER['SERVER_NAME'].dirname($_SERVER['REQUEST_URI']);
$url = substr($url,0,strlen($url)-1);
if (substr($_SERVER['HTTP_REFERER'],0,strlen($url))==$url || $_SERVER['HTTP_REFERER']==""){
}else{
$sql = "SELECT * FROM referers WHERE uri='{$_SERVER['HTTP_REFERER']}'";
$result = db_query($sql);
$row = db_fetch_assoc($result);
db_free_result($result);
$site = str_replace("http://","",$_SERVER['HTTP_REFERER']);
if (strpos($site,"/"))
$site = substr($site,0,strpos($site,"/"));
if ($row['refererid']>""){
$sql = "UPDATE referers SET count=count+1,last=now(),site='".addslashes($site)."' WHERE refererid='{$row['refererid']}'";
}else{
$sql = "INSERT INTO referers (uri,count,last,site) VALUES ('{$_SERVER['HTTP_REFERER']}',1,now(),'".addslashes($site)."')";
}
db_query($sql);
}
if ($_COOKIE['template']!="") $templatename=$_COOKIE['template'];
if ($templatename=="" || !file_exists("templates/$templatename")) $templatename="yarbrough.htm";
$template = loadtemplate($templatename);
//tags that must appear in the header
$templatetags=array("title","headscript","script");
foreach ($templatetags AS $val) {
if (strpos($template['header'],"{".$val."}")===false) $templatemessage.="You do not have {".$val."} defined in your header\n";
}
//tags that must appear in the footer
$templatetags=array();
foreach ($templatetags AS $val) {
if (strpos($template['footer'],"{".$val."}")===false) $templatemessage.="You do not have {".$val."} defined in your footer\n";
}
//tags that may appear anywhere but must appear
//touch the copyright and we will force your server to be shut down
$templatetags=array("nav","stats","petition","motd","mail","paypal","copyright","source");
foreach ($templatetags AS $val) {
if (strpos($template['header'],"{".$val."}")===false && strpos($template['footer'],"{".$val."}")===false) $templatemessage.="You do not have {".$val."} defined in either your header or footer\n";
}
if ($templatemessage!=""){
echo "<b>Du hast einen oder mehrere Fehler in deinem Template!</b><br>".nl2br($templatemessage);
$template=loadtemplate("yarbrough.htm");
}
$races=array( 1=>"Elf", 2=>"Hochelf", 3=>"Dunkelelf", 4=>"Blutelf", 5=>"Waldelf", 6=>"Sternenelf", 7=>"Halbelf", 8=>"Engel", 9=>"gefallener Engel", 10=>"Menschenmann", 11=>"Zwerg", 12=>"Kobold", 13=>"Werwolf", 14=>"Feline", 15=>"Echse", 16=>"Vampir", 17=>"Wervampir", 18=>"Vampirengel", 19=>"Dämon", 20=>"Halbdämon", 21=>"Inkubus", 22=>"Gargoyle", 23=>"Scrab", 24=>"Erzdämonengel", 25=>"Erzengel", 26=>"Elfin", 27=>"Hochelfin", 28=>"Dunkelelfin", 29=>"Blutelfin", 30=>"Waldelfin", 31=>"Sternenelfin", 32=>"Halbelfin", 33=>"Engel", 34=>"gefallener Engel", 35=>"Menschenfrau", 36=>"Zwergin", 37=>"Nymphe", 38=>"Werwölfin", 39=>"Feline", 40=>"Echse", 41=>"Vampiress", 42=>"Wervampiress", 43=>"Vampirengel", 44=>"Dämonin", 45=>"Halbdämonin", 46=>"Sukkubus", 47=>"Gargoyle", 48=>"Harpyie", 49=>"Gargoyle", 50=>"Erzdämonin", 51=>"Erzengel", 52=>"Erzdämonengel", 53=>"Mondelf", 54=>"Lichtelf", 55=>"Nachtelf", 56=>"Drow", 57=>"Loroth Elf", 58=>"Halbengel", 59=>"Cherubim", 60=>"Seraphim", 61=>"dunkler Engel", 62=>"Racheengel", 63=>"Richterengel", 64=>"Rachedämon", 65=>"Elementardämon", 66=>"Ätherdämon", 67=>"Druide", 68=>"Magier", 69=>"Vampirjäger", 70=>"Form/Gestaltenwandler", 71=>"Geist", 72=>"Traumwandler", 73=>"Phärenwandler", 74=>"Schattenwesen", 75=>"Drache", 76=>"Naga", 77=>"Najshka", 78=>"UndinLilim", 79=>"Vampirdämon", 80=>"Najshka", 81=>"Sirake", 82=>"Satan", 83=>"Mondelf", 84=>"Lichtelf", 85=>"DNachtelfin", 86=>"Drow", 87=>"Loroth Elfin", 88=>"Halbengel", 89=>"Cherubim", 90=>"Seraphim", 91=>"dunkler Engel", 92=>"Racheengel", 93=>"Richterengel", 94=>"Rachedämonin", 95=>"Elementardämonin", 96=>"Ätherdämonin", 97=>"Hexe", 98=>"Vampirjägerin", 99=>"Form/Gestaltwnadlerin", 100=>"Geist", 101=>"Traumwandlerin", 102=>"Phärenwandlerin", 103=>"Schattenwesen", 105=>"Drache", 106=>"Naga", 104=>"Gorgone", 107=>"Fee", 108=>"dunkle Fee", 109=>"Nixe", 110=>"Sirene", 11=>"Dryade", 112=>"Vampirdämonin", 113=>"Lamien", 114=>"Lilim", 115=>"Dämonvampir", 116=>"Halbgott", 0=>"Unbekannt", 120=>"Hoverschaf");
$colraces=array( 1=>"`@E`gl`^f ", 2=>"`äH`#o`Èc`ìh`Ìe`îl`&f", 3=>"`JD`ju`~n`Sk`Ue`Sl`~e`Jl`jf", 4=>"`jB`kl`4u`&t`We`Ul`~f", 5=>"`OW`oa`Nl`Md`me`Sl`Tf", 6=>"`qS`[t`³e`^r`;n`+e`+n`-e`_l`&f", 7=>"`VH`va`hl`Gb`he`#l`3f", 8=>"`6E`^n`&g`^e`6l", 9=>"`~g`&e`Sf`Xa`Ul`7l`we`)n`we`7r `UE`Xn`Sg`&e`~l", 10=>"`aM`Ae`dn`1s`‰c`!h`Ee`fn`9m`Fa`Gn`hn", 11=>"`TZ`tw`&e`tr`Tg", 12=>"`TK`to`+b`_o`tl`Td", 13=>"`~W`de`1r`Ew`1o`dl`~f", 14=>"`VF`ve`&li`vn`Ve", 15=>"`~E`mc`Nh`ms`~e", 16=>"`~V`ja`4mp`ji`~r", 17=>"`1W`de`ar`jv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>"`~D`jr`Ja`kc`§h`(e", 106=>"`@N`ûa`Üg`^a ", 104=>"`RG`Po`pr`jg`Jo`Kne", 107=>"`FF`he`#e", 108=>"`!d`‰u`1n`dk`Al`ae `pF`Pe`Re", 109=>"`#N`ìi`:x`|e", 110=>"`²S`èi`:r`+e`&ne", 111=>"`ÔD`Ûr`ûy`@a`Od`Ne", 112=>"`jV`Ja`4m`°p`Zi`jr`~d`Sä`Um`Wo`xn`)i`7n", 113=>"`4L`=am`Qie`qn", 114=>"`pL`Pi`Rl`Pi`pm ", 115=>"Dämonvampir", 116=>"`ÊH`Éa`#l`äb`hg`Go`Àt`Ft", 0=>"Unbekannt", 120=>"Hoverschaf");
$logd_version = "0.9.7+jt ext (GER)";
$session['user']['laston']=date("Y-m-d H:i:s");
$playermount = getmount($session['user']['hashorse']);
$titles = array(
0=>array("Bauernjunge","Bauernmädchen"),
1=>array("Knecht", "Magd"),
2=>array("Bauer", "Bäuerin"),
3=>array("Grossbauer", "Grossbäuerin"),
4=>array("Spurenleser","Spurenleserin"),
5=>array("Jäger","Jägerin"),
6=>array("Gutshofverwalter","Gutshofverwalterin"),
7=>array("Gutsherr","Gutsherrin"),
8=>array("Bürger","Bürgerin"),
9=>array("Gladiator","Gladiatorin"),
10=>array("Legionär","Legionärin"),
11=>array("Centurio","Centurioness"),
12=>array("Meister","Meisterin"),
13=>array("Ratsherr", "Ratsfrau"),
14=>array("Verwalter","Verwalterin"),
15=>array("Bürgermeister", "Bürgermeisterin"),
16=>array("Major", "Major"),
17=>array("General", "General"),
18=>array("Edler", "Edle"),
19=>array("Ritter", "Ritterin"),
20=>array("Junker", "Junkerin"),
21=>array("Freiherr", "Freifrau"),
22=>array("Baron", "Baronin"),
23=>array("Fürst", "Fürstin"),
24=>array("Grossfürst", "Grossfürstin"),
25=>array("Herzog", "Herzogin"),
26=>array("Graf", "Gräfin"),
27=>array("Prinz", "Prinzessin"),
28=>array("Kronprinz", "Kronprinzessin"),
29=>array("König", "Königin"),
30=>array("Kaiser", "Kaiserin"),
31=>array("Drachentöter","Drachentöterin"),
32=>array("Bischof","Bischöfin"),
33=>array("Papst", "Päpstin"),
34=>array("Seele", "Seele"),
35=>array("Seliger", "Selige"),
36=>array("Heiliger", "Heilige"),
37=>array("Engel", "Engel"),
38=>array("Erzengel", "Erzengel"),
39=>array("Kraft", "Kraft"),
40=>array("Macht", "Macht"),
41=>array("Herrschaft", "Herrschaft"),
42=>array("Thron", "Thron"),
43=>array("Seraphim", "Seraphim"),
44=>array("Cherubim", "Cherubim"),
45=>array("Titan","Titanin"),
46=>array("Erztitan","Erztitanin"),
47=>array("Halbgott", "Halbgöttin"),
48=>array("Untergott","Untergöttin")
);
$beta = (getsetting("beta",0) == 1 || $session['user']['beta']==1);
?> ')
_________________ Wenn ihr mir sagt wie ich es als Datei hochlade, dann kann ich die Source hochladen die ihr wollt .D
|