[geeklog-cvs] geeklog-1.3/system lib-custom.php,1.9,1.10

blaine at iowaoutdoors.org blaine at iowaoutdoors.org
Sat Oct 9 16:42:28 EDT 2004


Update of /var/cvs/geeklog-1.3/system
In directory www:/tmp/cvs-serv17262/system

Modified Files:
	lib-custom.php 
Log Message:
Added custom_showBlocks() that can be used to return a HTML formatted block or list of blocks.

Index: lib-custom.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/system/lib-custom.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** lib-custom.php	29 May 2004 15:46:56 -0000	1.9
--- lib-custom.php	9 Oct 2004 20:42:26 -0000	1.10
***************
*** 21,25 ****
  // |                                                                           |
  // | Authors: Tony Bibbs       - tony at tonybibbs.com                            |
! // |          Blaine Lang      - geeklog at langfamily.ca                         |
  // |          Dirk Haun        - dirk at haun-online.de                           |
  // +---------------------------------------------------------------------------+
--- 21,25 ----
  // |                                                                           |
  // | Authors: Tony Bibbs       - tony at tonybibbs.com                            |
! // |          Blaine Lang      - blaine at portalparts.com                        |
  // |          Dirk Haun        - dirk at haun-online.de                           |
  // +---------------------------------------------------------------------------+
***************
*** 268,271 ****
--- 268,292 ----
  
  
+ 
+ /**
+ * Custom function to retrieve and return a formatted block that is enabled.
+ * @param   array      $showblocks         An array of block names to retrieve and format
+ * @return   string  Formated HTML containing site footer and optionally right blocks
+ */
+ function custom_showBlocks($showblocks) {
+     global $_CONF, $_TABLES;
+     $retval = '';
+     foreach($showblocks as $block) {
+         $sql = "SELECT bid, name,type,title,content,rdfurl,phpblockfn,help FROM {$_TABLES['blocks']} WHERE name='$block' and is_enabled = '1'";
+         $result = DB_query($sql);
+         if (DB_numRows($result) == 1) {
+             $A = DB_fetchArray($result);
+             $retval .= COM_formatBlock($A);
+         }
+     }
+     return $retval;
+ }
+ 
+ 
  /**
  * This is an example of a custom email function. When this function is NOT
***************
*** 341,343 ****
  */
  
! ?>
--- 362,364 ----
  */
  
! ?>
\ No newline at end of file




More information about the geeklog-cvs mailing list