Page 1 of 1

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

Posted: Fri Dec 16, 2005 7:39 pm
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?

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

Posted: Fri Dec 16, 2005 8:15 pm
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.

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

Posted: Fri Dec 16, 2005 9:18 pm
by aejeffor
i tried that and it doesnt work either.  ANy other ideas?

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

Posted: Fri Dec 16, 2005 11:47 pm
by Ted
PHP code needs to be in a user defined tag.  Putting it directly in a template does not work.

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

Posted: Sat Dec 17, 2005 8:32 am
by aejeffor
i pasted it in a user defined tag and it works great.  Thanks for the help!

edwin