PDA

View Full Version : Custom WOL for index.php


evenmonkeys
03-26-2013, 04:24 AM
Currently, index.php points to "Viewing Forum Index" which is okay. I'd like to know if there's a way to make it so if they're on "index.php?page=example" that it would show "Viewing Page: Example" or something of the sort. I just can't figure out how to do it.

Thanks.

CoffeeLovesYou
03-26-2013, 09:16 AM
The way I learned how to do this;
Make a new plugin with any name
hook it to online_location_process

if ($filename == 'index.php?page=example')
{
$userinfo['activity'] = 'pageexample';
}

now make another plugin with a new name
hook to online_location_unknown

if($userinfo['activity'] == 'pageexample')
{
$userinfo['where'] = 'Example';
$userinfo['action'] = "Viewing Page:";
$handled = true;
}

This should work. Let me know if it doesn't. I only used it where the file ended with .php (for example, custompage.php), not when it didn't end with an extension (it's ending with ?page=example), but it may work still.

evenmonkeys
03-31-2013, 12:34 AM
Thanks for the reply. It doesn't appear to work though. I even tried adding to the first part.if ($filename == 'index.php' && $_REQUEST_['page'] == 'example')This did not work either.

CoffeeLovesYou
03-31-2013, 09:56 PM
What you added looks like it'd work. But why the extra underscore?

if ($filename == 'index.php' && $_REQUEST['page'] == 'example')

evenmonkeys
04-01-2013, 01:17 AM
Oh, I didn't mean to type that when I wrote it here. That doesn't work.