SpamBlocker

Spam Blocker is a CakePHP Behavior that automatically before after a comment is made. Each comment is tested upon a point system to determine if it should be approved, set to pending (high points), or marked as spam / deleted (low points).

Snippets for PHP

Truncate // truncate()
Truncates a string to a certain length. Can pass arguments to determine the length and ending delimiter.
Shorten // shorten()
If a string is too long, shorten it in the middle, similar to truncation.
Obfuscate // obfuscate()
Scrambles the source of a string. Converts characters to their ASCII alternatives and spoofs bots.
Listing // listing()
Creates a comma seperated list with the last item having an "and".
Debug // debug()
Outputs/Debugs a variable and shows where it was called from.
Generate Random String // generateString()
Generates a string of random characters. Can determine the length.
Days Between // daysBetween()
Finds difference in days between two dates.
Get Age // getAge()
Gets the age of an individual, based on a unix timestamp.
Timestamp in Timezone // timeInZone()
Gets a unix timestamp within a certain timezone.
Within Timeframe // withinTimeframe()
Checks to see if a timestamp was within a certain timeframe/daterange.
Datetime Breakdown // timeBreakdown()
Breaksdown a timestamp into an array of days, months, etc since the current time.