PDA

View Full Version : Dynamic Who's Online Info Broken


007
12-27-2008, 03:44 AM
Some products here such as the arcade hack and others have code that displays extra information in Who's Online about a user's actions.

i.e. If a user is on /file.php?action=testing

I can add the following code to online_location_unknown:

$action =& $userinfo['values']['action'];

and then display "$action" in the who's online bit.

I moved my forums to a new server and suddenly this code stopped working.

Has anybody had this happen before? Any ideas what might have stopped this from working?

Lynne
12-27-2008, 04:01 PM
There should be two plugins to make it work. Perhaps you disabled one? This is what I do:

Create two plugins using the following hooks. Replace mypage and similar with your information.

hook online_location_process:
Code:

switch ($filename)
{
case 'mypage.php':
$userinfo['activity'] = 'mypage';
break;
// add more cases here if you have more than one custom page. no need for multiple plugins. one plugin can handle all.
}


hook online_location_unknown
Code:

switch ($userinfo['activity'])
{
case 'mypage':
$userinfo['where'] = '<a href="mypage.php?'.$vbulletin->session->vars[sessionurl].'">My Page</a>';
$userinfo['action'] = "Viewing My Page";
$handled = true;
break;
// add more cases here if you have more than one custom page. no need for multiple plugins. one plugin can handle all.
}

007
12-27-2008, 04:16 PM
I know about those plugins. The problem is this doesn't work across VB, not just in plugins.

For example, profile.php?do=editsignature usually would show "Editing Signature" in Who's Online but now it just shows "Viewing Control Panel".

This isn't a result of any code changes but simply moving to a new server. I imagine it has something to do with how PHP is configured but I have no clue what to change that would affect this.

Lynne
12-27-2008, 04:22 PM
Hmmmm, servers are a kinda vague area of knowledge for me. I am not sure what to suggest you look at. If your host is familiar with vbulletin, perhaps they may have an idea?

Marco van Herwaarden
12-27-2008, 04:32 PM
Very hard to troubleshoot only based on descriptions. If this also happens when your modifications are disabled, then please open a support ticket so someone can take a look. But i doubt it is server configuration related.

007
12-27-2008, 05:32 PM
Very hard to troubleshoot only based on descriptions. If this also happens when your modifications are disabled, then please open a support ticket so someone can take a look. But i doubt it is server configuration related.

How could it not be server config related though? It worked fine on the old server and not on the new server, with zero changes besides moving to the new server. I am all ears though. By support ticket do you mean on VB.com? I have posted a thread there but didn't make a ticket yet.

Marco van Herwaarden
12-27-2008, 05:59 PM
Yes a Support Ticket on vB.com. The easiest way to troubleshoot this is when 1 of our technicials can login to the server to see what happens.

007
12-27-2008, 10:41 PM
I found the problem. PHP MySQL libraries did not match the version of MySQL installed. Reverting to the versions I had used before fixed this issue. Weird.

Lynne
12-27-2008, 11:44 PM
Wow, that's a really weird one. Glad you figured it out.

Marco van Herwaarden
12-28-2008, 07:33 AM
A bt surprised that this was the cause. Somehow a cash of encodings probably.