67 lines
3.0 KiB
PHP
67 lines
3.0 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();}
|
|
|
|
|
|
|
|
public function get_char_statistics(){
|
|
$result = '';
|
|
$chars = \DBD\CHAR_STATS::QA();
|
|
foreach ($chars as $race){
|
|
$vars = array();
|
|
$vars['race'] = player_races::name($race['race']);
|
|
$vars['count'] = $race['count'];
|
|
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_start/tpl/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'] = player_classes::name($class['class']);
|
|
$vars['count'] = $class['count'];
|
|
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_start/tpl/class_stats_realm.tpl'), $vars);
|
|
}
|
|
|
|
|
|
return $result;
|
|
}
|
|
|
|
public function get_faction_balance(){
|
|
$balance = \DBD\FACTION_BALANCE::Q1();
|
|
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_start/tpl/faction_balance.tpl'), $balance);
|
|
}
|
|
public function get_role_balance(){
|
|
$balance = \DBD\FACTION_BALANCE::Q1();
|
|
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_start/tpl/role_balance.tpl'), $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()['count'];
|
|
$vars['realm_status'] = realm::status();
|
|
$vars['world_status'] = world::status();
|
|
$vars['test'] = creature::data(1500);
|
|
$vars['player_online'] = database::player_online();
|
|
$vars['factionbalance'] = $this->get_faction_balance();
|
|
$vars['role_balance'] =$this->get_role_balance();
|
|
$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=race&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/tpl/user_start.tpl'), $vars);
|
|
}
|
|
} |