Log in

View Full Version : Custom Page O utside Directory Issues


Jarocks
08-12-2008, 02:48 PM
Is there a way to get the relative links and images to work in a custom vbulletin page outside the directory without having to go into the style and edit all the paths.
Edit: I have found a rudimentary solution to solve the image issue.
$headinclude = str_replace('images', $vbulletin->options['bburl'] . '/images', $headinclude);

$header = str_replace('images', $vbulletin->options['bburl'] . '/images', $header);

$footer = str_replace('images', $vbulletin->options['bburl'] . '/images', $footer);

should I go about doing the same for the links or is there an better way?

--------------- Added 1218559131 at 1218559131 ---------------

$headinclude = str_replace('href="', 'href="' . $vbulletin->options['bburl'] . '/', $headinclude);

$header = str_replace('href="', 'href="' . $vbulletin->options['bburl'] . '/', $header);

$footer = str_replace('href="', 'href="' . $vbulletin->options['bburl'] . '/', $footer);

$headinclude = str_replace('action="', 'action="' . $vbulletin->options['bburl'] . '/', $headinclude);

$header = str_replace('action="', 'action="' . $vbulletin->options['bburl'] . '/', $header);

$footer = str_replace('action="', 'action="' . $vbulletin->options['bburl'] . '/', $footer);

This sort of works but it seems like there should be a much simpler way to do it.

LT Mote
08-12-2008, 06:46 PM
Place this code IN the custom page...


chdir('./../');
require_once('./global.php');


Let me know if u need further assistance

RLShare
08-12-2008, 06:56 PM
If he is getting those template values in the first place then he already has that worked out and it won't fix his problem. Actually if you look at the code he's replacing all relative paths with full paths

Try adding a base url in the head tag of your custom page/template...
<base href="http://YOURFORUMURL" />