Welcome Guest ( Log In | Register)



9 Pages V  < 1 2 3 4 5 > »   
Reply to this topicStart new topic
> How To Make A Sig Rotator, for people with multiple sigs
Rating 1 V
Saint_Michael
post Jul 25 2005, 09:57 PM
Post #21


$p4m 0n j00 $h4m3 m3 0nc3 $p4m 0n m3 $h4m3 m3 7\/\/1c3
*********************

Group: [HOSTED]
Posts: 6,561
Joined: 21-September 04
From: 9r33|\| 399$ 4|\|D 5P4/\/\
Member No.: 1,218
T17 GFX Crew



oooh i get it know duh i was looking at it like a moron, going to try it out right now.

just tried it but it did not work and i know why i have png and gif files in here as well so how would i could the format .jpg/.gif/.png in tho the coding?

and it didn't pick up any of my jpg files either when i did it.
Go to the top of the page
 
+Quote Post
sachavdk
post Jul 26 2005, 12:34 AM
Post #22


Member [Level 1]
****

Group: Members
Posts: 62
Joined: 11-July 05
Member No.: 9,266



1st: Your png/gif problem could be solved using file_exists and check the extensions you use

IE:
CODE

$file = "http://www.saint-michael.trap17.com/images/sig1-".(rand(0,52)+2);
If (file_exists($file . ".png"))
{
readfile($file . ".png");
} elseif (file_exists($file . ".gif"))
{
readfile($file . ".gif");
} else {
echo "file does not exists";
}


2nd: I tested my previous code and it did work.

3rd: I'm sorry but I didn't really understand what you mean with your first line
QUOTE
oooh i get it know duh i was looking at it like a moron, going to try it out right now.
You mean I insulted you giving such and detailed explanation of the code?
If so I'm sorry cause it was not my intend. I just couldn't find a better way to explain php is trying to read the string with the random number as the imagepath since I thought you were saying that was the part that wouldn't work.
Go to the top of the page
 
+Quote Post
Saint_Michael
post Jul 26 2005, 04:35 AM
Post #23


$p4m 0n j00 $h4m3 m3 0nc3 $p4m 0n m3 $h4m3 m3 7\/\/1c3
*********************

Group: [HOSTED]
Posts: 6,561
Joined: 21-September 04
From: 9r33|\| 399$ 4|\|D 5P4/\/\
Member No.: 1,218
T17 GFX Crew



no it wasn't that i couldn't figure out why it would work until i looked at this ".rand(0,54)+2" closer, in the fact that the number reteive in this code was the ending number to it. hmm i will try it out again so if i get the results that im looking for.
Go to the top of the page
 
+Quote Post
Saint_Michael
post Jul 26 2005, 05:34 AM
Post #24


$p4m 0n j00 $h4m3 m3 0nc3 $p4m 0n m3 $h4m3 m3 7\/\/1c3
*********************

Group: [HOSTED]
Posts: 6,561
Joined: 21-September 04
From: 9r33|\| 399$ 4|\|D 5P4/\/\
Member No.: 1,218
T17 GFX Crew



i got it to work but what should be my pngs are showing up like this, because i don't have jpg files due to the pop-out sigs that i have, i
QUOTE
<br />
<b>Warning</b>:  readfile(http://www.saint-michael.trap17.com/images/sig1-19.jpg): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in <b>/home/saint/public_html/sig.png/index.php</b> on line <b>8</b><br />
file does not exists


this is code im using
QUOTE
<?php
Header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
Header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
Header("Pragma: no-cache");
Header("Content-Type: image/gif");

srand((double)microtime()*1000000);
readfile("http://www.saint-michael.trap17.com/images/sig1-".(rand(0,52)+2).".jpg");
If (file_exists($file . ".png"))
{
readfile($file . ".png");
} elseif (file_exists($file . ".gif"))
{
readfile($file . ".gif");
} else {
echo "file does not exists";
}
?>


if i take out the jpg portion out of the code then the script doesn't work at all but if i keep it in it does work, except that the png files and the gif do not work at all.

here is the link to the file http://www.saint-michael.trap17.com/sig.png/index.php when you refresh eventually you get that error up top, so what do i have to fix to get this working correctly?
Go to the top of the page
 
+Quote Post
sachavdk
post Jul 26 2005, 01:05 PM
Post #25


Member [Level 1]
****

Group: Members
Posts: 62
Joined: 11-July 05
Member No.: 9,266



Euhm, visited your site but it seemed to work. Sometimes I had a warning the file did not exists but then it refreshed and showed an image.
Go to the top of the page
 
+Quote Post
snlildude87
post Jul 26 2005, 04:52 PM
Post #26


Moderator
***************

Group: Members
Posts: 2,325
Joined: 8-March 05
From: Mawson, Antarctica
Member No.: 4,254



Michael, try this code:
CODE

<?php
Header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
Header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
Header("Pragma: no-cache");
Header("Content-Type: image/gif");

srand((double)microtime()*1000000);
$file = "http://www.saint-michael.trap17.com/images/sig1-" . (rand(0,52)+2);
if(file_exists($file . ".png"))
{
 readfile($file . ".png");
}
else if(file_exists($file . ".gif"))
{
 readfile($file . ".gif");
}
else if(file_exists($file . ".jpg"))
{
 readfile($file . ".jpg");
}
?>


Tell me if it works. It should, but I may have made some dumb error. smile.gif
Go to the top of the page
 
+Quote Post
badinfluence
post Jul 26 2005, 08:34 PM
Post #27


Super Member
*********

Group: Members
Posts: 283
Joined: 10-October 04
Member No.: 1,637



hey snlil,

one more idea, can you add rating system to this code, pls! under those random sig images, showing something like "Rating : 5 Star by 3 vote"
ummm likka those Coppermine or photo gallery does.. smile.gif
Go to the top of the page
 
+Quote Post
sachavdk
post Jul 26 2005, 10:10 PM
Post #28


Member [Level 1]
****

Group: Members
Posts: 62
Joined: 11-July 05
Member No.: 9,266



If you want to add a poll for each image you have to work with mysql as well and I don't think it is possible for a sig, cause you can't use php, not even html.
Go to the top of the page
 
+Quote Post
snlildude87
post Jul 27 2005, 01:53 AM
Post #29