<?php
// Original code credit to Edward on *****
// Caching addition by Ixel (http://retro-source.info)
// Do not remove these credits
if (file_exists("./cache_banner.png"))
{
$yesterday = strtotime('-1 minutes');
$i = filemtime("./cache_banner.png");
if ($i < $yesterday)
{
@unlink("./cache_banner.png");
}
else
{
header("Content-type: image/png");
$img = imagecreatefrompng("./cache_banner.png");
imagepng($img);
imagedestroy($img);
die();
}
}
// End of caching check
$dbhost = 'localhost';
$dbuser = 'Username';
$dbpass = 'Password';
$dbname = 'Database';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
mysql_select_db($dbname);
$result = mysql_query("SELECT * FROM server_status");
$row = mysql_fetch_array( $result );
$text = "Habbos Online";
$image = imagecreatefrompng('images/02.png');
$black = imagecolorallocate($image, 0, 0, 0);
imagefttext($image, 8, 0, 182, 80, $black, './verdanab.ttf', $row['users_online']);
// imagefttext($image, 8, 0, 182, 75, $black, './verdana.ttf', $text); // Remove the // ahead of this line to use it
header('Content-type: image/png');
imagepng($image);
imagepng($image, "./cache_banner.png");
imagedestroy($image);
?>
I've recently got into making retro banners and I was just wondering if anyone could help me with adding how many users the hotel has online to the banner.
I would appreciate any help.
Here, at a pack of mine, Re-Did the code so hopefully it should work with almost any database & hotel I Did this on RevCMS so definitely works on there.You must be registered for see linksHappy to help, Information is all in there.
Thanks but I have no idea where I put the code. I'm using Paint.NET software.
The hotel owner does, you don't.
Glen?