Tammy Posted October 21, 2008 Share Posted October 21, 2008 Umm okay I have this glitter generator but it only works with some servers. Can you tell me what's wrong with the script? or fix it? <TITLE>Dollz Glitter Text Maker - New lettersets added often - refresh your browser</TITLE> <? // ??? ?? TrueColor ?? ???? ??? ???? ??? ???? ?? ? ???? ??? // ????? ?? ? ? ????? ??? ?? ?? ?? require ("config.php"); $nln=chr(13).chr(10); $nlnb="<br>".$nln; ?> <SCRIPT language=JavaScript src="preview_templates.js" type=text/javascript></SCRIPT> <script type="text/javascript"> function image() { var style = document.getElementById('style').value; document.getElementById('bannerImage').innerHTML ='<img src="style/'+style+'/r.gif"><img src="style/'+style+'/a.gif"><img src="style/'+style+'/s.gif"><img src="style/'+style+'/a.gif"><img src="style/'+style+'/i.gif"><img src="style/'+style+'/n.gif"><img src="style/'+style+'/t.gif">' } function addtext(text) { // add this text to the object document.form1.text.value += text; document.form1.text.focus(); } </script> <style type="text/css"> <!-- A:active {color:#222222;} A:hover {color:#222222; text-decoration: none;} A:link {color:#222222;} A:visited {color:#222222;} --> </style> <table width="90%" height="100%" align="center"> <tr> <td width="113" valign="top"><DIV id=generator> <br> <UL > <? for($i=0;$i<count($category);$i++) { echo'<LI><A href="index.php?f='.strtolower($category[$i]).'">'.$category[$i].'</A></LI>'; } ?> </UL> </td> <td valign="top" align="center"> <? function show_im($im,$g1) // show temporary created images { $im_file='created/temp'.$g1.'.gif'; imagegif($im,$im_file); echo "<img src='".$im_file."'><br>".chr(13).chr(10); return $im_file; }; // function to count pixels for each color from palette and sort them ascending. function count_colors($inp_im,$width,$height) { $ar=Array(); for($i=0;$i<$width;$i++) { for($j=0;$j<$height;$j++) { $ar[imagecolorat($inp_im,$i,$j)]++; } } asort($ar); $res_ar=Array(); $k=0; foreach ($ar as $key => $val) { $res_ar[$k]['index']=$key; $res_ar[$k]['count']=$val; $k++; } return$res_ar; } function sub_sum($inp_ar,$numb,$row_sp)// returns summ of first $numb elements and adding spaces between rows { return (array_sum(array_slice($inp_ar,0,$numb))+$row_sp*$numb); } // showing start menu, where You can choose girls and type text if(!$_GET && !$_POST) { ?><div><br> <b><?php echo $site_name; ?></b> <center><table border="0" cellspacing="1" cellpadding="1" width="80%"> <tr> <td nowrap><br>Click on your color choice to begin.<br> Choose your font style.<br> Click a doll. (Optional)<br> Hold your mouse over any doll<br> to view the full image of the doll.<br> Use the <b>Enter Key</b> to make new lines of text<br> View the examples below</td> </tr> </table></center> <br><br> </div> <br /> <div> <div><img src="example.gif" border="0"> <img src="example4.gif" border="0"> <br><br><br> <img src="example3.gif" border="0"> <br><br> <img src="example2.gif" border="0"> </div> <br><br></div> <br> <br> <? } else if($_GET['f'] and !$_GET['style']) // if user just choose color but style did'nt choose { $d =dir('letters_styles/'.$_GET['f']); $i=0; while (false !== ($entry = $d->read())) { if ($entry != '..' && $entry != '.') { $ttt[$i]=$entry; $i++; } } $d->close(); //sort($ttt); usort($ttt, "strnatcmp"); $im_count =0; echo'<table>'; for($i=0;$i<count($ttt);$i++) { if ($im_count == 0 ) { echo "<tr><td><div align='center'>"; } echo'<A style="text-decoration:none;" href="index.php?style='.$ttt[$i].'&f='.$_GET['f'].'" ><IMG src="letters_styles/'.$_GET['f'].'/'.$ttt[$i].'/a.gif" border=0 ></A> '; if ($im_count == 3 ) { echo "</td></tr></div>";$status= "closed"; $im_count = 0; $im_cont=1; } if($im_cont!=1) $im_count += 1; else $im_cont=0; } //echo'<A href="index.php?style=1"> style</A>'; } else if($_GET['style'] and $_GET['f'])// if user choose color and style, show text field to input and lot of girls. { ?> <br> <form method="post" action="index.php" name="form1"> <b>Align</b><br> <input type=radio name=align value="l"> Left <input type=radio name=align value="c" checked> Center <input type=radio name=align value="r"> Right <br><b>Text to convert:</b><br /> <textarea name="text" id="text" cols="30" rows="3"></textarea> <!-- <input type="text" name="text" width="300" size="50" id="text" value=""/> //--> <input type="hidden" name="style" value="<? echo $_GET['style']?>"> <input type="hidden" name="color" value="<? echo $_GET['f']?>"> <br /> <br> <input type="submit" name="Create" value="Make" /> <input type="reset" value="Reset" name="Reset" /> <br><br> <TABLE cellSpacing=0 border=1> <TR align=middle > <TD height="35" > <A style="text-decoration:none;" href="javascript:addtext('<d1>')"><IMG onMouseOver="showtrail('doll/d1_2.gif','',0,0)" src="dolls/1thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d33>')"><IMG onMouseOver="showtrail('doll/d33_2.gif','',0,0)" src="dolls/33thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d2>')"><IMG onMouseOver="showtrail('doll/d2_2.gif','',0,0)" src="dolls/2thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d34>')"><IMG onMouseOver="showtrail('doll/d34_2.gif','',0,0)" src="dolls/34thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d3>')"><IMG onMouseOver="showtrail('doll/d3_2.gif','',0,0)" src="dolls/3thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d35>')"><IMG onMouseOver="showtrail('doll/d35_2.gif','',0,0)" src="dolls/35thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d4>')"><IMG onMouseOver="showtrail('doll/d4_2.gif','',0,0)" src="dolls/4thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d36>')"><IMG onMouseOver="showtrail('doll/d36_2.gif','',0,0)" src="dolls/36thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d65>')"><IMG onMouseOver="showtrail('doll/d65_2.gif','',0,0)" src="dolls/65thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d66>')"><IMG onMouseOver="showtrail('doll/d66_2.gif','',0,0)" src="dolls/66thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> </TD></TR> <TR align=middle > <TD height="35" > <A style="text-decoration:none;" href="javascript:addtext('<d5>')"><IMG onMouseOver="showtrail('doll/d5_2.gif','',0,0)" src="dolls/5thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d37>')"><IMG onMouseOver="showtrail('doll/d37_2.gif','',0,0)" src="dolls/37thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d6>')"><IMG onMouseOver="showtrail('doll/d6_2.gif','',0,0)" src="dolls/6thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d38>')"><IMG onMouseOver="showtrail('doll/d38_2.gif','',0,0)" src="dolls/38thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d7>')"><IMG onMouseOver="showtrail('doll/d7_2.gif','',0,0)" src="dolls/7thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d39>')"><IMG onMouseOver="showtrail('doll/d39_2.gif','',0,0)" src="dolls/39thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d8>')"><IMG onMouseOver="showtrail('doll/d8_2.gif','',0,0)" src="dolls/8thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d40>')"><IMG onMouseOver="showtrail('doll/d40_2.gif','',0,0)" src="dolls/40thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d67>')"><IMG onMouseOver="showtrail('doll/d67_2.gif','',0,0)" src="dolls/67thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d68>')"><IMG onMouseOver="showtrail('doll/d68_2.gif','',0,0)" src="dolls/68thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> </TD></TR> <TR align=middle > <TD height="35" > <A style="text-decoration:none;" href="javascript:addtext('<d9>')"><IMG onMouseOver="showtrail('doll/d9_2.gif','',0,0)" src="dolls/9thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d41>')"><IMG onMouseOver="showtrail('doll/d41_2.gif','',0,0)" src="dolls/41thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d10>')"><IMG onMouseOver="showtrail('doll/d10_2.gif','',0,0)" src="dolls/10thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d42>')"><IMG onMouseOver="showtrail('doll/d42_2.gif','',0,0)" src="dolls/42thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d11>')"><IMG onMouseOver="showtrail('doll/d11_2.gif','',0,0)" src="dolls/11thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d43>')"><IMG onMouseOver="showtrail('doll/d43_2.gif','',0,0)" src="dolls/43thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d12>')"><IMG onMouseOver="showtrail('doll/d12_2.gif','',0,0)" src="dolls/12thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d44>')"><IMG onMouseOver="showtrail('doll/d44_2.gif','',0,0)" src="dolls/44thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d69>')"><IMG onMouseOver="showtrail('doll/d69_2.gif','',0,0)" src="dolls/69thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d70>')"><IMG onMouseOver="showtrail('doll/d70_2.gif','',0,0)" src="dolls/70thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> </TD></TR> <TR align=middle > <TD height="35" > <A style="text-decoration:none;" href="javascript:addtext('<d13>')"><IMG onMouseOver="showtrail('doll/d13_2.gif','',0,0)" src="dolls/13thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d45>')"><IMG onMouseOver="showtrail('doll/d45_2.gif','',0,0)" src="dolls/45thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d14>')"><IMG onMouseOver="showtrail('doll/d14_2.gif','',0,0)" src="dolls/14thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d46>')"><IMG onMouseOver="showtrail('doll/d46_2.gif','',0,0)" src="dolls/46thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d15>')"><IMG onMouseOver="showtrail('doll/d15_2.gif','',0,0)" src="dolls/15thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d47>')"><IMG onMouseOver="showtrail('doll/d47_2.gif','',0,0)" src="dolls/47thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d16>')"><IMG onMouseOver="showtrail('doll/d16_2.gif','',0,0)" src="dolls/16thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d48>')"><IMG onMouseOver="showtrail('doll/d48_2.gif','',0,0)" src="dolls/48thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d71>')"><IMG onMouseOver="showtrail('doll/d71_2.gif','',0,0)" src="dolls/71thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d72>')"><IMG onMouseOver="showtrail('doll/d72_2.gif','',0,0)" src="dolls/72thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> </TD></TR> <TR align=middle > <TD height="35" > <A style="text-decoration:none;" href="javascript:addtext('<d17>')"><IMG onMouseOver="showtrail('doll/d17_2.gif','',0,0)" src="dolls/17thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d49>')"><IMG onMouseOver="showtrail('doll/d49_2.gif','',0,0)" src="dolls/49thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d18>')"><IMG onMouseOver="showtrail('doll/d18_2.gif','',0,0)" src="dolls/18thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d50>')"><IMG onMouseOver="showtrail('doll/d50_2.gif','',0,0)" src="dolls/50thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d19>')"><IMG onMouseOver="showtrail('doll/d19_2.gif','',0,0)" src="dolls/19thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d51>')"><IMG onMouseOver="showtrail('doll/d51_2.gif','',0,0)" src="dolls/51thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d20>')"><IMG onMouseOver="showtrail('doll/d20_2.gif','',0,0)" src="dolls/20thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d52>')"><IMG onMouseOver="showtrail('doll/d52_2.gif','',0,0)" src="dolls/52thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d73>')"><IMG onMouseOver="showtrail('doll/d73_2.gif','',0,0)" src="dolls/73thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d74>')"><IMG onMouseOver="showtrail('doll/d74_2.gif','',0,0)" src="dolls/74thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> </TD></TR> <TR align=middle > <TD height="35" > <A style="text-decoration:none;" href="javascript:addtext('<d21>')"><IMG onMouseOver="showtrail('doll/d21_2.gif','',0,0)" src="dolls/21thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d53>')"><IMG onMouseOver="showtrail('doll/d53_2.gif','',0,0)" src="dolls/53thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d22>')"><IMG onMouseOver="showtrail('doll/d22_2.gif','',0,0)" src="dolls/22thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d54>')"><IMG onMouseOver="showtrail('doll/d54_2.gif','',0,0)" src="dolls/54thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d23>')"><IMG onMouseOver="showtrail('doll/d23_2.gif','',0,0)" src="dolls/23thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d55>')"><IMG onMouseOver="showtrail('doll/d55_2.gif','',0,0)" src="dolls/55thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d24>')"><IMG onMouseOver="showtrail('doll/d24_2.gif','',0,0)" src="dolls/24thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d56>')"><IMG onMouseOver="showtrail('doll/d56_2.gif','',0,0)" src="dolls/56thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d75>')"><IMG onMouseOver="showtrail('doll/d75_2.gif','',0,0)" src="dolls/75thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d76>')"><IMG onMouseOver="showtrail('doll/d76_2.gif','',0,0)" src="dolls/76thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> </TD></TR> <TR align=middle > <TD height="35" > <A style="text-decoration:none;" href="javascript:addtext('<d25>')"><IMG onMouseOver="showtrail('doll/d25_2.gif','',0,0)" src="dolls/25thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d57>')"><IMG onMouseOver="showtrail('doll/d57_2.gif','',0,0)" src="dolls/57thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d26>')"><IMG onMouseOver="showtrail('doll/d26_2.gif','',0,0)" src="dolls/26thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d58>')"><IMG onMouseOver="showtrail('doll/d58_2.gif','',0,0)" src="dolls/58thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d27>')"><IMG onMouseOver="showtrail('doll/d27_2.gif','',0,0)" src="dolls/27thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d59>')"><IMG onMouseOver="showtrail('doll/d59_2.gif','',0,0)" src="dolls/59thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d28>')"><IMG onMouseOver="showtrail('doll/d28_2.gif','',0,0)" src="dolls/28thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d60>')"><IMG onMouseOver="showtrail('doll/d60_2.gif','',0,0)" src="dolls/60thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d77>')"><IMG onMouseOver="showtrail('doll/d77_2.gif','',0,0)" src="dolls/77thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d78>')"><IMG onMouseOver="showtrail('doll/d78_2.gif','',0,0)" src="dolls/78thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> </TD></TR> <TR align=middle > <TD height="35" > <A style="text-decoration:none;" href="javascript:addtext('<d29>')"><IMG onMouseOver="showtrail('doll/d29_2.gif','',0,0)" src="dolls/29thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d61>')"><IMG onMouseOver="showtrail('doll/d61_2.gif','',0,0)" src="dolls/61thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d30>')"><IMG onMouseOver="showtrail('doll/d30_2.gif','',0,0)" src="dolls/30thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d62>')"><IMG onMouseOver="showtrail('doll/d62_2.gif','',0,0)" src="dolls/62thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d31>')"><IMG onMouseOver="showtrail('doll/d31_2.gif','',0,0)" src="dolls/31thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d63>')"><IMG onMouseOver="showtrail('doll/d63_2.gif','',0,0)" src="dolls/63thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d32>')"><IMG onMouseOver="showtrail('doll/d32_2.gif','',0,0)" src="dolls/32thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d64>')"><IMG onMouseOver="showtrail('doll/d64_2.gif','',0,0)" src="dolls/64thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d79>')"><IMG onMouseOver="showtrail('doll/d79_2.gif','',0,0)" src="dolls/79thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d80>')"><IMG onMouseOver="showtrail('doll/d80_2.gif','',0,0)" src="dolls/80thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <TR align=middle > <TD height="35" > <A style="text-decoration:none;" href="javascript:addtext('<d81>')"><IMG onMouseOver="showtrail('doll/d81_2.gif','',0,0)" src="dolls/81thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d82>')"><IMG onMouseOver="showtrail('doll/d82_2.gif','',0,0)" src="dolls/82thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d83>')"><IMG onMouseOver="showtrail('doll/d83_2.gif','',0,0)" src="dolls/83thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d84>')"><IMG onMouseOver="showtrail('doll/d84_2.gif','',0,0)" src="dolls/84thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d85>')"><IMG onMouseOver="showtrail('doll/d85_2.gif','',0,0)" src="dolls/85thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d86>')"><IMG onMouseOver="showtrail('doll/d86_2.gif','',0,0)" src="dolls/86thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d87>')"><IMG onMouseOver="showtrail('doll/d87_2.gif','',0,0)" src="dolls/87thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d88>')"><IMG onMouseOver="showtrail('doll/d88_2.gif','',0,0)" src="dolls/88thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d89>')"><IMG onMouseOver="showtrail('doll/d89_2.gif','',0,0)" src="dolls/89thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> <A style="text-decoration:none;" href="javascript:addtext('<d90>')"><IMG onMouseOver="showtrail('doll/d90_2.gif','',0,0)" src="dolls/90thumb.gif" width="35" height="35" onMouseOut="hidetrail();"></A> </TD></TR> </TABLE><br><br><br><br> </form> <DIV id="preview_div" style="DISPLAY: none; Z-INDEX: 110; POSITION: absolute"></DIV> <? } // ************************************** if user choose text, show him first results ************************* else if($_POST['text'] and $_POST['style'] and $_POST['color']) { error_reporting(E_ERROR); $align=$_REQUEST["align"]; $text =$_REQUEST["text"];// entered text $new_text=explode(chr(13).chr(10),$text);// text separated for lines $rows_num=count($new_text);// calculating number of rows of toext to generate $style = $_REQUEST["style"]; $style = trim(strtolower(stripslashes(strip_tags($style))));// choosen style - to choose directory with letters $color = $_REQUEST["color"]; $color = trim(strtolower(stripslashes(strip_tags($color)))); // choosen color - to choose directory with letters for($row=0;$row<$rows_num;$row++) { $text = trim(strtolower(stripslashes($new_text[$row]))); $pieces = explode("<", $text); $comma = implode("^", $pieces); $pieces = explode(">", $comma); $comma = implode(".gif^", $pieces); $rows[$row] = explode("^", $comma); } // discover what elements of row are letters and what are girls. Creating array of letters and girls. $prep_rows=array(0);// rows, prepared for work with for($row=0;$row<$rows_num;$row++) { $k=0; $mass=Array(); for($i = 0; $i < count($rows[$row]); $i++) { if(substr($rows[$row][$i], -4) == ".gif") { $mass[$k]=$rows[$row][$i]; $k++; } else { $temp=$rows[$row][$i]; for($j = 0; $j < strlen($temp); $j++) { $mass[$k]=$temp[$j]; $k++; } } } $prep_rows[$row]=$mass; } // creating generated image names for saving for current user $surse = "qwertyuQWERThjklzYUIOPAxcvSDFGHVBNMiopasdfgbnmJKLZXC"; for ($i = 0; $i <10; $i++) { $newsurse[$i] = $surse[rand(0,60)]; $newsurse2[$i] = $surse[rand(0,60)]; } $imagesurse = implode("", $newsurse); //randomly created image name $curimage = implode("", $newsurse2); //randomly created image name // separating letters gif animated to each one frame of animation to paste in generated frames in a future output image for($row=0;$row<$rows_num;$row++) { for($i = 0; $i < count($prep_rows[$row]); $i++) { if(substr($prep_rows[$row][$i], -4) != ".gif") // if not gif image (girl) { if(file_exists("tempglitter/".$style."_".$prep_rows[$row][$i]."-0.gif") && file_exists("tempglitter/".$style."_".$prep_rows[$row][$i]."-1.gif")) { } else { // checking if " .gif" exists $letter_file="letters_styles/".$color."/".$style."/".$prep_rows[$row][$i].".gif"; if ($prep_rows[$row][$i]==' ') { if (!is_file($letter_file)) $letter_file="letters_styles/".$color."/".$style."/_.gif"; if (!is_file($letter_file)) $letter_file="letters_styles/".$color."/".$style."/space.gif"; } exec("convert ".$letter_file." -coalesce tempglitter/".$style."_".$prep_rows[$row][$i].".gif"); exec("convert tempglitter/".$style."_".$prep_rows[$row][$i].".gif +adjoin tempglitter/".$style."_".$prep_rows[$row][$i].".gif"); if(file_exists("tempglitter/".$style."_".$prep_rows[$row][$i].".gif")) {unlink ("tempglitter/".$style."_".$prep_rows[$row][$i].".gif");} } } } } // ************************************** calculationg size of an image ********************************* $row_sp=3;// space between rows for($row=0;$row<$rows_num;$row++) { $width_img = 0; $svaper[$row][0] = 0; $height_img = 0; // calculating image height for current row for($i = 0; $i < count($prep_rows[$row]); $i++) { if(substr($prep_rows[$row][$i], -4) == ".gif") // if doll { $height_img = 140; } else // if letter { // checking if " .gif" exists $letter_file="letters_styles/".$color."/".$style."/".$prep_rows[$row][$i].".gif"; if ($prep_rows[$row][$i]==' ') { if (!is_file($letter_file)) $letter_file="letters_styles/".$color."/".$style."/_.gif"; if (!is_file($letter_file)) $letter_file="letters_styles/".$color."/".$style."/space.gif"; } $size_img = getimagesize($letter_file); $tmp=$size_img[1]; if($tmp>$height_img){$height_img=$tmp;} } } // calculating image width for current row for($i = 0; $i < count($prep_rows[$row]); $i++) { if(substr($prep_rows[$row][$i], -4) == ".gif")// if doll { $number_img_ar_new = explode( ".", $prep_rows[$row][$i] ); $number_img_new = $number_img_ar_new[0]; $size_img = getimagesize( "dolls/". $number_img_new ."_1.gif"); $svaper[$row][$i + 1] = $svaper[$row][$i] + $size_img[0]; $width_img= $width_img + $size_img[0]; $smes_niz[$row][$i]=0; } else // if letter { // checking if " .gif" exists $letter_file="letters_styles/".$color."/".$style."/".$prep_rows[$row][$i].".gif"; if ($prep_rows[$row][$i]==' ') { if (!is_file($letter_file)) $letter_file="letters_styles/".$color."/".$style."/_.gif"; if (!is_file($letter_file)) $letter_file="letters_styles/".$color."/".$style."/space.gif"; } $size_img = getimagesize($letter_file); $svaper[$row][$i + 1] = $svaper[$row][$i] + $size_img[0]; $width_img= $width_img + $size_img[0]; $tmp=$size_img[1]; if($height_img >$tmp) { $smes_niz[$row][$i]=$height_img-$tmp; } } } $rows_height[$row]=$height_img+$row_sp*($rows_num-1); // height of current row $rows_width[$row]=$width_img; // width of current row } $width_img=max($rows_width); // width of all the image $height_img=array_sum($rows_height); // summary height of rows - height of image // ********************************** creating images (frames of animation) for future filling by dolls and letters ******* for($j=0;$j<3;$j++) { $im[$j] = imagecreatetruecolor($width_img, $height_img); $transparent_color = imagecolorallocate($im[$j],233, 14, 91); // to make it transparent in a future imagefill($im[$j], 0, 0, $transparent_color); } // ************************************* pasting girls into new image ****************************** for($row=0;$row<$rows_num;$row++) { if ($align=='l') $x_shift=0; // shifting of row according to align option else if ($align=='r') $x_shift=$width_img-$rows_width[$row]; else $x_shift=($width_img-$rows_width[$row])/2; for($i = 0; $i < count($prep_rows[$row]); $i++) { if(substr($prep_rows[$row][$i], -4) == ".gif") { $number_img_ar = explode (".", $prep_rows[$row][$i]); $number_img = $number_img_ar[0]; $x=$svaper[$row][$i]+$x_shift; $y=sub_sum($rows_height,$row,$row_sp); for($j=0;$j<3;$j++) { $rr=$j+1; $curr_doll=imagecreatefromgif("dolls/".$number_img."_".$rr.".gif"); imagecopy($im[$j],$curr_doll,$x,$y,0,0,imagesx($curr_doll),imagesy($curr_doll)); } } } } // ******************************** pasting letters into new image ******************************* for($row=0;$row<$rows_num;$row++) { if ($align=='l') $x_shift=0; // shifting of row according to align option else if ($align=='r') $x_shift=$width_img-$rows_width[$row]; else $x_shift=($width_img-$rows_width[$row])/2; for($i = 0; $i < count($prep_rows[$row]); $i++) { if(substr($prep_rows[$row][$i], -4) != ".gif") { $x=$svaper[$row][$i]+$x_shift; $y=sub_sum($rows_height,$row,$row_sp)+$smes_niz[$row][$i]; for($j=0;$j<3;$j++) { // echo "tempglitter/".$style."_".$prep_rows[$row][$i].".gif.".$j.""; // $curr_letter=imagecreatefromgif("tempglitter/".$style."_".$prep_rows[$row][$i].".gif.".$j.""); $curr_letter=imagecreatefromgif("tempglitter/".$style."_".$prep_rows[$row][$i]."-".$j.".gif"); imagecopy($im[$j],$curr_letter,$x,$y,0,0,imagesx($curr_letter),imagesy($curr_letter)); } } } } // ********************************************************************************************* // ********************* now creating new images with transparent - low used color *************** // ********************************************************************************************* imagetruecolortopalette($im[0],false,256); // converting from truecolor to palette image $colors_asc=count_colors($im[0],$width_img, $height_img); // counting colors of pixels $transp_ind=$colors_asc[0]['index']; // takes color, low usable $transp_rgb=imagecolorsforindex($im[0], $transp_ind); //taking RGB values for future transparent color imagecolortransparent($im[0],$transp_ind); // set transparent color imagefilledrectangle ($im[0], 0, 0, $width_img-1, $height_img-1, $transp_ind); //filling all the image by transparent color (palette still exists) for($j=1;$j<3;$j++) { imagedestroy($im[$j]); // destroying image $im[$j]=imagecreate($width_img, $height_img); //creating palette color image imagepalettecopy($im[$j],$im[0]);// copy palette from the first frame imagecolortransparent($im[$j],$transp_ind); // sets transparent color imagefilledrectangle ($im[$j], 0, 0, $width_img-1, $height_img-1, $transp_ind); //filling all the image by transparent color (palette still exists) } // ************************************* pasting girls into new image ****************************** for($row=0;$row<$rows_num;$row++) { if ($align=='l') $x_shift=0; // shifting of row according to align option else if ($align=='r') $x_shift=$width_img-$rows_width[$row]; else $x_shift=($width_img-$rows_width[$row])/2; for($i = 0; $i < count($prep_rows[$row]); $i++) { if(substr($prep_rows[$row][$i], -4) == ".gif") { // taking doll name $number_img_ar = explode ("." ,$prep_rows[$row][$i] ); $number_img = $number_img_ar[0]; $x=$svaper[$row][$i]+$x_shift; $y=sub_sum($rows_height,$row,$row_sp); // pasting doll into each frame of animated image for($j=0;$j<3;$j++) { $rr=$j+1; $curr_doll=imagecreatefromgif("dolls/".$number_img."_".$rr.".gif"); // doll for current image $curr_transp = imagecolortransparent ($curr_doll);// takes index for current transparent girl of doll image imagecolorset($curr_doll, $curr_transp, $transp_rgb['red'], $transp_rgb['green'], $transp_rgb['blue']);// changes the current transparent color to new one imagecopy($im[$j],$curr_doll,$x,$y,0,0,imagesx($curr_doll),imagesy($curr_doll));// pasting doll } } } } // ******************************** pasting letters into new image ******************************* for($row=0;$row<$rows_num;$row++) { if ($align=='l') $x_shift=0; // shifting of row according to align option else if ($align=='r') $x_shift=$width_img-$rows_width[$row]; else $x_shift=($width_img-$rows_width[$row])/2; for($i = 0; $i < count($prep_rows[$row]); $i++) { if(substr($prep_rows[$row][$i], -4) != ".gif") { $x=$svaper[$row][$i]+$x_shift; $y=sub_sum($rows_height,$row,$row_sp)+$smes_niz[$row][$i]; for($j=0;$j<3;$j++) { // $curr_letter=imagecreatefromgif("tempglitter/".$style."_".$prep_rows[$row][$i].".gif.".$j.""); $curr_letter=imagecreatefromgif("tempglitter/".$style."_".$prep_rows[$row][$i]."-".$j.".gif"); $curr_transp = imagecolortransparent ($curr_letter); imagecolorset($curr_letter, $curr_transp, $transp_rgb['red'], $transp_rgb['green'], $transp_rgb['blue']); imagecopy($im[$j],$curr_letter,$x,$y,0,0,imagesx($curr_letter),imagesy($curr_letter)); } } } } // *********************************** pasting watermark onto image ************************ set_time_limit(30); $watwrmark= imagecreatefromgif("site.gif"); $size_x=imageSX($watwrmark); $size_y=imageSY($watwrmark); for($j=0;$j<3;$j++) { imagecopy($im[$j],$watwrmark,(imageSX($im[$j])-$size_x)-2,(imageSY($im[$j])-$size_y)-2,0,0,$size_x,$size_y); } for($j=0;$j<3;$j++) { $rr=$j+1; imagegif($im[$j],'created/'.$imagesurse.''.$rr.'.gif'); } if(file_exists("created/$imagesurse.gif")) {unlink ("created/$imagesurse.gif");} exec("convert created/$imagesurse*.gif -loop 0 created/$curimage.gif"); for($n=1;$n<4;$n++) { if(file_exists("created/$imagesurse$n.gif")) {unlink ("created/$imagesurse$n.gif");} } $img="created/$curimage.gif"; ?> <form method="post" action="index.php" enctype="multipart/form-data"> <input type="hidden" name="url" id="url" value="<? echo $img;?>"/> <img src="<? echo $img;?>"/><br><br><br> <input type="submit" name="Trash" value="Trash It"/> <input type="submit" name="Grab" value="Keep"/> </form> <p> <? // ********************* if user choose to keep this image *************************** }else if(isset( $_POST[Grab] )) { function uploadURLToImageshack($url) { $ch = curl_init("http://www.imageshack.us/transload.php"); $post['xml']='yes'; $post['url']=$url; curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect: ')); $result = curl_exec($ch); curl_close($ch); if (strpos($result, '<'.'?xml version="1.0" encoding="iso-8859-1"?>') === false) { return 'failed'; } else { return $result; // XML data } } $xmlString=uploadURLToImageshack($site."".$_REQUEST["url"]); //begin parsing xml data if ($xmlString == 'failed') { echo "XML return failed"; exit; } $xmlData = explode("\n",$xmlString); foreach($xmlData as $xmlDatum){ $xmlDatum = trim($xmlDatum); if($xmlDatum != "" && !eregi("links",$xmlDatum) && !eregi("xml",$xmlDatum)){ $xmlDatum = str_replace(">","<",$xmlDatum); list($xmlNull,$xmlName,$xmlValue) = explode("<",$xmlDatum); $xmlr[$xmlName] = $xmlValue; } } ?> <img src="<? echo $xmlr["image_link"];?>" alt="Generate Your Own Glitter Graphics at <? echo $site;?> - Image hosted by ImageShack.us"><br> <br> <br> <br> To download your file, right click above & save as.. <b>OR</b> copy any code below</font><br> <br> <font size=2>Your generated image is proudly hosted by <a href="http://www.imageshack.us">ImageShack.us</a></font><br> <br> <br> <br> HTML Code for most websites (eg. <font color=red>Myspace</font>)<br> <textarea readonly onClick="this.focus();this.select()" style='font-family:arial;font-size:11px;width:340px' name='textarea' wrap='VIRTUAL'><a href="<? echo $site;?>" target="_blank"><img src="<? echo $xmlr["image_link"];?>" alt="Generate Your Own Glitter Graphics @ <? echo $site;?> - Image hosted by ImageShack.us" border="0"></a></textarea> <br> <br> <br> Code for <font color=red>Forums</font><br> <textarea readonly onClick="this.focus();this.select()" style='font-family:arial;font-size:11px;width:340px' name='textarea' wrap='VIRTUAL'>[url=<? echo $site;?>][img=<? echo $xmlr["image_link"];?>][/url]</textarea> </form> <? } // if user choose to send image to trash elseif(isset( $_POST[Trash] )) { if(file_exists($_REQUEST["url"])){unlink($_REQUEST["url"]);} echo"Thanks...."; } ?> </td> </tr> </table> Quote Link to comment https://forums.phpfreaks.com/topic/129377-glitter-gen-imagemagik/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.