Ah, it is this function in the extension:
// Return current time in the format preferred by your database.
function bb2_db_date() {
global $LOC;
return $LOC->now; // Example is MySQL format
}
The top note makes it sound like any date format will be accepted so I put in a Unix timestamp set for GMT, which is the standard way EE does dates, but he is using the MySQL field type ‘datetime’, which will only accept that one format. Bother. Try replacing that function with this new one below, and I will update the download too:
// Return current time in the format preferred by your database.
function bb2_db_date() {
global $LOC;
return date('Y-m-d h:i:s', $LOC->now); // Example is MySQL format
}
Hey Paul, I tried adding this to a couple of sites on different hosts, both running 1.4.2, but I get the following errors when posting a comment (the comment goes through though):
Notice: Undefined variable: screener2 in /home/blah/system/public_html/cp/extensions/bad-behavior/post.inc.php on line 32 Notice: Undefined property: num_rows in /home/blah/system/public_html/cp/extensions/ext.bad_behavior.php on line 68 Warning: Cannot modify header information - headers already sent by (output started at….
I’m using 2.0.5 of Bad Behavior. Is this something I should take up with the BB guys, or something to do with the extension (or something I missed!)? I wondered if the newer version of BB might be to blame, but apparently there’s a fix for EE in there.
Thanks!
Well, that first error reminds me of an error BB 2 had in their code, and their suggestion was to simply turn off error reporting. I see that they are on version 2.06 now, so perhaps try upgrading and seeing if the error goes away? As for the second, it seems something is going wrong with the abstraction layer. Do not recall this happening previously, so I can only hope it is on their site as I do not want to go through all of their code to find where it might be going awry. So, upgrade?
Thanks Paul, I gave upgrading to 2.0.6 a try but the errors remained, however I found when I turned off error reporting as per sigork’s comment on this post that seemed to do the trick, insofar as there’s no longer errors being reported! I’m only getting the occasional spam on a couple of sites and using it pre-emptively on another, so I guess I’ll just wait and see what happens.
Cheers!
BTW I think there’s a small bug in the extension with verbose logging not being set to off, despite it appearing to be off by default. I noticed that all requests were being logged until I went into the settings and hit ‘submit’, which stopped the normal requests being logged.
BTW I think there’s a small bug in the extension with verbose logging *not* being set to off, despite it appearing to be off by default. I noticed that all requests were being logged until I went into the settings and hit ‘submit’, which stopped the normal requests being logged.
Could you expand on this more? Hitting Submit?
Sure, sorry I meant hitting submit on the bad behavior extension settings page.
So basically what was happening was…
I was keeping an eye on the exp_bad_behavior table & I noticed ordinary requests for the home page etc were being logged.
When I went to Admin > Utils > Extensions Manager > Bad Behaviour settings, ‘Verbose’ appears to be set to ‘Off’, however the behavior of the extension is as though verbose logging is ‘on’. Without changing any of the extension settings (they all appear to be set to ‘off’ by default), I hit submit, which seemed to change the behavior of the extension so verbose logging stopped.
Hope that’s clearer :)
I just installed this on the latest EE and it worked (well installed fine)
I was a bit confused by which folder to upload in the extensions.
It needs to be the 2nd folder named “bad-behavior” the one at the same level as the readme not the one including the readme.
Hope this helps.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.