PDA

View Full Version : /forums/affiliates.php Unknown Location /forums/affiliates.php


DarkGizmo
03-10-2011, 05:31 PM
Is it possible to edit the who's online bit to make it say something more along the lines of:

"Viewing Affiliates"

instead of showing something like this?

Unknown Location
/forums/affiliates.php


Thanks! :D

BirdOPrey5
03-13-2011, 09:55 PM
make a plugin on the hook: online_location_unknown with the following php code:

if (strpos($userinfo['location'], 'forums/affiliates.php') === true)
{
$userinfo['action'] = 'Viewing Affiliates';
$handled = true;
}


*should* work...

DarkGizmo
03-20-2011, 12:03 AM
Still says unknown location..... Hmm....

BirdOPrey5
03-20-2011, 12:31 AM
try without the forums/... just:

if (strpos($userinfo['location'], 'affiliates.php') === true)
{
$userinfo['action'] = 'Viewing Affiliates';
$handled = true;
}

DarkGizmo
03-20-2011, 12:49 AM
Nope, still nothing :-\

BirdOPrey5
03-20-2011, 01:07 AM
weird, thats working for me on a custom page...

but anyway here is an article that explains another way of doing it:
https://vborg.vbsupport.ru/showthread.php?t=121776

DarkGizmo
03-20-2011, 01:23 AM
Thanks but that STILL didn't fix it.....what the hell? :-\

kh99
03-20-2011, 01:41 AM
if (strpos($userinfo['location'], 'affiliates.php') === true)
{
$userinfo['action'] = 'Viewing Affiliates';
$handled = true;
}


Does "=== true" work for you? It seems like since strpos() returns an int or else false, it would never be true.

DarkGizmo
03-20-2011, 01:51 AM
Any ideas what would work then, kh99?

kh99
03-20-2011, 01:55 AM
I guess you could try changing "=== true" to "!== false".

DarkGizmo
03-20-2011, 02:01 AM
That did it :D How could I make it a link to the page though? :D

BirdOPrey5
03-20-2011, 12:01 PM
kh99 to the rescue again... Yeah mine did say !== false but I forgot why it said that and not === true, which I figured was logically equivalent. :o

To add a link add an extra line to the plugin right above $handled = true;:

$userinfo['where'] = "<a href=\"affiliates.php?{$vbulletin->session->vars['sessionurl_q']}\">Affiliates</a>";
}

At least according to that article.

DarkGizmo
03-20-2011, 04:59 PM
Thanks. That did it :)