Jump to content
xisto Community
Sign in to follow this  
Saint_Michael

Another Sig Rotation even better then snlils :P XP

Recommended Posts

i was looking sround game renders for filter stuff when i happen to find this script, this script basically reads the files in your folder. without you the user to provide links into the script.

step 1: create a index.php file with in your images folder. and then paste this code into it, then save now open the index file in your browser and you should see an image. if not pm or pst here and i will help you out.
 



<?php

if ($dir = opendir("."))
{
$list = buildimagearray($dir);
displayrandomimage($list);
}

// This function reads all the files in the current directory and adds all image files to the array $list[]
function buildimagearray($dir)
{
while (false !== ($file = readdir($dir)))
{
if (!is_dir($file) && getimagesize($file))
{
$list[] = $file;
}
}
return $list;
}

// This function selects a random image, determines the mime type, opens the file for reading,
// and then outputs the image
function displayrandomimage($list)
{
srand ((double) microtime() * 10000000);
$sig = array_rand ($list);

$size = getimagesize ($list[$sig]);
$fp = fopen($list[$sig], "rb");

if ($size && $fp)
{
header("Content-type: {$size['mime']}");
fpassthru($fp);
exit;
}
}
?>




Step 2:change your images folder like this images>images.png in order for the script to work properly

NOTEi had to make another copy of my gift folder in order for this to work due to the fact that those who had gift sigs from me could still be seen just as a image. but to get it rotating i had to change the folder into a png format to get it to work.


Step3: then paste this code below to get it working. mind you put our own url in their not mine




gfxtrap.com/sig.png

ON A SIDE NOTE MAKE SURE THE FORUM HAS PHP ACTIVATED OR IT WILL NOT WORK

as you see here im using this as my gift sig rotator


if i have to make any edits i will let you all know.



Share this post


Link to post
Share on other sites

Oh...that's pretty cool. I love the automation-ness. But unfortunately, if I used it for my current gfx folder it'd also show my other stuff (gifts for people and such), which I wouldn't really want. And if I used a new folder I'd have to move all my sigs, which would screw up whatever links I have to them, or copy them, which would clog my site's space.But I guess it's okay, cause I'm fine with having just one sig. :D

Share this post


Link to post
Share on other sites

To tell you the truth, I was using the script the first time around, but then I made my own because the one you posted does not support images from other servers--sigs has to be on your server. The only advantages that I can think of when using Michael's sig is that it's shorter and automated. With mine, you won't waste bandwidth. Your call.

Share this post


Link to post
Share on other sites

Erm... Sorry to bother. I have tried to get the code to work, but have had no luck. What I have done is:

1. Copied code into index.php
2. Made folder on http://forums.xisto.com/no_longer_exists/ called images.png
3. put various png images in said folder and also the index.php file (images are allowed size)
4. Linked to http://forums.xisto.com/no_longer_exists/ in my edit signature area under my controls?

I just get a message saying IPB image.
What have I done wrong...?
is there something I should allow on trap hosting to prevent hotlink or leech protect on that folder to get them to display? or is there some other mistake. In the meantime I'll re-copy that code to make sure its right, but???

Thanks
James

Edited by Jimmy (see edit history)

Share this post


Link to post
Share on other sites

By just typing http://forums.xisto.com/no_longer_exists/ into your browser you should also see a random sig. However, yours shows a 404 error. Are you sure you made the 'images.png' folder in the correct place, that is, in the 'www' or 'public_html' folder? (Either one will work.)

ah! you've hit it bang on! I placed it outside those public directories... That would be why ;D
Wasn't paying attention! sorted the problem now and all works like a Saint! (pun intended)

Thanks Av. (and Saint for the whole codey thing)
P.S. your reply was like only 36 (Sorry! 34 :lol:) mins after my question - You're all nuts!
:rolleyes: Have a Nice Day and I'm Happy!
Edited by Jimmy (see edit history)

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
Sign in to follow this  

×
×
  • 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.