userdata['acclevel'] < 80) die ('Access denied!'); ?>
Options with an asterisk (*) beside them require a restart of the perl daemon to fully take effect.

title = $title; } function draw () { global $g_options; ?>

title; ?>

options as $opt) { $opt->draw(); } ?>
options as $opt) { if (($this->title == 'Fonts') || ($this->title == 'General')) { $optval = $_POST[$opt->name]; $search_pattern = array('/script/i', '/;/', '/%/'); $replace_pattern = array('', '', ''); $optval = preg_replace($search_pattern, $replace_pattern, $optval); } else { $optval = valid_request($_POST[$opt->name], 0); } $result = $db->query(" SELECT value FROM hlstats_Options WHERE keyname='$opt->name' "); if ($db->num_rows($result) == 1) { $result = $db->query(" UPDATE hlstats_Options SET value='$optval' WHERE keyname='$opt->name' "); } else { $result = $db->query(" INSERT INTO hlstats_Options ( keyname, value ) VALUES ( '$opt->name', '$optval' ) "); } } } } class Option { var $name; var $title; var $type; function Option ($name, $title, $type) { $this->name = $name; $this->title = $title; $this->type = $type; } function draw () { global $g_options, $optiondata, $db; ?> title . ":"; ?> type) { case 'textarea': echo "'; break; case 'styles': echo "'; break; case 'select': echo "'; break; default: echo "name\" size=\"35\" value=\""; echo html_entity_decode($optiondata[$this->name]); echo '" class="textbox" maxlength="255" />'; } ?> options[] = new Option('sitename', 'Site Name', 'text'); $optiongroups[0]->options[] = new Option('siteurl', 'Site URL', 'text'); $optiongroups[0]->options[] = new Option('contact', 'Contact URL', 'text'); $optiongroups[0]->options[] = new Option('bannerdisplay', 'Show Banner', 'select'); $optiongroups[0]->options[] = new Option('bannerfile', 'Banner file name (in hlstatsimg/) or full banner URL', 'text'); $optiongroups[0]->options[] = new Option('playerinfo_tabs', 'Use tabs in playerinfo to show/hide sections current page or just show all at once', 'select'); $optiongroups[0]->options[] = new Option('slider', 'Enable AJAX gliding server list (accordion effect) on homepage of each game (only affects games with more than one server)', 'select'); $optiongroups[0]->options[] = new Option('nav_globalchat', 'Show Chat nav-link', 'select'); $optiongroups[0]->options[] = new Option('nav_cheaters', 'Show Banned Players nav-link', 'select'); $optiongroups[0]->options[] = new Option('sourcebans_address', 'SourceBans URL
Enter the relative or full path to your SourceBans web site, if you have one. Ex: http://www.yoursite.com/sourcebans/ or /sourcebans/', 'text'); $optiongroups[0]->options[] = new Option('forum_address', 'Forum URL
Enter the relative or full path to your forum/message board, if you have one. Ex: http://www.yoursite.com/forum/ or /forum/', 'text'); $optiongroups[0]->options[] = new Option('show_weapon_target_flash', 'Show hitbox flash animation instead of plain html table for games with accuracy tracking (on supported games)', 'select'); $optiongroups[0]->options[] = new Option('show_server_load_image', 'Show load summaries from all monitored servers', 'select'); $optiongroups[0]->options[] = new Option('showqueries', 'Show "Executed X queries, generated this page in Y Seconds." message in footer?', 'select'); $optiongroups[0]->options[] = new Option('sigbackground', 'Default background for forum signature(Numbers 1-11 or random)
Look in sig folder to see background choices', 'text'); $optiongroups[0]->options[] = new Option('modrewrite', 'Use modrewrite to make forum signature image compatible with more forum types. (To utilize this, you must have modrewrite enabled on your webserver and add the following text to a .htaccess file in the directory of hlstats.php)

', 'select'); $optiongroups[1] = new OptionGroup('GeoIP data & Google Map settings'); $optiongroups[1]->options[] = new Option('countrydata', 'Show features requiring GeoIP data', 'select'); $optiongroups[1]->options[] = new Option('show_google_map', 'Show Google worldmap', 'select'); $optiongroups[1]->options[] = new Option('google_map_region', 'Google Maps Region', 'select'); $optiongroups[1]->options[] = new Option('google_map_type', 'Google Maps Type', 'select'); $optiongroups[1]->options[] = new Option('UseGeoIPBinary', '*Choose whether to use GeoCityLite data loaded into mysql database or from binary file. (If binary, GeoLiteCity.dat goes in perl/GeoLiteCity and Geo::IP::PurePerl module is required', 'select'); $optiongroups[2] = new OptionGroup('Awards settings'); $optiongroups[2]->options[] = new Option('gamehome_show_awards', 'Show daily award winners on Game Frontpage', 'select'); $optiongroups[2]->options[] = new Option('awarddailycols', 'Daily Awards: columns count', 'text'); $optiongroups[2]->options[] = new Option('awardglobalcols', 'Global Awards: columns count', 'text'); $optiongroups[2]->options[] = new Option('awardrankscols', 'Player Ranks: columns count', 'text'); $optiongroups[2]->options[] = new Option('awardribbonscols', 'Ribbons: columns count', 'text'); $optiongroups[3] = new OptionGroup('Hit counter settings'); $optiongroups[3]->options[] = new Option('counter_visit_timeout', 'Visit cookie timeout in minutes', 'text'); $optiongroups[3]->options[] = new Option('counter_visits', 'Current Visits', 'text'); $optiongroups[3]->options[] = new Option('counter_hits', 'Current Page Hits', 'text'); $optiongroups[20] = new OptionGroup('Paths'); $optiongroups[20]->options[] = new Option('map_dlurl', 'Map Download URL
(%MAP% = map, %GAME% = gamecode). Leave blank to suppress download link.', 'text'); $optiongroups[30] = new OptionGroup('Visual style settings'); $optiongroups[30]->options[] = new Option('graphbg_load', 'Server Load graph: background color hex# (RRGGBB)', 'text'); $optiongroups[30]->options[] = new Option('graphtxt_load', 'Server Load graph: text color# (RRGGBB)', 'text'); $optiongroups[30]->options[] = new Option('graphbg_trend', 'Player Trend graph: background color hex# (RRGGBB)', 'text'); $optiongroups[30]->options[] = new Option('graphtxt_trend', 'Player Trend graph: text color hex# (RRGGBB)', 'text'); $optiongroups[30]->options[] = new Option('style', 'Stylesheet filename to use', 'styles'); $optiongroups[30]->options[] = new Option('display_style_selector', 'Display Style Selector?
Allow end users to change the style they are using.', 'select'); $optiongroups[30]->options[] = new Option('display_gamelist', 'Enable Gamelist icons
Enables or Disables the game icons near the top-right of all pages.', 'select'); $optiongroups[35] = new OptionGroup('Ranking settings'); $optiongroups[35]->options[] = new Option('rankingtype', '*Ranking type', 'select'); $optiongroups[35]->options[] = new Option('MinActivity', '*HLstatsX will automatically hide players which have no event more days than this value. (Default 28 days)', 'text'); $optiongroups[40] = new OptionGroup('Daemon Settings'); $optiongroups[40]->options[] = new Option('Mode', '*Sets the player-tracking mode.
', 'select'); $optiongroups[40]->options[] = new Option('AllowOnlyConfigServers', '*Allow only servers set up in admin panel to be tracked. Other servers will NOT automatically added and tracked! This is a big security thing', 'select'); $optiongroups[40]->options[] = new Option('DeleteDays', '*HLstatsX will automatically delete history events from the events tables when they are over this many days old. This is important for performance reasons. Set lower if you are logging a large number of game servers or find the load on the MySQL server is too high', 'text'); $optiongroups[40]->options[] = new Option('DNSResolveIP', '*Resolve player IP addresses to hostnames. Requires a working DNS setup (on the box running hlstats.pl)', 'select'); $optiongroups[40]->options[] = new Option('DNSTimeout', '*Time, in seconds, to wait for DNS queries to complete before cancelling DNS resolves. You may need to increase this if on a slow connection or if you find a lot of IPs are not being resolved; however, hlstats.pl cannot be parsing log data while waiting for an IP to resolve', 'text'); $optiongroups[40]->options[] = new Option('MailTo', '*E-mail address to mail database errors to', 'text'); $optiongroups[40]->options[] = new Option('MailPath', '*Path to the mail program -- usually /usr/sbin/sendmail on webhosts', 'text'); $optiongroups[40]->options[] = new Option('Rcon', '*Allow HLstatsX to send Rcon commands to the game servers', 'select'); $optiongroups[40]->options[] = new Option('RconIgnoreSelf', '*Ignore (do not log) Rcon commands originating from the same IP as the server being rcon-ed (useful if you run any kind of monitoring script which polls the server regularly by rcon)', 'select'); $optiongroups[40]->options[] = new Option('RconRecord', '*Record Rcon commands to the Admin event table. This can be useful to see what your admins are doing, but if you run programs like PB it can also fill your database up with a lot of useless junk', 'select'); $optiongroups[40]->options[] = new Option('UseTimestamp', '*If no (default), use the current time on the database server for the timestamp when recording events. If yes, use the timestamp provided on the log data. Unless you are processing old log files on STDIN or your game server is in a different timezone than webhost, you probably want to set this to no', 'select'); $optiongroups[40]->options[] = new Option('TrackStatsTrend', '*Save how many players, kills etc, are in the database each day and give access to graphical statistics', 'select'); $optiongroups[40]->options[] = new Option('GlobalBanning', '*Make player bans available on all participating servers. Players who were banned permanently are automatic hidden from rankings', 'select'); $optiongroups[40]->options[] = new Option('LogChat', '*Log player chat to database', 'select'); $optiongroups[40]->options[] = new Option('LogChatAdmins', '*Log admin chat to database', 'select'); $optiongroups[40]->options[] = new Option('GlobalChat', '*Broadcast chat messages through all particapting servers. To all, none, or admins only', 'select'); $optiongroups[50] = new OptionGroup('Point calculation settings'); $optiongroups[50]->options[] = new Option('SkillMaxChange', '*Maximum number of skill points a player will gain from each frag. Default 25', 'text'); $optiongroups[50]->options[] = new Option('SkillMinChange', '*Minimum number of skill points a player will gain from each frag. Default 2', 'text'); $optiongroups[50]->options[] = new Option('PlayerMinKills', '*Number of kills a player must have before receiving regular points. (Before this threshold is reached, the killer and victim will only gain/lose the minimum point value) Default 50', 'text'); $optiongroups[50]->options[] = new Option('SkillRatioCap', '*Cap killer\'s gained skill with ratio using *XYZ*SaYnt\'s method "designed such that an excellent player will have to get about a 2:1 ratio against noobs to hold steady in points"', 'select'); $optiongroups[60] = new OptionGroup('Proxy Settings'); $optiongroups[60]->options[] = new Option('Proxy_Key', '*Key to use when sending remote commands to Daemon, empty for disable', 'text'); $optiongroups[60]->options[] = new Option('Proxy_Daemons', '*List of daemons to send PROXY events from (used by proxy-daemon.pl), use "," as delimiter, eg <ip>:<port>,<ip>:<port>,... ', 'text'); if (!empty($_POST)) { foreach ($optiongroups as $og) { $og->update(); } message('success', 'Options updated successfully.'); } $result = $db->query("SELECT keyname, value FROM hlstats_Options"); while ($rowdata = $db->fetch_row($result)) { $optiondata[$rowdata[0]] = $rowdata[1]; } foreach ($optiongroups as $og) { $og->draw(); } ?>