BigCommerce - Hosted Ecommerce Software by Interspire

Interspire Forum

 
Go Back   Interspire Forum > Interspire Shopping Cart Community Forum > Customization and Integration > Code Modification and Addon Releases

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-17-2012, 05:42 PM
tonybarnes + tonybarnes is offline
Interspire Customer
 
Join Date: Dec 2008
Posts: 1,285
Default Check for review spammers IPs so you can blacklist them

Really quick one, we've been getting a lot of review spam of late, don't want to use CAPTCHA, so I'm just blocking the IP addresses of any spammers in our .htaccess. Anyway, current system doesn't record the IP of review posters, this quick bit of code changes that.

Open /includes/classes/class.review.php, look for:

Code:
		// Save the review in the database
		$newReview = array(
			"revproductid" => (int)$reviewPostData['product_id'],
			"revfromname" => $reviewPostData['revfromname'],
			"revdate" => time(),
			"revrating" => max(1, min(5, $reviewPostData['revrating'])),
			"revtext" => $reviewPostData['revtext'],
			"revtitle" => $reviewPostData['revtitle'],
			"revstatus" => $status
		);
Change to:

Code:
		// Save the review in the database
		$newReview = array(
			"revproductid" => (int)$reviewPostData['product_id'],
			"revfromname" => $reviewPostData['revfromname'],
			"revdate" => time(),
			"revrating" => max(1, min(5, $reviewPostData['revrating'])),
			"revtext" => $reviewPostData['revtext'],
			"revtitle" => $reviewPostData['revtitle'],
			"revstatus" => $status,
			"reviewip" => getIp()
		);
Then in your database, alter the isc_reviews table to include a column called 'reviewip'. You can now check who is spamming you before deleting their nonsense and banning them from accessing your site.
__________________
www.savant-health.com
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump