1 jibberjab Sep 20, 2005 22:46
3 edb 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 personman 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 edb 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 personman 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 jibberjab 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 jibberjab 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 jibberjab 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 jibberjab 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 edb 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 jibberjab 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.
13 edb Sep 25, 2005 18:54
It's a version thing. You're running 0.9.0.10 with a hack made for 0.9.0.12. http://forums.b2evolution.net/viewtopic.php?p=24865#24865 begins an explanation of a solution.
14 jibberjab 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 edb 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 jibberjab 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.
EdB has upgraded his hack to work with the current version of b2evo, which is 0.9.1 :
http://wonderwinds.com/hackblog.php/2005/09/18/antispam_rechecking_dawn
And I created a successor to Isaac's blacklist update + recheck cronable script:
http://wonderwinds.com/hackblog.php/2005/09/18/antispam_rechecking_dawn#c346
I don't know what's going wrong for you now, but you could always just upgrade to the new version and apply these new hacks.