trevelyn1015
02-18-2008, 05:44 AM
ok, I'm trying to mod my search.php so that it can recognize looking for threads from certain amounts of time back (instead of one day/since last visit)
before on 3.0.3 i had this done:
In your search.php:
Find:
'days' => INT,Below, add:
'hours' => INT,
'minutes' => INT,
'seconds' => INT,
Then, find:
// 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);
}
Replace with:
// 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)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);
}
I now want to do the equivalent in 3.6.8
I am wondering how I edit the search.php accordingly?
before on 3.0.3 i had this done:
In your search.php:
Find:
'days' => INT,Below, add:
'hours' => INT,
'minutes' => INT,
'seconds' => INT,
Then, find:
// 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);
}
Replace with:
// 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)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);
}
I now want to do the equivalent in 3.6.8
I am wondering how I edit the search.php accordingly?