sim tech |
03-20-2005 03:42 AM |
I think I may have a clue as to what the one poster was talking about as far as it not working.
Maybe he has both of your mods just like me. I found that if the
Total members that have posted today
and the
Total users that have visited today
had both of their time set to reset at midnight (not rolling 24 hours) then one of them would not work, typically the Total users that have visited today one. ( Is this because of where it's placed in reference to the other?
So I changed one to show the rolling 24 hours, and the other was just on regular time, and they both started working.
At least that's how it appeared on this end.
:alien:
PHP Code:
// ############### Paul M - Who has visited today v1.40 #################
require_once('./includes/functions_misc.php');
$now = TIMENOW - intval($vboptions['hourdif']);
//$cutoff = vbmktime(0, 0, 0, date('m', $now), date('d', $now), date('Y', $now));
$cutoff = $now - 86400 ; // ## Uncomment this line if you want a rolling 24 hours display ## //
$todaysusers = $DB_site->query("SELECT userid, lastactivity, options, username, opentag, closetag
FROM " . TABLE_PREFIX . "user as user
LEFT JOIN " . TABLE_PREFIX . "usergroup as usergroup ON(user.usergroupid = usergroup.usergroupid)
WHERE lastactivity > " .$cutoff. " ORDER BY username" );
$totaltoday = 0;
while ($today = $DB_site->fetch_array($todaysusers))
{
$today[visible] = 1 ;
$totaltoday += 1;
if ($today[options] & $_USEROPTIONS[invisible])
{
$today[visible] = 0 ;
if (($permissions['genericpermissions'] & CANSEEHIDDEN) OR $today['userid'] == $bbuserinfo['userid'])
{
$today[visible] = 2 ;
}
}
if ($today[visible])
{
$wrdate = vbdate($vboptions['timeformat'], $today['lastactivity']);
$whotoday .= "<a href='member.php?u=$today[userid]' title='$wrdate' >";
if ($today[visible] == 2)
{
$whotoday .= $today['opentag'].$today[username].$today['closetag']."</a>*, ";
}
else
{
$whotoday .= $today['opentag'].$today[username].$today['closetag']."</a>, ";
}
}
}
if ($whotoday)
{
$whotoday = substr($whotoday, 0, strlen($whotoday)-2);
}
// ############# End of Who has visited today ###############
// ############# Paul Marsden - Who has posted today v1.40 ###############
$now = TIMENOW ;
require_once('./includes/functions_misc.php');
$cutoff = vbmktime(0, 0, 0, vbdate('m', $now. false, false), vbdate('d', $now. false, false), vbdate('Y', $now. false, false));
//$cutoff = $now - 86400 ; // Uncomment this line if you want a rolling last 24 hours.
$todaysposters = $DB_site->query("SELECT userid, lastpost, options, username, opentag, closetag
FROM " . TABLE_PREFIX . "user as user
LEFT JOIN " . TABLE_PREFIX . "usergroup as usergroup ON(user.usergroupid = usergroup.usergroupid)
WHERE lastpost > " .$cutoff. " ORDER BY username" );
unset ($posttoday);
$posterstoday = 0;
while ($today = $DB_site->fetch_array($todaysposters))
{
$today[visible] = 1 ;
$posterstoday += 1;
if ($today[options] & $_USEROPTIONS[invisible])
{
$today[visible] = 0 ;
if (($permissions['genericpermissions'] & CANSEEHIDDEN) OR $today['userid'] == $bbuserinfo['userid'])
{
$today[visible] = 2 ;
}
}
if ($today[visible])
{
$wrdate = vbdate($vboptions['timeformat'], $today['lastpost']);
$posttoday .= "<a href='search.php?do=finduser&u=$today[userid]' title='$wrdate' >";
if ($today[visible] == 2)
{
$posttoday .= $today['opentag'].$today[username].$today['closetag']."</a>*, ";
}
else
{
$posttoday .= $today['opentag'].$today[username].$today['closetag']."</a>, ";
}
}
}
if ($posttoday)
{
$posttoday = substr($posttoday, 0, strlen($posttoday)-2);
}
// ############# End of Who has posted today ###############
|