mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Profiler/Completions
* removed old workaround for js date object creation
This commit is contained in:
@@ -620,8 +620,8 @@ class AjaxProfile extends AjaxHandler
|
||||
// titleId => 1
|
||||
$profile['titles'] = DB::Aowow()->selectCol('SELECT `titleId` AS ARRAY_KEY, 1 FROM ?_profiler_completion_titles WHERE `id` = ?d', $pBase['id']);
|
||||
|
||||
// achievementId => date
|
||||
$profile['achievements'] = DB::Aowow()->selectCol('SELECT `achievementId` AS ARRAY_KEY, `date` FROM ?_profiler_completion_achievements WHERE `id` = ?d', $pBase['id']);
|
||||
// achievementId => js date object
|
||||
$profile['achievements'] = DB::Aowow()->selectCol('SELECT `achievementId` AS ARRAY_KEY, CONCAT("$new Date(", `date` * 1000, ")") FROM ?_profiler_completion_achievements WHERE `id` = ?d', $pBase['id']);
|
||||
|
||||
// just points
|
||||
$profile['achievementpoints'] = $profile['achievements'] ? DB::Aowow()->selectCell('SELECT SUM(`points`) FROM ?_achievement WHERE `id` IN (?a)', array_keys($profile['achievements'])) : 0;
|
||||
|
||||
@@ -7573,8 +7573,7 @@ function ProfilerCompletion(_parent) {
|
||||
}
|
||||
|
||||
if ((!_opt.compute || _opt.compute(row, data[i])) && data[i]) {
|
||||
// row.completed = (data[i].getTime ? data[i] : (_opt.showQuantity ? data[i] : 1)); // aowow: idk a way to generate a jScript-TimeObject in php (there probably isn't), but one is expected here
|
||||
row.completed = (data[i] > 946681200 ? new Date(data[i] * 1000) : (_opt.showQuantity ? data[i] : 1)); // so we create a dateObject from data[i] if it is a unixtime past the 1.1.2000 - 0:00 (wich probably isn't used as a sensible int anyway)
|
||||
row.completed = (data[i].getTime ? data[i] : (_opt.showQuantity ? data[i] : 1));
|
||||
hasData = true;
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user