Forum Moderators: coopster
Script is php/ajax
Issue is this code isnt working with smarty templates
echo rating_bar($user_id,5); this will show the user number {$user_id} how do I now put this into the statement?
Tried
echo rating_bar({$user_id},5); this gives me a unexpected '{', expecting ')'
Tried
echo rating_bar('{$user_id}',5); that gives me $user_id not the actual variable
Issue seems to be the ability to put the smarty var into () when the smarty var needs {}
So thats
echo rating_bar({$user_id},5); Can any one point me in the right direction please
rating_bar is a function below
function rating_bar($user_id,$units='',$static='') {
require('_config-rating.php'); // get the db connection info
//set some variables
$ip = $_SERVER['REMOTE_ADDR'];
if (!$units) {$units = 10;}
if (!$static) {$static = FALSE;}
[edited by: eelixduppy at 12:07 pm (utc) on June 17, 2008]
[edit reason] removed URL, fixed formatting [/edit]
Can any one point me in the right direction please
The smarty documentation pages [smarty.net] are one of your primary resources if you are incorporating this templating engine.