Buttons -again

Anna

Member
Hi guys!
The dynamic button at the bottom (the square one that show both rank, pageviewss and hitsIn on the same time) - is it possible to get that animated and still keep the dynamic showing of statistics? What format does it in such case need to be saved in?
 

Basti

Administrator
Staff member
Need to be in gif format, it is possible but the hole part in settings_buttons.php need to be changed, or rather a few parts, as its coded for png
Code:
$img = imagecreatefrompng("{$CONF['path']}/images/ranking.png");
$color1 = imagecolorallocate($img, 0, 0, 0);
$color2 = imagecolorallocate($img, 0, 0, 0);
header ("Content-type: image/png");
imagestring($img, 2, 80, 75, $TMPL['tot_pv_0_daily'], $color1);
imagestring($img, 2, 80, 90, $TMPL['unq_in_0_daily'], $color1);
//imagestring($img, 2, 80, 84, "{$TMPL['average_rating']}/5", $color1);
imagestring($img, 5, 75 - ((strlen($TMPL['rank']) - 1) * 4), 50, $TMPL['rank'], $color2);
imagepng($img);
the later lines at the bottom are there to position the text on the button.
If you have designed a button, you can send it over to me, as this would require some testing
 

Mark

Administrator
Staff member
I think when PHP writes data to a .gif it will stop the animation. At least that has been my experience in the past.
 

Mark

Administrator
Staff member
with GD lib anyway (what we use), but Imagemagick might have a tool for this, not sure.
 

Anna

Member
OK, then we were not too far of. OK, then it just had to be dynamic button without animation ;-) Btw, how do I change the color of rank# shown? For some reason it is now blueish and that dont work since background is blue^^ Cant remember that it was like this before?
 

Mark

Administrator
Staff member
colors are set on these lines:
PHP:
$color1 = imagecolorallocate($img, 0, 0, 0);
$color2 = imagecolorallocate($img, 0, 0, 0);
the 0,0,0 are Red, Green, Blue values. You might need an image editor (like photoshop) to know what colors are what. Or a reference like this might be helpful:
http://www.tayloredmktg.com/rgb/
 
Top