diff --git a/mojotrollz/dbd/qq/CHAR_STATS.php b/mojotrollz/dbd/qq/CHAR_STATS.php index 2155419..37dd1aa 100644 --- a/mojotrollz/dbd/qq/CHAR_STATS.php +++ b/mojotrollz/dbd/qq/CHAR_STATS.php @@ -7,7 +7,7 @@ class CHAR_STATS extends \SYSTEM\DB\QQ { //pg '', //mys -'SELECT count(*) as count FROM characters WHERE race=1', +'SELECT race,COUNT(*) FROM characters group by race;', new \DBD\mangos_chars() );}} diff --git a/mojotrollz/page/user_start/char_stats_realm.tpl b/mojotrollz/page/user_start/char_stats_realm.tpl index e69de29..a25e80d 100644 --- a/mojotrollz/page/user_start/char_stats_realm.tpl +++ b/mojotrollz/page/user_start/char_stats_realm.tpl @@ -0,0 +1 @@ +${race} diff --git a/mojotrollz/page/user_start/user_start.php b/mojotrollz/page/user_start/user_start.php index da8f4a4..cd67e12 100644 --- a/mojotrollz/page/user_start/user_start.php +++ b/mojotrollz/page/user_start/user_start.php @@ -2,11 +2,37 @@ class user_start extends SYSTEM\PAGE\Page { + private function get_race($race){ + switch($race){ + case 1: + return 'human'; + case 2: + return 'label label-danger'; + case 3: + return 'label label-info'; + case 4: + return 'label label-warning'; + case 5: + return 'label label-success'; + case 6: + return 'label label-success'; + case 7: + return 'label label-success'; + case 8: + return 'label label-success'; + default: + return ''; + } + } + public static function get_char_statistics(){ $result = ''; - $chars = \DBD\CHAR_STATS::QA(); - $vars[''] - $result = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_start/char_stats_realm.tpl'), $vars); + $chars = \DBD\CHAR_STATS::QQ(array()); + foreach($chars as $char){ + $vars['race'] = $this->get_race($char['race']); + $vars['count'] = $char['count']; + $result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_start/char_stats_realm.tpl'), $vars); + } return $result; } diff --git a/mojotrollz/page/user_start/user_start.tpl b/mojotrollz/page/user_start/user_start.tpl index 1552e8f..2b29679 100644 --- a/mojotrollz/page/user_start/user_start.tpl +++ b/mojotrollz/page/user_start/user_start.tpl @@ -13,4 +13,4 @@

Download realmlist.wtf

Download WoW 1.12

-${char_stats} \ No newline at end of file +
${char_stats}