-Karl- Posted March 20, 2010 Share Posted March 20, 2010 Here's sig.php <?php header("Content-type: image/png"); $username = $_GET['username']; $type = $_GET['type']; //$username = strtolower(str_replace(' ', '_', $username)); if(!$username) { echo ("You didn't enter a username."); } $index = @file_get_contents('http://hiscore.runescape.com/index_lite.ws?player=' . $username); if ($index != "") { $lulwut = explode("\n", $index); $overall = explode(",", $lulwut[0]); $lol['att'] = explode(",", $lulwut[1]); $lol['def'] = explode(",", $lulwut[2]); $lol['str'] = explode(",", $lulwut[3]); $lol['hp'] = explode(",", $lulwut[4]); $lol['rng'] = explode(",", $lulwut[5]); $lol['pry'] = explode(",", $lulwut[6]); $lol['mag'] = explode(",", $lulwut[7]); $lol['ck'] = explode(",", $lulwut[8]); $lol['wc'] = explode(",", $lulwut[9]); $lol['flt'] = explode(",", $lulwut[10]); $lol['fsh'] = explode(",", $lulwut[11]); $lol['fm'] = explode(",", $lulwut[12]); $lol['cra'] = explode(",", $lulwut[13]); $lol['smi'] = explode(",", $lulwut[14]); $lol['min'] = explode(",", $lulwut[15]); $lol['her'] = explode(",", $lulwut[16]); $lol['ag'] = explode(",", $lulwut[17]); $lol['th'] = explode(",", $lulwut[18]); $lol['sl'] = explode(",", $lulwut[19]); $lol['frm'] = explode(",", $lulwut[20]); $lol['rc'] = explode(",", $lulwut[21]); $lol['hun'] = explode(",", $lulwut[22]); $lol['cs'] = explode(",", $lulwut[23]); $lol['sum'] = explode(",", $lulwut[24]); if($type == 1) { $image_URL = './red.png'; $x = array('28', '80', '135', '188', '240'); $y = array('8', '29', '52', '77', '100'); } if($type == 2) { $image_URL = './brushedred.png'; $x = array('37', '89', '145', '200', '256'); $y = array('10', '36', '61', '90', '118'); } if($type == 3) { $image_URL = './brushedpurple.png'; $x = array('28', '80', '135', '188', '240'); $y = array('8', '29', '52', '77', '100'); } if($type == 4) { $image_URL = './blue.png'; $x = array('28', '80', '135', '188', '240'); $y = array('8', '29', '52', '77', '100'); } if($type == 5) { $image_URL = './green.png'; $x = array('28', '80', '135', '188', '240'); $y = array('8', '29', '52', '77', '100'); } if($type == 6) { $image_URL = './gradient.png'; $x = array('28', '80', '135', '188', '240'); $y = array('8', '29', '52', '77', '100'); } if($type == 7) { $image_URL = './pw.png'; $x = array('35', '95', '150', '205', '260'); $y = array('8', '36', '62', '90', '119'); } else { } $image = imagecreatefrompng($image_URL); $fcolour = imagecolorallocate($image, 255, 255, 255); $fsize = 5; $fsize2 = 2; $lol['hp'] = str_replace('-1', '10', $lol['hp']); $row = '0'; $column = '0'; if($type == 1) { foreach($lol as $s_key => $value){ $value[1] = str_replace('-1', '1', $value[1]); if($s_key == "att"){ imagestring($image, $fsize, 32, 8, $value[1], $fcolour); continue; } if($s_key == "def"){ imagestring($image, $fsize, 32, 62, $value[1], $fcolour); continue; } if($s_key == "str"){ imagestring($image, $fsize, 32, 36, $value[1], $fcolour); continue; } if($s_key == "hp"){ imagestring($image, $fsize, 88, 36, $value[1], $fcolour); continue; } if($s_key == "rng"){ imagestring($image, $fsize, 32, 90, $value[1], $fcolour); continue; } if($s_key == "pry"){ imagestring($image, $fsize, 32, 118, $value[1], $fcolour); continue; } if($s_key == "mag"){ imagestring($image, $fsize, 88, 8, $value[1], $fcolour); continue; } if($s_key == "ck"){ imagestring($image, $fsize, 198, 8, $value[1], $fcolour); continue; } if($s_key == "wc"){ imagestring($image, $fsize, 145, 8, $value[1], $fcolour); continue; } if($s_key == "flt"){ imagestring($image, $fsize, 88, 62, $value[1], $fcolour); continue; } if($s_key == "fsh"){ imagestring($image, $fsize, 260, 90, $value[1], $fcolour); continue; } if($s_key == "fm"){ imagestring($image, $fsize, 198, 62, $value[1], $fcolour); continue; } if($s_key == "cra"){ imagestring($image, $fsize, 198, 90, $value[1], $fcolour); continue; } if($s_key == "smi"){ imagestring($image, $fsize, 145, 118, $value[1], $fcolour); continue; } if($s_key == "min"){ imagestring($image, $fsize, 145, 90, $value[1], $fcolour); continue; } if($s_key == "her"){ imagestring($image, $fsize, 260, 8, $value[1], $fcolour); continue; } if($s_key == "ag"){ imagestring($image, $fsize, 145, 62, $value[1], $fcolour); continue; } if($s_key == "th"){ imagestring($image, $fsize, 198, 36, $value[1], $fcolour); continue; } if($s_key == "sl"){ imagestring($image, $fsize, 88, 90, $value[1], $fcolour); continue; } if($s_key == "frm"){ imagestring($image, $fsize, 145, 36, $value[1], $fcolour); continue; } if($s_key == "rc"){ imagestring($image, $fsize, 88, 118, $value[1], $fcolour); continue; } if($s_key == "hun"){ imagestring($image, $fsize, 260, 36, $value[1], $fcolour); continue; } if($s_key == "cs"){ imagestring($image, $fsize, 198, 118, $value[1], $fcolour); continue; } if($s_key == "sum"){ imagestring($image, $fsize, 260, 62, $value[1], $fcolour); continue; } imagestring($image, $fsize, $x[$row], $y[$column], $value[1], $fcolour); $row++; if($row == '5'){ $row = '0'; $column++; } } } if($type == 2) { foreach($lol as $s_key => $value){ $value[1] = str_replace('-1', '1', $value[1]); if($s_key == "att"){ imagestring($image, $fsize, 32, 8, $value[1], $fcolour); continue; } if($s_key == "def"){ imagestring($image, $fsize, 32, 62, $value[1], $fcolour); continue; } if($s_key == "str"){ imagestring($image, $fsize, 32, 36, $value[1], $fcolour); continue; } if($s_key == "hp"){ imagestring($image, $fsize, 88, 36, $value[1], $fcolour); continue; } if($s_key == "rng"){ imagestring($image, $fsize, 32, 90, $value[1], $fcolour); continue; } if($s_key == "pry"){ imagestring($image, $fsize, 32, 118, $value[1], $fcolour); continue; } if($s_key == "mag"){ imagestring($image, $fsize, 88, 8, $value[1], $fcolour); continue; } if($s_key == "ck"){ imagestring($image, $fsize, 198, 8, $value[1], $fcolour); continue; } if($s_key == "wc"){ imagestring($image, $fsize, 145, 8, $value[1], $fcolour); continue; } if($s_key == "flt"){ imagestring($image, $fsize, 88, 62, $value[1], $fcolour); continue; } if($s_key == "fsh"){ imagestring($image, $fsize, 260, 90, $value[1], $fcolour); continue; } if($s_key == "fm"){ imagestring($image, $fsize, 198, 62, $value[1], $fcolour); continue; } if($s_key == "cra"){ imagestring($image, $fsize, 198, 90, $value[1], $fcolour); continue; } if($s_key == "smi"){ imagestring($image, $fsize, 145, 118, $value[1], $fcolour); continue; } if($s_key == "min"){ imagestring($image, $fsize, 145, 90, $value[1], $fcolour); continue; } if($s_key == "her"){ imagestring($image, $fsize, 260, 8, $value[1], $fcolour); continue; } if($s_key == "ag"){ imagestring($image, $fsize, 145, 62, $value[1], $fcolour); continue; } if($s_key == "th"){ imagestring($image, $fsize, 198, 36, $value[1], $fcolour); continue; } if($s_key == "sl"){ imagestring($image, $fsize, 88, 90, $value[1], $fcolour); continue; } if($s_key == "frm"){ imagestring($image, $fsize, 145, 36, $value[1], $fcolour); continue; } if($s_key == "rc"){ imagestring($image, $fsize, 88, 118, $value[1], $fcolour); continue; } if($s_key == "hun"){ imagestring($image, $fsize, 260, 36, $value[1], $fcolour); continue; } if($s_key == "cs"){ imagestring($image, $fsize, 198, 118, $value[1], $fcolour); continue; } if($s_key == "sum"){ imagestring($image, $fsize, 260, 62, $value[1], $fcolour); continue; } imagestring($image, $fsize, $x[$row], $y[$column], $value[1], $fcolour); $row++; if($row == '5'){ $row = '0'; $column++; } } } if($type == 3) { foreach($lol as $s_key => $value){ $value[1] = str_replace('-1', '1', $value[1]); if($s_key == "att"){ imagestring($image, $fsize, 32, 8, $value[1], $fcolour); continue; } if($s_key == "def"){ imagestring($image, $fsize, 32, 62, $value[1], $fcolour); continue; } if($s_key == "str"){ imagestring($image, $fsize, 32, 36, $value[1], $fcolour); continue; } if($s_key == "hp"){ imagestring($image, $fsize, 88, 36, $value[1], $fcolour); continue; } if($s_key == "rng"){ imagestring($image, $fsize, 32, 90, $value[1], $fcolour); continue; } if($s_key == "pry"){ imagestring($image, $fsize, 32, 118, $value[1], $fcolour); continue; } if($s_key == "mag"){ imagestring($image, $fsize, 88, 8, $value[1], $fcolour); continue; } if($s_key == "ck"){ imagestring($image, $fsize, 198, 8, $value[1], $fcolour); continue; } if($s_key == "wc"){ imagestring($image, $fsize, 145, 8, $value[1], $fcolour); continue; } if($s_key == "flt"){ imagestring($image, $fsize, 88, 62, $value[1], $fcolour); continue; } if($s_key == "fsh"){ imagestring($image, $fsize, 260, 90, $value[1], $fcolour); continue; } if($s_key == "fm"){ imagestring($image, $fsize, 198, 62, $value[1], $fcolour); continue; } if($s_key == "cra"){ imagestring($image, $fsize, 198, 90, $value[1], $fcolour); continue; } if($s_key == "smi"){ imagestring($image, $fsize, 145, 118, $value[1], $fcolour); continue; } if($s_key == "min"){ imagestring($image, $fsize, 145, 90, $value[1], $fcolour); continue; } if($s_key == "her"){ imagestring($image, $fsize, 260, 8, $value[1], $fcolour); continue; } if($s_key == "ag"){ imagestring($image, $fsize, 145, 62, $value[1], $fcolour); continue; } if($s_key == "th"){ imagestring($image, $fsize, 198, 36, $value[1], $fcolour); continue; } if($s_key == "sl"){ imagestring($image, $fsize, 88, 90, $value[1], $fcolour); continue; } if($s_key == "frm"){ imagestring($image, $fsize, 145, 36, $value[1], $fcolour); continue; } if($s_key == "rc"){ imagestring($image, $fsize, 88, 118, $value[1], $fcolour); continue; } if($s_key == "hun"){ imagestring($image, $fsize, 260, 36, $value[1], $fcolour); continue; } if($s_key == "cs"){ imagestring($image, $fsize, 198, 118, $value[1], $fcolour); continue; } if($s_key == "sum"){ imagestring($image, $fsize, 260, 62, $value[1], $fcolour); continue; } imagestring($image, $fsize, $x[$row], $y[$column], $value[1], $fcolour); $row++; if($row == '5'){ $row = '0'; $column++; } } } if($type == 4) { foreach($lol as $s_key => $value){ $value[1] = str_replace('-1', '1', $value[1]); if($s_key == "att"){ imagestring($image, $fsize, 32, 8, $value[1], $fcolour); continue; } if($s_key == "def"){ imagestring($image, $fsize, 32, 62, $value[1], $fcolour); continue; } if($s_key == "str"){ imagestring($image, $fsize, 32, 36, $value[1], $fcolour); continue; } if($s_key == "hp"){ imagestring($image, $fsize, 88, 36, $value[1], $fcolour); continue; } if($s_key == "rng"){ imagestring($image, $fsize, 32, 90, $value[1], $fcolour); continue; } if($s_key == "pry"){ imagestring($image, $fsize, 32, 118, $value[1], $fcolour); continue; } if($s_key == "mag"){ imagestring($image, $fsize, 88, 8, $value[1], $fcolour); continue; } if($s_key == "ck"){ imagestring($image, $fsize, 198, 8, $value[1], $fcolour); continue; } if($s_key == "wc"){ imagestring($image, $fsize, 145, 8, $value[1], $fcolour); continue; } if($s_key == "flt"){ imagestring($image, $fsize, 88, 62, $value[1], $fcolour); continue; } if($s_key == "fsh"){ imagestring($image, $fsize, 260, 90, $value[1], $fcolour); continue; } if($s_key == "fm"){ imagestring($image, $fsize, 198, 62, $value[1], $fcolour); continue; } if($s_key == "cra"){ imagestring($image, $fsize, 198, 90, $value[1], $fcolour); continue; } if($s_key == "smi"){ imagestring($image, $fsize, 145, 118, $value[1], $fcolour); continue; } if($s_key == "min"){ imagestring($image, $fsize, 145, 90, $value[1], $fcolour); continue; } if($s_key == "her"){ imagestring($image, $fsize, 260, 8, $value[1], $fcolour); continue; } if($s_key == "ag"){ imagestring($image, $fsize, 145, 62, $value[1], $fcolour); continue; } if($s_key == "th"){ imagestring($image, $fsize, 198, 36, $value[1], $fcolour); continue; } if($s_key == "sl"){ imagestring($image, $fsize, 88, 90, $value[1], $fcolour); continue; } if($s_key == "frm"){ imagestring($image, $fsize, 145, 36, $value[1], $fcolour); continue; } if($s_key == "rc"){ imagestring($image, $fsize, 88, 118, $value[1], $fcolour); continue; } if($s_key == "hun"){ imagestring($image, $fsize, 260, 36, $value[1], $fcolour); continue; } if($s_key == "cs"){ imagestring($image, $fsize, 198, 118, $value[1], $fcolour); continue; } if($s_key == "sum"){ imagestring($image, $fsize, 260, 62, $value[1], $fcolour); continue; } imagestring($image, $fsize, $x[$row], $y[$column], $value[1], $fcolour); $row++; if($row == '5'){ $row = '0'; $column++; } } } if($type == 5) { foreach($lol as $s_key => $value){ $value[1] = str_replace('-1', '1', $value[1]); if($s_key == "att"){ imagestring($image, $fsize, 32, 8, $value[1], $fcolour); continue; } if($s_key == "def"){ imagestring($image, $fsize, 32, 62, $value[1], $fcolour); continue; } if($s_key == "str"){ imagestring($image, $fsize, 32, 36, $value[1], $fcolour); continue; } if($s_key == "hp"){ imagestring($image, $fsize, 88, 36, $value[1], $fcolour); continue; } if($s_key == "rng"){ imagestring($image, $fsize, 32, 90, $value[1], $fcolour); continue; } if($s_key == "pry"){ imagestring($image, $fsize, 32, 118, $value[1], $fcolour); continue; } if($s_key == "mag"){ imagestring($image, $fsize, 88, 8, $value[1], $fcolour); continue; } if($s_key == "ck"){ imagestring($image, $fsize, 198, 8, $value[1], $fcolour); continue; } if($s_key == "wc"){ imagestring($image, $fsize, 145, 8, $value[1], $fcolour); continue; } if($s_key == "flt"){ imagestring($image, $fsize, 88, 62, $value[1], $fcolour); continue; } if($s_key == "fsh"){ imagestring($image, $fsize, 260, 90, $value[1], $fcolour); continue; } if($s_key == "fm"){ imagestring($image, $fsize, 198, 62, $value[1], $fcolour); continue; } if($s_key == "cra"){ imagestring($image, $fsize, 198, 90, $value[1], $fcolour); continue; } if($s_key == "smi"){ imagestring($image, $fsize, 145, 118, $value[1], $fcolour); continue; } if($s_key == "min"){ imagestring($image, $fsize, 145, 90, $value[1], $fcolour); continue; } if($s_key == "her"){ imagestring($image, $fsize, 260, 8, $value[1], $fcolour); continue; } if($s_key == "ag"){ imagestring($image, $fsize, 145, 62, $value[1], $fcolour); continue; } if($s_key == "th"){ imagestring($image, $fsize, 198, 36, $value[1], $fcolour); continue; } if($s_key == "sl"){ imagestring($image, $fsize, 88, 90, $value[1], $fcolour); continue; } if($s_key == "frm"){ imagestring($image, $fsize, 145, 36, $value[1], $fcolour); continue; } if($s_key == "rc"){ imagestring($image, $fsize, 88, 118, $value[1], $fcolour); continue; } if($s_key == "hun"){ imagestring($image, $fsize, 260, 36, $value[1], $fcolour); continue; } if($s_key == "cs"){ imagestring($image, $fsize, 198, 118, $value[1], $fcolour); continue; } if($s_key == "sum"){ imagestring($image, $fsize, 260, 62, $value[1], $fcolour); continue; } imagestring($image, $fsize, $x[$row], $y[$column], $value[1], $fcolour); $row++; if($row == '5'){ $row = '0'; $column++; } } } if($type == 6) { foreach($lol as $s_key => $value){ $value[1] = str_replace('-1', '1', $value[1]); if($s_key == "att"){ imagestring($image, $fsize, 32, 8, $value[1], $fcolour); continue; } if($s_key == "def"){ imagestring($image, $fsize, 32, 62, $value[1], $fcolour); continue; } if($s_key == "str"){ imagestring($image, $fsize, 32, 36, $value[1], $fcolour); continue; } if($s_key == "hp"){ imagestring($image, $fsize, 88, 36, $value[1], $fcolour); continue; } if($s_key == "rng"){ imagestring($image, $fsize, 32, 90, $value[1], $fcolour); continue; } if($s_key == "pry"){ imagestring($image, $fsize, 32, 118, $value[1], $fcolour); continue; } if($s_key == "mag"){ imagestring($image, $fsize, 88, 8, $value[1], $fcolour); continue; } if($s_key == "ck"){ imagestring($image, $fsize, 198, 8, $value[1], $fcolour); continue; } if($s_key == "wc"){ imagestring($image, $fsize, 145, 8, $value[1], $fcolour); continue; } if($s_key == "flt"){ imagestring($image, $fsize, 88, 62, $value[1], $fcolour); continue; } if($s_key == "fsh"){ imagestring($image, $fsize, 260, 90, $value[1], $fcolour); continue; } if($s_key == "fm"){ imagestring($image, $fsize, 198, 62, $value[1], $fcolour); continue; } if($s_key == "cra"){ imagestring($image, $fsize, 198, 90, $value[1], $fcolour); continue; } if($s_key == "smi"){ imagestring($image, $fsize, 145, 118, $value[1], $fcolour); continue; } if($s_key == "min"){ imagestring($image, $fsize, 145, 90, $value[1], $fcolour); continue; } if($s_key == "her"){ imagestring($image, $fsize, 260, 8, $value[1], $fcolour); continue; } if($s_key == "ag"){ imagestring($image, $fsize, 145, 62, $value[1], $fcolour); continue; } if($s_key == "th"){ imagestring($image, $fsize, 198, 36, $value[1], $fcolour); continue; } if($s_key == "sl"){ imagestring($image, $fsize, 88, 90, $value[1], $fcolour); continue; } if($s_key == "frm"){ imagestring($image, $fsize, 145, 36, $value[1], $fcolour); continue; } if($s_key == "rc"){ imagestring($image, $fsize, 88, 118, $value[1], $fcolour); continue; } if($s_key == "hun"){ imagestring($image, $fsize, 260, 36, $value[1], $fcolour); continue; } if($s_key == "cs"){ imagestring($image, $fsize, 198, 118, $value[1], $fcolour); continue; } if($s_key == "sum"){ imagestring($image, $fsize, 260, 62, $value[1], $fcolour); continue; } imagestring($image, $fsize, $x[$row], $y[$column], $value[1], $fcolour); $row++; if($row == '5'){ $row = '0'; $column++; } } } $overall[1] = str_replace('-1', 'Not Ranked', $overall[1]); $overall[1] = str_replace('Verdana', 'Not Ranked', $overall[1]); imagestring($image, $fsize2, '240', '105', 'Total:' . $overall[1], $fcolour); $username = str_replace('_', ' ', $username); imagestring($image, $fsize2, '240', '115', 'RSN:' . $username, $fcolour); imagepng($image); imagedestroy($image); } else { echo("You have entered an invalid username or the username was not found on the hiscores."); } ?> Here's index.php <? $url = "http://****/statsigs/"; $sr = $_POST['image']; ?> <script type="text/javascript"> function changeSampleColor(color) { var sample_img = document.getElementById('sample'); sample_img.src = 'http://****/statsigs/red.png'; sample_img.src = 'http://****/statsigs/' + color + '.png'; } </script> <br> <form method="POST"> <select style="width: 345px; vertical-align: top; height: 143px;" id="background" name="image" size="7" onchange="javascript:changeSampleColor(this.value);"> <option value="red">Red</option> <option value="brushedred">Brushed Red</option> <option value="brushedpurple">Brushed Purple</option> <option value="blue">Blue</option> <option value="green">Green</option> <option value="gradient">Gradient</option> <option value="pw">Pure Warfare</option> </select> <img id="sample" src="./statsigs/red.png" alt="Not Found" /></td> <br> <input type="textbox" name="username" value="Username"> <input type="submit" name="submit" value="Go"><br /> <?php echo $stats[53] ?> </form> <? if($_POST['submit']){ $username = $_POST['username']; $username = str_replace(' ', '_', $username); if($sr == red) { echo('<b>Your Signature</b>:<br> <img src="'.$url.'sig.php?username='.$username.'&type=1"><br>'); echo('<b>For Forums:</b> <input type="textbox" value="[url=http://www.****.com][img=http://'.$url.'sig.php?username='.$username.'&type=1][/url]"><br>'); echo('<b>Direct Link:</b> <input type="textbox" value="'.$url.'sig.php?username='.$username.'&type=1"><br>'); } else if($sr == brushedred) { echo('<b>Your Signature</b>:<br> <img src="'.$url.'sig.php?username='.$username.'&type=2"><br>'); echo('<b>For Forums:</b> <input type="textbox" value="[url=http://www.****.com][img=http://'.$url.'sig.php?username='.$username.'&type=2][/url]"><br>'); echo('<b>Direct Link:</b> <input type="textbox" value="'.$url.'sig.php?username='.$username.'&type=2"><br>'); } else if($sr == brushedpurple) { echo('<b>Your Signature</b>:<br> <img src="'.$url.'sig.php?username='.$username.'&type=3"><br>'); echo('<b>For Forums:</b> <input type="textbox" value="[url=http://www.****.com][img=http://'.$url.'sig.php?username='.$username.'&type=2][/url]"><br>'); echo('<b>Direct Link:</b> <input type="textbox" value="'.$url.'sig.php?username='.$username.'&type=2"><br>'); } else if($sr == blue) { echo('<b>Your Signature</b>:<br> <img src="'.$url.'sig.php?username='.$username.'&type=4"><br>'); echo('<b>For Forums:</b> <input type="textbox" value="[url=http://www.****.com][img=http://'.$url.'sig.php?username='.$username.'&type=2][/url]"><br>'); echo('<b>Direct Link:</b> <input type="textbox" value="'.$url.'sig.php?username='.$username.'&type=2"><br>'); } else if($sr == green) { echo('<b>Your Signature</b>:<br> <img src="'.$url.'sig.php?username='.$username.'&type=5"><br>'); echo('<b>For Forums:</b> <input type="textbox" value="[url=http://www.****.com][img=http://'.$url.'sig.php?username='.$username.'&type=2][/url]"><br>'); echo('<b>Direct Link:</b> <input type="textbox" value="'.$url.'sig.php?username='.$username.'&type=2"><br>'); } else if($sr == gradient) { echo('<b>Your Signature</b>:<br> <img src="'.$url.'sig.php?username='.$username.'&type=6"><br>'); echo('<b>For Forums:</b> <input type="textbox" value="[url=http://www.****.com][img=http://'.$url.'sig.php?username='.$username.'&type=2][/url]"><br>'); echo('<b>Direct Link:</b> <input type="textbox" value="'.$url.'sig.php?username='.$username.'&type=2"><br>'); } else if($sr == pw) { echo('<b>Your Signature</b>:<br> <img src="'.$url.'sig.php?username='.$username.'&type=7"><br>'); echo('<b>For Forums:</b> <input type="textbox" value="[url=http://www.****.com][img=http://'.$url.'sig.php?username='.$username.'&type=3][/url]"><br>'); echo('<b>Direct Link:</b> <input type="textbox" value="'.$url.'sig.php?username='.$username.'&type=3"><br>'); } else { echo('<b><font color="red">You did not choose an image, so one was selected for you.</font></b><br /><br />'); echo('<b>Your Signature</b>:<br> <img src="'.$url.'sig.php?username='.$username.'&type=1"><br>'); echo('<b>For Forums:</b> <input type="textbox" value="[img=http://'.$url.'sig.php?username='.$username.'&type=1]"><br>'); echo('<b>Direct Link:</b> <input type="textbox" value="'.$url.'sig.php?username='.$username.'&type=1"><br>'); } } ?> The script itself works fine, it generates the image and displays the information where it should. The only problem is that the output is sig.php?username=Username&type=2. Obviously this isn't allowed on most forum software, so the dynamic signatures can't be used in certain places. I was wondering if anyone knew how to change the code so that ir would produce a .png file which will be allowed on forum software. Quote Link to comment Share on other sites More sharing options...
-Karl- Posted March 20, 2010 Author Share Posted March 20, 2010 Any ideas anyone? Quote Link to comment Share on other sites More sharing options...
oni-kun Posted March 20, 2010 Share Posted March 20, 2010 Any ideas anyone? I've used many dynamic signatures and none of them have cut off url parameters, If it's not an image it simply would not load. You can assign a mock up ID: username=Username..type=2 exploding the obvious on server, the forum software would not know the difference. [ot]Do I know you from somewhere? :-\[/ot] Quote Link to comment Share on other sites More sharing options...
-Karl- Posted March 21, 2010 Author Share Posted March 21, 2010 Any ideas anyone? I've used many dynamic signatures and none of them have cut off url parameters, If it's not an image it simply would not load. You can assign a mock up ID: username=Username..type=2 exploding the obvious on server, the forum software would not know the difference. [ot]Do I know you from somewhere? :-\[/ot] Well, on sites similar to what I'm trying to create they have been able to create a script, where it becomes .png at the end, thus being able to use them on forums. (www.rsbandb.com is just one example). [ot]Where do you think you know me from?[/ot] Quote Link to comment Share on other sites More sharing options...
oni-kun Posted March 21, 2010 Share Posted March 21, 2010 Any ideas anyone? I've used many dynamic signatures and none of them have cut off url parameters, If it's not an image it simply would not load. You can assign a mock up ID: username=Username..type=2 exploding the obvious on server, the forum software would not know the difference. [ot]Do I know you from somewhere? :-\[/ot] Well, on sites similar to what I'm trying to create they have been able to create a script, where it becomes .png at the end, thus being able to use them on forums. (www.rsbandb.com is just one example). [ot]Where do you think you know me from?[/ot] header("Content-type: image/png"); Do you want the end result in a png? Then parse png files as PHP, or create an on-request generation to serve it as a transparent png file. Use the AddType directive in a .htaccess document and you can do whatever you wish there, mod_rewrite is a useful tool. Quote Link to comment Share on other sites More sharing options...
-Karl- Posted March 21, 2010 Author Share Posted March 21, 2010 Any ideas anyone? I've used many dynamic signatures and none of them have cut off url parameters, If it's not an image it simply would not load. You can assign a mock up ID: username=Username..type=2 exploding the obvious on server, the forum software would not know the difference. [ot]Do I know you from somewhere? :-\[/ot] Well, on sites similar to what I'm trying to create they have been able to create a script, where it becomes .png at the end, thus being able to use them on forums. (www.rsbandb.com is just one example). [ot]Where do you think you know me from?[/ot] header("Content-type: image/png"); Do you want the end result in a png? Then parse png files as PHP, or create an on-request generation to serve it as a transparent png file. Use the AddType directive in a .htaccess document and you can do whatever you wish there, mod_rewrite is a useful tool. I've tried, but I just can't figure out how to do it. Quote Link to comment Share on other sites More sharing options...
oni-kun Posted March 21, 2010 Share Posted March 21, 2010 .htaccess in sig folder: AddType application/x-httpd-php5 .png filename.png: <?php header("Content-type: image/png"); ... ?> Then it can be called by /sig/filename.png and it will be dynamic as required. Quote Link to comment Share on other sites More sharing options...
-Karl- Posted March 21, 2010 Author Share Posted March 21, 2010 .htaccess in sig folder: AddType application/x-httpd-php5 .png filename.png: <?php header("Content-type: image/png"); ... ?> Then it can be called by /sig/filename.png and it will be dynamic as required. Then how would I make this work depending on the persons username and the signature design they chose? Sorry, I've never tried doing this before. Quote Link to comment Share on other sites More sharing options...
-Karl- Posted March 21, 2010 Author Share Posted March 21, 2010 filename.png returns The image “****/filename.png” cannot be displayed, because it contains errors. I really have no idea what I'm doing now. Quote Link to comment Share on other sites More sharing options...
-Karl- Posted March 21, 2010 Author Share Posted March 21, 2010 I have found a way that could possibly work when I type this in the url http://****/username.png using the .htaccess RewriteEngine on RewriteBase / RewriteRule ^(.+).png http://****/sig.php\?username\=$1 [NC,L] RewriteRule ^(.*).png http://****/ [R=permanent,NC,L] The username part works, how could I also get the type to work? Such as http://****/username-type.png How would I get that to work with the RewriteRule? Quote Link to comment 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.