[geeklog-cvs] geeklog: Merge with other changes

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Thu Mar 18 14:33:00 EDT 2010


changeset 7812:ffc334a4da99
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/ffc334a4da99
user: Tom <websitemaster at cogeco.net>
date: Thu Mar 18 14:32:11 2010 -0400
description:
Merge with other changes

diffstat:

 public_html/docs/history    |   5 +++++
 public_html/links/index.php |  11 ++++++++++-
 system/lib-plugins.php      |  20 +++++++++++++++++++-
 3 files changed, 34 insertions(+), 2 deletions(-)

diffs (87 lines):

diff -r 7d84a09982f6 -r ffc334a4da99 public_html/docs/history
--- a/public_html/docs/history	Thu Mar 18 14:30:27 2010 -0400
+++ b/public_html/docs/history	Thu Mar 18 14:32:11 2010 -0400
@@ -3,6 +3,8 @@
 Apr ??, 2010 (1.6.2)
 ------------
 
+- Introduced a [user:] autotag that links to a user's profile (feature request
+  #0001081, patch provided by Akeda Bagus)
 - The "Users" entry in the Admins block now displays the number of active users
   only, i.e. it only counts users that logged in at least once [Dirk]
 - Fixed display of list of allowed HTML tags and available autotags in
@@ -89,6 +91,9 @@
 
 Links Plugin
 ------------
+- A link to an invalid Link Category could lead to an endless loop for users
+  with Link Admins permissions (bug #0001090; reported and patch provided by
+  Akeda Bagus)
 - Allow autotags in the Links and Link Category description (feature request
   #0001079, patch provided by Akeda Bagus)
 - Added support for a CAPTCHA in the submission form (bug #0001091, patch
diff -r 7d84a09982f6 -r ffc334a4da99 public_html/links/index.php
--- a/public_html/links/index.php	Thu Mar 18 14:30:27 2010 -0400
+++ b/public_html/links/index.php	Thu Mar 18 14:32:11 2010 -0400
@@ -112,7 +112,7 @@
         }
     }
     
-    // Check has access to this category
+    // Check has access and existent to this category
     if ($cid != $_LI_CONF['root']) {
         $result = DB_query("SELECT owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon FROM {$_TABLES['linkcategories']} WHERE cid='{$cat}'");
         $A = DB_fetchArray($result);
@@ -123,6 +123,15 @@
             COM_output($display);
             exit;
         }
+        
+        // check existent
+        if ( !isset($A['owner_id']) ) {
+            $display .= COM_siteHeader ('menu', $page_title);
+            $display .= COM_showMessage (16, 'links');
+            $display .= COM_siteFooter ();
+            COM_output($display);
+            exit;
+        }
     }
 
     $display .= COM_siteHeader ('menu', $page_title);
diff -r 7d84a09982f6 -r ffc334a4da99 system/lib-plugins.php
--- a/system/lib-plugins.php	Thu Mar 18 14:30:27 2010 -0400
+++ b/system/lib-plugins.php	Thu Mar 18 14:32:11 2010 -0400
@@ -1485,7 +1485,9 @@
 
     // Determine which Core Modules and Plugins support AutoLinks
     //                        'tag'   => 'module'
-    $autolinkModules = array('story' => 'geeklog');
+    $autolinkModules = array(
+        'story' => 'geeklog', 'user' => 'geeklog'
+    );
 
     foreach ($_PLUGINS as $pi_name) {
         $function = 'plugin_autotags_' . $pi_name;
@@ -1605,6 +1607,22 @@
                     }
                 }
 
+                if ($autotag['tag'] == 'user') {
+                    $autotag['parm1'] = COM_applyFilter($autotag['parm1']);
+                    if (! empty($autotag['parm1'])) {
+                        $uname = addslashes($autotag['parm1']);
+                        $sql = "SELECT uid, fullname FROM {$_TABLES['users']} WHERE username = '$uname'";
+                        $result = DB_query($sql);
+                        if (DB_numRows($result) == 1) {
+                            $A = DB_fetchArray($result);
+                            $url = $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'];
+                            if (empty($linktext)) {
+                                $linktext = COM_getDisplayName($A['uid'], $autotag['parm1'], $A['fullname']);
+                            }
+                        }
+                    }
+                }
+
                 if (!empty($url)) {
                     $filelink = COM_createLink($linktext, $url);
                     $content = str_replace($autotag['tagstr'], $filelink,



More information about the geeklog-cvs mailing list