Hacking attempt!
\n"); } ## -------------------------------------------------------------------------------------------------------------- ## $vwartpladmin = 0; $admintemplates = 0; ## -------------------------------------------------------------------------------------------------------------- ## // include language files if (isset($userlanguage)) { if (@file_exists($vwar_root . "includes/language/" . $userlanguage . ".inc.php")) { require($vwar_root . "includes/language/" . $userlanguage . ".inc.php"); } else { die("Error: File ".$vwar_root . "'includes/language/" . $userlanguage . ".inc.php' is missing!"); } } else if(!empty($GPC['vwarlanguage'])) { if (@file_exists($vwar_root . "includes/language/" . $GPC['vwarlanguage'] . ".inc.php")) { require("./includes/language/".$GPC['vwarlanguage'].".inc.php"); } else { die("Error: File ".$vwar_root . "'includes/language/" . $GPC['vwarlanguage'] . ".inc.php' is missing!"); } } else { if (@file_exists($vwar_root . "includes/language/" . $vwarlanguage . ".inc.php")) { require($vwar_root . "includes/language/" . $vwarlanguage . ".inc.php"); } else { die("Error: File ".$vwar_root . "'includes/language/" . $vwarlanguage . ".inc.php' is missing!"); } } ## -------------------------------------------------------------------------------------------------------------- ## // do time vars $timediff = ''; if ($timezoneoffset!=0) { $timediff = " " . $timezoneoffsetuser . "h"; } // calculate timezoneoffset from server's timezoneoffset and user's timezoneoffset $timezoneoffset = $timezoneoffsetuser - $timezoneoffset; if ($timeformat == 0) { $timenow = formatdatetime(time(), "h:i"."a"); } else { $timenow = formatdatetime(time(), "H:i"); } ## -------------------------------------------------------------------------------------------------------------- ## ## FUNCTIONS ## -------------------------------------------------------------------------------------------------------------- ## // alternate colors to separate rows of long lists function switchColors($start=1) { global $n,$vwardb,$altcolor,$firstaltcolor,$secondaltcolor,$colourcounter; if (!isset($colourcounter)) { $colourcounter = 1; } if (!isset($firstaltcolor)) { $result = $vwardb->query_first("SELECT replaceword FROM vwar".$n."_replacement WHERE findword = '{firstaltcolor}'"); $firstaltcolor = $result['replaceword']; } if (!isset($secondaltcolor)) { $result = $vwardb->query_first("SELECT replaceword FROM vwar".$n."_replacement WHERE findword = '{secondaltcolor}'"); $secondaltcolor = $result['replaceword']; } $altcolor = ($colourcounter++ % 2 != $start ? $secondaltcolor : $firstaltcolor); return $altcolor; } ## -------------------------------------------------------------------------------------------------------------- ## function sendMail( $mailtext, $tomail, $toname="", $frommail="", $fromname="", $subject="", $type="text", $priority=3, $smilies=1, $url=1, $isslashed=0 ) { global $vwartpl, $vwarversion, $ownhomepage, $ownname, $ownnameshort; // check vars if ($frommail == "") { global $ownmail; $frommail = $ownmail; } /* ... if ($fromname == "") { $fromname = rehtmlspecialchars($ownname); } */ if ($subject == "") { $subject = rehtmlspecialchars($owname) . " Virtual War - Mail"; } /* BUG: problems if $toname contains slashes, quotes, etc., no solution so far... 2004-05-08 $to = ( $toname != "" ) ? "\"" . addslashes($toname) . "\" <" . $tomail . ">" : $tomail; */ $to = $tomail; // mailtext // we get back html. if the mail is sent as html, htmlspecialchars() is used later // like that we can be sure, everyhting is fine when the mail is sent as normal text if ($isslashed == 1) { strip_slashes($mailtext); } eval("\$footer = \"".$vwartpl->get("message_mail_footer")."\";"); $footer = rehtmlspecialchars ($footer); $mailtext = rehtmlspecialchars ($mailtext); // create header // $from = "\"" . addslashes($fromname) . "\" <" . $frommail . ">"; $from = $frommail; $header = "From: " . $from."\r\n"; if ((strtolower($type) == "html") || $type == 1) { $header .= "MIME-Version: 1.0\r\n"; $header .= "Content-Type: text/html; charset=iso-8859-1\r\n"; $mailtext = parseText (dbSelect($mailtext), "", $smilies, 0, 1, $url, 1); $footer = dbSelect ($footer); } $header .= "X-Priority: " . $priority . "\r\n"; $header .= "X-Mailer: VWar v" . $vwarversion . " www.vwar.de (PHP v" . phpversion() . ")\r\n"; $header .= "X-Comment: mail generated at " . date ("m/d/Y, H:i:s a", time()) . "\r\n"; // add footer $mailtext .= $footer; // send mail if ( checkMail($tomail) ) { if ( @mail($to, $subject, $mailtext, $header) ) { $return = true; } else { $return = false; } } else { $return = false; } return $return; } ## -------------------------------------------------------------------------------------------------------------- ## function clickable_smilies ($formname,$textfieldname,$num_per_row=5,$maxsmilies=10) { global $vwartpl,$vwardb,$vwar_root,$n,$str; $result = $vwardb->query_first("SELECT COUNT(smilieid) AS numsmilies FROM vwar".$n."_smilie WHERE deleted = '0'"); $totalsmilies = $result['numsmilies']; $count = 0; $result = $vwardb->query("SELECT * FROM vwar".$n."_smilie WHERE deleted = '0' AND smilie = '1' LIMIT $maxsmilies"); while ($row = $vwardb->fetch_array($result)) { $count++; if ($count % 1 OR $count == 1) { $smiliesbit .= "\t\t\t\t\t\t\t\t\t\t