Webmastersite.net
Register Log In

Custom Template prepends all HREFs

Comments on Custom Template prepends all HREFs

joshberm
Nothing is impossible...

Usergroup: Customer
Joined: Aug 07, 2006
Location: Tampa, Florida

Total Topics: 36
Total Comments: 91
Posted Sep 11, 2006 - 6:59 PM:

I have installed a custom PHP script within a custom template (movies.tpl).

I have set up the "Custom Template Anywhere" hack so that the new page (movies.php) will have the uniform look & function of the WSN header and footer.

The problem is that this custom script echoes code back into movies.php, and WSN Links is prepending all the anchor HREFs with {DIRURL}.

Here's the source of movies.php:

<?php
$pathtowsn = '/data/10/0/130/155/945155/user/973349/htdocs/home/directory/'
$yourtemplatename = 'movies.tpl'
$usewrapper = 'yes'
$curr_path = getcwd();
chdir($pathtowsn);
require 'start.php'
if (!$template) $template = new template('custom/'. $yourtemplatename);
require 'end.php'
chdir($curr_path);
?>

I tried setting the path variables above to absolute URLs and that did not work.

I have taken the PHP from movies.tpl and executed it in its own file apart from this code above and the anchors come out fine. So it is definitely something in the hack or my setup that is affecting the HREFs.

Here's the page in question: http://www.gowesleychapel.com/directory/movies.ph...
joshberm
Nothing is impossible...

Usergroup: Customer
Joined: Aug 07, 2006
Location: Tampa, Florida

Total Topics: 36
Total Comments: 91
Posted Sep 12, 2006 - 6:57 PM:

Here's the workaround:

Create the PHP file your visitors will navigate to, and insert ONLY the "Custom Template Anywhere" code to call your custom template.

Inside the custom template TPL file, use a PHP include to call another PHP file, containing the custom PHP code you want to run.


Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Sep 13, 2006 - 9:48 AM:

You didn't show me your template, which is where the problem is, but I presume you simply need to use absolute URLs in your template -- don't change the php file.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.