Hello,
i have code a advanced avatar caching system, because i'm boring..
How it works.
You make a php file, avatars.php or something, and it makes the source.
The first time the script is used, there will a folder created ..
and there are all avatars stored.
The first time this avatar being watched, get stored on habbo hotel, to your web server.
The next time you watched avatar, hosts.allow the avatar from the server read it does not use the internet, so equal * rads * from the server ..
i have code a advanced avatar caching system, because i'm boring..
PHP:
<?phpheader('Content-Type: image/png');// Avatar caching system// CODER: Karim, AKA iFuckR
// CONFIGdefine("HOST", "127.0.0.1"); // Gebruiker 127.0.0.1 voor snelheid!define("GEBRUIKER", "root"); // Gebruiker, meestal 'root'define("WACHTWOORD", "123"); // Wachtwoord, moet voor zichzelf sprekendefine("DATABASE", "bcstorm"); // Database naam.$map = './avatars'; // De map waar alles word opgeslagen.define("HOTEL", "habbo.co.uk"); // Het hotel waar de data vandaan moet komen, gebruik geen .com!// Verander niks onder deze lijn! Anders kan het systeem langzaam worden, of verknalt worden enzo.. xd
mysql_connect(HOST, GEBRUIKER, WACHTWOORD) or die ('FATALE FOUT: Onmogelijk om met MySQL server te verbinden!'); mysql_select_db(DATABASE) or die ('FATALE FOUT: Onmogelijk om te verbinden met database!');
if (!is_dir($map)) { if (!mkdir($map, 0, true)) { die('FATALE FOUT: Onmogelijk om folder aan te maken!'); } }
$figure = $_GET['figure'];
if(isset($_GET['size'])){$size = $_GET['size'];} else { $size= 'b';}
if(isset($_GET['direction'])){$direction = $_GET['direction'];} else { $direction = '2';}
if(isset($_GET['head_direction'])){$head = $_GET['head_direction'];} else { $head = '2'; }
if(isset($_GET['gesture'])){$gesture = $_GET['gesture'];} else { $gesture = '';}
$lookhash = md5("$figure$size$direction$head$gesture");
if (file_exists("$map/$lookhash.png")) { $finalavatar = require("$map/$lookhash.png"); } else { $habbo = file_get_contents("http://".HOTEL."/habbo-imaging/avatarimage?figure=".$figure."&size=".$size."&direction=".$direction."&head_direction=".$head."&gesture=".$gesture.""); $fp = fopen("$map/$lookhash.png", 'w'); fwrite($fp, $habbo); fclose($fp); $finalavatar = $habbo;}
/// JAJAJAJAJ! EINDELIJK! DAAR IS DIE DAN, EN VELE MALEN SNELLER :o!echo $finalavatar;
How it works.
You make a php file, avatars.php or something, and it makes the source.
The first time the script is used, there will a folder created ..
and there are all avatars stored.
The first time this avatar being watched, get stored on habbo hotel, to your web server.
The next time you watched avatar, hosts.allow the avatar from the server read it does not use the internet, so equal * rads * from the server ..