PDA

View Full Version : Links to external


doubleclick
02-03-2011, 12:43 PM
Hello -

I've been trying to learn how to use templates outside the forum directory by duplicating the online.php page, and putting it a level up.


I added chdir('forum'); to the top of the page.
I created a new template in the admincp for the WHOSONLINE and added /forum/ in front of all links there.
Added eval('print_output("' . fetch_template('WHOSONLINE-external') . '");'); to the end of the externalonline.php file.


All links and data are working correctly except the location link, which refuses to add "forum" to the path. This comes from the $onlinebits which is in the copy of the template I made, and I've tried a number of ways to point to a level down to the forum directory, but no luck.

Interestingly enough, when I hover over a user's location, the alt-text correctly shows the correct information.

THis is probably a very simple fix, but I've tried and errored a fix for too long. Any ideas?

Thanks,
dc

BirdOPrey5
02-03-2011, 03:52 PM
My guess would be a plugin the runs on an "online" hook that uses THIS_SCRIPT to see if its being run from the external file and if so, modify the variable holding the path to manually add /forum/ to it...

That is if i understand what you are tying to do...

doubleclick
02-03-2011, 04:54 PM
In a nutshell, I'm just trying to get a copy of the online.php file to work above the forum directory. Is that how you understood it?

BirdOPrey5
02-03-2011, 05:03 PM
Basically, but I guess since it's it's own file you don't need a plugin you could just edit the code directly.

doubleclick
02-03-2011, 06:15 PM
I've tried everything, but can't find what to change or where to change it. What really drives me nuts is that every other link on the page works.

Do you know what to do to make this work as it should?

BirdOPrey5
02-03-2011, 07:33 PM
Looking more closely this is being controlled by the template: whosonlinebit and I believe the location and associated link is stored in the variable: $userinfo[where]

In your custom php page I think you need code to read in the data in $userinfo[where] and alter it to add /forums/ to the link.