Zephyrus
Wanderer
- Sep 28, 2011
- 336
- 21
Hey guys, i found a script that displays every badge that habbo is in their database, but one thing...I want it to only display 6 images, which I can't do as I havent really worked with PHP!!
Please help me make this only display 6 images! Thanks!
SCRIPT:
<?php
$url = "
$data = file_get_contents($url);
$newlines = array("\n" ,"\r", "\r\n", ">", "<", "/");
$content = str_replace($newlines, "", html_entity_decode($data));
$Statushtml= '/badge_desc_(.+?)=/';
preg_match_all($Statushtml,$content,$Statusraw);
$badges = implode("-", $Statusraw[0]);
$badgevar = explode("=-badge_desc_", $badges);
$number = ($badgevar);
$badgevar2 = str_replace("=","",$badgevar);
$badgevar3 = str_replace("badge_desc_","",$badgevar2);
$number = count($badgevar3);
while ($number != 3) {
$number = $number - 1;
$imageUrl = "
if(file_exists('images/badges/' . $badgevar3[$number] . '.gif'))
{
// removed the echo failure line line
} else {
echo '<div style="float:left; background:url(' . $imageUrl . '); height:50px; width:10%; background-repeat:no-repeat; background-position:center center;"></div>'; // changed this echo to display the image.
}
}
?>
Please help me make this only display 6 images! Thanks!
SCRIPT:
<?php
$url = "
You must be registered for see links
"; // you can change habbo.com to other hotels$data = file_get_contents($url);
$newlines = array("\n" ,"\r", "\r\n", ">", "<", "/");
$content = str_replace($newlines, "", html_entity_decode($data));
$Statushtml= '/badge_desc_(.+?)=/';
preg_match_all($Statushtml,$content,$Statusraw);
$badges = implode("-", $Statusraw[0]);
$badgevar = explode("=-badge_desc_", $badges);
$number = ($badgevar);
$badgevar2 = str_replace("=","",$badgevar);
$badgevar3 = str_replace("badge_desc_","",$badgevar2);
$number = count($badgevar3);
while ($number != 3) {
$number = $number - 1;
$imageUrl = "
You must be registered for see links
"; // if you did change habbo.com, you'd have to change it here too.if(file_exists('images/badges/' . $badgevar3[$number] . '.gif'))
{
// removed the echo failure line line
} else {
echo '<div style="float:left; background:url(' . $imageUrl . '); height:50px; width:10%; background-repeat:no-repeat; background-position:center center;"></div>'; // changed this echo to display the image.
}
}
?>