Recent Topics

1 Sep 20, 2005 22:46    

I'm reading the following pages in trying to set up automatic antispam updating and rechecking:

1. http://isaacschlueter.com/blog/automatic_antispam_update_cron
DONE, and working fine

2. http://isaacschlueter.com/blog/b2evolution_antispam_recheck_cronjob/

This page says that EdB's antispam recheck must first be implemented.

2a. That recheck hack is located here: http://wonderwinds.com/hackblog.php/2005/02/07/antispam_recheck_tool_part3

I successfully added the table to the db, the code block to /admin/hacks.php and replaced my existing b2antispam.php with the one shown on his site (after making a backup copy of my existing one).

On implementing step 2a, and before going back to step 2, I loaded my blog and got the following across the top of the page:

/* * list_antiSpam_short(-) * * Extract anti-spam that have not been rechecked */ function list_antiSpam_short() { global $DB, $querycount, $tableantispam, $res_stats; $sql = "SELECT aspm_ID, aspm_string, aspm_source, aspm_checked FROM $tableantispam WHERE aspm_checked = 'needs' ORDER BY aspm_string ASC"; $res_stats = $DB->get_results( $sql, ARRAY_A ); }

Is this because that hack will not work under 9.0.12, or is there something else going on here? I did not have an existing hacks.php file before completing step 2a, so I created a new one. Does it need specific permissions or something?
I'd like to get the antispam running so that it automatically downloads the list and then also rechecks all my blog posts for blacklisted content and strikes it out. Step 1 works, and the list is getting downloaded, just something isn't right with the recheck...

jj.

3 Sep 20, 2005 23:54

It looks like it's displaying the content of your hacks.php file. Does your hacks.php file start with

<?php
if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );


It needs to for two reasons. The first line tells the server to process PHP, and the second stops people from seeing the file if they type the path into their address bar.

I hope that helps you out. The v12 version worked fine, as did Isaac's cron tools to automate the whole thing. I *think* Isaac's cron tools will also work after you upgrade to dawn, but I had to re-do my hack.

4 Sep 21, 2005 00:18

EdB, Isaac's script wasn't working for me with the Dawn version because the last line just includes antispam_recheck.php. You don't have that file anymore because you've rolled it all into b2antispam.php, right? But I pulled out the parts that make the recheck work without asking and put them into Isaac's script where the include used to be.

5 Sep 21, 2005 00:36

Cool. I had to think for a minute what the "antispam_recheck.php" was all about. That was actually an Isaac-spinoff of my original hack. I had it all replacing the b2antispam.php file and a few new funcs in b2evocore/_functions_antispam.php. Isaac took the bit that does the rechecking and turned it into a continuous thing - no stopping for human verification, then did the cron thing. Bottom line is you're right: you do [url=http://wonderwinds.com/hackblog.php/2005/09/18/antispam_rechecking_dawn]only the hack[/url] and you will manually have to verify each time a recheck catches something. If you want to let it run free and unfettered you grab the [url=http://www.brendoman.com/updateantispam.php.txt]stand-alone file[/url], and cron that if you're into it.

Sheesh. It's too confusing to keep up with which hacker hacked what hack hacked.

6 Sep 21, 2005 01:07

I got confused, too. :oops:

After my upgrade I only re-applied part of Isaac's hack. I forgot that antispam_recheck.php was from him and I thought it was from you and you changed the way you did things. So I spent half an hour recreating what Isaac had already done. I thought I was hot stuff, but I was just reinventing the wheel. My script does have the slight advantage of being in one file rather than two. I'll stop hijacking this thread now.

7 Sep 23, 2005 02:59

EdB wrote:

It looks like it's displaying the content of your hacks.php file. Does your hacks.php file start with

<?php
if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );


It needs to for two reasons. The first line tells the server to process PHP, and the second stops people from seeing the file if they type the path into their address bar.

You know, that might have been the problem. I'm going to try setting it up again and see what happens. Thanks for the input. I lost track of this thread from the other day. Didn't realize so much helpful info had been added. I'll post my results after trying it again.

[EDIT: It seems to work now that I added the leading code which EdB listed. I'm assuming there is no closing ?> at the end of the file? It "appears" to be working without the closing tag, but I want to make sure...]

jj.

8 Sep 23, 2005 03:50

Does the hacks.php file require a closing ?> tag at the end?

I've completed step 2a and step 2 from my original post, and am now waiting for the next cron-scheduled update to see if the recheck is done, assuming I get any referrer spam by that point. I might change the update time from 3 hours to 12 or something, which will make it more likely that I'll get some kind of referrer spam by which to check if the recheck is working for me.

jj.

9 Sep 23, 2005 04:19

Hmm... I got the cron email, which included the following error:

Parse error: parse error, unexpected ';' in /path/to/the/blog/admin/b2antispam_recheck.php on line 24

The b2antispam_recheck.php file is the one here:
http://isaacschlueter.com/download/b2antispam_recheck

[EDIT: Okay, I think the problem is that in Isaac's code, the two ampersands got encoded to amp;amp;]

jj.

10 Sep 23, 2005 05:03

Nope, that wasn't the problem... Anyone have any ideas...?

[EDIT: never mind, I think that was, in fact, the problem. There was another set of encoded ampersands that I missed. I feel like I'm talking to myself.]

jj.

11 Sep 23, 2005 05:18

I would put the ?> at the end of the hacks file. If for no other reason than the principal of the thing. Nice tidy files are happy files :D

12 Sep 25, 2005 18:45

Okay, I have this all running now, and the cron emails are showing the recheck being performed, so all seems good.

I have the crontab set to update every two hours. Still trying to determine if that's too frequently, but for now it's working ok.

However, my site just got hit with referrer spam from a site called:

lookprices dot com

When I went into the admin antispam panel, and tried to manually add/ban that domain, I got the following error:

Fatal error: Call to undefined function: stats_hit_remote_addr() in /path/to/the/blog/admin/b2antispam.php on line 127

jj.

14 Sep 25, 2005 19:10

Yup, just ran it through examdiff and found the piece of code in question. The missing code is actually in /b2evocore/_functions_hitlogs.php. If anyone else has the same problem, I'm adding the piece below, copied from my v12 blog to my v10:

/*
 * stats_hit_remote_addr(-)
 */
function stats_hit_remote_addr()
{
	global $row_stats;
	echo $row_stats['hit_remote_addr'];
}

/*
 * stats_time(-)
 */

Thanks EdB.

jj.

15 Sep 25, 2005 19:25

The BEST way to deal with it is to upgrade. v10 to v12 at the very least, but going straight to dawn is even betterer. (Look who's talking eh? I'm still on v12! I have entirely too many poorly done, but important to me, hacks to make the transition - yet.)

16 Sep 25, 2005 19:39

Yeah, I've been thinking about moving my v10 to v12 but I'm concerned about what little differences may exist between the two. Luckily I've kept documentation on every little tweak and hack which I've implemented, so re-doing them wouldnt be too much of a headache.

Is Dawn considered a stable/production version?

jj.


Form is loading...