Welcome Guest ( Log In | Register )




                Web Hosting Guide

 
Reply to this topicNew Topic
Yet Another Sig Rotator, head of trap17.com gfx crew
saint-michael
post Sep 5 2005, 05:49 AM
Post #1


SM- the Man -The Myth - The Legend Himself
Group Icon

Group: Members
Posts: 477
Joined: 4-September 05
From: Drinking da rootbeers
Member No.: 8,313
myCENTs:61.67


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.saint-michael.trap17.com/gift.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





if i have to make any edits i will let you all know.
Go to the top of the page
 
+Quote Post
saint-michael
post Sep 5 2005, 05:52 AM
Post #2


SM- the Man -The Myth - The Legend Himself
Group Icon

Group: Members
Posts: 477
Joined: 4-September 05
From: Drinking da rootbeers
Member No.: 8,313
myCENTs:61.67


-----I merged this post with the above tutorial since this doesn't really stand as a single tutorial, and it can be considered a follow up to this topic/the above tutorial-----szupie


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);
readfile("http://www.saint-michael.trap17.com/images/sig1-".rand(0,54)+2.".jpg");
?>

here is another script the only downside to this is that you only can sig rotate jpgs and and not png or gifs. well you could just change the jpg into one of them.

just follow the same steps in my other sig rotating scripts.

This post has been edited by szupie: Sep 15 2005, 11:13 PM
Go to the top of the page
 
+Quote Post
lilqb3
post Jun 21 2006, 03:06 AM
Post #3


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 3
Joined: 21-June 06
Member No.: 14,039


Thanks so much! I've been looking for a script to do this for a while now!
Go to the top of the page
 
+Quote Post
ntk100
post Jul 10 2006, 04:30 PM
Post #4


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 2
Joined: 10-July 06
Member No.: 14,420


Thanx man! you're the Best!
Go to the top of the page
 
+Quote Post
Exc
post Aug 6 2006, 09:56 PM
Post #5


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 6
Joined: 6-August 06
Member No.: 15,020


Wow! Thank you soo much! I have been looking for one of these for ages... The one I used to use went down permanently and I haven't been able to track down another...
Go to the top of the page
 
+Quote Post

Reply to this topicNew Topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No New Posts   7 miCRoSCoPiC^eaRthLinG 1,441 14th February 2007 - 07:35 PM
Last post by: dhanesh


Web Hosting Powered by ComputingHost.com.