Text on PNG path issues....
The code below works...
PHP Code:
if ($context['allow_calendar']) {
$font = 'arial.ttf';
$text = date("d");
$dow = date("l");
$im = ImageCreateFromPNG('../forums/Themes/BlackBox/images/mainlinks_f/calendar.png');
$black = ImageColorAllocate($im,50,50,50);
$white = ImageColorAllocate($im,255,255,255);
$lft = (strlen($text)==2) ? 8 : 16;
$fSize = 7;
switch (strlen($dow)) {
Case 6:
$l2 = 12;
break;
Case 7:
$l2 = 10;
break;
Case 8:
$l2 = 7;
break;
Case 9:
$l2 = 4;
$fSize=6.5;
break;
}
imagettftext($im, 26, 0, $lft, 43, $black, $font, $text);
imagettftext($im, $fSize, 0, $l2, 10, $white, $font, $dow);
ImagePNG($im,'../forums/Themes/BlackBox/images/mainlinks_f/calendar1.png');
imagedestroy($im);
echo '<td class="linktd"><a href="index.php?action=calendar" title="CALENDAR"><img src="../forums/Themes/BlackBox/images/mainlinks_f/calendar1.png" border=0></a></td>';
}
if I change the paths in these:
PHP Code:
$im = ImageCreateFromPNG('../forums/Themes/BlackBox/images/mainlinks_f/calendar.png');
ImagePNG($im,'../forums/Themes/BlackBox/images/mainlinks_f/calendar1.png');
to
PHP Code:
$im = ImageCreateFromPNG($settings['theme_url'] . '/images/mainlinks_f/calendar.png');
ImagePNG($im,$settings['theme_url'] . '/images/mainlinks_f/calendar1.png');
it no longer works?
$settings['theme_url'] is set yes. cause I can echo it and the path is correct... it doesnt want to load or write the image.
Re: Text on PNG path issues....
but, what is $settings['theme_url'] set to? we would definitely need to know. if you don't have the fopen url wrappers on in php.ini, you won't be able to open remote files (if your variable is set to a URL, that is).
Re: Text on PNG path issues....
Is $settings something read from a database? Could it be a slashes problem?