Zephyrus
Wanderer
- Sep 28, 2011
- 336
- 21
If someone can get this script to display a maximum of only 3 images, that would be great! PLEASE POST A REPLY BACK!!!!
[THIS SCRIPT DISPLAYS ALL OF THE IMAGES WITHIN THE BADGES DIRECTORY IN THEIR SWFS.]
<?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.
}
}
?>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.pages.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("div.holder").jPages({
containerID : "test",
perPage: 60
});
});
</script>
<section class="row">
<div class="news-box">
<span style="font-weight:bold;">Habbo Badges</span>
<div class="holder"></div>
<div id="test" style="overflow-x:scroll; height:350px;">
<?php
function mtimecmp($a, $b) {
$mt_a = filemtime($a);
$mt_b = filemtime($b);
if ($mt_a == $mt_b)
return 0;
else if ($mt_a < $mt_b)
return -1;
else
return 1;
}
$images = glob("images/badges/*.gif");
usort($images, "mtimecmp");
for ($i = count($images) - 1; $i >= 0; $i--) {
$image = $images[$i];
$imgname = basename($image,".gif");
echo '<div style="float:left; background:url(' . $image . '); height:50px; width:10%; background-repeat:no-repeat; background-position:center center;"></div>';
}
?>
<div style="clear:both;"></div>
</div>
</div>
</div>
</div>
</section>
[THIS SCRIPT DISPLAYS ALL OF THE IMAGES WITHIN THE BADGES DIRECTORY IN THEIR SWFS.]
<?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.
}
}
?>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.pages.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("div.holder").jPages({
containerID : "test",
perPage: 60
});
});
</script>
<section class="row">
<div class="news-box">
<span style="font-weight:bold;">Habbo Badges</span>
<div class="holder"></div>
<div id="test" style="overflow-x:scroll; height:350px;">
<?php
function mtimecmp($a, $b) {
$mt_a = filemtime($a);
$mt_b = filemtime($b);
if ($mt_a == $mt_b)
return 0;
else if ($mt_a < $mt_b)
return -1;
else
return 1;
}
$images = glob("images/badges/*.gif");
usort($images, "mtimecmp");
for ($i = count($images) - 1; $i >= 0; $i--) {
$image = $images[$i];
$imgname = basename($image,".gif");
echo '<div style="float:left; background:url(' . $image . '); height:50px; width:10%; background-repeat:no-repeat; background-position:center center;"></div>';
}
?>
<div style="clear:both;"></div>
</div>
</div>
</div>
</div>
</section>