![]() |
Need help putting code into .tpl file - php rss2
Okay,
I've seen RSS discussions before (there are mods for sale out there) but I thought I might try to do some tweeking myself based off some code another person wrote. I think I've got a pretty hot idea that could work but I'm missing one or two small details that I hope you guys can help me with. Please take a look at: http://madhatterrgames.com/rss2html.php?XMLFILE=http://madhatterrgames.com/phpBB3/generate_feed.php%3fcont...tml&MAXITEMS=1 That's what the feed will look like at the top of my center/right area on this page (and, because of where I'm putting it in the home.tpl file, all my pages) http://www.madhatterrgames.com/home.php ... on the home.php page it would appear just above the category images. The code I'd like to put into the home.tpl would look something like this (I think): Code:
<?php or Code:
<?php Initially I tried putting the first in without the <?php tag and the ?> end tag. No dice. Second I tried the same with the second and then with putting { } around hte include command making sure to try it with a space before and after the include command. All three attempts failed and produced errors. I'm pretty sure I should be able to make this appear in the home.tpl ... I'm just failing in the execution of it. LOL Could someone please give me a hand with this one. I promise eternal gratitude and cookies if we ever meet face to face. *wink* -Dee :mrgreen: |
Re: Need help putting code into .tpl file - php rss2
*polite bump*
|
Re: Need help putting code into .tpl file - php rss2
Smarty was designed to divide HTML markup and PHP script. So it is not convinient to put PHP scripts into template.
But it is possible Wrap the PHP code with tags HTML Code:
|
Re: Need help putting code into .tpl file - php rss2
So it should look like this?
Code:
{php} |
Re: Need help putting code into .tpl file - php rss2
Okay I'm fiddling still (thanks btw for replying!) here's what I've gotten so far in trial and error.
When I put it in like this Code:
{php} I get this: Parse error: syntax error, unexpected '<' in /.../public_html/var/templates_c/%%5A^5A2^5A22702C%%home.tpl.php on line 206 When I put it in like this: Code:
{php} I get this: Parse error: syntax error, unexpected '<' in /.../public_html/var/templates_c/%%5A^5A2^5A22702C%%home.tpl.php on line 206 When I put it in like this: Code:
{php} I get this: Parse error: syntax error, unexpected '<' in /.../public_html/var/templates_c/%%5A^5A2^5A22702C%%home.tpl.php on line 206 When I put it in like this: Code:
{php} I get this: Warning: include() [function.include]: URL file-access is disabled in the server configuration in /.../public_html/var/templates_c/%%5A^5A2^5A22702C%%home.tpl.php on line 206 |
Re: Need help putting code into .tpl file - php rss2
HTML Code:
should not work due to security reasons You have to specify not the URL of the file, but path to it from the directory where your store is located Cleanup templates cache with HTML Code:
http://madhatterrgames.com/pathToYourStore/cleanup.php HTML Code:
{php} if rss2html.php is located in the folder with your store. |
Re: Need help putting code into .tpl file - php rss2
Thank You SOOO MUCH for taking your time to help me out with this. :mrgreen:
I did as you instructed and got the following error: Quote:
Any other help you can give is greatly appriciated. -Dee |
Re: Need help putting code into .tpl file - php rss2
it's like poking all around without access to your server ;)
One more try: Place rss2html.php in the root of your webserver and the add just one more slash: HTML Code:
|
Re: Need help putting code into .tpl file - php rss2
LOL, the things we go through for better seo and content. :roll:
Alright, tried the above and got this error: Quote:
As for your mention of access to our website, any chance you'd be willing to nose around? If so I'd be willing to drop you the information, it might be quicker than this guess work based off my replies (since you seem willing to assist us until we get it right ... did I mention how VERY much I appriciate this?) Anyway, even if you're not willing... thanks and hopefully we'll get this figured out soon. I'm sure it will be a ton better for our site than the iframe solution I'm using right now. -Dee |
Re: Need help putting code into .tpl file - php rss2
For those looking to put an rss feed reader on their page, here's a GREAT & FREE solution: http://www.xcartmods.co.uk/x-cart-rss-feeds-displayer-v4x-x-cart-mods-pr-17.html
Victor, thanks ever so much for your help but it seems someone beat me to the answer on how to do it! :) If I do any successful tinkering with it, I'll post here and share. YAY!!! :D/ -Dee |
Re: Need help putting code into .tpl file - php rss2
The last affort to make it end shedding hardly any blood :)
Insert this somewhere into your template f.e. skin1/customer/home.tpl, HTML Code:
put the script rss2html.php to directory that will be displayed after viewing this template in browser clear cache and use this variant HTML Code:
|
All times are GMT -8. The time now is 03:16 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.