I've only found one other topic pertaining to create_function() in the globals file:
http://www.gossamer-threads.com/...ring=create_function
Doesn't quite seem to apply to the problem I'm having, though... I'm trying to assemble an image rating global variable for use next to links (it worked in the 2.0.5 Perl version's globals, as I recall). I've got something of the form:
global $Rating;
if ($Rating == \'10.00\') { return \'...\'; }
elseif ($Rating == \'0.00\') { return \'...\'; }
....
else { return \'...\'; }
\');',Best I can tell, that properly follows the 'time' and 'date' examples. However, I get the following error:
PHP Fatal error: Call to undefined function: create_function(...
I just thought of one thing that could help explain my confusion... I only get the error when visiting pages that call $rate_img, and I don't have the 'date' or 'time' functions used anywhere in my templates, so maybe they don't work either and I'm following a bad example???
I figure $Rating probably isn't the correct way to retrieve the rating value for a given link, so I tried a slight change (same result):
if ($Rating == \'10.00\') { return \'...\'; }
elseif ($Rating == \'0.00\') { return \'...\'; }
....
else { return \'...\'; }
\');',
and accessing it by:
<?echo $rate_img($Rating)?>
in link.html, where I know $Rating is available.
Any insight?
Dan
http://www.gossamer-threads.com/...ring=create_function
Doesn't quite seem to apply to the problem I'm having, though... I'm trying to assemble an image rating global variable for use next to links (it worked in the 2.0.5 Perl version's globals, as I recall). I've got something of the form:
Code:
'rate_img' => 'create_function("", \' global $Rating;
if ($Rating == \'10.00\') { return \'...\'; }
elseif ($Rating == \'0.00\') { return \'...\'; }
....
else { return \'...\'; }
\');',
PHP Fatal error: Call to undefined function: create_function(...
I just thought of one thing that could help explain my confusion... I only get the error when visiting pages that call $rate_img, and I don't have the 'date' or 'time' functions used anywhere in my templates, so maybe they don't work either and I'm following a bad example???
I figure $Rating probably isn't the correct way to retrieve the rating value for a given link, so I tried a slight change (same result):
Code:
'rate_img' => 'create_function($Rating, \' if ($Rating == \'10.00\') { return \'...\'; }
elseif ($Rating == \'0.00\') { return \'...\'; }
....
else { return \'...\'; }
\');',
and accessing it by:
<?echo $rate_img($Rating)?>
in link.html, where I know $Rating is available.
Any insight?
Dan