query("UPDATE hlstats_Options SET value=value+1 WHERE keyname='counter_hits';");
// visit counter
if ($_COOKIE['ELstatsNEO_Visit'] == 0) {
// kein cookie gefunden, also visitcounter erhöhen und cookie setzen
$db->query("UPDATE hlstats_Options SET value=value+1 WHERE keyname='counter_visits';");
@setcookie('ELstatsNEO_Visit', '1', time() + ($g_options['counter_visit_timeout'] * 60), '/');
}
global $game,$mode;
// see if they have a defined style or a new style they'd like
$selectedStyle = (isset($_COOKIE['style']) && $_COOKIE['style']) ? $_COOKIE['style'] : "";
$selectedStyle = isset($_POST['stylesheet']) ? $_POST['stylesheet'] : $selectedStyle;
// if they do make sure it exists
if(!empty($selectedStyle))
{
// this assumes that styles is up a directory from page_path, this might be a bad assumption
$testfile=sprintf("%s/%s/%s", PAGE_PATH, '../styles', $selectedStyle);
if(!file_exists($testfile))
{
$selectedStyle = "";
}
}
// if they don't have one defined or the defined was is invalid use the default
if(empty($selectedStyle))
{
$selectedStyle=$g_options['style'];
}
// if they had one, or tried to have one, set it to whatever we resolved it to
if (isset($_POST['stylesheet']) || isset($_COOKIE['style']))
{
setcookie('style', $selectedStyle, time()+60*60*24*30);
}
// this code here assumes that styles end with .css (the selector box for users and for admin does NOT check), someone may want to change this -octo
// Determine if we have custom nav images available
if ($selectedStyle) {
$style = preg_replace('/\.css$/','',$selectedStyle);
} else {
$style = preg_replace('/\.css$/','',$g_options['style']);
}
$iconpath = IMAGE_PATH . "/icons";
if (file_exists($iconpath . "/" . $style)) {
$iconpath = $iconpath . "/" . $style;
}
?>
\n";
}
?>
'
;
$_SESSION['nojs'] = 1;
$g_options['playerinfo_tabs'] = 0;
$g_options['show_google_map'] = 0;
}
}
// Determine if we should show SourceBans links/Forum links
if ($g_options['sourcebans_address'] && file_exists($iconpath . "/title-sourcebans.png")) {
$extratabs .= "