Help with the Catcher please...
Help with the Catcher please...
I'm really stuck with this, and would like someone to help me, as this is quite important to me. Thanks.
First of, take a look at the logo on my site: http://needleboy.mine.nu
As you can see, I'm also using the whatplaying.php on the logo to create the song's title and curent listeners on the PNG image of the logo.
What I would like to know is how can I add to this info the server status, and bitrate?
I've checked the includes.php file, and it has the info there:
How do I create the output to the image from the whatplaying.php file?
Right now it looks like this:
How can I use the ImageString command to display the $server output?
I tried:
and:
but they're not working.
Can anyone help me?
First of, take a look at the logo on my site: http://needleboy.mine.nu
As you can see, I'm also using the whatplaying.php on the logo to create the song's title and curent listeners on the PNG image of the logo.
What I would like to know is how can I add to this info the server status, and bitrate?
I've checked the includes.php file, and it has the info there:
Code: Select all
$server[0]['bitrate']='32';
$server[0]['status']='Online';
Right now it looks like this:
Code: Select all
<?php
include("includes.php");
header("Content-Type: image/png");
$im = imagecreatefrompng("logo.png");
if ($im)
{
ImageString($im, 2, 31, 10, "::Listeners: $listeners/$max_listeners::", 50);
ImageString($im, 2, 31, 100, "::Now Playing: $current_song::", 50);
ImagePNG($im);
}
?>
I tried:
Code: Select all
ImageString($im, 2, 31, 10, "Status: $server[0]['status']", 50);
Code: Select all
ImageString($im, 2, 31, 10, "Status: $status", 50);
Can anyone help me?
- Jay
- Will work for food (Administrator)
- Posts: 3029
- Joined: Mon Jan 14, 2002 12:48 am
- Location: Next Door
- Contact:
that should work the only thing wrong is that you are placing the image right on top of another imagestring, the imagestring function works just like any other image editor's txt tool so you may want to place it somewhere else on the image. Check out http://us4.php.net/manual/en/function.imagestring.php for more information on the Image string function and how to use it.
- Jay
That's what I did now
I put the following:
It returned the following on the picture:
::Status: Array['status'] ::
That's what happened at the beggining as well...
Can you figure it out?
Code: Select all
ImageString($im, 2, 300, 10, "::Status: $server[0]['status'] ::", 50);
::Status: Array['status'] ::
That's what happened at the beggining as well...
Can you figure it out?
- Jay
- Will work for food (Administrator)
- Posts: 3029
- Joined: Mon Jan 14, 2002 12:48 am
- Location: Next Door
- Contact:
try this
Code: Select all
ImageString($im, 2, 300, 10, "::Status: ".$server[0]['status']." ::", 50);
- Jay
Whoa dude :)
Thanks man!
Just shows how much I know about PHP
Tomorrow I'll steal a PHP book from the bookstore I work in...
What do you think of my site?
Thanks again!
NeedleBoy.
Just shows how much I know about PHP

Tomorrow I'll steal a PHP book from the bookstore I work in...
What do you think of my site?
Thanks again!
NeedleBoy.
Alternatively, you could also do:
Notice the {Curly-Brackets} around the multi-dimensional array? 
Code: Select all
ImageString($im, 2, 300, 10, "::Status: {$server[0]['status']} ::", 50);
