* tabs 2 spaces in some *.js and *.css
* updated Summary.js (Item Comparison) - can now manage custom weightscales, when logged in - can now apply weightscales to rank search results - CAN NOT yet search for items with a certain scale alone, as i haven't figured out yet how to design the database for that * sorted and commented basic.css * some missing imagery * some cleanup (my todoStack just got less inhuman in size)
This commit is contained in:
parent
b26accb32a
commit
21f50ae2cd
29 changed files with 10197 additions and 8432 deletions
|
|
@ -166,8 +166,8 @@ class User
|
|||
return AUTH_WRONGPASS;
|
||||
|
||||
// "stay logged in" unchecked; kill session in time() + 5min
|
||||
if (self::$timeout > 0 && self::$timeout < time())
|
||||
return AUTH_TIMEDOUT;
|
||||
// if (self::$timeout > 0 && self::$timeout < time())
|
||||
// return AUTH_TIMEDOUT;
|
||||
|
||||
if (self::$timeout > 0)
|
||||
DB::Auth()->query('UPDATE ?_account SET timeout = ?d WHERE id = ?d',
|
||||
|
|
@ -275,15 +275,47 @@ class User
|
|||
'avatar' => self::$avatar,
|
||||
'community' => self::$description,
|
||||
'chars' => self::getCharacters(),
|
||||
'profiles' => self::getProfiles(),
|
||||
'profiles' => self::getProfiles()
|
||||
);
|
||||
|
||||
if ($_ = self::getWeightScales())
|
||||
$subSet['weights'] = json_encode($_, JSON_NUMERIC_CHECK);
|
||||
|
||||
$smarty->assign('user', array_merge($set, $subSet));
|
||||
}
|
||||
else
|
||||
$smarty->assign('user', $set);
|
||||
}
|
||||
|
||||
public static function getWeightScales()
|
||||
{
|
||||
$data = [];
|
||||
|
||||
$res = DB::Aowow()->select('SELECT * FROM ?_account_weightscales WHERE account = ?d', self::$id);
|
||||
foreach ($res as $i)
|
||||
{
|
||||
$set = array (
|
||||
'name' => $i['name'],
|
||||
'id' => $i['id']
|
||||
);
|
||||
|
||||
$weights = explode(',', $i['weights']);
|
||||
foreach ($weights as $weight)
|
||||
{
|
||||
$w = explode(':', $weight);
|
||||
|
||||
if ($w[1] === 'undefined')
|
||||
$w[1] = 0;
|
||||
|
||||
$set[$w[0]] = $w[1];
|
||||
}
|
||||
|
||||
$data[] = $set;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function getCharacters($asJSON = true)
|
||||
{
|
||||
if (empty(self::$characters))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue