phpDocumentor pivotx
modules
[ class tree: pivotx ] [ index: pivotx ] [ all elements ]

Procedural File: module_spamkiller.php

Source Location: /modules/module_spamkiller.php

Page Details

Contains all the functions needed for SpamQuiz and HashCash comment spam protection. Based on the excellent Pivot Blacklist (version 0.9.3) written by Marco van Hylckama Vlieg.

[email protected] - http://www.i-marco.nl/

Includes a modified/stripped down version of Elliott Back's WP-Hashcash version 2.3 http://www.elliottback.com/

Also contains some code to block/log trackback spam.

Classes
Class Description
pivotx_hashcash Hashcash Class
Functions
add_hashcash  [line 564]

boolean add_hashcash( $page, [ $form_name = 'anonymous']  )

Add hashcash to a form

  1. Disable the form by default
  2. Add <noscript>-warning
  3. Add hidden variable
  4. Add javascript (the actual hashcash)

Parameters:
   $page: 
   $form_name: 


[ Top ]
get_spamlog  [line 757]

string get_spamlog( )

Fetches the spam log inserted into a table.



[ Top ]
hashcash_check_hidden_tag  [line 611]

boolean hashcash_check_hidden_tag( [ $form_name = 'anonymous']  )

Returns true if it matches the hidden md5'ed tag.

Parameters:
   $form_name: 


[ Top ]
killtrackbackspam  [line 629]

void killtrackbackspam( )

Check the trackback for spam (currently using Hardened Trackback if enabled).



[ Top ]
logspammer  [line 668]

void logspammer( $p_sSpam, $p_sType, [ $p_sAdditional = &quot;&quot;]  )

Logs the blocked spam.

Parameters:
   $p_sSpam: 
   $p_sType: 
   $p_sAdditional: 


[ Top ]
set_spamlog  [line 827]

void set_spamlog( [string $text = &quot;&quot;]  )

Set the content of the spam log.

Parameters:
string   $text: 


[ Top ]
trim_spamlog  [line 850]

void trim_spamlog( )

This function trims the spamlog file down, if needed.

The spam logfile can easily become very large.. So large that it can't be read by common PHP installs without going over the amount of allocated memory. This function checks the filesize, and trims the file if it becomes to large.

It trims off about 1/3 of the entire file. This is to prevent that it has to be trimmed too often, since that would be very server-unfriendly.



[ Top ]


Documentation generated on Tue, 05 Sep 2017 01:06:11 +0200 by phpDocumentor 1.4.3