127 lines
4.1 KiB
PHP
127 lines
4.1 KiB
PHP
<?php
|
|
class user_start extends SYSTEM\PAGE\Page {
|
|
public static function js(){
|
|
return array( \SYSTEM\WEBPATH(new PPAGE(),'user_start/js/user_start.js'));}
|
|
|
|
public static function css (){
|
|
return array();}
|
|
|
|
private function switch_race($race){
|
|
switch($race){
|
|
case 1:
|
|
return 'human';
|
|
case 2:
|
|
return 'ork';
|
|
case 3:
|
|
return 'dwarf';
|
|
case 4:
|
|
return 'nightelf';
|
|
case 5:
|
|
return 'undead';
|
|
case 6:
|
|
return 'tauren';
|
|
case 7:
|
|
return 'gnome';
|
|
case 8:
|
|
return 'troll';
|
|
default:
|
|
return '';
|
|
}
|
|
}
|
|
|
|
private function switch_order($race){
|
|
switch($race){
|
|
case 1:
|
|
return '1';
|
|
case 2:
|
|
return '3';
|
|
case 3:
|
|
return '7';
|
|
case 4:
|
|
return '4';
|
|
case 5:
|
|
return '2';
|
|
case 6:
|
|
return '8';
|
|
case 7:
|
|
return '6';
|
|
case 8:
|
|
return '5';
|
|
default:
|
|
return '';
|
|
}
|
|
}
|
|
|
|
private function switch_class($class){
|
|
switch($class){
|
|
case 1:
|
|
return 'Warrior';
|
|
case 2:
|
|
return 'Paladin';
|
|
case 3:
|
|
return 'Hunter';
|
|
case 4:
|
|
return 'Rogue';
|
|
case 5:
|
|
return 'Priest';
|
|
case 6:
|
|
return 'Shaman';
|
|
case 7:
|
|
return 'Mage';
|
|
case 8:
|
|
return 'Warlock';
|
|
case 9:
|
|
return 'Druid';
|
|
default:
|
|
return 'class not valid';
|
|
}
|
|
}
|
|
|
|
public function get_char_statistics(){
|
|
$chars = \DBD\CHAR_STATS::QA();
|
|
foreach ($chars as $race){
|
|
$vars = array();
|
|
$order = $this->switch_order($race['race']);
|
|
$vars['race'] = $this->switch_race($order);
|
|
$vars['count'] = $race['count'];
|
|
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_start/char_stats_realm.tpl'), $vars);
|
|
}
|
|
|
|
return $result;
|
|
}
|
|
|
|
public function get_class_statistics(){
|
|
$result = '';
|
|
$chars = \DBD\CLASS_STATS::QA();
|
|
foreach ($chars as $class){
|
|
$vars = array();
|
|
$vars['class'] = $this->switch_class($class['class']);
|
|
$vars['count'] = $class['count'];
|
|
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_start/class_stats_realm.tpl'), $vars);
|
|
}
|
|
|
|
|
|
return $result;
|
|
}
|
|
|
|
public function get_faction_balance(){
|
|
|
|
}
|
|
|
|
public function html(){
|
|
$vars = array();
|
|
$vars['char_stats'] = $this->get_char_statistics();
|
|
$vars['class_stats'] = $this->get_class_statistics();
|
|
$vars['guildcount'] = \DBD\COUNT_GUILDS::Q1();
|
|
$vars['realm_status'] = realm::status();
|
|
$vars['world_status'] = world::status();
|
|
$vars['player_online'] = database::player_online();
|
|
$vars['PICPATH'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=default_page&id=';
|
|
$vars['PIC'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=wowicons&id=';
|
|
$vars['PI'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=class&id=';
|
|
$vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE),
|
|
\SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_WOW_SERVERINFO),
|
|
\SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_BASIC));
|
|
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_start/user_start.tpl'), $vars);
|
|
}
|
|
} |