Hello DP'ers I wonder if someone could help me to center the "Paying" image icon inside a php image file please. Link to the image: http://idev.freehostingnoads.net/monitoring/img.php?id=10 The code for the php image, <?php if(strlen($_GET['id'])>0) { include('./config/config.php'); if($result=mysql_query("SELECT `nazwa`, `status` FROM `programs` WHERE `id_program`='". $_GET['id'] ."' AND `blacklist`='' AND `status`>'0'") and $payout=mysql_query("SELECT `data` FROM `payouts` WHERE `id_program`='". $_GET['id'] ."' ORDER BY `data` DESC LIMIT 1")) { if(mysql_num_rows($result)==1) { $name=mysql_result($result, 0, 0); $status=mysql_result($result, 0, 1); if(mysql_num_rows($payout)==1) $last_payout=mysql_result($payout, 0, 0); else $last_payout='no payouts'; mysql_free_result($result); $img=imagecreatefrompng('gfx/banner.png'); $black=imagecolorallocate($img, 0, 0, 0); $name=((strlen($name)>15) ? substr($name, 0, 13). '...' : $name); $x = floor((ImageSX($img) / 2) - ((ImageFontWidth(2) * strlen($name)) / 2)); imagestring($img, 2, $x, 63, $name, $black); imagestring($img, 2, 25, 83, $last_payout, $black); if ($p=imagecreatefrompng('./gfx/icons/status_'. $status .'.png')) { imagecopyresampled($img, $p, 1, 103, 0, 0, 108, 16, 108, 16); imagedestroy($p); } header("Content-type: image/png"); imagepng($img); } } } ?> PHP: Thanks
<?php if(strlen($_GET['id'])>0) { include('./config/config.php'); if($result=mysql_query("SELECT `nazwa`, `status` FROM `programs` WHERE `id_program`='". $_GET['id'] ."' AND `blacklist`='' AND `status`>'0'") and $payout=mysql_query("SELECT `data` FROM `payouts` WHERE `id_program`='". $_GET['id'] ."' ORDER BY `data` DESC LIMIT 1")) { if(mysql_num_rows($result)==1) { $name=mysql_result($result, 0, 0); $status=mysql_result($result, 0, 1); if(mysql_num_rows($payout)==1) $last_payout=mysql_result($payout, 0, 0); else $last_payout='no payouts'; mysql_free_result($result); $img=imagecreatefrompng('gfx/banner.png'); $black=imagecolorallocate($img, 0, 0, 0); $name=((strlen($name)>15) ? substr($name, 0, 13). '...' : $name); $x = floor((ImageSX($img) / 2) - ((ImageFontWidth(2) * strlen($name)) / 2)); imagestring($img, 2, $x, 63, $name, $black); imagestring($img, 2, 25, 83, $last_payout, $black); if ($p=imagecreatefrompng('./gfx/icons/status_'. $status .'.png')) { $statusImageX = floor((ImageSX($img)/2))-floor((ImageSX($p)/2)); imagecopyresampled($img, $p, $statusImageX, 103, 0, 0, 108, 16, 108, 16); imagedestroy($p); } header("Content-type: image/png"); imagepng($img); } } } Code (markup):
Thank you i will try it shortly, But i seem to have an error come out of no where now, i wonder if you have a fix for it, if you have time of course. Error Lines 256 - 268 //AUTORYZACJE function auth() { $r=false; $login=$_SESSION['login']; if(strlen($login) > 0 && $login=='admin') { if ($passDB=mysql_query("SELECT `haslo` AS `p` FROM `users` WHERE `login`='admin' LIMIT 1")) { $p=@mysql_result($passDB, 0, 0); $r=(($_SESSION['login']=='admin') && (decode($_SESSION['password'])==decode($p)))?true:false; } } PHP: Thanks