plugins/CategoryList.php
changeset 2 125e913485a2
parent 1 eaeb479c52c9
child 3 6d3aeed690d1
--- a/plugins/CategoryList.php	Fri Aug 15 20:39:02 2008 -0400
+++ b/plugins/CategoryList.php	Sat May 16 23:55:59 2009 +0000
@@ -9,14 +9,14 @@
 */
 
 // attach parser hook
-$plugins->attachHook('render_wikiformat_pre', 'catlist_parser_hook($text);');
+$plugins->attachHook('render_wikiformat_veryearly', 'catlist_parser_hook($text);');
 
 function catlist_parser_hook(&$text)
 {
   if ( preg_match_all('/\{\{
-                         Category:
+                         CategoryContents:
                          ([^|\r\n\a\t]+?)                                              # category name
-                         (\|(?:(?:[a-z0-9_]+)(?:[\s]*)=(?:[\s]*)(?:[^\}\r\n\a\t]+)))   # parameters
+                         (\|(?:(?:[a-z0-9_]+)(?:[\s]*)=(?:[\s]*)(?:[^\}\r\n\a\t]+)))?  # parameters
                        \}\}/x', $text, $matches) )
   {
     foreach ( $matches[0] as $i => $match )
@@ -106,7 +106,7 @@
     $ticker = 0;
     $have_subcats = false;
     $class = 'row1';
-    while ( $row = $db->fetchrow() )
+    while ( $row = $db->fetchrow($q) )
     {
       if ( empty($row['is_subcategory']) )
         break;