diff --git a/index.php b/index.php index e735c748..29d7a5d4 100644 --- a/index.php +++ b/index.php @@ -124,8 +124,8 @@ include ("GameEngine/Lang/".LANG.".php"); @@ -139,8 +139,8 @@ include ("GameEngine/Lang/".LANG.".php"); ".(time() - (3600*24))." AND tribe!=0 AND tribe!=4 AND tribe!=5"); + $active=(!empty($return))? mysqli_fetch_assoc($return)['Total']:0; echo $active; ?> @@ -155,7 +155,7 @@ include ("GameEngine/Lang/".LANG.".php"); ".(time() - (60*10))." AND tribe!=0 AND tribe!=4 AND tribe!=5"); $online=(!empty($return))? mysqli_num_rows($return):0; echo $online; diff --git a/install/data/sql.sql b/install/data/sql.sql index 6d02f420..28016fd4 100644 --- a/install/data/sql.sql +++ b/install/data/sql.sql @@ -1548,7 +1548,10 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%users` ( KEY `invited` (`invited`), KEY `lastupdate` (`lastupdate`), KEY `alliance` (`alliance`), - KEY `username` (`username`(25)) USING BTREE + KEY `username` (`username`(25)) USING BTREE, + KEY `tribe` (`tribe`), + KEY `timestamp` (`timestamp`), + KEY `timestamp-tribe` (`timestamp`,`tribe`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; -- diff --git a/sql_updates.txt b/sql_updates.txt index 4c67ba91..8c269f62 100644 --- a/sql_updates.txt +++ b/sql_updates.txt @@ -1,3 +1,7 @@ +-- 22.10.2017 -> SQL optimizations +ALTER TABLE `s1_users` ADD INDEX(`tribe`); +ALTER TABLE `s1_users` ADD INDEX `timestamp-tribe` (`timestamp`, `tribe`); + -- 22.10.2017 -> forum topics table and indexe changes ALTER TABLE `s1_forum_post` CHANGE `topic` `topic` INT NULL DEFAULT NULL; ALTER TABLE `s1_forum_post` CHANGE `owner` `owner` INT NULL DEFAULT NULL; diff --git a/todo.txt b/todo.txt index b6443d1b..bcd91b7c 100644 --- a/todo.txt +++ b/todo.txt @@ -1,4 +1,5 @@ - add checkbox when sending units for a raid to include the attack in the raid list, if eligible +- change "incoming attacker" title of the raid list icon when actually attacking a farm (it should be "Own attacking troops") - normalize forum tables - varchar is used for numeric values and is joined with int field - finish parts in Admin that are unfinished (mostly delete -X- buttons and Alliance settings) - add batching logic to mehods which get called too frequently and multiple times (example - Message::sendMessage() now that is sends messages for each forum post)