alexasigno Posted July 27, 2007 Share Posted July 27, 2007 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 More sharing options...
wmbetts Posted July 27, 2007 Share Posted July 27, 2007 You're not really suppose to php actual PHP in a smarty template. Try moving your PHP outside of your template. I'm not really sure if that will help or not, but it's worth a try. Link to comment https://forums.phpfreaks.com/topic/62076-php-problem-in-smarty-template/#findComment-309074 Share on other sites More sharing options...
alexasigno Posted July 27, 2007 Author Share Posted July 27, 2007 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 https://forums.phpfreaks.com/topic/62076-php-problem-in-smarty-template/#findComment-309123 Share on other sites More sharing options...
alexasigno Posted July 28, 2007 Author Share Posted July 28, 2007 Anyone else got an ideas? THanks Link to comment https://forums.phpfreaks.com/topic/62076-php-problem-in-smarty-template/#findComment-309469 Share on other sites More sharing options...
alexasigno Posted July 30, 2007 Author Share Posted July 30, 2007 btt Link to comment https://forums.phpfreaks.com/topic/62076-php-problem-in-smarty-template/#findComment-311302 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.