Skip to content

Commit

Permalink
Fixed new message
Browse files Browse the repository at this point in the history
fixed icon and mktime() (deprecated, there are more mktime()'s in the
code but only the one without arguments is deprecated)
  • Loading branch information
Piotr Halama committed Jun 26, 2017
1 parent 10be457 commit b20de47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions includes/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@
fseek($f, (((int)$_COOKIE["id_env"] * 2) - 2));
$new_pm = fread($f, 2);
fclose($f);
if ((int)$new_pm != 0) $pm_alert = "-&nbsp;<img src=\"images/new.gif\"> <a href='pmsystem.php?section=inbox'><strong>".$new_pm."</strong> new PMs in your inbox</a>";
if ((int)$new_pm != 0) $pm_alert = "-&nbsp;<img src=\"images/new.jpg\"> <a href='pmsystem.php?section=inbox'><strong>".$new_pm."</strong> new PMs in your inbox</a>";
else $pm_alert = "-&nbsp;<img src=\"images/old.gif\"> No new messages";
$mark_all_read = "<a href='setallread.php'>Mark all posts read</a>";
if ($_COOKIE["power_env"] >= 3) {
$adminlink = "<a href='admin.php'>Admin Panel</a>&nbsp;&middot;";
if($_REGIST['reg_approval']) {
if($_SESSION['reg_approval_count'] == 0 && mktime() > ($_SESSION['reg_approval_lastcheck']+300)) {//Check every 5 mins IF count == 0
if($_SESSION['reg_approval_count'] == 0 && time() > ($_SESSION['reg_approval_lastcheck']+300)) {//Check every 5 mins IF count == 0
$users = $tdb->query('users', "reg_code?'reg_'", 1, -1);
$_SESSION['reg_approval_count'] = ((!empty($users[0])) ? count($users) : 0);
}
Expand Down
2 changes: 1 addition & 1 deletion login.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
if($_REGIST['reg_approval']) {
$reg_approvals = $tdb->query('users', "reg_code?'reg_'", 1, -1);
$_SESSION['reg_approval_count'] = ((!empty($reg_approvals[0])) ? count($reg_approvals) : 0);
$_SESSION['reg_approval_lastcheck'] = mktime(); //Use only if reg_approval_count == 0
$_SESSION['reg_approval_lastcheck'] = time(); //Use only if reg_approval_count == 0
} else {
$_SESSION['reg_approval_count'] = 0;
$_SESSION['reg_approval_lastcheck'] = 0;
Expand Down

0 comments on commit b20de47

Please sign in to comment.