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
https://forums.phpfreaks.com/topic/62076-php-problem-in-smarty-template/
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  :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.