Old 25th October 2004, 21:42   #1
Torq
Junior Member
 
Join Date: Mar 2004
Posts: 35
Problem With Signature

Hello people,

I've been trying to set-up a signature to use both on my site and e-mails, posts etc. displaying song playing / online / offline etc.

I've check-out both the FAQ and 'Ruff Dawg's' guide but can't figure out this error I keep getting when trying to access the .php file :-


<br>
<b>Warning</b>: imagecreatefrompng: Unable to open 'cgi/sigpic.png' for reading in <b>/www/cgi/sig.php</b> on line <b>19</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/www/cgi/sig.php</b> on line <b>30</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/www/cgi/sig.php</b> on line <b>97</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/www/cgi/sig.php</b> on line <b>98</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/www/cgi/sig.php</b> on line <b>99</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/www/cgi/sig.php</b> on line <b>100</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/www/cgi/sig.php</b> on line <b>102</b><br>
<br>
<b>Warning</b>: Supplied argument is not a valid Image resource in <b>/www/cgi/sig.php</b> on line <b>103</b><br>


The file is definitely a .png picture file. I also definitely have both PHP and GD library on my host.

Does anybody have any ideas on this one ?? Help muchly appreciated as usual ...

Thanks in advance.

Torq
Torq is offline   Reply With Quote
Old 26th October 2004, 01:34   #2
protegechris
Forum Queen
 
protegechris's Avatar
 
Join Date: Feb 2004
Location: Texarkana, Texas/Arkansas
Posts: 6,635
Send a message via AIM to protegechris Send a message via Yahoo to protegechris
You need to have the image in the SAME folder as the signature code.

yeah, i'm back.
protegechris is offline   Reply With Quote
Old 26th October 2004, 17:58   #3
Torq
Junior Member
 
Join Date: Mar 2004
Posts: 35
Thanks for the reply protegechris.

Yup, done that already. The .php file has to be placed in the /cgi/ folder on my site to be able to run. The .png picture file is in there too. Still the same problem ...
Torq is offline   Reply With Quote
Old 26th October 2004, 19:46   #4
protegechris
Forum Queen
 
protegechris's Avatar
 
Join Date: Feb 2004
Location: Texarkana, Texas/Arkansas
Posts: 6,635
Send a message via AIM to protegechris Send a message via Yahoo to protegechris
Well take out this part:
'cgi/'sigpic

Just remove the "cgi/" from it and it should work,.

yeah, i'm back.
protegechris is offline   Reply With Quote
Old 26th October 2004, 22:31   #5
Torq
Junior Member
 
Join Date: Mar 2004
Posts: 35
Thanks again protegechris. I'm getting there slowly but surely !!

I've changed the path for .png file and at least it shows the background pic now, although it is saying I'm offline when I'm not.

I am using the IP address of my host in the $host string (this is 'xxx.xx.xxx.xxx') - I've filled this is as numerical IP addy as I don't have a steaming URL (ie. 'mystation.myhost.com').

Any ideas ???

Many thanks again !!
Torq is offline   Reply With Quote
Old 26th October 2004, 23:47   #6
arielb
Member
 
Join Date: Aug 2004
Posts: 89
not sure but could be that ur php server does not support gd library???
arielb is offline   Reply With Quote
Old 27th October 2004, 00:04   #7
Torq
Junior Member
 
Join Date: Mar 2004
Posts: 35
Thanks for the reply areilb.

I've already checked with my server and they have said they do support GD library ...

So, still stuck on this one ... !!
Torq is offline   Reply With Quote
Old 27th October 2004, 01:38   #8
101
Major Dude
 
101's Avatar
 
Join Date: Jul 2004
Location: Argentina
Posts: 828
Send a message via ICQ to 101
If you are sure that your server info is correct in the script [IP without 'http://' for example], make sure that your host has not disabled the fsockopen() function. You can see the disabled functions with phpinfo()
code:

<?php echo phpinfo(); ?>


Run the script on your host and look in the entry 'disable_functions' under "PHP Core"

Words are very unnecessary, they can only do harm, so enjoy the silence - Depeche Mode
Firemonger Project: Help spread Firefox
101 is offline   Reply With Quote
Old 30th October 2004, 23:31   #9
Torq
Junior Member
 
Join Date: Mar 2004
Posts: 35
Thanks for the reply 101.

I've checked with my webhost and they have advised that the 'fsockopen()' function HASN'T been disabled ...

Back to square one on this ... Any ideas as this is very frustrating !!

Thanks again.

Torq
Torq is offline   Reply With Quote
Old 31st October 2004, 04:45   #10
101
Major Dude
 
