PDA

View Full Version : problem with adding numbers


double
06-06-2006, 04:40 PM
i'm using addon feature to make some improvements to my photoblog. But there is a problem I can't figure out:

-------------------------------------------------
$numberA = 100;
$numberB = 200;
$numberAB = $numberA + $numberB;

$tpl = ereg_replace("<NEWTAG>",$numberAB,$tpl);
-------------------------------------------------

this is the code. when I use <NEWTAG> in my template I get only "?" for answer. Is my coding buggy or is it something else?

I'm using:
PP 1.5.0
PHP-version 4.4.2

Thanks for help and for this great project :)

SOLVED:
instead of: $tpl = ereg_replace("<NEWTAG>",$numberAB,$tpl);
use: $tpl = str_replace("<NEWTAG>",$numberAB,$tpl);


PART 2:

there is also problem getting the tags from template:
$pic_width = <IMAGE_WIDTH>; <- parse error, unexpected

is it possible to use original tags in addon's?'

SOLVED: use $image_width instead of <IMAGE_WIDTH>

GeoS
06-07-2006, 09:04 AM
Try to put this:
$tpl = ereg_replace("<NEWTAG>","$numberAB",$tpl);