mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 01:34:55 +02:00
and https://otland.net/threads/myaac-v0-0-1.251454/page-7#post-2444035
This commit is contained in:
@@ -120,6 +120,7 @@ define('USE_ACCOUNT_NAME', fieldExist('name', 'accounts'));
|
||||
$tmp = '';
|
||||
if($cache->enabled() && $cache->fetch('vocations', $tmp)) {
|
||||
$config['vocations'] = unserialize($tmp);
|
||||
$config['vocation_last'] = $cache->get('vocation_last');
|
||||
}
|
||||
else {
|
||||
$vocations = new DOMDocument();
|
||||
@@ -135,14 +136,15 @@ else {
|
||||
$config['vocations'] = array();
|
||||
foreach($vocations->getElementsByTagName('vocation') as $vocation) {
|
||||
$id = $vocation->getAttribute('id');
|
||||
//if($id == $vocation->getAttribute('fromvoc'))
|
||||
$config['vocations'][$id] = $vocation->getAttribute('name');
|
||||
//else
|
||||
// $config['vocations'][$id] = $vocation->getAttribute('name');
|
||||
if($id == $vocation->getAttribute('fromvoc'))
|
||||
$config['vocation_last'] = $id;
|
||||
|
||||
$config['vocations'][$id] = $vocation->getAttribute('name');
|
||||
}
|
||||
|
||||
if($cache->enabled()) {
|
||||
$cache->set('vocations', serialize($config['vocations']), 120);
|
||||
$cache->set('vocation_last', $config['vocation_last'], 120);
|
||||
}
|
||||
}
|
||||
unset($tmp, $id, $vocation);
|
||||
|
Reference in New Issue
Block a user