Jump to content
xisto Community
snlildude87

How To Make A Sig Rotator for people with multiple sigs

Recommended Posts

i don't think so, but i am not 100% sure.

Notice from BuffaloHELP:
You must explain or specify your idea when contributing. This is considered a spam and this is your only notice. Next will earn you adjustment in warning level.
Edited by BuffaloHELP (see edit history)

Share this post


Link to post
Share on other sites

It looks really impressive. I'll give a try very soon. But can't the code be made a little shorter. Does it have to be this long? ;) Will not there be any ways to shortern the code? :)I'll give a try and inform you soon. Thanks for sharing this cool sig.

Share this post


Link to post
Share on other sites

well if thier is another way to shorten up the coding to retrieve the images then that would be good, but i think its going to be pretty big, if you look what i did i have over 50+ images, but the best parts its not really taking that much space in the long run since all your doing is adding 2 lines of coding.

Share this post


Link to post
Share on other sites

I kinda didn't use an array....

164696[/snapback]


It looks really impressive. I'll give a try very soon. But can't the code be made a little shorter. Does it have to be this long? :) Will not there be any ways to shortern the code? :D

165397[/snapback]


i mean as we can see in Saint Miky, there are 50 plus repeated code line for each sig. so if we can replace with array(function/class) then the code gonna be shortened, i suppose and it will be perfect! ;)

Share this post


Link to post
Share on other sites

but your missing something in the coding, yeah you set up the process for the image to be shown but how would you retrieve it. out of this line of the code ".rand(0,54)+2"

165364[/snapback]


 


no I'm not :)

readfile() reads the file from which the path is given in a string.

Since you want a random image you add the random number to the string.

 

You (Saint_Michael) have 52 images if I'm not mistaken starting from number 2 until 54. So a random number is taken between 0 and 52 (I've been mistaken)



rand(0,54)+2//should berand(0,52)+2//in your case

Then the random number is between 2 and 54 since you added 2 and that value is added to the string of the filepath.

Only when the string's complete, the file will be read.

But maybe this one's better:



readfile("www.saint-michael.trap17.com/images/sig1");

An example of the string after the number is generated could be

"http://forums.xisto.com/no_longer_exists/404.png"

which I think is one of your images and it should been read properly.



Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

IE:

$file = "http://forums.xisto.com/no_longer_exists/ (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

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

<br /><b>Warning</b>:  readfile(http://forums.xisto.com/no_longer_exists/): 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

<?phpHeader("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://forums.xisto.com/no_longer_exists/-;.(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://forums.xisto.com/no_longer_exists/ when you refresh eventually you get that error up top, so what do i have to fix to get this working correctly?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Michael, try this 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://forums.xisto.com/no_longer_exists/; . (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. :D

Share this post


Link to post
Share on other sites

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.. :D

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.. :D

166091[/snapback]

Umm, I can make a rating system, but I can only do it on my site. If I'm displaying a sig on my site, then it's possible, but it's not possible Invision Power Board....

 

I hoped that made sense....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.