". mysql_error()); } // Select the database $db_select = mysql_select_db($db_database); if (!$db_select){ die ("Could not select the database:
". mysql_error( )); } // for vbulletin //echo " // "; if (isset($_POST['submit'])) { // ************************************************************************ // BEGIN SUBMIT // ************************************************************************ function html2rgb($color) { if ($color[0] == '#') $color = substr($color, 1); if (strlen($color) == 6) list($r, $g, $b) = array($color[0].$color[1], $color[2].$color[3], $color[4].$color[5]); elseif (strlen($color) == 3) list($r, $g, $b) = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]); else return false; $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); return array($r, $g, $b); } $BannerType = $_POST["BannerType"]; $FontColor = $_POST["FontColor"]; $TagLineFontColor = $_POST["TagLineFontColor"]; $RGBCOLOR = html2rgb($FontColor); $RedColor = $RGBCOLOR[0]; $GreenColor = $RGBCOLOR[1]; $BlueColor = $RGBCOLOR[2]; $TagLineFontColorRGBCOLOR = html2rgb($TagLineFontColor); $TagLineFontColorRedColor = $TagLineFontColorRGBCOLOR[0]; $TagLineFontColorGreenColor = $TagLineFontColorRGBCOLOR[1]; $TagLineFontColorBlueColor = $TagLineFontColorRGBCOLOR[2]; // The text to draw $text = $_POST["LogoText"]; $text = stripslashes($text); $TagLineText = $_POST["TagLineText"]; $TagLineText = stripslashes($TagLineText); $XPosition = mysqlclean($_POST,"XPosition",100,$connection); $YPosition = mysqlclean($_POST,"YPosition",100,$connection); //$YPosition = $_POST["YPosition"]; $FontSize = $_POST["FontSize"]; $TagLineXPosition = $_POST["TagLineXPosition"]; $TagLineYPosition = $_POST["TagLineYPosition"]; $TagLineFontSize = $_POST["TagLineFontSize"]; $FontType = mysqlclean($_POST,"FontType",100,$connection); $query="SELECT FontLocation FROM AvailableFonts where UniqueID = '$FontType'"; $result=mysql_query($query); $num=mysql_numrows($result); $i=0; while ($i < $num) { $FontLocation=mysql_result($result,$i,"FontLocation"); $i++; } $FontDirectory = "/usr/local/apache2/htdocs/gopherforum/forum/uploaded-files/pages/fonts"; // Set the enviroment variable for GD putenv('GDFONTPATH=' . $FontDirectory); $font = $FontLocation; include('GIFEncoder.class.php'); //$font_file = 'cour.ttf'; $font_file = '/fonts/arial.ttf'; ob_start(); $i = 0; //while($i<$frames){ // initiallize total number of frames // lawn mowing banner if ($BannerType == 1){ $TotalNumberOfFrames = 16; } // snow plow banner elseif ($BannerType == 2) { $TotalNumberOfFrames = 24; } // don't let bugs banner elseif ($BannerType == 3) { $TotalNumberOfFrames = 22; } // help sell banner elseif ($BannerType == 4) { $TotalNumberOfFrames = 17; } // landscape lighting elseif ($BannerType == 5) { $TotalNumberOfFrames = 26; } // winterize lawn elseif ($BannerType == 6) { $TotalNumberOfFrames = 28; } // square outdoor lighting banner elseif ($BannerType == 7) { $TotalNumberOfFrames = 21; } // holiday lighting elseif ($BannerType == 8) { $TotalNumberOfFrames = 33; } // holiday lighting elseif ($BannerType == 9) { $TotalNumberOfFrames = 25; } // stump grinding elseif ($BannerType == 10) { $TotalNumberOfFrames = 34; } // chain saw elseif ($BannerType == 11) { $TotalNumberOfFrames = 29; } while($i<$TotalNumberOfFrames){ $j = $i +1; // imagettftext($image,$font_size,0,0,$line_height,$color,$font_file,$text[$i]); // when you are working with gifs, you can't add a new color when the gif file created already uses the 255 alotted colors so I had to save these gif files with less than 255 colors to allow for a font color. // $image = imagecreatefromgif ( $ImageDirectory . $j.".gif" ); if ($BannerType == 1){ $image = imagecreatefromgif ( "/usr/local/apache2/htdocs/gopherforum/forum/uploaded-files/pages/test12/grass-banner/images".$j.".gif" );} if ($BannerType == 2){ $image = imagecreatefromgif ( "/usr/local/apache2/htdocs/gopherforum/forum/uploaded-files/pages/test12/snow-plow-banner/images".$j.".gif" );} if ($BannerType == 3){ $image = imagecreatefromgif ( "/usr/local/apache2/htdocs/gopherforum/forum/uploaded-files/pages/test12/grass-banner/bugs".$j.".gif" );} if ($BannerType == 4){ $image = imagecreatefromgif ( "/usr/local/apache2/htdocs/gopherforum/forum/uploaded-files/pages/test12/grass-banner/help_sell".$j.".gif" );} if ($BannerType == 5){ $image = imagecreatefromgif ( "/usr/local/apache2/htdocs/gopherforum/forum/uploaded-files/pages/test12/grass-banner/landscape_lighting".$j.".gif" );} if ($BannerType == 6){ $image = imagecreatefromgif ( "/usr/local/apache2/htdocs/gopherforum/forum/uploaded-files/pages/test12/grass-banner/winterize".$j.".gif" );} if ($BannerType == 7){ $image = imagecreatefromgif ( "/usr/local/apache2/htdocs/gopherforum/forum/uploaded-files/pages/test12/grass-banner/small_landscape_lighting".$j.".gif" );} if ($BannerType == 8){ $image = imagecreatefromgif ( "/usr/local/apache2/htdocs/gopherforum/forum/uploaded-files/pages/test12/grass-banner/holidays_coming".$j.".gif" );} if ($BannerType == 9){ $image = imagecreatefromgif ( "/usr/local/apache2/htdocs/gopherforum/forum/uploaded-files/pages/test12/grass-banner/season_greet".$j.".gif" );} if ($BannerType == 10){ $image = imagecreatefromgif ( "/usr/local/apache2/htdocs/gopherforum/forum/uploaded-files/pages/test12/grass-banner/stump-grinding-banner".$j.".gif" );} if ($BannerType == 11){ $image = imagecreatefromgif ( "/usr/local/apache2/htdocs/gopherforum/forum/uploaded-files/pages/test12/grass-banner/chainsaw-banner".$j.".gif" );} $NewFontColor = imagecolorallocate($image, $RedColor, $GreenColor, $BlueColor); $TagLineNewFontColor = imagecolorallocate($image, $TagLineFontColorRedColor, $TagLineFontColorGreenColor, $TagLineFontColorBlueColor); //make the last frame a lot longer. if ($i <> ($TotalNumberOfFrames-1)){ $imagespeed[$i] = 10; } else { $imagespeed[$i] = 350; // $background = imagecolorallocate( $image, 0, 0, 255 ); $white = imagecolorallocate($image, 255, 255, 255); // $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); // $black = imagecolorallocate($image, 0, 0, 0); // $border = imagecolorallocate($image, 0, 0, 0); // imagestring( $image, 4, 30, 25, "gopherforum.com", $white ); // imagerectangle($image, 0, 0, 35, 35, $border); // $NewFontColor = $white; // $text = "Testing"; $grey = imagecolorallocate($image, 128, 128, 128); $black = imagecolorallocate($image, 0, 0, 0); // make a shadow image of the text imagettftext($image, $FontSize, 0, ($XPosition + 1), ($YPosition + 1), $grey, $font, $text); imagettftext($image, $FontSize, 0, $XPosition, $YPosition, $NewFontColor, $font, $text); imagettftext($image, $TagLineFontSize, 0, $TagLineXPosition, $TagLineYPosition, $TagLineNewFontColor, $font, $TagLineText); // imagettftext($image, $FontSize, 0, $XPosition, $YPosition, $NewFontColor, $font, $text); // imagettftext($my_img, $FontSize, 0, $XPosition, $YPosition, $NewFontColor, $font, $text); // imagettftext($my_img, $TagLineFontSize, 0, $TagLineXPosition, $TagLineYPosition, $TagLineNewFontColor, $font, $TagLineText); } // i want to give this bug banner a little more time on some frames if ($BannerType == 3){ $imagespeed[8] = 200; $imagespeed[20] = 250; } elseif ($BannerType == 4){ $imagespeed[5] = 200; $imagespeed[10] = 100; $imagespeed[14] = 350; } elseif ($BannerType == 5){ $imagespeed[21] = 200; } elseif ($BannerType == 6){ $imagespeed[25] = 300; $imagespeed[26] = 75; } elseif ($BannerType == 7){ $imagespeed[1] = 300; $imagespeed[14] = 300; } elseif ($BannerType == 8){ $imagespeed[18] = 200; $imagespeed[19] = 200; $imagespeed[20] = 200; $imagespeed[21] = 200; } elseif ($BannerType == 10){ $imagespeed[8] = 200; $imagespeed[32] = 200; } elseif ($BannerType == 11){ $imagespeed[0] = 200; $imagespeed[27] = 100; } imagegif($image); $imagedata[$i] = ob_get_contents(); ob_clean(); ++$i; } /* GIFEncoder constructor: ======================= image_stream = new GIFEncoder ( URL or Binary data 'Sources' int 'Delay times' int 'Animation loops' int 'Disposal' int 'Transparent red, green, blue colors' int 'Source type' "url" or "bin" ); */ //gifmerge $gif = new GIFEncoder( $imagedata, $imagespeed, 0, 2, 1, 0, 0, "bin" ); /* Possibles outputs: ================== Output as GIF for browsers : - Header ( 'Content-type:image/gif' ); Output as GIF for browsers with filename: - Header ( 'Content-disposition:Attachment;filename=myanimation.gif'); Output as file to store into a specified file: - FWrite ( FOpen ( "myanimation.gif", "wb" ), $gif->GetAnimation ( ) ); */ $SaveOrPreview = mysqlclean($_POST,"SaveOrPreview",100,$connection); if ($SaveOrPreview== 'Save') { Header ( 'Content-disposition:Attachment;filename=myanimation.gif'); } else { header ( 'Content-type:image/gif' ); } echo $gif->GetAnimation (); } // ************************************************************************ // END SUBMIT // ************************************************************************ else // ************************************************************************ // BEGIN Design the banner // ************************************************************************ { // for the color picker echo" Lawn Care Business Banner Designer "; echo "

Lawn Care Banner Designer.


"; echo ""; echo ''; // echo ''; echo "
"; echo "
"; echo " "; echo "
Choose Lawn Care Banner Background
Font Type
Text
Font Color <- Click Here
X Position (left and right)
Y Position (up and down)
Font Size
Tag Line Or Phone Number Text
Font Color <- Click Here
X Position (left and right)
Y Position (up and down)
Font Size
Save
Preview
How did the banner designer work?
Did you try the lawn care logo designer or the
Lawn Care Flyer & Door Hanger Designer?
Please consider making a $5.00 Donation
To keep this site going. Thanks!
Also please tell others about this site.
\"\"
Instructions: Choose a lawn care banner background. Enter your text and play around with the text position. Click the submit button and then if the image needs adjusting, use your browser back arrow to change settings. When you are satisfied with the results choose the save button and click the submit button. Review design templates setting examples and discuss this banner designer at the Gopher Lawn Care Business Forum here.
"; // ************************************************************************ // END Design the banner // ************************************************************************ // for vbulletin //echo ""; } ?>