Re: Avatarimage.php script
Quote:
Originally Posted by
joopie
:stupid:
PHP Code:
while($row = mysql_fetch_assoc($result))
To
PHP Code:
$row = mysql_fetch_assoc($result)
/facepalm
I acctly tried that one, didn't work for me >.<
Edit: Parse error: syntax error, unexpected T_ECHO in avatarimage.php on line 20
Re: Avatarimage.php script
Good job guy, but this script does not support the use HTML tags <img>, try the php document be interpreted as an image like mine: http://www.maniahotel.com.br/avatar?...ure=sml&size=b
Re: Avatarimage.php script
Good job guy, but this script does not support the use HTML tags <img>, try the php document be interpreted as an image like mine:
http://www.maniahotel.com.br/avatar?...ure=sml&size=b
Re: Avatarimage.php script
Quote:
Originally Posted by
Akimbo
I acctly tried that one, didn't work for me >.<
Edit: Parse error: syntax error, unexpected T_ECHO in avatarimage.php on line 20
did you ever put an ; after the "$row = ...."???
Re: Avatarimage.php script
If it matter, yes, i did.
Quote:
Originally Posted by
MrCR
Something like this?:
PHP Code:
<?php
header("Content-Type: image/png");
?>
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$db = 'uber';
mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($db);
$action = mysql_real_escape_string( strip_tags( $_GET["action"] ) );
$direction = mysql_real_escape_string( strip_tags( $_GET["direction"] ) );
$head_direction = mysql_real_escape_string( strip_tags( $_GET["head_direction"] ) );
$gesture = mysql_real_escape_string( strip_tags( $_GET["gesture"] ) );
$size = mysql_real_escape_string( strip_tags( $_GET["size"] ) );
$u = mysql_real_escape_string( strip_tags( $_GET["user"] ) );
$userq = mysql_query("SELECT * FROM users WHERE username = '$u' LIMIT 1");
$user = mysql_fetch_array($userq);
$looks = $user['look'];
$image = imagecreatefrompng("stand.png");
$look = imagecreatefrompng("http://habbo.com/habbo-imaging/avatarimage?figure='.$looks.'&action=" . $action . "&direction=" . $direction . "&head_direction=" . $h_direction . "&gesture=" . $gesture . "&size=" . $size . "");
imagecopy($image, $look, 9, 10, 6, 13, 49, 94);
ImagePng ($look);
imagedestroy($look);
// $result = mysql_query($query) or die('Query failed: ' . mysql_error()); //Okay
// if(mysql_num_rows($result)) { //thihi<3
// while($row = mysql_fetch_assoc($result)) { //resultat...
// echo "<img src=\"http://habbo.com/habbo-imaging/avatarimage?figure=".$row['look']."\" alt='".$row['username']."'>";
// }
// }
?>
Re: Avatarimage.php script
It would be nicer if you use'd the look code instead of the username.
something like: this
Re: Avatarimage.php script
Quote:
Originally Posted by
iOmvuZ
It would be nicer if you use'd the look code instead of the username.
something like:
this
The point is like using for fansites and habbo-generator's. Habbo retro fansites can use that for usersystem's and other stuff :) It's really usable for other stuff to.
Example:
If the user change their look, it will be updating auto!
Re: Avatarimage.php script
Quote:
Originally Posted by
Akimbo
The point is like using for fansites and habbo-generator's. Habbo retro fansites can use that for usersystem's and other stuff :) It's really usable for other stuff to.
Example:
If the user change their look, it will be updating auto!
Never thought about that! OT: Thanks for the release.
Re: Avatarimage.php script
Quote:
Originally Posted by
Akimbo
If it matter, yes, i did.
Something like this?:
PHP Code:
<?php
header("Content-Type: image/png");
?>
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$db = 'uber';
mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($db);
$action = mysql_real_escape_string( strip_tags( $_GET["action"] ) );
$direction = mysql_real_escape_string( strip_tags( $_GET["direction"] ) );
$head_direction = mysql_real_escape_string( strip_tags( $_GET["head_direction"] ) );
$gesture = mysql_real_escape_string( strip_tags( $_GET["gesture"] ) );
$size = mysql_real_escape_string( strip_tags( $_GET["size"] ) );
$u = mysql_real_escape_string( strip_tags( $_GET["user"] ) );
$userq = mysql_query("SELECT * FROM users WHERE username = '$u' LIMIT 1");
$user = mysql_fetch_array($userq);
$looks = $user['look'];
$image = imagecreatefrompng("stand.png");
$look = imagecreatefrompng("http://habbo.com/habbo-imaging/avatarimage?figure='.$looks.'&action=" . $action . "&direction=" . $direction . "&head_direction=" . $h_direction . "&gesture=" . $gesture . "&size=" . $size . "");
imagecopy($image, $look, 9, 10, 6, 13, 49, 94);
ImagePng ($look);
imagedestroy($look);
// $result = mysql_query($query) or die('Query failed: ' . mysql_error()); //Okay
// if(mysql_num_rows($result)) { //thihi<3
// while($row = mysql_fetch_assoc($result)) { //resultat...
// echo "<img src=\"http://habbo.com/habbo-imaging/avatarimage?figure=".$row['look']."\" alt='".$row['username']."'>";
// }
// }
?>
Exactly, just make sure that the image is not when used with white background in HTML.
Man, good job, I think you and I were the only ones thinking about avatarimage for fansite use!
Re: Avatarimage.php script
Here's mine. Works with username or if you just want a look!
Code:
<?php
if(isset($_GET['user'])) {
$host = "host";
$username = "root";
$password = "pass";
$dbname = "db";
$connect = mysql_connect($host, $username, $password) or die(mysql_error());
mysql_select_db($dbname, $connect) or die("Could not connect to database, error: ".mysql_error());
$user = mysql_real_escape_string($_GET['user']);
$figure = "figure=".mysql_result(mysql_query("SELECT look FROM users WHERE username='".$user."' LIMIT 1"),0);
header('Content-Type: image/png');
exit(file_get_contents('http://habbo.com/habbo-imaging/avatarimage?'.$figure.http_build_query($_GET)));
}
else {
$url = 'http://habbo.com/habbo-imaging/avatarimage?figure='.http_build_query($_GET);
header('Content-Type: image/png');
exit(file_get_contents($url));
}
?>
http://habbo.ac/imager.php?user=Daniel
Re: Avatarimage.php script
Quote:
Originally Posted by
MrCR
Exactly, just make sure that the image is not when used with white background in HTML.
Man, good job, I think you and I were the only ones thinking about avatarimage for fansite use!
That was bad ;( I fixed a new one! Yeh, fansites are good to have, and it's cool to use for Habbo Imagers, Battle ball generators etc.. :)
Quote:
Originally Posted by
iRaged
Here's mine. Works with username or if you just want a look!
Code:
<?php
if(isset($_GET['user'])) {
$host = "host";
$username = "root";
$password = "pass";
$dbname = "db";
$connect = mysql_connect($host, $username, $password) or die(mysql_error());
mysql_select_db($dbname, $connect) or die("Could not connect to database, error: ".mysql_error());
$user = mysql_real_escape_string($_GET['user']);
$figure = "figure=".mysql_result(mysql_query("SELECT look FROM users WHERE username='".$user."' LIMIT 1"),0);
header('Content-Type: image/png');
exit(file_get_contents('http://habbo.com/habbo-imaging/avatarimage?'.$figure.http_build_query($_GET)));
}
else {
$url = 'http://habbo.com/habbo-imaging/avatarimage?figure='.http_build_query($_GET);
header('Content-Type: image/png');
exit(file_get_contents($url));
}
?>
http://habbo.ac/imager.php?user=Daniel
Thay was good bro :)