Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Dynamic Users Online banner

Status
Not open for further replies.
Newbie Spellweaver
Joined
Jan 6, 2012
Messages
5
Reaction score
2
This tutorial requires allitle bit of knowlege of php you may be able to do it if you dont know any. Its a tutorial on how to create a signature or a topsites banner that displays current up-to the minute information about your website. To use it follow the directions below and just visit and itll show!

Materials-

1. Just download this file which has all needed files.

Directions-

1. Open the Online.php
2. Edit the database variables.
3. Open Banner.png
4. Edit it how you want.
5. Upload Online.php and arial.ttf to your root directory, and banner.png to your /images/ directory.

To Edit Placements-

1. Open Online.php
2. Find the variable you want to edit. (for this ill use "imagefttext($image, 8, 0, 398, 45, $font_color, './arial.ttf', $online);")
3. In imagefttext($image, 8, 0, 398, 45, $font_color, './arial.ttf', $online); edit the bold part. (398 is the X-Axis (across), and 45 is the Y-Axis (up and down))

Example-

NoEffex - Dynamic Users Online banner - RaGEZONE Forums
 
Junior Spellweaver
Joined
Jan 1, 2012
Messages
150
Reaction score
16
Nice to see, bit big source maybe Ill try shorten it a bit?

Thank you
 
Junior Spellweaver
Joined
Jan 1, 2012
Messages
150
Reaction score
16
Code:
<?php 

$onlineurl = file_get_contents('ONLINE LINK HERE'); // T.EX blablabla.com/online.php? lol$result = mysql_query("SELECT * FROM server_status");
$online = "Users Online!";

$row = mysql_fetch_array( $result ); 
$image = imagecreatefrompng('images/banner.png'); 
$font_color = imagecolorallocate($image, 255, 0, 0); 
imagefttext($image, 20, 0, 417, 30, $font_color, './arial.ttf', $row['users_online']); 
imagefttext($image, 8, 0, 398, 45, $font_color, './arial.ttf', $online); 
imagefttext($image, 20, 0, 394, 77, $font_color, './arial.ttf', $num_rows); 
header('Content-type: image/png'); 
imagepng($image); 
imagedestroy($image); 
?>

That should do =)
 
The one and only!
Loyal Member
Joined
Nov 24, 2008
Messages
2,529
Reaction score
1,435
Line13: $num_rows = mysql_num_rows($usersreg)+ 5000;

You should not encourage people to lie about statistics, it is bad for everyone.

&This: http://forum.ragezone.com/f353/dynamic-php-banner-744171/

PHP:
<?php

header('Content-type: image/png');
$onlineurl = file_get_contents('http://www.blazehotel.info/online.cfm'); // Users online file poop? lol

$font = 'Espar_Arial_Classic.ttf'; //Use your own
$handle = imagecreatefrompng('banner.png'); // Background Image
$bg_color = imagecolorallocate ($handle, 135, 206, 250);
$txt_color = imagecolorallocate ($handle, 239, 244, 241);
imagettftext($handle, 12, 0, 130, 16, $txt_color, $font, "$onlineurl Users Online!");
imagepng ($handle);
imagedestroy($handle);

?>
 
"(still lacks brains)"
Loyal Member
Joined
Sep 2, 2011
Messages
2,371
Reaction score
1,361
Line13: $num_rows = mysql_num_rows($usersreg)+ 5000;

You should not encourage people to lie about statistics, it is bad for everyone.

&This: http://forum.ragezone.com/f353/dynamic-php-banner-744171/

PHP:
<?php

header('Content-type: image/png');
$onlineurl = file_get_contents('http://www.blazehotel.info/online.cfm'); // Users online file poop? lol

$font = 'Espar_Arial_Classic.ttf'; //Use your own
$handle = imagecreatefrompng('banner.png'); // Background Image
$bg_color = imagecolorallocate ($handle, 135, 206, 250);
$txt_color = imagecolorallocate ($handle, 239, 244, 241);
imagettftext($handle, 12, 0, 130, 16, $txt_color, $font, "$onlineurl Users Online!");
imagepng ($handle);
imagedestroy($handle);

?>

Habplus lie about there stats.
 
Status
Not open for further replies.
Back
Top