We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29106
    • 22 Posts
    Can some one please either help me convert this script to a snippet or do it for me please
    <?php
    header("Content-type: image/png");
    
    $bg = $_GET['img'];
    
    if($bg == "" or !$bg){
    
    	$im = imagecreatefrompng("assets/images/bg.png");
    
    }else{
    
    	$im = imagecreatefrompng($bg);
    }
    
    $habbo = $_GET['name'];
    
    $home = file_get_contents("http://www.habbohotel.co.uk/home/".$habbo);
    
    if (eregi("This page is not available anymore", $home)){
    
    	$im = imagecreatefrompng("assets/images/banned.png");
    
    }elseif (eregi("marked this page as private.", $home)){
    
    	$im = imagecreatefrompng("assets/images/private.png");
    
    }elseif (eregi("Habbo Home is your own Home page on Habbo", $home)){
    
    	$im = imagecreatefrompng("assets/images/notfound.png");
    
    }else{
    
    	$white = imagecolorallocate($im, 255, 255, 255);
    
    	imagettftext($im, 7, 0, 84, 32, $white, "assets/fonts/volter (Goldfish).ttf", $habbo);
    
    	if (eregi("http://images.habbohotel.co.uk/web/web-2.0.1_b21/images/myhabbo/profile/habbo_online_anim.gif", $home)){
    
    		imagettftext($im, 7, 0, 261, 32, $white, "assets/fonts/volter (Goldfish).ttf", "I'm Online!");
    	
    	}else{
    
    		imagettftext($im, 7, 0, 260, 32, $white, "assets/fonts/volter (Goldfish).ttf", "I'm Offline!");
    	}
    
    	if (eregi('<div class="profile-motto">', $home)){
    
    		$start = explode('<div class="profile-motto">', $home);
    
    		$end = explode('</div>', $start[1]);
    
    		$motto1 = trim($end[0]);
    
    		$motto = str_replace('		<div class="clear">','',$motto1);
    		
    		$motto = str_replace('<img src="http://images.habbohotel.co.uk/web/web-2.0.1_b21/images/fonts/volter/165.gif" class="vchar" />', "¥", $motto);
    
    		imagettftext($im, 7, 0, 85, 62, $white, "assets/fonts/volter (Goldfish).ttf", $motto);
    
    	}else{
    
    		imagettftext($im, 7, 0, 85, 62, $white, "volter (Goldfish).ttf", "NO MOTTO FOUND");
    
    	}
    
    	$div_start = explode('<div class="profile-figure">', $home, 2);
    
    	$div_end = explode('</div>', $div_start[1], 2);
    
    	$img = trim($div_end[0]);
    
    	$img = preg_replace('/<img alt=\"(.*?)\" src=\"(.*?)\" \/>/', '$2', $img);
    
    	$imag = "http://www.habbohotel.co.uk".$img;
    
    	$habim = imagecreatefromgif($imag);
    
    	imagecopy($im, $habim, 0, 0, -11, -18, 80, 122);
    
    	imagedestroy($habim);
    
    }
    
    imagepng($im);
    
    imagedestroy($im);
    ?>