[geeklog-cvs] geeklog: Use the same workaround for a clickable title in the Si...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Mon Mar 29 07:34:27 EDT 2010


changeset 7860:f21158aceb5c
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/f21158aceb5c
user: Dirk Haun <dirk at haun-online.de>
date: Mon Mar 29 13:19:10 2010 +0200
description:
Use the same workaround for a clickable title in the Site Statistics, too

diffstat:

 plugins/staticpages/functions.inc |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r f16108cc4562 -r f21158aceb5c plugins/staticpages/functions.inc
--- a/plugins/staticpages/functions.inc	Mon Mar 29 12:58:27 2010 +0200
+++ b/plugins/staticpages/functions.inc	Mon Mar 29 13:19:10 2010 +0200
@@ -651,7 +651,7 @@
     if (!empty($perms)) {
         $perms = ' AND ' . $perms;
     }
-    $result = DB_query("SELECT sp_id,sp_title,sp_hits FROM {$_TABLES['staticpage']} WHERE (sp_hits > 0) AND (draft_flag = 0)" . $perms . ' ORDER BY sp_hits DESC LIMIT 10');
+    $result = DB_query("SELECT sp_id,sp_title,sp_page_title,sp_hits FROM {$_TABLES['staticpage']} WHERE (sp_hits > 0) AND (draft_flag = 0)" . $perms . ' ORDER BY sp_hits DESC LIMIT 10');
     $nrows  = DB_numRows($result);
     if ($nrows > 0) {
         require_once $_CONF['path_system'] . 'lib-admin.php';
@@ -671,7 +671,14 @@
         );
         for ($i = 0; $i < $nrows; $i++) {
             $A = DB_fetchArray($result);
-            $A['sp_title'] = stripslashes($A['sp_title']);
+            $A['sp_title'] = stripslashes(trim($A['sp_title']));
+            if (empty($A['sp_title'])) {
+                $A['sp_title'] = $A['sp_page_title'];
+                if (empty($A['sp_title'])) {
+                    $A['sp_title'] = $A['sp_id'];
+                }
+                $A['sp_title'] = '(' . $A['sp_title'] . ')';
+            }
             $A['sid'] = COM_createLink($A['sp_title'],
                             COM_buildUrl($_CONF['site_url']
                                 . "/staticpages/index.php?page={$A['sp_id']}"));



More information about the geeklog-cvs mailing list