Making Userbars -
Luis- - 08.07.2011
Hello, I have been thinking about making userbars for my server which will have all of there information on the image.
Something like this:
No advertising intended.
I just have no idea on how to make them.
~ Thanks, Luis.
Re: Making Userbars -
iGetty - 08.07.2011
Do you mean for your website?
Re: Making Userbars -
Luis- - 08.07.2011
Yeah, so it gets all the players information from the database in to the image.
Re: Making Userbars -
Luis- - 08.07.2011
Could someone help, I could do with some help now.
Re: Making Userbars -
Luis- - 08.07.2011
Anyone?
Re: Making Userbars - [L3th4l] - 08.07.2011
First of all, DON'T bump. Second, you should use ******. (Yes, it has hundreds of tutorials for what you are looking for)
Well, here, you can use my code, if you are using MySQL, then you are a lucker:
PHP код:
$imagepath = "css/images/statspage.jpg";
$image = imagecreatefromjpeg($imagepath);
$imgheight = imagesy($image);
$color = imagecolorallocate($image, 221, 160, 221);
// setlocale(LC_MONETARY, 'en_US'); // If you want to format cash
// Connect to MySQL & DB
$user = mysql_real_escape_string($_GET['changeme']);
$result = mysql_query("SELECT * FROM changeme WHERE changeme = '$changeme'", $connect);
// Y < Lower Higer >
// X ^ Lower Higher V
// Got our row, lets get the values
while($myrow = mysql_fetch_assoc($result))
{
imagestring($image, 5, 126, $imgheight-93, $myrow["user"], $color); // Username
imagestring($image, 3, 90, $imgheight-31, $myrow["kills"], $color); // Kills
imagestring($image, 3, 220, $imgheight-31, $myrow["deaths"], $color); // Deaths
// imagestring($image, 3, 332, $imgheight-31, money_format('%i', $myrow[5]), $color); // Money
imagestring($image, 3, 332, $imgheight-31, $myrow["money"], $color); // Money
imagestring($image, 3, 459, $imgheight-31, $myrow["Level"], $color); // Admin Level
}
header('Content-Type: image/jpeg');
// imagejpeg(Image, FileName, Quality);
imagejpeg($image, NULL, 100);
You will have to play with "imagestring" to get the correct position. ****** it if you need any more help.
Your URL would be something like: [IMG/]http://******.com/image.php?changeme=Luis[IMG]
Here's the example image using that above code:
Good luck.
Re: Making Userbars -
PrawkC - 08.07.2011
Tbh, this is pretty much just php and mysql, not alot is done in PAWN.. Look for tutorials for PHP dynamic signatures.
edit; or that.
Re: Making Userbars -
Luis- - 09.07.2011
Funnily enough, I get these errors & warnings:
Код:
Warning: imagecreatefromjpeg(/ucp/userbars/images/statspage.jpg) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /home/luis/domains/foxxrp.com/public_html/ucp/userbars/img.php on line 16
Warning: imagesy(): supplied argument is not a valid Image resource in /home/luis/domains/foxxrp.com/public_html/ucp/userbars/img.php on line 18
Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/luis/domains/foxxrp.com/public_html/ucp/userbars/img.php on line 20
Warning: Cannot modify header information - headers already sent by (output started at /home/luis/domains/foxxrp.com/public_html/ucp/userbars/img.php:16) in /home/luis/domains/foxxrp.com/public_html/ucp/userbars/img.php on line 44
Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/luis/domains/foxxrp.com/public_html/ucp/userbars/img.php on line 47
Re: Making Userbars -
Luis- - 09.07.2011
All the paths are correct it just gives me those errors.
Re: Making Userbars -
Luis- - 09.07.2011
Can anyone please help me, this has to be fixed soon.