Skip to content

Commit

Permalink
v0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gouarfig committed Feb 1, 2019
1 parent 4afc45b commit 9a40da1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"type": "phpbb-extension",
"description": "With this extension, you can manage all sorts of notices for your board",
"homepage": "https://github.com/gouarfig/board-notices",
"version": "0.5.1-beta",
"time": "2019-01-31",
"version": "0.5.1",
"time": "2019-02-01",
"license": "GPL-2.0-only",
"authors": [{
"name": "Fred Quointeau",
Expand Down
6 changes: 3 additions & 3 deletions event/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __construct(
public function display_board_notices()
{
// We tag the visit first so that we don't display the message WHEN visiting the forum
if ($this->forumVisitedEnabled() && $this->isUserLoggedIn())
if ($this->forumVisitedEnabled() && $this->isUserRegistered())
{
$this->setForumVisited();
}
Expand Down Expand Up @@ -209,9 +209,9 @@ private function forumVisitedEnabled()
return $this->config[constants::$CONFIG_TRACK_FORUMS_VISITS] ? true : false;
}

private function isUserLoggedIn()
private function isUserRegistered()
{
return (($this->user->data['user_type'] == USER_NORMAL) || ($this->user->data['user_type'] == USER_FOUNDER));
return !empty($this->user->data['is_registered']);
}

private function isPreview()
Expand Down
1 change: 1 addition & 0 deletions rules/date.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function isTrue($conditions)
return false;
}
$now = getdate();
// $current_datetime = $this->user->create_datetime();
$valid = ((($date[0] == 0) || ($now['mday'] == $date[0]))
&& (($date[1] == 0) || ($now['mon'] == $date[1]))
&& (($date[2] == 0) || ($now['year'] == $date[2])));
Expand Down
3 changes: 2 additions & 1 deletion tests/rules/date_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

include_once 'phpBB/includes/functions.php';

use \fq\boardnotices\rules\date;
use fq\boardnotices\rules\date;

class date_test extends rule_test_base
{
Expand Down Expand Up @@ -103,6 +103,7 @@ private function getDatetime(\phpbb\user $user, $time = null)
}

/**
* null values mean "any" and zero values mean "current one"
* @return int[]
*/
private function buildConditions($now, $day = null, $month = null, $year = null)
Expand Down

0 comments on commit 9a40da1

Please sign in to comment.