mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 16:32:45 +00:00
Add better punishment expiry detection
This commit is contained in:
parent
08353acdae
commit
fc65dda94b
18
inc/page.php
18
inc/page.php
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user