From fc1cd2cb9a3000c36aba228559fdc9232c6cdd76 Mon Sep 17 00:00:00 2001 From: rylon Date: Fri, 20 Jun 2014 01:51:33 +0200 Subject: [PATCH 01/33] updated startpage --- mojotrollz/api/autoload.inc.php | 3 ++- mojotrollz/api/db/wow_db.php | 7 ------- mojotrollz/api/realm/realm.php | 5 +++++ mojotrollz/api/world/world.php | 5 +++++ mojotrollz/dbd/tbl/locale_string.php | 5 +++-- .../page/default_page/css/default_page.css | 3 ++- mojotrollz/page/default_page/default_page.php | 9 ++++++--- mojotrollz/page/default_page/default_page.tpl | 2 +- .../page/default_page/default_page_login.tpl | 18 +++++++++--------- .../default_page/default_page_serverinfo.tpl | 5 +++-- .../saimod_mojotrollz_server_handling.php | 4 ++-- 11 files changed, 38 insertions(+), 28 deletions(-) delete mode 100644 mojotrollz/api/db/wow_db.php create mode 100644 mojotrollz/api/realm/realm.php create mode 100644 mojotrollz/api/world/world.php diff --git a/mojotrollz/api/autoload.inc.php b/mojotrollz/api/autoload.inc.php index 13cb766..fa2d14e 100644 --- a/mojotrollz/api/autoload.inc.php +++ b/mojotrollz/api/autoload.inc.php @@ -1,3 +1,4 @@ &1');} +} \ No newline at end of file diff --git a/mojotrollz/api/world/world.php b/mojotrollz/api/world/world.php new file mode 100644 index 0000000..892bfd7 --- /dev/null +++ b/mojotrollz/api/world/world.php @@ -0,0 +1,5 @@ +&1');} +} diff --git a/mojotrollz/dbd/tbl/locale_string.php b/mojotrollz/dbd/tbl/locale_string.php index 02ac0f2..3eb3b46 100644 --- a/mojotrollz/dbd/tbl/locale_string.php +++ b/mojotrollz/dbd/tbl/locale_string.php @@ -4,8 +4,9 @@ namespace DBD; class locale_string extends \SYSTEM\DBD\system_locale_string { -const VALUE_CATEGORY_MAINPAGE = 100; +const VALUE_CATEGORY_MAINPAGE = 100; const VALUE_CATEGORY_WOW_INFOTEXT_RACES = 120; -const VALUE_CATEGORY_WOW_INFOTEXT_HELP = 130; +const VALUE_CATEGORY_WOW_INFOTEXT_HELP = 130; +const VALUE_CATEGORY_WOW_SERVERINFO = 140; } \ No newline at end of file diff --git a/mojotrollz/page/default_page/css/default_page.css b/mojotrollz/page/default_page/css/default_page.css index 04b4ec1..764bfdb 100644 --- a/mojotrollz/page/default_page/css/default_page.css +++ b/mojotrollz/page/default_page/css/default_page.css @@ -91,7 +91,8 @@ body { #frame_content_right { float: right; width: 30%; - margin: 1.5%; + margin-left: 1.5%; + margin-right: 1.5%; } #frame_footer{ diff --git a/mojotrollz/page/default_page/default_page.php b/mojotrollz/page/default_page/default_page.php index 6c8cfac..1d6d12a 100644 --- a/mojotrollz/page/default_page/default_page.php +++ b/mojotrollz/page/default_page/default_page.php @@ -24,14 +24,17 @@ class default_page extends SYSTEM\PAGE\Page { $vars['js'] = $this->js(); $vars['css'] = $this->css(); $vars['default_page_welcome'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_welcome.tpl'), array()); - $vars['default_page_serverinfo'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_serverinfo.tpl'), - array('database_version' => wow_db::version())); + $vars['default_page_serverinfo'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_serverinfo.tpl'), array()); $vars['default_page_login'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_login.tpl'), array()); $vars['default_page_toolbar'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_toolbar.tpl'), array()); $vars['PICPATH'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=default_page&id='; $vars['copyright'] = ''; $vars['inprint'] = ''; - $vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE)); + $vars['realm_status'] = realm::status(); + $vars['world_status'] = world::status(); + $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(),'default_page/default_page.tpl'), $vars); } } \ No newline at end of file diff --git a/mojotrollz/page/default_page/default_page.tpl b/mojotrollz/page/default_page/default_page.tpl index cef302f..c883ad5 100644 --- a/mojotrollz/page/default_page/default_page.tpl +++ b/mojotrollz/page/default_page/default_page.tpl @@ -20,7 +20,7 @@
${default_page_welcome}
-
+
diff --git a/mojotrollz/page/default_page/default_page_login.tpl b/mojotrollz/page/default_page/default_page_login.tpl index 8ccfea9..1bfdd11 100644 --- a/mojotrollz/page/default_page/default_page_login.tpl +++ b/mojotrollz/page/default_page/default_page_login.tpl @@ -6,25 +6,25 @@ size="30" style="margin-bottom: 15px;" id="bt_login_user" - placeholder="${login_username}" - minlength="3" data-validation-minlength-message="${login_username_too_short}" - maxlength="16" data-validation-maxlength-message="${login_username_too_long}" - required data-validation-required-message="${login_username_required}"/> + placeholder="${basic_username}" + minlength="3" data-validation-minlength-message="${basic_username_short}" + maxlength="16" data-validation-maxlength-message="${basic_username_long}" + required data-validation-required-message="${basic_username_miss}"/>
+ placeholder="${basic_password}" + minlength="5" data-validation-minlength-message="${basic_password_short}" + maxlength="16" data-validation-maxlength-message="${basic_password_long}" + required data-validation-required-message="${basic_password_miss}"/>
+ id="login_submit">${basic_login}
\ No newline at end of file diff --git a/mojotrollz/page/default_page/default_page_serverinfo.tpl b/mojotrollz/page/default_page/default_page_serverinfo.tpl index ea8dca7..1eb6359 100644 --- a/mojotrollz/page/default_page/default_page_serverinfo.tpl +++ b/mojotrollz/page/default_page/default_page_serverinfo.tpl @@ -5,9 +5,10 @@

Database Version: ${database_version}

Server Status

+This Server is currently closed for the Public. Be gone.

Realm Server: ${realm_status}

World Server: ${world_status}

Server Help

-

Download realmlist.wtf

-

Download WoW 1.12

\ No newline at end of file +

Download realmlist.wtf

+

Download WoW 1.12

\ No newline at end of file diff --git a/mojotrollz/sai/saimod_mojotrollz_server_handling/saimod_mojotrollz_server_handling.php b/mojotrollz/sai/saimod_mojotrollz_server_handling/saimod_mojotrollz_server_handling.php index 79b5cc6..5cc5818 100644 --- a/mojotrollz/sai/saimod_mojotrollz_server_handling/saimod_mojotrollz_server_handling.php +++ b/mojotrollz/sai/saimod_mojotrollz_server_handling/saimod_mojotrollz_server_handling.php @@ -18,13 +18,13 @@ class saimod_mojotrollz_server_handling extends \SYSTEM\SAI\SaiModule { public static function sai_mod_saimod_mojotrollz_server_handling_action_realmstop(){ return shell_exec('/home/mojotrolls/mojo_zero/realm stop 2>&1');} public static function sai_mod_saimod_mojotrollz_server_handling_action_realmstatus(){ - return shell_exec('/home/mojotrolls/mojo_zero/realm status 2>&1');} + return realm::status();} public static function sai_mod_saimod_mojotrollz_server_handling_action_worldstart(){ return shell_exec('/home/mojotrolls/mojo_zero/world start 2>&1');} public static function sai_mod_saimod_mojotrollz_server_handling_action_worldstop(){ return shell_exec('/home/mojotrolls/mojo_zero/world stop 2>&1');} public static function sai_mod_saimod_mojotrollz_server_handling_action_worldstatus(){ - return shell_exec('/home/mojotrolls/mojo_zero/world status 2>&1');} + return world::status();} public static function sai_mod_saimod_mojotrollz_server_handling_action_compile(){ return shell_exec('/home/mojotrolls/mojo_zero/compile 2>&1');} public static function sai_mod_saimod_mojotrollz_server_handling_action_backup_db(){ From fd0cdfd843dd92d2a883b790d1335ee2c92e102e Mon Sep 17 00:00:00 2001 From: rylon Date: Fri, 20 Jun 2014 16:31:46 +0200 Subject: [PATCH 02/33] online graphic --- mojotrollz/api/api_mojotrollz.php | 7 +++++- mojotrollz/api/realm/realm.php | 4 +++- mojotrollz/api/world/world.php | 4 +++- mojotrollz/autoload.inc.php | 5 ++--- mojotrollz/dbd/autoload.inc.php | 1 + mojotrollz/dbd/qq/ONLINE_STATS.php | 18 +++++++++++++++ mojotrollz/log/WOW_STATS_OFLINE.php | 2 ++ mojotrollz/log/WOW_STATS_ONLINE.php | 2 ++ mojotrollz/log/WOW_STATS_PLAYER.php | 6 +++++ mojotrollz/log/autoload.inc.php | 2 ++ mojotrollz/page/default_page/default_page.php | 3 +++ .../page/default_page/default_page_login.tpl | 3 ++- .../page/default_page/js/onlinegraphic.js | 22 +++++++++++++++++++ mojotrollz/page/default_page/js/wizard.js | 1 + 14 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 mojotrollz/dbd/qq/ONLINE_STATS.php create mode 100644 mojotrollz/log/WOW_STATS_OFLINE.php create mode 100644 mojotrollz/log/WOW_STATS_ONLINE.php create mode 100644 mojotrollz/log/WOW_STATS_PLAYER.php create mode 100644 mojotrollz/log/autoload.inc.php create mode 100644 mojotrollz/page/default_page/js/onlinegraphic.js diff --git a/mojotrollz/api/api_mojotrollz.php b/mojotrollz/api/api_mojotrollz.php index 4f25d0c..9f28360 100644 --- a/mojotrollz/api/api_mojotrollz.php +++ b/mojotrollz/api/api_mojotrollz.php @@ -1,2 +1,7 @@ &1');} + $res = shell_exec('/home/mojotrolls/mojo_zero/realm status 2>&1'); + $res == '1' ? new WOW_STATS_ONLINE() : new WOW_STATS_OFLINE(); + return $res == '1' ? 'on' : 'off';} } \ No newline at end of file diff --git a/mojotrollz/api/world/world.php b/mojotrollz/api/world/world.php index 892bfd7..684d0a2 100644 --- a/mojotrollz/api/world/world.php +++ b/mojotrollz/api/world/world.php @@ -1,5 +1,7 @@ &1');} + $res = shell_exec('/home/mojotrolls/mojo_zero/world status 2>&1'); + $res == '1' ? new WOW_STATS_ONLINE() : new WOW_STATS_OFLINE(); + return $res == '1' ? 'on' : 'off';} } diff --git a/mojotrollz/autoload.inc.php b/mojotrollz/autoload.inc.php index d7f0970..3ce5a8f 100644 --- a/mojotrollz/autoload.inc.php +++ b/mojotrollz/autoload.inc.php @@ -1,9 +1,8 @@ registerFolder(dirname(__FILE__).'/tbl/definitions/','DBD\DEFINITIONS'); //$autoload->registerFolder(dirname(__FILE__).'/tbl/data/','DBD\DATA'); //$autoload->registerFolder(dirname(__FILE__).'/tbl/data_processed/','DBD\DATA_PROCESSED'); \ No newline at end of file diff --git a/mojotrollz/dbd/qq/ONLINE_STATS.php b/mojotrollz/dbd/qq/ONLINE_STATS.php new file mode 100644 index 0000000..463ca88 --- /dev/null +++ b/mojotrollz/dbd/qq/ONLINE_STATS.php @@ -0,0 +1,18 @@ +'. ''. ''. + ''. + ''. ''. + ''. ''. ''; } diff --git a/mojotrollz/page/default_page/default_page_login.tpl b/mojotrollz/page/default_page/default_page_login.tpl index 1bfdd11..d3073cd 100644 --- a/mojotrollz/page/default_page/default_page_login.tpl +++ b/mojotrollz/page/default_page/default_page_login.tpl @@ -27,4 +27,5 @@ type="submit" id="login_submit">${basic_login}
- \ No newline at end of file + +
\ No newline at end of file diff --git a/mojotrollz/page/default_page/js/onlinegraphic.js b/mojotrollz/page/default_page/js/onlinegraphic.js new file mode 100644 index 0000000..78952b1 --- /dev/null +++ b/mojotrollz/page/default_page/js/onlinegraphic.js @@ -0,0 +1,22 @@ +function load_visualisation(id){ + $.getJSON('./api.php?call=stats',function(json){ + if(!json || json.status != true || !json.result){ + return; + } + json = json.result; + var data = new google.visualization.DataTable(); + first = true; + $.each(json[0], function(key, value){ + if(first){ + data.addColumn('datetime',key); + first = false; + } else { + data.addColumn('number',key); + } + }); + $.each(json, function(key, value){first = true; data.addRow($.map(value, function(v) { if(first){first=false;return [new Date(v)];}else{return [(v == null || parseFloat(v) <= 0) ? 0 : parseFloat(v)];}}));}); + + var options = {title: id, backgroundColor: 'darkslategrey', aggregationTarget: 'category', selectionMode: 'multiple', curveType: 'function', /*focusTarget: 'category',*/ chartArea:{left:20,top:40}, interpolateNulls: false, height: "200"}; + new google.visualization.LineChart(document.getElementById(id)).draw(data, options); + }); +} \ No newline at end of file diff --git a/mojotrollz/page/default_page/js/wizard.js b/mojotrollz/page/default_page/js/wizard.js index d5b6602..2aabff2 100644 --- a/mojotrollz/page/default_page/js/wizard.js +++ b/mojotrollz/page/default_page/js/wizard.js @@ -22,6 +22,7 @@ $(document).ready(function() { $('#start a').click(function() { load_wizard_details();}); + load_visualisation('onlinestats'); }); function load_wizard_details(){ From 7673c1dfc1910d3396659cf6d09b0b64de1aafcb Mon Sep 17 00:00:00 2001 From: rylon Date: Fri, 20 Jun 2014 16:39:40 +0200 Subject: [PATCH 03/33] fixed console result to be parsed as int --- mojotrollz/api/realm/realm.php | 4 ++-- mojotrollz/api/world/world.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mojotrollz/api/realm/realm.php b/mojotrollz/api/realm/realm.php index 6de927a..072cae1 100644 --- a/mojotrollz/api/realm/realm.php +++ b/mojotrollz/api/realm/realm.php @@ -2,6 +2,6 @@ class realm { public static function status(){ $res = shell_exec('/home/mojotrolls/mojo_zero/realm status 2>&1'); - $res == '1' ? new WOW_STATS_ONLINE() : new WOW_STATS_OFLINE(); - return $res == '1' ? 'on' : 'off';} + ($res == 1) ? new WOW_STATS_ONLINE() : new WOW_STATS_OFLINE(); + return ($res == 1) ? 'on' : 'off';} } \ No newline at end of file diff --git a/mojotrollz/api/world/world.php b/mojotrollz/api/world/world.php index 684d0a2..a972718 100644 --- a/mojotrollz/api/world/world.php +++ b/mojotrollz/api/world/world.php @@ -2,6 +2,6 @@ class world { public static function status(){ $res = shell_exec('/home/mojotrolls/mojo_zero/world status 2>&1'); - $res == '1' ? new WOW_STATS_ONLINE() : new WOW_STATS_OFLINE(); - return $res == '1' ? 'on' : 'off';} + ($res == 1) ? new WOW_STATS_ONLINE() : new WOW_STATS_OFLINE(); + return ($res == 1) ? 'on' : 'off';} } From 8427657b642129ff2b5b99ca8791447043279d27 Mon Sep 17 00:00:00 2001 From: rylon Date: Fri, 20 Jun 2014 19:32:40 +0200 Subject: [PATCH 04/33] playercount, better stats --- mojotrollz/api/autoload.inc.php | 3 ++- mojotrollz/api/database/database.php | 7 +++++++ mojotrollz/api/realm/realm.php | 2 +- mojotrollz/api/world/world.php | 2 +- mojotrollz/dbd/db/mangos_chars.php | 2 +- mojotrollz/dbd/qq/ONLINE_STATS.php | 6 ++++-- mojotrollz/dbd/qq/PLAYER_ONLINE.php | 13 +++++++++++++ mojotrollz/log/WOW_STATS_OFLINE.php | 2 -- mojotrollz/log/WOW_STATS_ONLINE.php | 2 -- mojotrollz/log/WOW_STATS_PLAYER.php | 6 ------ mojotrollz/log/WOW_STATS_PLAYER_ONLINE.php | 2 ++ mojotrollz/log/WOW_STATS_REALM_OFFLINE.php | 2 ++ mojotrollz/log/WOW_STATS_REALM_ONLINE.php | 2 ++ mojotrollz/log/WOW_STATS_WORLD_OFFLINE.php | 2 ++ mojotrollz/log/WOW_STATS_WORLD_ONLINE.php | 2 ++ mojotrollz/page/default_page/default_page.php | 1 + .../page/default_page/default_page_serverinfo.tpl | 1 + 17 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 mojotrollz/api/database/database.php create mode 100644 mojotrollz/dbd/qq/PLAYER_ONLINE.php delete mode 100644 mojotrollz/log/WOW_STATS_OFLINE.php delete mode 100644 mojotrollz/log/WOW_STATS_ONLINE.php delete mode 100644 mojotrollz/log/WOW_STATS_PLAYER.php create mode 100644 mojotrollz/log/WOW_STATS_PLAYER_ONLINE.php create mode 100644 mojotrollz/log/WOW_STATS_REALM_OFFLINE.php create mode 100644 mojotrollz/log/WOW_STATS_REALM_ONLINE.php create mode 100644 mojotrollz/log/WOW_STATS_WORLD_OFFLINE.php create mode 100644 mojotrollz/log/WOW_STATS_WORLD_ONLINE.php diff --git a/mojotrollz/api/autoload.inc.php b/mojotrollz/api/autoload.inc.php index fa2d14e..cfd6daf 100644 --- a/mojotrollz/api/autoload.inc.php +++ b/mojotrollz/api/autoload.inc.php @@ -1,4 +1,5 @@ &1'); - ($res == 1) ? new WOW_STATS_ONLINE() : new WOW_STATS_OFLINE(); + ($res == 1) ? new WOW_STATS_REALM_ONLINE() : new WOW_STATS_REALM_OFFLINE(); return ($res == 1) ? 'on' : 'off';} } \ No newline at end of file diff --git a/mojotrollz/api/world/world.php b/mojotrollz/api/world/world.php index a972718..9b5ea3a 100644 --- a/mojotrollz/api/world/world.php +++ b/mojotrollz/api/world/world.php @@ -2,6 +2,6 @@ class world { public static function status(){ $res = shell_exec('/home/mojotrolls/mojo_zero/world status 2>&1'); - ($res == 1) ? new WOW_STATS_ONLINE() : new WOW_STATS_OFLINE(); + ($res == 1) ? new WOW_STATS_WORLD_ONLINE() : new WOW_STATS_WORLD_OFFLINE(); return ($res == 1) ? 'on' : 'off';} } diff --git a/mojotrollz/dbd/db/mangos_chars.php b/mojotrollz/dbd/db/mangos_chars.php index e1e6b98..5ce9680 100644 --- a/mojotrollz/dbd/db/mangos_chars.php +++ b/mojotrollz/dbd/db/mangos_chars.php @@ -4,5 +4,5 @@ namespace DBD; class mangos_chars extends \SYSTEM\DB\DBInfoMYS { public function __construct() { - parent::__construct('mangos_one_chars', 'mojotrolls_dev', 'dsjgfasudzfsvad', '127.0.0.1');} + parent::__construct('mangos_zero_chars', 'mojotrolls_dev', 'dsjgfasudzfsvad', '127.0.0.1');} } diff --git a/mojotrollz/dbd/qq/ONLINE_STATS.php b/mojotrollz/dbd/qq/ONLINE_STATS.php index 463ca88..8349f71 100644 --- a/mojotrollz/dbd/qq/ONLINE_STATS.php +++ b/mojotrollz/dbd/qq/ONLINE_STATS.php @@ -8,8 +8,10 @@ class ONLINE_STATS extends \SYSTEM\DB\QP { '', //mys 'SELECT DATE_FORMAT(FROM_UNIXTIME(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.') - MOD(UNIX_TIMESTAMP('.\SYSTEM\DBD\system_log::FIELD_TIME.'),?)),"%Y/%m/%d %H:%i:%s") as day,' - .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'WOW_STATS_ONLINE\' then 1 else 0 end) online,' - .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'WOW_STATS_OFLINE\' then 1 else 0 end) Ofline' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'WOW_STATS_REALM_ONLINE\' then 1 else 0 end) realm_on,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'WOW_STATS_REALM_OFFLINE\' then 1 else 0 end) realm_off,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'WOW_STATS_WORLD_OFFLINE\' then 1 else 0 end) world_off,' + .'sum(case when '.\SYSTEM\DBD\system_log::FIELD_CLASS.' = \'WOW_STATS_WORLD_ONLINE\' then 1 else 0 end) world_on' .' FROM '.\SYSTEM\DBD\system_log::NAME_MYS .' GROUP BY day' .' ORDER BY day DESC' diff --git a/mojotrollz/dbd/qq/PLAYER_ONLINE.php b/mojotrollz/dbd/qq/PLAYER_ONLINE.php new file mode 100644 index 0000000..a26cdb5 --- /dev/null +++ b/mojotrollz/dbd/qq/PLAYER_ONLINE.php @@ -0,0 +1,13 @@ +This Server is currently closed for the Public. Be gone.

Realm Server: ${realm_status}

World Server: ${world_status}

+

Players Online: ${player_online}

Server Help

Download realmlist.wtf

From 2c63c828d2a21d5f0ed24ffebb0f11bd164521e2 Mon Sep 17 00:00:00 2001 From: rylon Date: Sat, 21 Jun 2014 02:26:15 +0200 Subject: [PATCH 05/33] player count in graphic --- mojotrollz/api/database/database.php | 2 +- mojotrollz/dbd/qq/ONLINE_STATS.php | 3 ++- mojotrollz/dbd/qq/PLAYER_ONLINE.php | 2 +- mojotrollz/log/WOW_STATS_PLAYER_ONLINE.php | 5 ++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mojotrollz/api/database/database.php b/mojotrollz/api/database/database.php index d009585..af43a2d 100644 --- a/mojotrollz/api/database/database.php +++ b/mojotrollz/api/database/database.php @@ -1,7 +1,7 @@ Date: Sat, 21 Jun 2014 02:35:37 +0200 Subject: [PATCH 06/33] fixed floats on default-page, mojopulse --- mojotrollz/page/default_page/default_page.tpl | 2 +- mojotrollz/page/default_page/default_page_login.tpl | 2 +- mojotrollz/page/default_page/default_page_welcome.tpl | 2 +- mojotrollz/page/default_page/js/wizard.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mojotrollz/page/default_page/default_page.tpl b/mojotrollz/page/default_page/default_page.tpl index c883ad5..c67052b 100644 --- a/mojotrollz/page/default_page/default_page.tpl +++ b/mojotrollz/page/default_page/default_page.tpl @@ -15,7 +15,7 @@
-
+
${default_page_welcome}
diff --git a/mojotrollz/page/default_page/default_page_login.tpl b/mojotrollz/page/default_page/default_page_login.tpl index d3073cd..87f6fb4 100644 --- a/mojotrollz/page/default_page/default_page_login.tpl +++ b/mojotrollz/page/default_page/default_page_login.tpl @@ -28,4 +28,4 @@ id="login_submit">${basic_login}
-
\ No newline at end of file +
\ No newline at end of file diff --git a/mojotrollz/page/default_page/default_page_welcome.tpl b/mojotrollz/page/default_page/default_page_welcome.tpl index 7af4fa6..d487ea4 100644 --- a/mojotrollz/page/default_page/default_page_welcome.tpl +++ b/mojotrollz/page/default_page/default_page_welcome.tpl @@ -6,6 +6,6 @@ Feel free to snoop around.
-
+
\ No newline at end of file diff --git a/mojotrollz/page/default_page/js/wizard.js b/mojotrollz/page/default_page/js/wizard.js index 2aabff2..b1f324c 100644 --- a/mojotrollz/page/default_page/js/wizard.js +++ b/mojotrollz/page/default_page/js/wizard.js @@ -22,7 +22,7 @@ $(document).ready(function() { $('#start a').click(function() { load_wizard_details();}); - load_visualisation('onlinestats'); + load_visualisation('mojopulse'); }); function load_wizard_details(){ From 44651e4c794c70c97c3c3707e6f4330a6c602c31 Mon Sep 17 00:00:00 2001 From: rylon Date: Sun, 22 Jun 2014 05:04:38 +0200 Subject: [PATCH 07/33] style fixes --- .../page/default_page/css/default_page.css | 4 + mojotrollz/page/default_page/default_page.tpl | 4 +- .../default_page/default_page_welcome.tpl | 4 +- mojotrollz/page/default_page/js/wizard.js | 78 +++++++++++++++++++ 4 files changed, 86 insertions(+), 4 deletions(-) diff --git a/mojotrollz/page/default_page/css/default_page.css b/mojotrollz/page/default_page/css/default_page.css index 764bfdb..176c183 100644 --- a/mojotrollz/page/default_page/css/default_page.css +++ b/mojotrollz/page/default_page/css/default_page.css @@ -1,3 +1,7 @@ +#mojopulse { + padding-top: 15px; +} + body { color: gold; } diff --git a/mojotrollz/page/default_page/default_page.tpl b/mojotrollz/page/default_page/default_page.tpl index c67052b..70c76d9 100644 --- a/mojotrollz/page/default_page/default_page.tpl +++ b/mojotrollz/page/default_page/default_page.tpl @@ -20,7 +20,7 @@
${default_page_welcome}
-
+
@@ -39,7 +39,7 @@
-
+
diff --git a/mojotrollz/page/default_page/default_page_welcome.tpl b/mojotrollz/page/default_page/default_page_welcome.tpl index d487ea4..c2dbfce 100644 --- a/mojotrollz/page/default_page/default_page_welcome.tpl +++ b/mojotrollz/page/default_page/default_page_welcome.tpl @@ -5,7 +5,7 @@
Feel free to snoop around. -
-
+
+
\ No newline at end of file diff --git a/mojotrollz/page/default_page/js/wizard.js b/mojotrollz/page/default_page/js/wizard.js index b1f324c..110239e 100644 --- a/mojotrollz/page/default_page/js/wizard.js +++ b/mojotrollz/page/default_page/js/wizard.js @@ -1,3 +1,81 @@ +/* + +divs -> content wird geladen +eindeutige id +url -> formulardaten +function die danach ausgeführt wird + +id : div -> url -> func +default : div -> url -> func //default load + +hole array via json +lese id +stelle dar id mithilfe von json + +// Define a class like this +function Person(name, gender){ + + // Add object properties like this + this.name = name; + this.gender = gender; +} + +// Add methods like this. All Person objects will be able to invoke this +Person.prototype.speak = function(){ + alert("Howdy, my name is" + this.name); +} + +// Instantiate new objects with 'new' +var person = new Person("Bob", "M"); + +// Invoke methods like this +person.speak(); // alerts "Howdy, my name is Bob" + + */ + +function SYSTEM(endpoint){ + this.endpoint = endpoint; + this.statedef = null; +} +SYSTEM.prototype.load_statedef = function(){ + if(!this.statedef){ + $.getJSON(this.endpoint+'?call=statedef', function (data) { + if(data['status']){ + this.statedef = data['result']; + } else { + alert("Problem with the statedef");} + }); + } +} +SYSTEM.prototype.load = function(id){ + this.load_statedef(); + var push = true; + this.statedef.forEach(function(entry) { + if(entry['id'] == id){ + if(push){ + window.history.pushState(null, "", id); + push = false;} + var fn = window[settings.entry['function']]; + if(typeof fn !== 'function') { + fn = null;} + $(entry['div']).load(entry['url'],fn); + } + }); +} + +SYSTEM.prototype.cur_state = function() { + var pathName = window.location.pathname, + pageName = ""; + + if (pathName.indexOf("/") != -1) { + pageName = pathName.split("/").pop(); + } else { + pageName = pathName; + } + + return pageName; +} + $(document).ready(function() { $("#login_form input").not("[type=submit]").jqBootstrapValidation({ preventSubmit: true, From e9f86e2738a7a135dd4969250046b166b3c8618d Mon Sep 17 00:00:00 2001 From: rylon Date: Mon, 23 Jun 2014 00:09:51 +0200 Subject: [PATCH 08/33] char details, session char creation start --- mojotrollz/api/api_mojotrollz.php | 2 + mojotrollz/api/autoload.inc.php | 3 +- mojotrollz/api/charcreation/cc_session.php | 12 ++++ mojotrollz/api/charcreation/charcreation.php | 18 ++++++ .../charcreation/charcreation_validator.php | 28 ++++++++++ mojotrollz/page/wizard_details/details.tpl | 56 ++++++++++--------- .../page/wizard_details/js/wizard_details.js | 21 ++++++- .../page/wizard_toolbar/wizard_toolbar.php | 15 ++--- .../page/wizard_toolbar/wizard_toolbar.tpl | 6 +- 9 files changed, 121 insertions(+), 40 deletions(-) create mode 100644 mojotrollz/api/charcreation/cc_session.php create mode 100644 mojotrollz/api/charcreation/charcreation.php create mode 100644 mojotrollz/api/charcreation/charcreation_validator.php diff --git a/mojotrollz/api/api_mojotrollz.php b/mojotrollz/api/api_mojotrollz.php index 9f28360..884a1aa 100644 --- a/mojotrollz/api/api_mojotrollz.php +++ b/mojotrollz/api/api_mojotrollz.php @@ -4,4 +4,6 @@ class api_mojotrollz extends \SYSTEM\API\api_system { public static function call_stats(){ $result = \DBD\ONLINE_STATS::QA(array('3600')); return \SYSTEM\LOG\JsonResult::toString($result);} + public static function call_charcreation($json=NULL){ + return charcreation::data($json);} } diff --git a/mojotrollz/api/autoload.inc.php b/mojotrollz/api/autoload.inc.php index cfd6daf..bda1015 100644 --- a/mojotrollz/api/autoload.inc.php +++ b/mojotrollz/api/autoload.inc.php @@ -2,4 +2,5 @@ SYSTEM\autoload::registerFolder(dirname(__FILE__),''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/realm',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/world',''); -SYSTEM\autoload::registerFolder(dirname(__FILE__).'/database',''); \ No newline at end of file +SYSTEM\autoload::registerFolder(dirname(__FILE__).'/database',''); +SYSTEM\autoload::registerFolder(dirname(__FILE__).'/charcreation',''); \ No newline at end of file diff --git a/mojotrollz/api/charcreation/cc_session.php b/mojotrollz/api/charcreation/cc_session.php new file mode 100644 index 0000000..6ed40bd --- /dev/null +++ b/mojotrollz/api/charcreation/cc_session.php @@ -0,0 +1,12 @@ +$value){ + if(method_exists('charcreation_validator',$key)){ + call_user_func('charcreation_validator::'.$key,$value);} + } + } + return JsonResult::toString(\SYSTEM\SECURITY\Security::load(self::MOJO_CC_SESSIONKEY)); + } +} + diff --git a/mojotrollz/api/charcreation/charcreation_validator.php b/mojotrollz/api/charcreation/charcreation_validator.php new file mode 100644 index 0000000..1fdbab8 --- /dev/null +++ b/mojotrollz/api/charcreation/charcreation_validator.php @@ -0,0 +1,28 @@ +char_name = $value; + \SYSTEM\SECURITY\Security::save(charcreation::MOJO_CC_SESSIONKEY,$data); + } + public static function char_gender($value){ + $data = \SYSTEM\SECURITY\Security::load(charcreation::MOJO_CC_SESSIONKEY); + $data->char_gender = $value; + \SYSTEM\SECURITY\Security::save(charcreation::MOJO_CC_SESSIONKEY,$data); + } + public static function char_race($value){ + $data = \SYSTEM\SECURITY\Security::load(charcreation::MOJO_CC_SESSIONKEY); + $data->char_race = $value; + \SYSTEM\SECURITY\Security::save(charcreation::MOJO_CC_SESSIONKEY,$data); + } + public static function char_class($value){ + $data = \SYSTEM\SECURITY\Security::load(charcreation::MOJO_CC_SESSIONKEY); + $data->char_class = $value; + \SYSTEM\SECURITY\Security::save(charcreation::MOJO_CC_SESSIONKEY,$data); + } + public static function char_appearance($value){} + public static function char_skill_tree($value){} + public static function char_equip($value){} + public static function char_guild($value){} + public static function char_spawn($value){} +} \ No newline at end of file diff --git a/mojotrollz/page/wizard_details/details.tpl b/mojotrollz/page/wizard_details/details.tpl index a4a099a..dba9af6 100644 --- a/mojotrollz/page/wizard_details/details.tpl +++ b/mojotrollz/page/wizard_details/details.tpl @@ -1,42 +1,44 @@

- - + +
- - - - + + + +
- - - - + + + +
- - - - + + + +
- - - - + + + +
- - + +
- - + +
- - + +
- - + + +
+
-
${default_page_toolbar}
+
${default_page_toolbar}
diff --git a/mojotrollz/page/wizard_details/js/wizard_details.js b/mojotrollz/page/wizard_details/js/wizard_details.js index 5363d5e..137b884 100644 --- a/mojotrollz/page/wizard_details/js/wizard_details.js +++ b/mojotrollz/page/wizard_details/js/wizard_details.js @@ -1,15 +1,27 @@ function wizard_details (){ + $('#charname').keyup(function(){ + $.get('./api.php?call=charcreation&json={"char_name" : "'+$(this).val()+'"}',function(){ + load_toolbar(); + }) + }) + $('#details_gender a').click(function(){ $('#details_gender a').removeClass('selected'); $('#details_race a').removeClass('selected'); $('#details_class a').removeClass('selected'); - $(this).addClass('selected'); + $(this).addClass('selected'); + $.get('./api.php?call=charcreation&json={"char_gender" : "'+$(this).attr('gender')+'"}',function(){ + load_toolbar(); + }) }); $('#details_race a').click(function(){ $('#details_race a').removeClass('selected'); - $(this).addClass('selected'); + $(this).addClass('selected'); + $.get('./api.php?call=charcreation&json={"char_race" : "'+$(this).attr('race')+'", "char_gender" : "'+$(this).attr('gender')+'"}',function(){ + load_toolbar(); + }) }); $('#details_class a').click(function(){ @@ -38,6 +50,11 @@ function wizard_details (){ if(!$('#details_race .selected').hasClass('fadein')){ $('#details_race .selected').removeClass('selected'); } + + $.get('./api.php?call=charcreation&json={"char_class" : "'+$(this).attr('cclass')+'"}',function(){ + load_toolbar(); + }) + }); $('#content .male').click(function (){ diff --git a/mojotrollz/page/wizard_toolbar/wizard_toolbar.php b/mojotrollz/page/wizard_toolbar/wizard_toolbar.php index c229fa2..7023e7e 100644 --- a/mojotrollz/page/wizard_toolbar/wizard_toolbar.php +++ b/mojotrollz/page/wizard_toolbar/wizard_toolbar.php @@ -1,14 +1,15 @@ js(); - $vars['css'] = $this->css(); + $vars = array('char_name' => 'Choose your name', 'char_class' => 'hunter', 'char_gender' => 'male', 'char_race' => 'human', 'char_class' => 'druid'); + if($data = \SYSTEM\SECURITY\Security::load(charcreation::MOJO_CC_SESSIONKEY)){ + $vars['char_name'] = $data->char_name; + $vars['char_class'] = $data->char_class; + $vars['char_gender'] = $data->char_gender; + $vars['char_race'] = $data->char_race; + $vars['char_class'] = $data->char_class; + } $vars['WOWICONS'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=wowicons&id='; //$vars['PICPATH'] = \SYSTEM\WEBPATH(new PPAGE(), 'wizard_toolbar/img/'); //$vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE)); diff --git a/mojotrollz/page/wizard_toolbar/wizard_toolbar.tpl b/mojotrollz/page/wizard_toolbar/wizard_toolbar.tpl index 1a6b9bf..9fc7d07 100644 --- a/mojotrollz/page/wizard_toolbar/wizard_toolbar.tpl +++ b/mojotrollz/page/wizard_toolbar/wizard_toolbar.tpl @@ -1,7 +1,7 @@ -Mein Charname - - +${char_name} + + From 9ed14f94b644b1a94c131e5b3039ee29b262674e Mon Sep 17 00:00:00 2001 From: rylon Date: Mon, 23 Jun 2014 04:19:39 +0200 Subject: [PATCH 09/33] load info --- mojotrollz/api/charcreation/charcreation.php | 16 ++++- mojotrollz/dbd/tbl/locale_string.php | 3 +- mojotrollz/page/default_info/default_info.php | 15 +++++ mojotrollz/page/page_mojotrollz.php | 3 + mojotrollz/page/register_page_classes.php | 27 ++++----- mojotrollz/page/wizard_details/details.tpl | 60 +++++++++---------- .../page/wizard_details/js/wizard_details.js | 5 ++ .../page/wizard_details/wizard_details.php | 5 +- .../page/wizard_toolbar/wizard_toolbar.php | 9 +-- 9 files changed, 85 insertions(+), 58 deletions(-) create mode 100644 mojotrollz/page/default_info/default_info.php diff --git a/mojotrollz/api/charcreation/charcreation.php b/mojotrollz/api/charcreation/charcreation.php index be8cbb4..542e09a 100644 --- a/mojotrollz/api/charcreation/charcreation.php +++ b/mojotrollz/api/charcreation/charcreation.php @@ -12,7 +12,21 @@ class charcreation { call_user_func('charcreation_validator::'.$key,$value);} } } - return JsonResult::toString(\SYSTEM\SECURITY\Security::load(self::MOJO_CC_SESSIONKEY)); + return JsonResult::toString(self::get()); } + + public static function get(){ + $vars = array('char_name' => 'Choose your name', 'char_gender' => 'default', 'char_race' => 'default', 'char_class' => 'default'); + if($data = \SYSTEM\SECURITY\Security::load(charcreation::MOJO_CC_SESSIONKEY)){ + $vars['char_name'] = $data->char_name; + $vars['char_class'] = $data->char_class; + $vars['char_gender'] = $data->char_gender; + $vars['char_race'] = $data->char_race; + $vars['char_class'] = $data->char_class; + } + return $vars; + } + + public static function checkClassRace($class,$race){ return true;} //todo } diff --git a/mojotrollz/dbd/tbl/locale_string.php b/mojotrollz/dbd/tbl/locale_string.php index 3eb3b46..2daa0cc 100644 --- a/mojotrollz/dbd/tbl/locale_string.php +++ b/mojotrollz/dbd/tbl/locale_string.php @@ -5,8 +5,7 @@ namespace DBD; class locale_string extends \SYSTEM\DBD\system_locale_string { const VALUE_CATEGORY_MAINPAGE = 100; -const VALUE_CATEGORY_WOW_INFOTEXT_RACES = 120; -const VALUE_CATEGORY_WOW_INFOTEXT_HELP = 130; +const VALUE_CATEGORY_WOW_INFOTEXT = 120; const VALUE_CATEGORY_WOW_SERVERINFO = 140; } \ No newline at end of file diff --git a/mojotrollz/page/default_info/default_info.php b/mojotrollz/page/default_info/default_info.php new file mode 100644 index 0000000..d1c329e --- /dev/null +++ b/mojotrollz/page/default_info/default_info.php @@ -0,0 +1,15 @@ +id =$id; + } + public function html(){ + $data = \SYSTEM\locale::getStrings(\DBD\locale_string::VALUE_CATEGORY_WOW_INFOTEXT); + if(!array_key_exists($this->id, $data)){ + return $data['default'];} + return $data[$this->id]; + } +} + diff --git a/mojotrollz/page/page_mojotrollz.php b/mojotrollz/page/page_mojotrollz.php index 24c7db5..b003175 100644 --- a/mojotrollz/page/page_mojotrollz.php +++ b/mojotrollz/page/page_mojotrollz.php @@ -40,4 +40,7 @@ class page_mojotrollz extends \SYSTEM\API\api_default { public static function action_user_logout(){ return new user_logout();} + + public static function action_default_info($id){ + return new default_info($id);} } diff --git a/mojotrollz/page/register_page_classes.php b/mojotrollz/page/register_page_classes.php index 85100ae..31f4a40 100644 --- a/mojotrollz/page/register_page_classes.php +++ b/mojotrollz/page/register_page_classes.php @@ -1,15 +1,14 @@ -
- - +
+ +
- - - - + + + +
- - - - + + + +
- - - - + + + +
- - - - + + + +
- - + +
- - + +
- - + +
- - + +
- +
-
From 152e0c3a59b83eb8e7d45184a5223996d44dfa7a Mon Sep 17 00:00:00 2001 From: rylon Date: Mon, 23 Jun 2014 15:16:17 +0200 Subject: [PATCH 12/33] more wizard details --- mojotrollz/api/charcreation/cc_session.php | 12 ----- mojotrollz/api/charcreation/charcreation.php | 26 ++++----- .../charcreation/charcreation_validator.php | 12 +++-- mojotrollz/page/wizard_details/details.tpl | 8 ++- .../page/wizard_details/js/wizard_details.js | 54 ++++--------------- .../page/wizard_details/wizard_details.php | 2 +- .../page/wizard_toolbar/wizard_toolbar.php | 4 +- 7 files changed, 36 insertions(+), 82 deletions(-) delete mode 100644 mojotrollz/api/charcreation/cc_session.php diff --git a/mojotrollz/api/charcreation/cc_session.php b/mojotrollz/api/charcreation/cc_session.php deleted file mode 100644 index 6ed40bd..0000000 --- a/mojotrollz/api/charcreation/cc_session.php +++ /dev/null @@ -1,12 +0,0 @@ - 'Charactername', 'char_gender' => 'default', 'char_race' => 'default', 'char_class' => 'default'); - if($data = \SYSTEM\SECURITY\Security::load(charcreation::MOJO_CC_SESSIONKEY)){ - $vars['char_name'] = $data->char_name; - $vars['char_class'] = $data->char_class; - $vars['char_gender'] = $data->char_gender; - $vars['char_race'] = $data->char_race; - $vars['char_class'] = $data->char_class; - } - return $vars; - } + private static function session_default(){ + return array( 'char_name' => self::DEFAULT_CHAR_NAME, + 'char_gender' => 'default', + 'char_race' => 'default', + 'char_class' => 'default', + 'char_appearance' => 0, + 'char_skill_tree' => 0, + 'char_equip' => 0, + 'char_guild' => 0, + 'char_spawn' => 0);} public static function checkClassRace($class,$race){ return true;} //todo } diff --git a/mojotrollz/api/charcreation/charcreation_validator.php b/mojotrollz/api/charcreation/charcreation_validator.php index 1fdbab8..9c6ed2e 100644 --- a/mojotrollz/api/charcreation/charcreation_validator.php +++ b/mojotrollz/api/charcreation/charcreation_validator.php @@ -2,22 +2,26 @@ class charcreation_validator { public static function char_name($value){ $data = \SYSTEM\SECURITY\Security::load(charcreation::MOJO_CC_SESSIONKEY); - $data->char_name = $value; + if( strlen($value) > 12 || + preg_match('/[^A-Za-z]/',$value)){ + $data['char_name'] = charcreation::DEFAULT_CHAR_NAME; + } else { + $data['char_name'] = $value;} \SYSTEM\SECURITY\Security::save(charcreation::MOJO_CC_SESSIONKEY,$data); } public static function char_gender($value){ $data = \SYSTEM\SECURITY\Security::load(charcreation::MOJO_CC_SESSIONKEY); - $data->char_gender = $value; + $data['char_gender'] = $value; \SYSTEM\SECURITY\Security::save(charcreation::MOJO_CC_SESSIONKEY,$data); } public static function char_race($value){ $data = \SYSTEM\SECURITY\Security::load(charcreation::MOJO_CC_SESSIONKEY); - $data->char_race = $value; + $data['char_race'] = $value; \SYSTEM\SECURITY\Security::save(charcreation::MOJO_CC_SESSIONKEY,$data); } public static function char_class($value){ $data = \SYSTEM\SECURITY\Security::load(charcreation::MOJO_CC_SESSIONKEY); - $data->char_class = $value; + $data['char_class'] = $value; \SYSTEM\SECURITY\Security::save(charcreation::MOJO_CC_SESSIONKEY,$data); } public static function char_appearance($value){} diff --git a/mojotrollz/page/wizard_details/details.tpl b/mojotrollz/page/wizard_details/details.tpl index 969db26..ef09a35 100644 --- a/mojotrollz/page/wizard_details/details.tpl +++ b/mojotrollz/page/wizard_details/details.tpl @@ -1,6 +1,5 @@ -
-
+
@@ -29,7 +28,7 @@
- +
@@ -38,9 +37,8 @@
- +
-
diff --git a/system b/system index 51b7c68..b196e1c 160000 --- a/system +++ b/system @@ -1 +1 @@ -Subproject commit 51b7c6857ae7efbfdb4652652db527368332308c +Subproject commit b196e1cb7a403e4fabefc8ae686e6597b3f3eee5 From 2681c877b7fdc6ff9bdbb88f2e26032f758b2882 Mon Sep 17 00:00:00 2001 From: rylon Date: Mon, 23 Jun 2014 22:01:37 +0200 Subject: [PATCH 16/33] state system working, toolbar for details workin --- mojotrollz/page/default_page/default_page.php | 14 +++--- mojotrollz/page/default_page/default_page.tpl | 44 +------------------ mojotrollz/page/default_page/js/wizard.js | 40 +++++++++-------- .../default_page_login.tpl | 0 .../default_page_serverinfo.tpl | 0 .../default_page_toolbar.tpl | 0 .../default_page_welcome.tpl | 0 .../page/default_start/default_start.php | 21 +++++++++ .../page/default_start/default_start.tpl | 41 +++++++++++++++++ mojotrollz/page/page_mojotrollz.php | 7 ++- mojotrollz/page/register_page_classes.php | 5 ++- .../page/wizard_details/js/wizard_details.js | 3 +- .../page/wizard_toolbar/wizard_toolbar.php | 8 ++++ .../page/wizard_toolbar/wizard_toolbar.tpl | 4 +- 14 files changed, 110 insertions(+), 77 deletions(-) rename mojotrollz/page/{default_page => default_start}/default_page_login.tpl (100%) rename mojotrollz/page/{default_page => default_start}/default_page_serverinfo.tpl (100%) rename mojotrollz/page/{default_page => default_start}/default_page_toolbar.tpl (100%) rename mojotrollz/page/{default_page => default_start}/default_page_welcome.tpl (100%) create mode 100644 mojotrollz/page/default_start/default_start.php create mode 100644 mojotrollz/page/default_start/default_start.tpl diff --git a/mojotrollz/page/default_page/default_page.php b/mojotrollz/page/default_page/default_page.php index 146e38c..a1f6071 100644 --- a/mojotrollz/page/default_page/default_page.php +++ b/mojotrollz/page/default_page/default_page.php @@ -26,16 +26,16 @@ class default_page extends SYSTEM\PAGE\Page { $vars = array(); $vars['js'] = $this->js(); $vars['css'] = $this->css(); - $vars['default_page_welcome'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_welcome.tpl'), array()); - $vars['default_page_serverinfo'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_serverinfo.tpl'), array()); - $vars['default_page_login'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_login.tpl'), array()); - $vars['default_page_toolbar'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_toolbar.tpl'), array()); + //$vars['default_page_welcome'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_welcome.tpl'), array()); + //$vars['default_page_serverinfo'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_serverinfo.tpl'), array()); + //$vars['default_page_login'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_login.tpl'), array()); + //$vars['default_page_toolbar'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_toolbar.tpl'), array()); $vars['PICPATH'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=default_page&id='; $vars['copyright'] = ''; $vars['inprint'] = ''; - $vars['realm_status'] = realm::status(); - $vars['world_status'] = world::status(); - $vars['player_online'] = database::player_online(); + //$vars['realm_status'] = realm::status(); + //$vars['world_status'] = world::status(); + //$vars['player_online'] = database::player_online(); $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)); diff --git a/mojotrollz/page/default_page/default_page.tpl b/mojotrollz/page/default_page/default_page.tpl index 70c76d9..4f24732 100644 --- a/mojotrollz/page/default_page/default_page.tpl +++ b/mojotrollz/page/default_page/default_page.tpl @@ -17,49 +17,7 @@
-
-
${default_page_welcome}
-
-
-
-
-
-
-
-
-
-
${default_page_login}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
${default_page_serverinfo}
-
-
-
-
-
-
-
-
-
-
-
${default_page_toolbar}
-
+
+
+
+
+
+
+
+
+
+
+
${default_page_login}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
${default_page_serverinfo}
+
+
+
+
+
+
+
+
+
+
+
${default_page_toolbar}
\ No newline at end of file diff --git a/mojotrollz/page/page_mojotrollz.php b/mojotrollz/page/page_mojotrollz.php index b003175..068cd07 100644 --- a/mojotrollz/page/page_mojotrollz.php +++ b/mojotrollz/page/page_mojotrollz.php @@ -4,6 +4,9 @@ class page_mojotrollz extends \SYSTEM\API\api_default { public static function default_page(){ return new default_page();} + + public static function action_default_start(){ + return new default_start();} public static function action_wizard_details(){ return new wizard_details();} @@ -26,8 +29,8 @@ class page_mojotrollz extends \SYSTEM\API\api_default { public static function action_wizard_reg(){ return new wizard_reg();} - public static function action_wizard_toolbar(){ - return new wizard_toolbar();} + public static function action_wizard_toolbar($last,$next){ + return new wizard_toolbar($last,$next);} public static function action_user_news(){ return new user_news();} diff --git a/mojotrollz/page/register_page_classes.php b/mojotrollz/page/register_page_classes.php index 31f4a40..a5d62ae 100644 --- a/mojotrollz/page/register_page_classes.php +++ b/mojotrollz/page/register_page_classes.php @@ -1,6 +1,8 @@ last = $last; + $this->next = $next; + } public function html(){ $vars = json_decode(charcreation::data(),true)['result']; + $vars['last'] = $this->last; + $vars['next'] = $this->next; $vars['WOWICONS'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=wowicons&id='; return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'wizard_toolbar/wizard_toolbar.tpl'), $vars); } diff --git a/mojotrollz/page/wizard_toolbar/wizard_toolbar.tpl b/mojotrollz/page/wizard_toolbar/wizard_toolbar.tpl index 8db2cba..981274f 100644 --- a/mojotrollz/page/wizard_toolbar/wizard_toolbar.tpl +++ b/mojotrollz/page/wizard_toolbar/wizard_toolbar.tpl @@ -1,4 +1,4 @@ - + ${char_name} @@ -7,4 +7,4 @@ - \ No newline at end of file + \ No newline at end of file From c8f6e71a9096d8ab83eb5e0a7a1e77d771d1b822 Mon Sep 17 00:00:00 2001 From: rylon Date: Mon, 23 Jun 2014 23:55:16 +0200 Subject: [PATCH 17/33] implemented visuals, system js ajax call --- mojotrollz/page/default_page/default_page.php | 1 + mojotrollz/page/default_page/js/wizard.js | 50 ++++++++++--------- mojotrollz/page/wizard_details/details.tpl | 4 +- .../page/wizard_details/js/wizard_details.js | 20 ++++---- .../page/wizard_toolbar/wizard_toolbar.php | 2 +- .../page/wizard_visuals/js/wizard_visuals.js | 8 +++ .../page/wizard_visuals/wizard_visuals.php | 6 ++- .../page/wizard_visuals/wizard_visuals.tpl | 6 +++ 8 files changed, 59 insertions(+), 38 deletions(-) create mode 100644 mojotrollz/page/wizard_visuals/js/wizard_visuals.js create mode 100644 mojotrollz/page/wizard_visuals/wizard_visuals.tpl diff --git a/mojotrollz/page/default_page/default_page.php b/mojotrollz/page/default_page/default_page.php index a1f6071..cbec83c 100644 --- a/mojotrollz/page/default_page/default_page.php +++ b/mojotrollz/page/default_page/default_page.php @@ -13,6 +13,7 @@ class default_page extends SYSTEM\PAGE\Page { ''. ''. ''. + ''. ''; } diff --git a/mojotrollz/page/default_page/js/wizard.js b/mojotrollz/page/default_page/js/wizard.js index b41e36e..2d20f68 100644 --- a/mojotrollz/page/default_page/js/wizard.js +++ b/mojotrollz/page/default_page/js/wizard.js @@ -38,25 +38,32 @@ function SYSTEM(endpoint, group){ this.group = group; this.pagestates = null; } + +SYSTEM.prototype.handle_call_pagestates = function (data) { + if(data['status']){ + newps = data['result']; + console.log('SYSTEM: loaded Pagestates'); + result = true; + } else { + console.log('SYSTEM: Problem with your Pagestates.'); + result = false;} +} + +SYSTEM.prototype.call = function(call,success,data,data_type,async){ + $.ajax({ + async: async, + data: data, + dataType: data_type, + url: this.endpoint+'?'+call, + success: success + }); +} + SYSTEM.prototype.load_pagestates = function(){ result = false; newps = this.pagestates; if(!this.pagestates){ - $.ajax({ - async: false, - dataType: "json", - url: this.endpoint+'?call=pagestates&group='+this.group, - data: {}, - success: function (data) { - if(data['status']){ - newps = data['result']; - console.log('SYSTEM: loaded Pagestates'); - result = true; - } else { - console.log('SYSTEM: Problem with your Pagestates.'); - result = false;} - } - }); + this.call('call=pagestates&group='+this.group,this.handle_call_pagestates,{},"json",false); } else { result = true;} this.pagestates = newps; return result; @@ -100,6 +107,10 @@ $(document).ready(function() { sys.load('start'); }); + +function sendInfo(json,toolbar){ + $.get('./api.php?call=charcreation&json='+json,function(){sys.load(toolbar)})} + function init_start(){ register_login(); load_visualisation('mojopulse'); @@ -108,15 +119,6 @@ function init_start(){ sys.load('wizard_details');}); } -function init_wizard_details(){ - wizard_details(); - sys.load('wizard_details_toolbar');} - -function init_wizard_details_toolbar(){ - $('#last').click(function(){sys.load($(this).attr('sysload'));}); - $('#next').click(function(){sys.load($(this).attr('sysload'));}); -} - function register_login(){ $("#login_form input").not("[type=submit]").jqBootstrapValidation({ preventSubmit: true, diff --git a/mojotrollz/page/wizard_details/details.tpl b/mojotrollz/page/wizard_details/details.tpl index cafefff..d4f02d2 100644 --- a/mojotrollz/page/wizard_details/details.tpl +++ b/mojotrollz/page/wizard_details/details.tpl @@ -39,9 +39,9 @@
-