[geeklog-cvs] Geeklog-1.x/public_html/links index.php,1.31,1.32

Dirk Haun dhaun at qs1489.pair.com
Sat Jan 5 15:47:47 EST 2008


Update of /cvsroot/geeklog/Geeklog-1.x/public_html/links
In directory qs1489.pair.com:/tmp/cvs-serv18094

Modified Files:
	index.php 
Log Message:
Re-instate 1.4.1 feature: Setting $_LI_CONF['linkcols'] = 0 will list all links grouped by category


Index: index.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/links/index.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** index.php	5 Jan 2008 20:05:58 -0000	1.31
--- index.php	5 Jan 2008 20:47:45 -0000	1.32
***************
*** 271,282 ****
          $linklist->set_var ('page_navigation', '');
      } else {
!         // Get current category name
!         $currentcategory = DB_getItem($_TABLES['linkcategories'], 'category',
!                                       "cid = '{$cat}'");
!         $linklist->set_var('link_category', $currentcategory);
!         $linklist->set_var('link_details', '');
! 
          for ($i = 0; $i < $nrows; $i++) {
              $A = DB_fetchArray($result);
              prepare_link_item($A, $linklist);
              $linklist->parse('link_details', 'link', true);
--- 271,289 ----
          $linklist->set_var ('page_navigation', '');
      } else {
!         $currentcid = '';
          for ($i = 0; $i < $nrows; $i++) {
              $A = DB_fetchArray($result);
+             if (strcasecmp ($A['cid'], $currentcid) != 0) {
+                 // print the category and link
+                 if ($i > 0) {
+                     $linklist->parse('category_links', 'catlinks', true);
+                     $linklist->set_var('link_details', '');
+                 }
+                 $currentcid = $A['cid'];
+                 $currentcategory = DB_getItem($_TABLES['linkcategories'],
+                         'category', "cid = '" . addslashes($currentcid) . "'");
+                 $linklist->set_var('link_category', $currentcategory);
+             }
+ 
              prepare_link_item($A, $linklist);
              $linklist->parse('link_details', 'link', true);
***************
*** 309,312 ****
--- 316,320 ----
      $linklist->parse ('output', 'linklist');
      $display .= $linklist->finish ($linklist->get_var ('output'));
+ 
      return $display;
  }




More information about the geeklog-cvs mailing list