A Digital Age Deserves A Digital Leader

Rotating/Random Signature Image

Rotating/Random Signature Image

Postby kanaloa » Thu Oct 12, 2006 9:41 pm

I am using this now on my signature... notice the image will change randomly on reloads.

Make sure your images are in the same directory as the code snippet below (the second one). Then whatever you call it... use it in your sig like this...

Code: Select all
<img src="http://www.yourdomain.com/directory/filename.php">


Here's the code for your server.

Code: Select all
<?php
$folder = '';

$exts = 'jpg jpeg png gif';

$files = array(); $i = -1; // Initialize some variables
if ('' == $folder) $folder = './';
$handle = opendir($folder);
$exts = explode(' ', $exts);
while (false !== ($file = readdir($handle))) {
    foreach($exts as $ext) { // for each extension check the extension
        if (preg_match('/\.'.$ext.'$/i', $file, $test)) { // faster than ereg, case insensitive
            $files[] = $file; // it's good
            ++$i;
            }
        }
    }
closedir($handle); // We're not using it anymore
mt_srand((double)microtime()*1000000); // seed for PHP <4>
"Greatness is not a function of circumstance. Greatness, it turns out, is largely a matter of conscious choice, and discipline." - Jim Collins
President
User avatar
Posts: 11795
Joined: Sun Mar 10, 2002 1:18 am
Location: HI & SC
Real Name: John Derrick

Postby gries818 » Thu Oct 12, 2006 10:26 pm

Very nice

Whenever I get sometime I'll try this out. Seems very interesting to me.

I've been so busy I haven't even had time to watch LOST yet!!! (recorded of course (I've been avoiding the LOST thread so I won't have it spolied to me)).
Image

Mac OS 10.6.7 - Personal
Ubuntu Server 11.04 - Server
Software Development
User avatar
Posts: 3991
Joined: Wed Jul 07, 2004 6:28 pm

Postby gries818 » Fri Jan 12, 2007 5:08 pm

hey, i am having a hard time getting this to work.

Any suggestions?
Image

Mac OS 10.6.7 - Personal
Ubuntu Server 11.04 - Server
Software Development
User avatar
Posts: 3991
Joined: Wed Jul 07, 2004 6:28 pm

Postby gries818 » Fri Jan 12, 2007 7:40 pm

nevermind - i got it now!
Image

Mac OS 10.6.7 - Personal
Ubuntu Server 11.04 - Server
Software Development
User avatar
Posts: 3991
Joined: Wed Jul 07, 2004 6:28 pm

Postby shougan » Sun Jan 14, 2007 11:58 pm

Nice on John, here something I have always used for this sort of situation; http://automaticlabs.com/products/rotator

-Sid
Do you want the latest news on Betas & Software, Security, or even Vista? Check out our <a href="http://www.pro-networks.org/forum/home_index.php" target="_blank" class="postlink">news areas</a> and be sure to <a href="http://www.pro-networks.org/main/newsletters.htm" target="_blank" class="postlink">subscribe to our PROneT newsletters!</a>
PRO Level 15
Posts: 1174
Joined: Tue Apr 27, 2004 2:12 am
Location: Western Hemisphere

Return to HTML, CSS, and Scripts

Who is online

Users browsing this forum: No registered users and 6 guests

cron
cron