Add to Google

Another Sig Rotation - even better then snlil's :P XP

free web hosting
Open Discussion > Xisto Network Sites > The GFXTrap Forum - Trap17 Graphics Site > Tutorials

Another Sig Rotation - even better then snlil's :P XP

Saint_Michael
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.

QUOTE
<?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


CODE

[IMG]http://www.gfxtrap.com/sig.png[/IMG]


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

IPB Image



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

 

 

 


Reply

Johnny
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. smile.gif

Reply

snlildude87
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.

Reply

Jimmy
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://projectjim.co.uk 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://projectjim.co.uk/images.png 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

Reply

Avalon
By just typing http://projectjim.co.uk/images.png 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.)

Reply

Jimmy
QUOTE(Avalon @ Jun 6 2006, 02:40 PM) *

By just typing http://projectjim.co.uk/images.png 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 tongue.gif) mins after my question - You're all nuts!
smile.gif Have a Nice Day and I'm Happy!

 

 

 


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.







*SIMILAR VIDEOS*
Searching Video's for sig, rotation, snlils, p, xp

*MORE FROM TRAP17.COM*
advertisement



Another Sig Rotation - even better then snlil's :P XP



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE