[geeklog-cvs] geeklog: Changed how group id is retrieved in autotag code

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Mon Nov 29 09:54:25 EST 2010


changeset 8025:631b412b1126
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/631b412b1126
user: Tom <websitemaster at cogeco.net>
date: Mon Nov 29 09:53:37 2010 -0500
description:
Changed how group id is retrieved in autotag code

diffstat:

 plugins/calendar/functions.inc    |  5 ++---
 plugins/links/functions.inc       |  5 ++---
 plugins/polls/functions.inc       |  5 ++---
 plugins/staticpages/functions.inc |  5 ++---
 system/lib-story.php              |  5 ++---
 system/lib-user.php               |  5 ++---
 6 files changed, 12 insertions(+), 18 deletions(-)

diffs (132 lines):

diff -r 721466e26a83 -r 631b412b1126 plugins/calendar/functions.inc
--- a/plugins/calendar/functions.inc	Mon Nov 29 09:26:00 2010 -0500
+++ b/plugins/calendar/functions.inc	Mon Nov 29 09:53:37 2010 -0500
@@ -1152,7 +1152,7 @@
 */
 function plugin_autotags_calendar ($op, $content = '', $autotag = '')
 {
-    global $_CONF, $_TABLES, $LANG_CAL_1, $_CA_CONF;
+    global $_CONF, $_TABLES, $LANG_CAL_1, $_CA_CONF, $_GROUPS;
 
     if ($op == 'tagname' ) {
         return 'event';
@@ -1163,8 +1163,7 @@
             $flag = false;
         }
         
-        // Get Link Admin group id
-        $group_id = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = 'Calendar Admin'");
+        $group_id = $_GROUPS['Calendar Admin'];
         $owner_id = 2; // Admin
         if (COM_getPermTag($owner_id, $group_id, $_CA_CONF['autotag_permissions_event'][0], $_CA_CONF['autotag_permissions_event'][1], $_CA_CONF['autotag_permissions_event'][2], $_CA_CONF['autotag_permissions_event'][3]) == $flag) {
             $tagname[] = 'event';
diff -r 721466e26a83 -r 631b412b1126 plugins/links/functions.inc
--- a/plugins/links/functions.inc	Mon Nov 29 09:26:00 2010 -0500
+++ b/plugins/links/functions.inc	Mon Nov 29 09:53:37 2010 -0500
@@ -182,7 +182,7 @@
 */
 function plugin_autotags_links($op, $content = '', $autotag = '')
 {
-    global $_CONF, $_TABLES, $LANG_DIRECTION, $LANG_LINKS, $_LI_CONF;
+    global $_CONF, $_TABLES, $LANG_DIRECTION, $LANG_LINKS, $_LI_CONF, $_GROUPS;
 
     if ($op == 'tagname' ) {
         return 'link';
@@ -193,8 +193,7 @@
             $flag = false;
         }
         
-        // Get Link Admin group id
-        $group_id = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = 'Links Admin'");
+        $group_id = $_GROUPS['Links Admin'];
         $owner_id = 2; // Admin
         if (COM_getPermTag($owner_id, $group_id, $_LI_CONF['autotag_permissions_link'][0], $_LI_CONF['autotag_permissions_link'][1], $_LI_CONF['autotag_permissions_link'][2], $_LI_CONF['autotag_permissions_link'][3]) == $flag) {
             $tagname[] = 'link';
diff -r 721466e26a83 -r 631b412b1126 plugins/polls/functions.inc
--- a/plugins/polls/functions.inc	Mon Nov 29 09:26:00 2010 -0500
+++ b/plugins/polls/functions.inc	Mon Nov 29 09:53:37 2010 -0500
@@ -1447,7 +1447,7 @@
 */
 function plugin_autotags_polls($op, $content = '', $autotag = '')
 {
-    global $_CONF, $_PO_CONF, $_TABLES, $LANG_POLLS;
+    global $_CONF, $_PO_CONF, $_TABLES, $LANG_POLLS, $_GROUPS;
 
     if ($op == 'tagname') {
         return array('poll_vote', 'poll_result', 'poll');
@@ -1458,8 +1458,7 @@
             $flag = false;
         }
         
-        // Get Polls Admin group id
-        $group_id = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = 'Polls Admin'");
+        $group_id = $_GROUPS['Polls Admin'];
         $owner_id = 2; // Admin
         if (COM_getPermTag($owner_id, $group_id, $_PO_CONF['autotag_permissions_poll_vote'][0], $_PO_CONF['autotag_permissions_poll_vote'][1], $_PO_CONF['autotag_permissions_poll_vote'][2], $_PO_CONF['autotag_permissions_poll_vote'][3]) == $flag) {
             $tagname[] = 'poll_vote';
diff -r 721466e26a83 -r 631b412b1126 plugins/staticpages/functions.inc
--- a/plugins/staticpages/functions.inc	Mon Nov 29 09:26:00 2010 -0500
+++ b/plugins/staticpages/functions.inc	Mon Nov 29 09:53:37 2010 -0500
@@ -1132,7 +1132,7 @@
 */
 function plugin_autotags_staticpages($op, $content = '', $autotag = '')
 {
-    global $_CONF, $_TABLES, $_SP_CONF, $LANG_STATIC;
+    global $_CONF, $_TABLES, $_SP_CONF, $LANG_STATIC, $_GROUPS;
 
     static $recursive = array();
 
@@ -1145,8 +1145,7 @@
             $flag = false;
         }
         
-        // Get Polls Admin group id
-        $group_id = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = 'Static Page Admin'");
+        $group_id = $_GROUPS['Static Page Admin'];
         $owner_id = 2; // Admin
         if (COM_getPermTag($owner_id, $group_id, $_SP_CONF['autotag_permissions_staticpage_content'][0], $_SP_CONF['autotag_permissions_staticpage_content'][1], $_SP_CONF['autotag_permissions_staticpage_content'][2], $_SP_CONF['autotag_permissions_staticpage_content'][3]) == $flag) {
             $tagname[] = 'staticpage_content';
diff -r 721466e26a83 -r 631b412b1126 system/lib-story.php
--- a/system/lib-story.php	Mon Nov 29 09:26:00 2010 -0500
+++ b/system/lib-story.php	Mon Nov 29 09:53:37 2010 -0500
@@ -1135,7 +1135,7 @@
 */
 function plugin_autotags_story($op, $content = '', $autotag = '')
 {
-    global $_CONF, $_TABLES, $LANG24;
+    global $_CONF, $_TABLES, $LANG24, $_GROUPS;
 
     if ($op == 'tagname' ) {
         return 'story';
@@ -1146,8 +1146,7 @@
             $flag = false;
         }
         
-        // Get Story Admin group id
-        $group_id = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = 'Story Admin'");
+        $group_id = $_GROUPS['Story Admin'];
         $owner_id = 2; // Admin
         if (COM_getPermTag($owner_id, $group_id, $_CONF['autotag_permissions_story'][0], $_CONF['autotag_permissions_story'][1], $_CONF['autotag_permissions_story'][2], $_CONF['autotag_permissions_story'][3]) == $flag) {
             $tagname[] = 'story';
diff -r 721466e26a83 -r 631b412b1126 system/lib-user.php
--- a/system/lib-user.php	Mon Nov 29 09:26:00 2010 -0500
+++ b/system/lib-user.php	Mon Nov 29 09:53:37 2010 -0500
@@ -1121,7 +1121,7 @@
 */
 function plugin_autotags_user($op, $content = '', $autotag = '')
 {
-    global $_CONF, $_TABLES, $LANG28;
+    global $_CONF, $_TABLES, $LANG28, $_GROUPS;
 
     if ($op == 'tagname' ) {
         return 'user';
@@ -1132,8 +1132,7 @@
             $flag = false;
         }
         
-        // Get User Admin group id
-        $group_id = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = 'User Admin'");
+        $group_id = $_GROUPS['User Admin'];
         $owner_id = 2; // Admin
         if (COM_getPermTag($owner_id, $group_id, $_CONF['autotag_permissions_user'][0], $_CONF['autotag_permissions_user'][1], $_CONF['autotag_permissions_user'][2], $_CONF['autotag_permissions_user'][3]) == $flag) {
             $tagname[] = 'user';



More information about the geeklog-cvs mailing list