added a php code snippet to my template now i get a smarty error?!?!?!?!

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
aejeffor

added a php code snippet to my template now i get a smarty error?!?!?!?!

Post by aejeffor »

Fatal error: Smarty error: [in db:Charts line 96]: syntax error: unrecognized tag 'echo' (Smarty_Compiler.class.php, line 580) in /home/cary/public_html/cms/lib/smarty/Smarty.class.php on line 1088
this is the error i get when i added the following code to my page template.  It is used to pull sports data onto my site from a 3rd party.  i just entered the code in the spot where the data is to be shown, and it gives me this error.  ANY IDEAS??????

";
      echo "$data";
  } else {
      echo "System Configuration error.";
  }

?>

you can view the page with source, etc. here

http://www.thewinningadvantage.com/cms/ ... age=Charts



I can cut and paste my way around and through php, but as far as coding goes, im clueless.  Can anyone help me figure this out?

I should be able to paste php into the template right?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: added a php code snippet to my template now i get a smarty error?!?!?!?!

Post by calguy1000 »

I think you need to put {literal} and {/literal} tags around your php code if it's in a template, so that smarty doesn't try to process it.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
aejeffor

Re: added a php code snippet to my template now i get a smarty error?!?!?!?!

Post by aejeffor »

i tried that and it doesnt work either.  ANy other ideas?
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: added a php code snippet to my template now i get a smarty error?!?!?!?!

Post by Ted »

PHP code needs to be in a user defined tag.  Putting it directly in a template does not work.
aejeffor

Re: added a php code snippet to my template now i get a smarty error?!?!?!?!

Post by aejeffor »

i pasted it in a user defined tag and it works great.  Thanks for the help!

edwin
Locked

Return to “CMSMS Core”