2011-06-03, 11:22 PM
So far I have this
Here is the code
I want to make it so that it also shows
Users online: 10 (Or whatever is online)
How do I do this?
Regards Ben
Here is the code
<?php
$connect = mysql_connect("127.0.0.1", "DB USER", "DB PASSWORD") or die();
$selectdb = mysql_select_db("DB NAME", $connect) or die();
$posts = mysql_num_rows(mysql_query("SELECT * FROM `mybb_posts`"));
$threads = mysql_num_rows(mysql_query("SELECT * FROM `mybb_threads`"));
$members = mysql_num_rows(mysql_query("SELECT * FROM `mybb_users`"));
header("Content-type: image/png");
$picture = imagecreate(360, 55);
$black = imagecolorallocate($picture, 0, 0, 0);
imagecolortransparent($picture, $black);
$green = imagecolorallocate($picture, 255, 0, 153);
imagestring($picture, 10, 5, 10, 'SEForums Has '.$posts.' Posts.', $green);
imagestring($picture, 10, 5, 25, 'SEForums Has '.$threads.' Threads.', $green);
imagestring($picture, 10, 5, 40, 'SEForums Has '.$members.' Members.', $green);
imagepng($picture);
imagedestroy($picture);
?>
I want to make it so that it also shows
Users online: 10 (Or whatever is online)
How do I do this?
Regards Ben