HighDots Forums  

Re: Help with CSS Page Layout

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Re: Help with CSS Page Layout in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
janeinpa
 
Posts: n/a

Default Re: Help with CSS Page Layout - 01-02-2008 , 07:57 PM






Thank you for your suggestions. I like the look of both of those programs.
There is a substantial price difference between them. Is this truly an
advantage over my Flash based program? I wonder if there isn't a better way
for me to do the Flash than what I've done (I'm likely not using the css
correctly for it!)


Reply With Quote
  #2  
Old   
Gary White
 
Posts: n/a

Default Re: Help with CSS Page Layout - 01-02-2008 , 09:47 PM






On Thu, 03 Jan 2008 01:44:55 +0000, Malcolm N_ <malcom (AT) mgnixon (DOT) org.uk>
wrote:

Quote:
So I have got a PHP random selector of an array of about 30 images
that display - and refresh if one hits the F5 key or refresh.
Here's my humble contribution to the topic. Note that it will read a
specified directory and display a random image from that directory, so
if you want to add an image, all you need do is upload it. However, it
may not work on a Windows server running IIS because it relies on
$_SERVER['DOCUMENT_ROOT']. Other than that, just change the $imgdir line
to point to the directory you want to read. It defaults to read all
..jpg, .gif, and .png files. If you want to change that, the line below
the $imgdir line sets the types.

<?php
// root relative path where the images are stored
$imgdir = '/images/demo';

$types = array('.jpg','.gif','.png');

$imgpath = $_SERVER['DOCUMENT_ROOT'].$imgdir;
if($dp = @opendir($imgpath)){
$files = array();
$exp = '\\'.join('$|\\',$types).'$';
while (($file = readdir($dp)) !== false){
if (preg_match("/$exp/",$file))
$files[] = $file;
}
srand ((float) microtime() * 10000000);
$img = $files[array_rand($files)];
$img_sz = getimagesize("$imgpath/$img");
print "<img src=\"$imgdir/$img\" $img_sz[3]>\n";
}
?>

Gary


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.