Phpfox_Spam

Description

SPAM/Flood Control Class Handles global SPAM & Flood control checks with support for plugins.

  • author: Raymond Benc
  • version: $Id: spam.class.php 1687 2010-07-22 03:13:27Z Raymond_Benc $
  • copyright: [PHPFOX_COPYRIGHT]

Located in /include/library/phpfox/spam/spam.class.php (line 17)


	
			
Variable Summary
 array $_aParams
 object $_oDb
Method Summary
 Phpfox_Spam __construct ()
 mixed check ([array $aParams = array()])
 string getWaitTime ()
 bool _isSpam ()
 boolean _lastPost ()
 void __call (string $sMethod, array $aArguments)
Variables
array $_aParams = array() (line 31)

Params passed via the check() method

  • access: private
object $_oDb = null (line 24)

Database object

  • access: private
Methods
Constructor __construct (line 36)

Class constructor

  • access: public
Phpfox_Spam __construct ()
check (line 47)

Method used to call other private methods which control the spam/flood methods.

  • return: Returns data based on the spam/flood method.
  • access: public
mixed check ([array $aParams = array()])
  • array $aParams: Array of params used with spam/flood methods provided.
getWaitTime (line 78)

Gets the time phrase of how long a user must wait before they can repost on the same section.

  • access: public
string getWaitTime ()
_isSpam (line 139)

Check to see if the content being passed is considered as SPAM.

  • return: TRUE is spam, FALSE if it isn't.
  • access: private
bool _isSpam ()
_lastPost (line 120)

SPAM control that checks the last time a user posted an item.

Inline Example:

  1.  Phpfox::getLib('spam')->check(array(
  2.                 'action' => 'last_post'// The SPAM action
  3.                 'params' => array(
  4.                     'field' => 'time_stamp'// The time stamp field
  5.                     'table' => Phpfox::getT('shoutbox')// Database table we plan to check
  6.                     'condition' => 'user_id = ' Phpfox::getUserId()// Database WHERE query
  7.                     'time_stamp' => Phpfox::getParam('shoutbox.shoutbox_flood_limit'// Seconds
  8.                 )
  9.             )
  10.         );

  • return: Returns TRUE if user has posted an item within X seconds, FALSE if they have nothing new posted.
  • access: private
boolean _lastPost ()
__call (line 225)

If a call is made to an unknown method attempt to connect it to a specific plug-in with the same name thus allowing plug-in developers the ability to extend classes.

  • access: public
void __call (string $sMethod, array $aArguments)
  • string $sMethod: is the name of the method
  • array $aArguments: is the array of arguments of being passed

Documentation generated on Tue, 28 Sep 2010 10:36:44 +0200 by phpDocumentor 1.4.0a2