Add better punishment expiry detection

This commit is contained in:
ruan 2017-06-29 22:12:47 +02:00
parent 08353acdae
commit fc65dda94b
No known key found for this signature in database
GPG Key ID: 062534EE618F498C

View File

@ -288,7 +288,7 @@ class Page {
$done = true;
}
}
if ($row['removed_by_name'] === "#expired") {
if ($this->is_expired($row)) {
$until .= $this->lang->page_expire;
$done = true;
}
@ -320,6 +320,22 @@ class Page {
return (((int)$row[$field]) !== 0);
}
function is_expired($row) {
if ($row['removed_by_name'] === "#expired") return true;
$until = $row['until'];
if ($until <= 0) return false;
$time = gettimeofday();
$millis = $time["sec"] * 1000;
if ($millis > $until) {
return true;
}
return false;
}
function print_title() {
$title = $this->title;
$name = $this->settings->name;