some small update

* moved site_closed to database, now you can close your site through
admin panel
* added option to admin panel: clear cache
* added experiencetable_rows configurable
* optimized OTS_Account->getGroupId(), now its using like 20 queries
less
* optimized OTS_Player->load($id) function, should perform faster
loading
* fixed highscores displaying of group outfits
This commit is contained in:
slawkens1
2017-05-19 02:30:39 +02:00
parent 6658eb5f20
commit 1310a49729
17 changed files with 265 additions and 93 deletions

View File

@@ -852,11 +852,7 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
public function getGroupId()
{
global $groups;
if(!isset($groups))
$groups = new OTS_Groups_List();
$group_id = 0;
global $db;;
if(fieldExist('group_id', 'accounts')) {
$query = $this->db->query('SELECT `group_id` FROM `accounts` WHERE `id` = ' . (int) $this->getId())->fetch();
// if anything was found
@@ -864,19 +860,11 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
return $query['group_id'];
}
// finds groups of all characters
foreach( $this->getPlayersList() as $player)
{
$group = $player->getGroup();
// checks if group's access level is higher then previouls found highest
if( $group->getId() > $group_id)
{
$group_id = $group->getId();
}
}
$db->query('SELECT `group_id` FROM `players` WHERE `account_id` = ' . $this->getId() . ' ORDER BY `group_id` DESC LIMIT 1')->fetch();
if(isset($query['group_id']))
return $query['group_id'];
return $group_id;
return 0;
}
/**