Re: Avatarimage.php script
SELECT look FROM users WHERE username = '$u' LIMIT 1 *
Re: Avatarimage.php script
Quote:
Originally Posted by
Mathis Hbx
SELECT look FROM users WHERE username = '$u' LIMIT 1 *
Yeah, it's so simple, why would you make this? :l It's already coded into CMSs.
Re: Avatarimage.php script
Re: Avatarimage.php script
Quote:
Originally Posted by
FullmetalPride
Yeah, it's so simple, why would you make this? :l It's already coded into CMSs.
I made this bcus it's useful for retro fansites and stuff. Then they can use the script to make habbo imagers and stuff :)
Re: Avatarimage.php script
Why a while loop for a single result?
Re: Avatarimage.php script
Instead of echoing a html tag you should do file_get_contents from the source and out headers image/png
This is mine:
PHP Code:
<?php header('Content-Type: image/png'); define('IGNORE_EXECUTEMSG', true);
if(isset($_GET['user']) && $users->name_taken(c_filter($_GET['user']))) { $_GET['figure'] = result("SELECT look FROM users WHERE username = '" . c_filter($_GET['user']) . "'"); } else if(!isset($_GET['figure'])) $_GET['figure'] = 'default'; unset($_GET['user']);
$file = 'storage/avatars/' . http_build_build($_GET) . '.png'; if (!file_exists($file)) { $data = $core->get_url('http://www.habbo.nl/habbo-imaging/avatarimage?'.http_build_build($_GET)); file_put_contents($file, $data); }
die((isset($data))?$data:file_get_contents($file));?>
Re: Avatarimage.php script
Quote:
Originally Posted by
joopie
Why a while loop for a single result?
like, i dindn't check the codes or anything like that, i just made this quick and easy
OF: 1,999 posts :D
Re: Avatarimage.php script
Quote:
Originally Posted by
Akimbo
dafaq?
he means you should use mysql_result instead of a loop (while)
Re: Avatarimage.php script
Quote:
Originally Posted by
Akimbo
like, i dindn't check the codes or anything like that, i just made this quick and easy
OF: 1,999 posts :D
2000*
But, you code something and you know it should return one result? :P "LIMIT 1" in query
Re: Avatarimage.php script
This is not an avatar image generator. This just copies the exact same avatar from Habbo...
Re: Avatarimage.php script
Quote:
Originally Posted by
Funixeh
This is not an avatar image generator. This just copies the exact same avatar from Habbo...
It's a script for fansites really. And useful for other stuff to.. Never said it was a generator little boy.
Re: Avatarimage.php script
I have one that caches the avatars
Re: Avatarimage.php script
Quote:
Originally Posted by
JohnHearfield
I have one that caches the avatars
What's the poitn with that? Yeh, it does take more space! That must be the point.
The point with this is for fansites really. It's simple and easy. Still pretty secure.
Re: Avatarimage.php script
Quote:
Originally Posted by
Akimbo
What's the poitn with that? Yeh, it does take more space! That must be the point.
The point with this is for fansites really. It's simple and easy. Still pretty secure.
Not sure if ignorant or just real stupid... No point in caching? My CMS must suck now...
Re: Avatarimage.php script
Quote:
Originally Posted by
Akimbo
What's the poitn with that? Yeh, it does take more space! That must be the point.
The point with this is for fansites really. It's simple and easy. Still pretty secure.
It does save speed, though, but in light, it doesn't seem efficient if the person has changed their avatar. Caching is worth it.
Re: Avatarimage.php script
Quote:
Originally Posted by
Near
Not sure if ignorant or just real stupid... No point in caching? My CMS must suck now...
You are right Sir, I am stupid.
Re: Avatarimage.php script
It might take up space, but i have a fairly small hotel, so not that much avatar's are cached in the long run.
Re: Avatarimage.php script
PHP Code:
foreach ($_GET as $key => $value)
{
$_GET[$key] = mysql_real_escape_string($value);
}
Re: Avatarimage.php script
Haha, nice script. Thankz nigga!
Re: Avatarimage.php script
Quote:
Originally Posted by
Nathandj
PHP Code:
foreach ($_GET as $key => $value)
{
$_GET[$key] = mysql_real_escape_string($value);
}
http_build_query does not require an loop.
plus its only a function (less code)
PHP Code:
http_build_query($_GET)
Re: Avatarimage.php script
Quote:
Originally Posted by
joopie
2000*
But, you code something and you know it should return one result? :P "LIMIT 1" in query
Try and remove the while loop and see what's happening
Re: Avatarimage.php script
Quote:
Originally Posted by
Akimbo
Try and remove the while loop and see what's happening
Not remove it, replace it with a mysql_result /facepalm
Re: Avatarimage.php script
Quote:
Originally Posted by
Akimbo
Try and remove the while loop and see what's happening
:stupid:
PHP Code:
while($row = mysql_fetch_assoc($result))
To
PHP Code:
$row = mysql_fetch_assoc($result)
/facepalm
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
Maybe it does not effect the performance but as the only thing he really gets from the database is the look. Wouldent it then be better with a mysql_result?
Like this:
PHP Code:
$look = mysql_result(mysql_query("SELECT look FROM users WHERE username = '" . $u . "'"), 0);