[geeklog-cvs] geeklog: Display the number of links in the current category in ...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Oct 4 17:22:20 EDT 2009


changeset 7364:21144754222c
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/21144754222c
user: Dirk Haun <dirk at haun-online.de>
date: Sun Oct 04 21:47:24 2009 +0200
description:
Display the number of links in the current category in the Category Editor.

diffstat:

 plugins/links/language/english.php                 |   3 ++-
 plugins/links/language/english_utf-8.php           |   3 ++-
 plugins/links/templates/admin/categoryeditor.thtml |   4 ++++
 public_html/admin/plugins/links/category.php       |  10 ++++++++++
 public_html/docs/history                           |   2 ++
 5 files changed, 20 insertions(+), 2 deletions(-)

diffs (72 lines):

diff -r 8b1e9b058fbd -r 21144754222c plugins/links/language/english.php
--- a/plugins/links/language/english.php	Sun Oct 04 21:38:38 2009 +0200
+++ b/plugins/links/language/english.php	Sun Oct 04 21:47:24 2009 +0200
@@ -206,7 +206,8 @@
     57 => 'Not validated yet',
     58 => 'Validate now',
     59 => '<p>To validate all links displayed, please click on the "Validate now" link below. Please note that this might take some time depending on the amount of links displayed.</p>',
-    60 => 'User %s tried illegally to edit category %s.'
+    60 => 'User %s tried illegally to edit category %s.',
+    61 => 'Links in Category'
 );
 
 $LANG_LINKS_STATUS = array(
diff -r 8b1e9b058fbd -r 21144754222c plugins/links/language/english_utf-8.php
--- a/plugins/links/language/english_utf-8.php	Sun Oct 04 21:38:38 2009 +0200
+++ b/plugins/links/language/english_utf-8.php	Sun Oct 04 21:47:24 2009 +0200
@@ -206,7 +206,8 @@
     57 => 'Not validated yet',
     58 => 'Validate now',
     59 => '<p>To validate all links displayed, please click on the "Validate now" link below. Please note that this might take some time depending on the amount of links displayed.</p>',
-    60 => 'User %s tried illegally to edit category %s.'
+    60 => 'User %s tried illegally to edit category %s.',
+    61 => 'Links in Category'
 );
 
 $LANG_LINKS_STATUS = array(
diff -r 8b1e9b058fbd -r 21144754222c plugins/links/templates/admin/categoryeditor.thtml
--- a/plugins/links/templates/admin/categoryeditor.thtml	Sun Oct 04 21:38:38 2009 +0200
+++ b/plugins/links/templates/admin/categoryeditor.thtml	Sun Oct 04 21:47:24 2009 +0200
@@ -23,6 +23,10 @@
                 <td>{topic_selection}<td>
             </tr>
             <tr>
+                <td align="right">{lang_num_links}:</td>
+                <td>{num_links}<td>
+            </tr>
+            <tr>
                 <td colspan="2"><hr{xhtml}></td>
             </tr>
             <tr>
diff -r 8b1e9b058fbd -r 21144754222c public_html/admin/plugins/links/category.php
--- a/public_html/admin/plugins/links/category.php	Sun Oct 04 21:38:38 2009 +0200
+++ b/public_html/admin/plugins/links/category.php	Sun Oct 04 21:47:24 2009 +0200
@@ -274,6 +274,16 @@
     $T->set_var('topic_selection', '<select name="tid">' . $alltopics
                                    . $topics . '</select>');
 
+    if (empty($cid)) {
+        $num_links = $LANG_ADMIN['na'];
+    } else {
+        $nresult = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['links']} WHERE cid='{$cid}'" . COM_getPermSQL('AND'));
+        $N = DB_fetchArray($nresult);
+        $num_links = $N['count'];
+    }
+    $T->set_var('lang_num_links', $LANG_LINKS_ADMIN[61]);
+    $T->set_var('num_links', COM_numberFormat($num_links));
+
     // user access info
     $T->set_var('lang_accessrights', $LANG_ACCESS['accessrights']);
     $T->set_var('lang_owner', $LANG_ACCESS['owner']);
diff -r 8b1e9b058fbd -r 21144754222c public_html/docs/history
--- a/public_html/docs/history	Sun Oct 04 21:38:38 2009 +0200
+++ b/public_html/docs/history	Sun Oct 04 21:47:24 2009 +0200
@@ -88,6 +88,8 @@
 
 Links Plugin
 ------------
+- Display the number of links in the current category in the Category Editor.
+  Note: Does not (yet) count links in sub-categories [Dirk]
 - Link titles in autotags showed up with backslashes before quotes (bug
   #0000986) [Dirk]
 



More information about the geeklog-cvs mailing list