Log in

View Full Version : VBA problem? Need a bit of coding help please.


jailer
11-06-2006, 11:46 AM
Not posting on the VBA forum yet, chances of a reply there are slim to none.


The Most Ever Users Online was 1 on 01 01 1970

I've got that showing on my forum home page after the forum hit over 100 members online and 'broke'.
As per: http://www.vbulletin.com/forum/showthread.php?t=203222
(pages 4 & 5)
I've tried loads to fix it to no avail.
I'm told now I have to remove VBAdvanced for the problem to go away..
I'm not prepared to do this, so I'm looking for help in manually editing a template or PHP file that shows this info in the What's Going On box.

Any pointers would be very much appreciated.
It looks terrible.

Thanks in advance.

Paul M
11-06-2006, 02:24 PM
To fix the VBA usersonline module (for vb 3.6) either use the copy in CMPS 2.2.1 or read this post (http://www.vbadvanced.com/forum/showthread.php?p=96689#post96689), which is where I asked them to fix the incorrect code they use.

jailer
11-06-2006, 05:43 PM
Thanks Paul and much as appreciate 100% your coding skills and opinions, altering that code still doesn't work for me.
I re ran the query:

UPDATE datastore
SET data = ''
WHERE title = 'maxloggedin'

afterwards too, but after a refresh, the forum still shows 01-01-1970

:confused:

:edit:
Just uploaded the copy from 2.2.1 also - still no difference.
Sorry to be a pain.
:(

As you suggested in the other thread, I've downloaded all my non-standard files and scanned them for maxloggedin

The only two files I find it in are:

vba_cmps_include_template.php
forum.php (which is VB's index.php renamed)

________


:edit 2:

OK, think I've fixed it.

Following your code with the serializing, I have altered the code in the VB forum.php (originally index.php) as so:

// ### MAX LOGGEDIN USERS ################################
if (intval($vbulletin->maxloggedin['maxonline']) <= $totalonline)
{
$vbulletin->maxloggedin['maxonline'] = $totalonline;
$vbulletin->maxloggedin['maxonlinedate'] = TIMENOW;
build_datastore('maxloggedin', serialize($vbulletin->maxloggedin));
}

Is now:

// ### MAX LOGGEDIN USERS ################################
if (intval($vbulletin->maxloggedin['maxonline']) <= $totalonline)
{
$vbulletin->maxloggedin['maxonline'] = $totalonline;
$vbulletin->maxloggedin['maxonlinedate'] = TIMENOW;
build_datastore('maxloggedin', serialize($vbulletin->maxloggedin), 1);
}

Added the , 1

Seems to have done the trick.
Does this sound abnormal to you Paul?


Hopefully those with a similar problem might search and find a solution.

Paul M
11-07-2006, 09:42 AM
That looks exactly correct, if the ',1' is missing from the build_datastore() call then it will almost certainly break the 'maxloggedin' values on a vbulletin 3.6 installation.

jailer
11-07-2006, 09:44 AM
Wow. A VB bug then perhaps?

Kidswap
11-07-2006, 06:34 PM
I did a check and all of my maxloggedin already have the '1'. I deleted everything that had to do with vbcmps and still no luck fixing this.

newbe_haselina
11-08-2006, 03:56 AM
Hi Jailor,

that's terriffic !!! :laugh: It works! I can't tell you how happy I am!

Thank you very much, and thanks to all the others trying to give me a little help.

But I'm wondering, if it's a bug?! I mentioned, that I set for security reasons some files to CHMOD 644, also the index.php ... is it possible that the index.php was not updated? Just a guess why this happened.

But anyway, works fine now and I am really thankfull.

jailer
11-10-2006, 11:38 AM
Yep, I think it's a bug - glad you got it sorted. Must say, I was thrilled myself.
:)
Kidswap, have you tried adding the , 1 to your VB index.php ..?