Jump to content

PHP problem in smarty template


alexasigno

Recommended Posts

Hi i am trying to get the following code to work in the smarty template system, it all works fine normally but im not quite sure what i am doing wrong with the smarty template.

 

If you could spare any help it would be most appreciated.

 

Many thanks

Alex

 

 

{php}
$URL = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
if ( $URL == "http://www.alexasigno.co.uk/travel/" | $URL == "http://www.alexasigno.co.uk/travel/index.php"){

function add_filter($a,$b) { }; // this is a function that WordPress normally provides
define("ABSPATH",'./'); // this is a constant that WordPress normally provides
include 'inlineRSS.php'; // this is the unmodified inlineRSS.php file
inlineRSS('travel'); // and finally, this is the call to your feed

}

$URL = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
if ( $URL == "http://www.alexasigno.co.uk/travel/ski_holidays/" | $URL == "http://www.alexasigno.co.uk/travel/ski_holidays/index.php"){

function add_filter($a,$b) { }; // this is a function that WordPress normally provides
define("ABSPATH",'./'); // this is a constant that WordPress normally provides
include 'inlineRSS.php'; // this is the unmodified inlineRSS.php file
inlineRSS('ski'); // and finally, this is the call to your feed

{/php}

Link to comment
Share on other sites

Hi i have tried putting the code in an include file and have linked it in with

{include_php file="/testfile.php"}

 

However i get an error

 

Warning: Smarty error: file:/travel/test.php is not readable in /home/alexf40/public_html/alexasigno/travel/libs/smarty/Smarty.class.php on line 1095

 

Any ideas?

 

Thank you  :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.