Making Userbars
#1

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.
Reply
#2

Do you mean for your website?
Reply
#3

Yeah, so it gets all the players information from the database in to the image.
Reply
#4

Could someone help, I could do with some help now.
Reply
#5

Anyone?
Reply
#6

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($image221160221);
// 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($image5126$imgheight-93$myrow["user"], $color); // Username
    
imagestring($image390,  $imgheight-31$myrow["kills"], $color); // Kills
    
imagestring($image3220$imgheight-31$myrow["deaths"], $color); // Deaths
    // imagestring($image, 3, 332, $imgheight-31, money_format('%i', $myrow[5]), $color); // Money
    
imagestring($image3332$imgheight-31$myrow["money"], $color); // Money
    
imagestring($image3459$imgheight-31$myrow["Level"], $color); // Admin Level
}
header('Content-Type: image/jpeg');
// imagejpeg(Image, FileName, Quality);
imagejpeg($imageNULL100); 
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.
Reply
#7

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.
Reply
#8

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
Reply
#9

All the paths are correct it just gives me those errors.
Reply
#10

Can anyone please help me, this has to be fixed soon.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)