From efef6e67a2a102111a58dabf73d81c6f1072bb71 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Wed, 2 Nov 2011 11:46:57 +0100 Subject: [PATCH] Adds flags to distinguish notified animators on xnet. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- classes/userfilter/conditions.inc.php | 13 ++++++++++++- upgrade/1.1.4/11_groups.sql | 3 +++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 upgrade/1.1.4/11_groups.sql diff --git a/classes/userfilter/conditions.inc.php b/classes/userfilter/conditions.inc.php index 2604a37..bb9ad83 100644 --- a/classes/userfilter/conditions.inc.php +++ b/classes/userfilter/conditions.inc.php @@ -858,12 +858,19 @@ class UFC_NLSubscribed extends UserFilterCondition */ class UFC_Group extends UserFilterCondition { + const BOTH = 0; + const NOTIFIED = 1; + const UNNOTIFIED = 2; + private $group; private $anim; - public function __construct($group, $anim = false) + private $notified; + + public function __construct($group, $anim = false, $notified = self::BOTH) { $this->group = $group; $this->anim = $anim; + $this->notified = $notified; } public function buildCondition(PlFilter $uf) @@ -877,6 +884,10 @@ class UFC_Group extends UserFilterCondition if ($this->anim) { $where .= ' AND gpm' . $sub . '.perms = \'admin\''; } + if ($this->notified != self::BOTH) { + $where .= ' AND ' . ($this->notified == self::UNNOTIFIED ? 'NOT ' : '') + . "FIND_IN_SET('notify', gpm" . $sub . '.flags)'; + } return $where; } } diff --git a/upgrade/1.1.4/11_groups.sql b/upgrade/1.1.4/11_groups.sql new file mode 100644 index 0000000..6910c8e --- /dev/null +++ b/upgrade/1.1.4/11_groups.sql @@ -0,0 +1,3 @@ +ALTER TABLE group_members ADD COLUMN flags SET('notify') NOT NULL DEFAULT ''; + +-- vim:set syntax=mysql: -- 2.1.4