error_reporting(E_ALL ^ E_NOTICE); /*---------------------------------------------------------------------- index.php - Displays information from the sk_list table ------------------------------------------------------------------------ Date : Monday Jan 23, 2006 Copyright : B. Travis Turner Email : admin@chainsoffate.com You are free to modify these files for your own personal use as long as this header and all copyright information remains intact. However, these files cannot be redistributed after modification without explicit written permission from the author. See http://creativecommons.org/licenses/by-nc-nd/2.5/ for complete copyright information. ----------------------------------------------------------------------*/ // Report all errors except E_NOTICE // This is the default value set in php.ini error_reporting(E_ALL ^ E_NOTICE); require('config.php'); // SK_List config file putenv('TZ='.$timezone); // Sets the timezone (Defined in config.php) mysql_connect($db_host,$db_user,$db_pass); mysql_select_db($db_name); // If the file exists, display a timestamp if(file_exists("files/SuicideKings.lua")) { $timestamp = '(Last Updated '.date("m-d-Y H:i:s T",filemtime("files/SuicideKings.lua")).')'; } // If user has chosen from the drop-down, set the list if($_REQUEST['list']) { $currentList = $_REQUEST['list']; } if($_REQUEST['prefix']) { $currentPrefix = $_REQUEST['prefix']; } $listArr = Array(); $prefixArr = Array(); $query = "SELECT * FROM sk_list ORDER BY list"; $dropList = mysql_query($query); while($lists = mysql_fetch_array($dropList)) { //echo '
'; //var_dump($lists); //echo ''; // If $currentList hasn't been set, default to the first list if(!$currentList) { $currentList = $defaultList; $currentPrefix = $lists['prefix']; } if($use_prefixes == 1) { // Check against the $prefixArr to make sure we don't get duplicates if(!in_array($lists['prefix'],$prefixArr)) { // If $currentPrefix is set, make it selected in the drop-down if($lists['prefix'] == $currentPrefix) { $selected = ' selected'; } else { $selected = ''; } // Build the drop-down box $prefixArr[] = $lists['prefix']; $prefix_name .= ' '; } // Check against the $listArr to make sure we don't get duplicates if(!in_array($lists['list'],$listArr)) { // If $currentList is set, make it selected in the drop-down if($lists['list'] == $currentList) { $selected = ' selected'; } else { $selected = ''; } // Build the drop-down box $listArr[] = $lists['list']; $list_name .= ' '; } } else { // Check against the $listArr to make sure we don't get duplicates if(!in_array($lists['list'],$listArr)) { // If $currentList is set, make it selected in the drop-down if($lists['list'] == $currentList) { $selected = ' selected'; } else { $selected = ''; } // Build the drop-down box $listArr[] = $lists['list']; $list_name .= ' '; } } } $query = "SELECT * FROM sk_list WHERE list='".$currentList."' AND prefix='".$currentPrefix."' ORDER BY position"; $sklist = mysql_query($query); // When user selects a specific list, grab records that match that list while($players = mysql_fetch_array($sklist)) { // Default color $color = ' style="color: '.$default_color.';"'; // Grab the records from sk_class if classes or colors are enabled if($use_class_display == 1 || $use_class_color == 1) { $definedClasses = Array('Hunter','Warlock','Priest','Paladin','Mage','Rogue','Druid','Shaman','Warrior'); for($i = 0; $i < count($definedClasses); $i++) { if(stristr($currentList, $definedClasses[$i]) !== FALSE) { $is_class_list = 1; } } $query = "SELECT * FROM sk_class WHERE player_name='".$players['player_name']."'"; $skclass = mysql_query($query); $class = mysql_fetch_array($skclass); // Set the class display if enabled if($use_class_display == 1 && $is_class_list == 0) { $player_class = ' ('.$class["class"].')'; } // If using color-coding, set the appropriate color style if($use_class_color == 1) { if($class["class"] == 'Hunter') { $color = ' style="color: '.$hunter_color.';"'; } if($class["class"] == 'Warlock') { $color = ' style="color: '.$warlock_color.';"'; } if($class["class"] == 'Priest') { $color = ' style="color: '.$priest_color.';"'; } if($class["class"] == 'Paladin') { $color = ' style="color: '.$paladin_color.';"'; } if($class["class"] == 'Mage') { $color = ' style="color: '.$mage_color.';"'; } if($class["class"] == 'Rogue') { $color = ' style="color: '.$rogue_color.';"'; } if($class["class"] == 'Druid') { $color = ' style="color: '.$druid_color.';"'; } if($class["class"] == 'Shaman') { $color = ' style="color: '.$shaman_color.';"'; } if($class["class"] == 'Warrior') { $color = ' style="color: '.$warrior_color.';"'; } // If colors on class lists are disabled, set to the default style if($color_on_classes == 0 && $is_class_list == 1) { // Default color $color = ' style="color: '.$default_color.';"'; } } } // If roster linkbacks are enabled, make character names links to their roster entries if($use_roster_data == 1) { $player = '