101's Avatar
 
Join Date: Jul 2004
Location: Argentina
Posts: 828
Send a message via ICQ to 101
Make it simple: get a free account on www.***********.com that script works there for sure. Btw, are you using a pay streaming host or you have the DNAS on your computer?

Words are very unnecessary, they can only do harm, so enjoy the silence - Depeche Mode
Firemonger Project: Help spread Firefox
101 is offline   Reply With Quote
Old 31st October 2004, 11:51   #11
Torq
Junior Member
 
Join Date: Mar 2004
Posts: 35
Thanks again for the reply 101 ...

I'm paying for a streaming host and paying for my webhost. I'm not exactly sure how relevant it is but my streaming IP address isn't a 'mystation.myhost.com' but a series of numbers ... this is what I have used in my php script ie. no '.com'

Anyway, I'll get back to my webhost one last time about this - but thanks for the tip regarding '***********.com' - appreciate it !!

Torq
Torq is offline   Reply With Quote
Old 31st October 2004, 22:12   #12
Torq
Junior Member
 
Join Date: Mar 2004
Posts: 35
Here's my code, anything obviously wrong ??

Thanks !!

Torq



<?php
// Ruff Dawg's 'Now Playing Sig w/ Background v. 1.5 May 7, 2004
// Special thanks to the originator, DJ Rampage

// This image you can call immediately from an html file in the image tag
// (i.e. <img src="black.php">) easy huh?

Header("Content-type: image/png");

/////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////*Configurables*//////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////

/////////////////////*Background Picture File*////////////////////////

/* Replace "/sicpic.png" with your own
picture file (must be a .png) */

$im = imagecreatefrompng("sigpic.png");

/////////////////////////////*Host Information*/////////////////////////////

$host = "207.44.249.228"; // No 'http://' in the host
$port = "8005";

//////////////////////////////////*Text Colors*////////////////////////////////

// text colors are in RGB

$text_color1 = ImageColorAllocate($im,0,153,255);

////////////////////////////////////*Text Size*/////////////////////////////////

$text_size = "3";

//////////////////////////////*Text Alignment*/////////////////////////////

//X alignment

$x1 = "78";
$x2 = "78";

//Y alignment

$y1 = "24";
$y2 = "44";

///////////////////////////*Offline Message*///////////////////////////////

$offline1 = "We Are Currently Offline";
$offline2 = "Please Check Again Later";


//////////////////////////////////////////////////////////////////////////////////////////////////
/////*DON'T TOUCH THE CODE BELOW UNLESS//////////
///YOU KNOW EXACTALLY WHAT YOU ARE DOING*//
///////////////////////////////////////////////////////////////////////////////////////////////

$fp = fsockopen("$host", $port, &$errno, &$errstr, 30);
if(!$fp) {
$success=2;
}
if($success!=2){ //if connection
fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
while(!feof($fp)) {
$page .= fgets($fp, 1000);
}
fclose($fp);
$page = ereg_replace(".*<body>", "", $page); //extract data
$page = ereg_replace("</body>.*", ",", $page); //extract data
$numbers = explode(",",$page);
$currentlisteners=$numbers[0];
$connected=$numbers[1];
if($connected==1)
$wordconnected="yes";
else
$wordconnected="no";
$peaklisteners=$numbers[2];
$maxlisteners=$numbers[3];
$reportedlisteners=$numbers[4];
}

if($success!=2 && $connected==1){

$song=explode(" - ",$numbers[6]);

$string1= $song[0];
$string2= $song[1];

}

else {
$string1= $offline1;
$string2= $offline2;
}

$px = (imagesx($im)-5*strlen($string1))/2;
ImageString($im,$text_size,$x1,$y1,$string1,$text_color1);
$px = (imagesx($im)-5*strlen($string2))/2;
ImageString($im,$text_size,$x2,$y2,$string2,$text_color1);

ImagePng($im);
imagedestroy($im);
?>
Torq is offline   Reply With Quote
Old 1st November 2004, 00:18   #13
101
Major Dude
 
101's Avatar
 
Join Date: Jul 2004
Location: Argentina
Posts: 828
Send a message via ICQ to 101
Nothing wrong, in fact I tested with your DNAS and works just fine. Again, it must be a prob with your web host. If they say that fsockopen() is enabled, ask them if they have something that would prevent a socket connection to a remote host on port 8005.

Words are very unnecessary, they can only do harm, so enjoy the silence - Depeche Mode
Firemonger Project: Help spread Firefox
101 is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > SHOUTcast > SHOUTcast Technical Support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump