<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[scipt per generare banner]]></title><description><![CDATA[<p dir="auto">ho un problema con uno script modello banner maker trovato in rete, il problema consiste nel file generato che viene fuoti come un bitmap mentre sarebbe molto meglio avere una png o una gif</p>
<p dir="auto">questo è il file banner.php che raccoglie gli imput dell'index</p>
<pre><code class="language-php">&lt;?php
header("Content-Type: image/gif");
$fontpath = "fonts/";
$titlefont = "$fontpath/$titlef";
$tagfont = "$fontpath/$tagf";
if ((isset($titletext) || $titletext &gt; "")
  and (isset($tagtext) || $tagtext &gt; "")) {
 $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);
 ImageGIF($image);
} 
$fp = fopen("gencount.txt","r+");
$gen = fread ($fp,7);
$gen++;
rewind($fp);
fputs($fp, $gen, 7);
fclose($fp);
?&gt;
</code></pre>
<p dir="auto">qualcuno sa dove mettere le mani ?</p>
]]></description><link>https://dev.connect.gt/topic/76040/scipt-per-generare-banner</link><generator>RSS for Node</generator><lastBuildDate>Thu, 03 Dec 2026 14:51:05 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/76040.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 29 Jun 2008 18:55:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to scipt per generare banner on Sun, 29 Jun 2008 21:47:36 GMT]]></title><description><![CDATA[<p dir="auto">interessante, non sapevo che firefox mostrasse gli errori sulla sorgente della pagina.</p>
<p dir="auto">purtroppo il server elabora il codice php e restituisce al client un puro e semplice html. <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=3abbd2034aa" class="not-responsive emoji emoji-android emoji--disappointed" style="height:1.4em;width:auto;vertical-align:middle" title=":(" alt="😞" /></p>
<p dir="auto">edit : ho risolto, firefox è molto pignolo :p... eliminato</p>
<pre><code class="language-php">header("Content-Type: image/gif");
</code></pre>
<p dir="auto">funziona perfettamente, ora con photoshop qualche sfondo carino e poi online <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/customizations/559d73b1-6433-4f6d-8068-61f9dfa0017d-tupitupi.gif?v=3abbd2034aa" class="not-responsive emoji emoji-customizations emoji--yuppi" style="height:1.4em;width:auto;vertical-align:middle" title=":yuppi:" alt="" /></p>
]]></description><link>https://dev.connect.gt/post/732934</link><guid isPermaLink="true">https://dev.connect.gt/post/732934</guid><dc:creator><![CDATA[supercapocc]]></dc:creator><pubDate>Sun, 29 Jun 2008 21:47:36 GMT</pubDate></item><item><title><![CDATA[Reply to scipt per generare banner on Sun, 29 Jun 2008 21:12:06 GMT]]></title><description><![CDATA[<p dir="auto">Fia tasto destro visulizza sorgente sull'immagine con firefox in mezzo ai simboli vedi gli errori, e puoi correggerli</p>
]]></description><link>https://dev.connect.gt/post/732932</link><guid isPermaLink="true">https://dev.connect.gt/post/732932</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Sun, 29 Jun 2008 21:12:06 GMT</pubDate></item><item><title><![CDATA[Reply to scipt per generare banner on Sun, 29 Jun 2008 20:58:11 GMT]]></title><description><![CDATA[<p dir="auto">dicevo che il file generato su IE è un bitmap senza nome, mentre con firefox andrebbe quasi bene visto che genera un file banner.php.gif</p>
<p dir="auto">ho provato a fare queste modifiche</p>
<p dir="auto">aggiungo la variabile nuovo banner all'inizio</p>
<pre><code class="language-php"> $newbanner = 'banners/' . tuobanner . '.gif';
</code></pre>
<p dir="auto">la stessa l'aggiungo sulla funzione ImageGIF</p>
<pre><code class="language-php">ImageGIF($image, $newbanner);
</code></pre>
<p dir="auto">e aggiungo il seguente echo</p>
<pre><code class="language-php">echo "&lt;img src=\"$newbanner\" width=\"468\" height=\"60\" alt=\"Your Generated Banner\" border=\"0\"&gt;\n";
 echo "\n\n";
</code></pre>
<p dir="auto">il codice diventa così</p>
<pre><code class="language-php">&lt;?php
header("Content-Type: image/gif");
$fontpath = "fonts/";
$titlefont = "$fontpath/$titlef";
$tagfont = "$fontpath/$tagf";
$newbanner = 'banners/' . tuobanner . '.gif';
if ((isset($titletext) || $titletext &gt; "")
  and (isset($tagtext) || $tagtext &gt; "")) {
 $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);
 ImageGIF($image, $newbanner);
} 
echo "&lt;img src=\"$newbanner\" width=\"468\" height=\"60\" alt=\"Your Generated Banner\" border=\"0\"&gt;\n";
$fp = fopen("gencount.txt","r+");
$gen = fread ($fp,7);
$gen++;
rewind($fp);
fputs($fp, $gen, 7);
fclose($fp);
?&gt;
</code></pre>
<p dir="auto">adesso con IE funziona perfettamente, il file generato ha l'estensione .gif mentre firefox mi dice ciò<br />
l'immagine "miourl/bannermaker/banner.php non può essere visualizzata perchè la pagina contiene degli errori</p>
]]></description><link>https://dev.connect.gt/post/732933</link><guid isPermaLink="true">https://dev.connect.gt/post/732933</guid><dc:creator><![CDATA[supercapocc]]></dc:creator><pubDate>Sun, 29 Jun 2008 20:58:11 GMT</pubDate></item><item><title><![CDATA[Reply to scipt per generare banner on Sun, 29 Jun 2008 20:25:33 GMT]]></title><description><![CDATA[<p dir="auto">Che errore ti dà?</p>
]]></description><link>https://dev.connect.gt/post/732929</link><guid isPermaLink="true">https://dev.connect.gt/post/732929</guid><dc:creator><![CDATA[jeeves]]></dc:creator><pubDate>Sun, 29 Jun 2008 20:25:33 GMT</pubDate></item></channel></rss>