The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
For one thing, your equation is wrong. If you were trying to find posts from 2 days and 3 hours ago, which is possible to do, you would end up with
2*3*60*60, which isn't right. What you need to do is to say that if hours, minutes, days, etc. aren't set, they are equal to 0. Then, your math looks like (days *24*60*60) + (hours *60*60) + (minutes*60) + seconds. |
#12
|
|||
|
|||
|
#13
|
||||
|
||||
It won't work for seconds.
You got lucky with hours, because days is set to 1. The equation for hours is TIMENOW - ($hours *60*60) because there are 60 minutes in an hour and 60 seconds in a minute. Anything bigger than an hour isn't a problem because your math holds true. The problem is with the minutes and seconds. |
#14
|
|||
|
|||
so what should i do, amy?
the original string of code for that section looked like this: Code:
// ############################################################################# if ($_REQUEST['do'] == 'getnew' OR $_REQUEST['do'] == 'getdaily') { globalize($_REQUEST, array( 'forumid' => INT, 'days' => INT, 'exclude' => STR )); // get date: if ($_REQUEST['do'] == 'getnew' AND $bbuserinfo['lastvisit'] != 0) { // if action = getnew and last visit date is set $datecut = $bbuserinfo['lastvisit']; } else { $_REQUEST['do'] = 'getdaily'; if ($days < 1) { $days = 1; } $datecut = TIMENOW - (24 * 60 * 60 * $days); } |
#15
|
||||
|
||||
PHP Code:
|
#16
|
||||
|
||||
You can't default the variables to 0, that'll make it TIMENOW - 0 when you multiply anything by it.
|
#17
|
||||
|
||||
Quote:
And, no Saber. That's not what I was saying My board is down right now so I can't test this, but I imagine it would look like this: Code:
else { $_REQUEST['do'] = 'getdaily'; if (($days < 1)AND(!$hours)AND(!$minutes)AND(!$seconds)) { $days = 1; $hours = 0; $minutes = 0; $seconds = 0; } elseif($days < 1) { $days = 0; } $datecut = TIMENOW - (($days*24*60*60) + ($hours*60*60) + ($minutes*60) + $seconds); } Within that elseif block, you should check to see if the hours, minutes and seconds are properly set and initialize them to 0 if not. |
#18
|
||||
|
||||
my site's back up, and it seems like it works as I posted it.
|
#19
|
|||
|
|||
amykhar is my hero!!!
|
#20
|
||||
|
||||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|