From 4fa7f147b070c07d33d38330db65aafc9e1789b8 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 20 Apr 2011 16:19:07 -0400 Subject: [PATCH] Make tag-per-group optional, default false --- README | 2 ++ classes/Notice.php | 12 +++++++----- lib/default.php | 3 ++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README b/README index 5f58179bfe..3507fa420b 100644 --- a/README +++ b/README @@ -1392,6 +1392,8 @@ maxaliases: maximum number of aliases a group can have. Default 3. Set desclimit: maximum number of characters to allow in group descriptions. null (default) means to use the site-wide text limits. 0 means no limit. +addtag: Whether to add a tag for the group nickname for every group post + (pre-1.0.x behaviour). Defaults to false. oembed -------- diff --git a/classes/Notice.php b/classes/Notice.php index ecb3b82557..ba66dd8054 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1071,13 +1071,15 @@ class Notice extends Memcached_DataObject common_log_db_error($gi, 'INSERT', __FILE__); } - // we automatically add a tag for every group name, too + if (common_config('group', 'addtag')) { + // we automatically add a tag for every group name, too - $tag = Notice_tag::pkeyGet(array('tag' => common_canonical_tag($group->nickname), - 'notice_id' => $this->id)); + $tag = Notice_tag::pkeyGet(array('tag' => common_canonical_tag($group->nickname), + 'notice_id' => $this->id)); - if (is_null($tag)) { - $this->saveTag($group->nickname); + if (is_null($tag)) { + $this->saveTag($group->nickname); + } } $groups[] = clone($group); diff --git a/lib/default.php b/lib/default.php index c58db28f51..aeb72ec99a 100644 --- a/lib/default.php +++ b/lib/default.php @@ -268,7 +268,8 @@ $default = array('desclimit' => null), 'group' => array('maxaliases' => 3, - 'desclimit' => null), + 'desclimit' => null, + 'addtag' => false), 'peopletag' => array('maxtags' => 100, // maximum number of tags a user can create. 'maxpeople' => 500, // maximum no. of people with the same tag by the same user -- 2.39.5