Boofo
06-03-2004, 10:40 PM
I have a strange request here that I'm hoping someone can help me with. First of all, here is the code I am currently working with:
require_once('./includes/functions_misc.php');
$timestamp = vbmktime(0, 0, 0, vbdate('m', TIMENOW, false, false), vbdate('d', TIMENOW, false, false), vbdate('Y', TIMENOW, false, false));
// <!-- NEW REGISTRATIONS TODAY -->
$newestusers = $DB_site->query_first("
SELECT COUNT(*) AS count
FROM " . TABLE_PREFIX . "user
WHERE joindate >= $timestamp
");
$statscache['newusers'] = intval ($newestusers[count]);
Ok, this work like it is supposed to. The newuser will change at midnight for each user according to their time offset. The follwing code is where I am having the problem.
if($statscache['newusers'] > '0')
{
if ($bbuserinfo['userid'] == '1')
{
$statscache['newusers'] = sprintf("<a href=\"admincp/user.php?$session[sessionurl]do=find&user[joindateafter]=%s\" target=\"_blank\">%d</a>", date('Y-m-d'), vb_number_format($statscache['newusers']));
}
else
{
$statscache['newusers'] = vb_number_format($statscache['newusers']);
}
}
The link to the newuser profile tells me it couldn't match the query. It doesn't go to the user's profile now. Can anyone please help me figure out how to make it work with the timestamp variable?
require_once('./includes/functions_misc.php');
$timestamp = vbmktime(0, 0, 0, vbdate('m', TIMENOW, false, false), vbdate('d', TIMENOW, false, false), vbdate('Y', TIMENOW, false, false));
// <!-- NEW REGISTRATIONS TODAY -->
$newestusers = $DB_site->query_first("
SELECT COUNT(*) AS count
FROM " . TABLE_PREFIX . "user
WHERE joindate >= $timestamp
");
$statscache['newusers'] = intval ($newestusers[count]);
Ok, this work like it is supposed to. The newuser will change at midnight for each user according to their time offset. The follwing code is where I am having the problem.
if($statscache['newusers'] > '0')
{
if ($bbuserinfo['userid'] == '1')
{
$statscache['newusers'] = sprintf("<a href=\"admincp/user.php?$session[sessionurl]do=find&user[joindateafter]=%s\" target=\"_blank\">%d</a>", date('Y-m-d'), vb_number_format($statscache['newusers']));
}
else
{
$statscache['newusers'] = vb_number_format($statscache['newusers']);
}
}
The link to the newuser profile tells me it couldn't match the query. It doesn't go to the user's profile now. Can anyone please help me figure out how to make it work with the timestamp variable?