[geeklog-cvs] geeklog-1.3/system lib-plugins.php,1.46,1.47

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


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

Modified Files:
	lib-plugins.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-plugins.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/system/lib-plugins.php,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** lib-plugins.php	29 Sep 2004 11:43:29 -0000	1.46
--- lib-plugins.php	2 Oct 2004 03:32:53 -0000	1.47
***************
*** 1193,1195 ****
  }
  
! ?>
--- 1193,1227 ----
  }
  
! /**
! * Allows plugins and Core GL Components to filter out spam.
! * The SPAMX Plugin is now part of the Geeklog Distribution
! * This plugin API will call the main function in the SPAMX plugin
! * but can also be used to call other plugins or custom functions
! * if available for filtering spam or content.
! *
! * @param string $content   Text to be filtered or checked for spam
! * @param integer $action   what to do if comment found
! * @return an error or formatted action HTML to return to calling program
! * 
! * Note: Examples for formatted action HTML are a redirect formatted by COM_refresh
! * The spamx DeleteComment.Action does this.
! *
! */
! function PLG_checkforSpam($content, $action = -1)
! {
!     global $_PLUGINS;
! 
!     foreach ($_PLUGINS as $pi_name) {
!         $function = 'plugin_checkforSpam_' . $pi_name;
!         if (function_exists($function)) {
!             $someError = $function($content, $action);
!             if ($someError) {
!                 // Plugin found a match for spam or else an error
!                 return $someError;
!             }
!         }
!     }
!     return false;
! }
! 
! ?>
\ No newline at end of file




More information about the geeklog-cvs mailing list