What I need/want to do is add code to an exsisting php file.
What I need done is to have the the image url in a selection box in bbcode.
Confusing I know.Best way to explain is by looking here
Click on a smilie and at the top,the bbcode is inserted.
I have a banner generator that when you click CREATE,you go to /banner.php and it has the generated image.The image is clickable to get the full path so that it can be hotlinked.
What I would like to do is on banner.php ,add code that will grab the image path and have it as in the link above.
Here is my file banner.php
Code: Select all
<?php
$fontpath = "$DOCUMENT_ROOT/banner3/fonts/";
$titlefont = "$fontpath/$titlef";
$tagfont = "$fontpath/$tagf";
if ((isset($titletext) || $titletext > "")
and (isset($tagtext) || $tagtext > "")) {
$titlecolor = substr($titlecolor, -6);
$r1 = hexdec(substr($titlecolor, 0, 2));
$g1 = hexdec(substr($titlecolor, 2, 2));
$b1 = hexdec(substr($titlecolor, 4, 2));
$tagcolor = substr($tagcolor, -6);
$r2 = hexdec(substr($tagcolor, 0, 2));
$g2 = hexdec(substr($tagcolor, 2, 2));
$b2 = hexdec(substr($tagcolor, 4, 2));
$titletext2 = stripslashes($titletext);
$tagtext2 = stripslashes($tagtext);
$image = imagecreatefrompng("banner/$select_banner");
$titlecolor = imagecolorallocate($image, $r1, $g1, $b1);
$tagcolor = imagecolorallocate($image, $r2, $g2, $b2);
$shadow = imagecolorallocate($image, 153, 153, 153);
if ($titleshadow == "yes"){
ImageTTFText($image, $titlesize, 0, $titlex+1, $titley+1, $shadow, $titlefont, $titletext2);
}
if ($tagshadow == "yes"){
ImageTTFText($image, $tagsize, 0, $tagx+1, $tagy+1, $shadow, $tagfont, $tagtext2);
}
ImageTTFText($image, $titlesize, 0, $titlex, $titley, $titlecolor, $titlefont, $titletext2);
ImageTTFText($image, $tagsize, 0, $tagx, $tagy, $tagcolor, $tagfont, $tagtext2);
$counterval = 0;
$filename = "banners/counter.txt";
$fp = fopen($filename, "r");
$counterval = fread($fp, 26);
fclose($fp);
$counterval = (integer)$counterval + 1;
$fp = fopen($filename, "w+");
fwrite($fp, $counterval, 26);
fclose($fp);
$newbanner = 'banners/' . $counterval . '.png';
ImagePNG($image, $newbanner);
include("header.inc");
echo "\n";
echo "<a href="$newbanner"><img src="$newbanner" width="468" height="60" alt="Your Generated Banner" border="0"></a>\n";
echo "<font color="#990000">Click on the image to get the full path.You will use this path to hotlink your image to your BlogCP</font>";
echo "\n\n";
include("footer.inc");
}
?>Would like to just have:
Code: Select all
їimg]http://www.host.com/generator/banners/01.pngї/img]The folder BANNERS is where all the generated images get saved to.
I hope this didnt sound confusing,couldnt think of a way to explain it.
btw........what happened to the
Code: Select all