08-01-2012, 03:43 PM
08-01-2012, 05:47 PM
Is not there a settings for this within MyBB? Pretty sure it does... try under server configurations or similar.
08-02-2012, 05:13 AM
Oh sorry I didn't mean for mybb's thread searches, but for a seperate query i'm adding.
I found this on the internet but am a little confused by it:
I found this on the internet but am a little confused by it:
PHP Code:
|
Could someone explain to me if that's the method I would use to store a persons last search time, and also how I could use that to add a check using that method for if a person made a search within the last 30 seconds, and if they did itll echo them some message, if not they can continue?
08-02-2012, 07:55 AM
It's a function that you need to analyse and determine the solution for.
Ultimately you need some mechanism for:
Ultimately you need some mechanism for:
- tracking people
- determining their last search time
- throwing an error if you find they've committed a search not long ago
08-02-2012, 04:38 PM
Thanks Zinga,
I tried this:
I tried this:
PHP Code:
|
However I can't figure out what is wrong with this code. It is basically ignoring my first if statement and always returning $nosearch as well going through my while loop, Can you spot what i'm doing wrong?
08-02-2012, 11:23 PM
Both code paths will never be executed.
Perhaps check this condition
Perhaps check this condition
PHP Code:
|
08-03-2012, 04:02 AM
(08-02-2012 11:23 PM)ZiNgA BuRgA Wrote: [ -> ]Both code paths will never be executed.
Perhaps check this condition
PHP Code:
$_SESSION['last_search'] + $limit < time()
Hmm, this really has me stumped.
As far as i'm aware the first time the user searches, the if statement should return false since $_SESSION['ip'] isn't set yet, so it should skip to the else statement and record the current time of the search. The 2nd time they try to search, the $_SESSION['ip'] var should be set, and then it should check if the recorded time of the first search + 10 seconds is greater than the current time. Obviously that can't be correct or it would work but... how is it wrong? haha
08-03-2012, 07:49 AM
(08-03-2012 04:02 AM)mdb Wrote: [ -> ]is greater thanAnd what's the greater than symbol again?