kennn
04-26-2006, 09:50 PM
I recently started using this plugin (http://www.vbulletin.org/forum/showthread.php?t=98887) by Paul M. on my forum which maintains "most" stats, like most visitors in one day (goes with the who has visited plugin) and most posters in one day (goes with the who has posted plugin), etc.
Today I noticed that the stats were being overwritten (at least I think that is what is going on) and I think I've tracked it down to the ONLINEUSERS module of CMPS. For example, yesterday the most users in one day was 8 (yes, I run a very small private family forum) and today the most users in one day is listed as 6. There were 6 visitors today (so far) so the "most" stat should still be showing 8.
I believe this is the pertinent code in ONLINEUSERS that is doing it:
$maxusers['maxonline'] = $vbulletin->maxloggedin['maxonline'];
if ($vbulletin->maxloggedin['maxonline'] <= $totalonline)
{
$maxusers['maxonline'] = $totalonline;
$maxusers['maxonlinedate'] = TIMENOW;
$db->query_write("UPDATE " . TABLE_PREFIX . "datastore SET data='" . addslashes(serialize($maxusers)) . "' WHERE title = 'maxloggedin'");
}
$recordusers = $maxusers['maxonline'];
$recorddate = vbdate($vbulletin->options['dateformat'], $vbulletin->maxloggedin['maxonlinedate'], 1);
$recordtime = vbdate($vbulletin->options['timeformat'], $vbulletin->maxloggedin['maxonlinedate']);
Paul M. has stated on vBulletin.org that the plugin stores its info in the maxloggedin datastore and this bit of code above seems to be writing to that same datastore.
First of all, I'm no programmer so I could be completely wrong about what is going on and could also be wrong about the code above being the culprit, so if someone could confirm this, that would be great.
Second, if I'm right, I'd like to continue using both the ONLINEUSERS module and the "most" plugin if possible. Is there anyway that the ONLINEUSERS module could be "adjusted" to prevent it from overwriting the data stored by the plugin? Note, I posted pretty much the same details on the thread at vBulletin.org linked above, too, but I figured I'd check here as well.
Thanks!
Today I noticed that the stats were being overwritten (at least I think that is what is going on) and I think I've tracked it down to the ONLINEUSERS module of CMPS. For example, yesterday the most users in one day was 8 (yes, I run a very small private family forum) and today the most users in one day is listed as 6. There were 6 visitors today (so far) so the "most" stat should still be showing 8.
I believe this is the pertinent code in ONLINEUSERS that is doing it:
$maxusers['maxonline'] = $vbulletin->maxloggedin['maxonline'];
if ($vbulletin->maxloggedin['maxonline'] <= $totalonline)
{
$maxusers['maxonline'] = $totalonline;
$maxusers['maxonlinedate'] = TIMENOW;
$db->query_write("UPDATE " . TABLE_PREFIX . "datastore SET data='" . addslashes(serialize($maxusers)) . "' WHERE title = 'maxloggedin'");
}
$recordusers = $maxusers['maxonline'];
$recorddate = vbdate($vbulletin->options['dateformat'], $vbulletin->maxloggedin['maxonlinedate'], 1);
$recordtime = vbdate($vbulletin->options['timeformat'], $vbulletin->maxloggedin['maxonlinedate']);
Paul M. has stated on vBulletin.org that the plugin stores its info in the maxloggedin datastore and this bit of code above seems to be writing to that same datastore.
First of all, I'm no programmer so I could be completely wrong about what is going on and could also be wrong about the code above being the culprit, so if someone could confirm this, that would be great.
Second, if I'm right, I'd like to continue using both the ONLINEUSERS module and the "most" plugin if possible. Is there anyway that the ONLINEUSERS module could be "adjusted" to prevent it from overwriting the data stored by the plugin? Note, I posted pretty much the same details on the thread at vBulletin.org linked above, too, but I figured I'd check here as well.
Thanks!