[geeklog-cvs] geeklog-1.3/public_html lib-common.php,1.380,1.381

blaine at iowaoutdoors.org blaine at iowaoutdoors.org
Fri Oct 1 23:32:55 EDT 2004


Update of /var/cvs/geeklog-1.3/public_html
In directory www:/tmp/cvs-serv1578/public_html

Modified Files:
	lib-common.php 
Log Message:
Added support for Optional WHERE clause to COM_optionList
Added support for PLG_replacetags (autotag API) when displaying Comments - COM_getComment

Added new Plugin API PLG_checkforSpam to support plugins that can detect and filter SPAM. Initially only the SPAMX plugin does this but having a wrapper function allows other plugins in the future to extend this capability. 

Index: lib-common.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.380
retrieving revision 1.381
diff -C2 -d -r1.380 -r1.381
*** lib-common.php	30 Sep 2004 10:00:17 -0000	1.380
--- lib-common.php	2 Oct 2004 03:32:52 -0000	1.381
***************
*** 1198,1206 ****
  * @param        string      $selected   Value (from $selection) to set to SELECTED or default
  * @param        int         $sortcol    Which field to sort option list by 0 (value) or 1 (label)
  * @see function COM_checkList
  * @return   string  Formated HTML of option values
  *
  */
! function COM_optionList( $table, $selection, $selected='', $sortcol=1 )
  {
      $retval = '';
--- 1198,1207 ----
  * @param        string      $selected   Value (from $selection) to set to SELECTED or default
  * @param        int         $sortcol    Which field to sort option list by 0 (value) or 1 (label)
+ * @param        string      $where      Optional WHERE clause to use in the SQL Selection
  * @see function COM_checkList
  * @return   string  Formated HTML of option values
  *
  */
! function COM_optionList( $table, $selection, $selected='', $sortcol=1, $where='' )
  {
      $retval = '';
***************
*** 1209,1213 ****
      $select_set = explode( ',', $tmp );
  
!     $result = DB_query( "SELECT $selection FROM $table ORDER BY $select_set[$sortcol]" );
      $nrows = DB_numRows( $result );
  
--- 1210,1219 ----
      $select_set = explode( ',', $tmp );
  
!     $sql = "SELECT $selection FROM $table";
!     if ($where != '') {
!         $sql .= " WHERE $where";
!     }
!     $sql .= " ORDER BY {$select_set[$sortcol]}";
!     $result = DB_query($sql);
      $nrows = DB_numRows( $result );
  
***************
*** 2904,2907 ****
--- 2910,2915 ----
          $A['comment'] = str_replace( '}', '}', $A['comment'] );
  
+         $A['comment'] = PLG_replacetags($A['comment']);   // Replace any plugin autolink tags
+ 
          $template->set_var( 'title', $A['title'] );
          $template->set_var( 'comments', $A['comment'] );




More information about the geeklog-cvs mailing list