<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <channel>

    <title>A List Apart: Comments on: Random Image Rotation</title>
    <link>{url_title_path=articles/}</link>
    <description></description>
    <dc:language>en</dc:language>
    <dc:rights>Copyright 2012</dc:rights>
    <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    <admin:generatorAgent rdf:resource="http://expressionengine.com/" />




    <item>
      <title>Posted by: Abhi Malani</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/#1</link>
      <guid>http://www.alistapart.com/comments/randomizer/#1</guid>         
	  
      <description><![CDATA[Nice article :)

If anyone is interested in an ASP version: 

Demo : http://www.duelcom.com/malani/db/img/

http://www.duelcom.com/malani/files/otherstuff.zip (ImageTools - also includes an album page)]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: mac davis</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/#2</link>
      <guid>http://www.alistapart.com/comments/randomizer/#2</guid>         
	  
      <description><![CDATA[excellent code and article, 

thank you guys!]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Charles S.</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/#3</link>
      <guid>http://www.alistapart.com/comments/randomizer/#3</guid>         
	  
      <description><![CDATA[Does not work in Safari. I didn't test it with any other browsers. 

Spits out:

GIF89ad]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Charles S.</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/#4</link>
      <guid>http://www.alistapart.com/comments/randomizer/#4</guid>         
	  
      <description><![CDATA[Along with "GIF89ad" it also spits out a bunch of unlegible characters. 

Apparently the forum doesn't allow such characters...]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: François Briatte</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/#5</link>
      <guid>http://www.alistapart.com/comments/randomizer/#5</guid>         
	  
      <description><![CDATA[Nice and clean.
Will be featured at www.phnk.com in a few days. Credits go to author on index page, for sure.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: LintHuman</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/#6</link>
      <guid>http://www.alistapart.com/comments/randomizer/#6</guid>         
	  
      <description><![CDATA[Firebird doesn't like it either. Looks like an IE-only script. Shame - I can't use PHP for professional projects and I can't pull this kind of thing off in ASP myself... Still, a good little article. I already use Dan's code on my personal site to display random CSS background images. Works beautifully.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: LintHuman</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/#7</link>
      <guid>http://www.alistapart.com/comments/randomizer/#7</guid>         
	  
      <description><![CDATA[Just thought I'd better explain how you can use Dan's script for CSS background-images.

In your CSS file, simply put the location of the script in the url() value of the background-image property:

div#rotateImage &#123;
background-image : url(/scripts/rotate.php);
&#125;

and you're laughing!]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Abhi Malani</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/#8</link>
      <guid>http://www.alistapart.com/comments/randomizer/#8</guid>         
	  
      <description><![CDATA[^^^ Apologies.

Apparently it doesn't work as the link I gave is for the actual script itself. The script works well otherwise.

http://www.duelcom.com/malani/db/img/imgrotate.asp

This is an HTML page with the image script linked.

tested in IE/Moz/FB/NN.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Jason Lotito</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/#9</link>
      <guid>http://www.alistapart.com/comments/randomizer/#9</guid>         
	  
      <description><![CDATA[Possibly even easier, this script you don't have to actually edit.  Simply drop this script into the same directory as the images are that you want to change between.

Example:
http://www.devnetwork.net/forums/images/faces/randimages.php

Code:
http://www.devnetwork.net/forums/images/faces/randimages.phps]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Stephen Sample</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/#10</link>
      <guid>http://www.alistapart.com/comments/randomizer/#10</guid>         
	  
      <description><![CDATA[This may be beyond the scope of the article, but it would be very cool to have a rotation script that could handle dimensions (for faster layout) and captions/alt text/longdesc (for accessibility) as well.
There are certainly (nonsemantic) images for which the proper alt text is empty--and for that matter sets of images for which the alt text is always the same, but both additional features would have important benefits for certain groups (of images, and of visitors). I can think of a few ways to handle this--from&lt;ul&gt;&lt;li&gt;putting the images, dimensions, alt text, longdesc, and caption info in a database,&lt;/li&gt;&lt;li&gt;to using a more heterogenous folder with images, text files, and so on, and a common naming scheme (image-j.png, caption-j.txt, longdesc-j.txt, dimensions-j.txt...)&lt;/li&gt;&lt;li&gt;to embedding the alt, caption, and longdesc info in the IPTC headers and then using one of the open source IPTC parsers to extract them&lt;/li&gt;&lt;/ul&gt;All of those have potential downsides in terms of workflow, but they would also have significant potential benefits as well.
...Can you tell that I'm working on these issues for another project right now?]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Stephen Sample</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P10/#11</link>
      <guid>http://www.alistapart.com/comments/randomizer/#11</guid>         
	  
      <description><![CDATA[For that matter, can you tell that I didn't notice the "HTML displays as Source; it does not render." message? 

Either that, or I just assumed that everyone hear is a native speaker of HTML. Yeah, that's it...]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Ian</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P10/#12</link>
      <guid>http://www.alistapart.com/comments/randomizer/#12</guid>         
	  
      <description><![CDATA[You just made my life so much easier!!!

Thanks]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Rob Sayles</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P10/#13</link>
      <guid>http://www.alistapart.com/comments/randomizer/#13</guid>         
	  
      <description><![CDATA[We've been running a CGI script to do the same thing, inserted as an include into the webpage - drop us a line for more :)]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Simon Drijver</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P10/#14</link>
      <guid>http://www.alistapart.com/comments/randomizer/#14</guid>         
	  
      <description><![CDATA[I also wrote a php script like this (don't have the sourcecode near me athm though) but instead of giving the contents of the image, it redirects the browser to the url of the image using the Header("Location: ") command.

This way you can save bandwith since the image can be cached instead of being downloaded over and over again.
Just my $0.02 :)]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Justin Greer</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P10/#15</link>
      <guid>http://www.alistapart.com/comments/randomizer/#15</guid>         
	  
      <description><![CDATA[There are a couple bugs in this script that together make for a huge security issue.  

I've emailed the author with details.

Please don't use this script until the author can post the updated version.  It is a simple fix, so I'm hoping we'll see the update soon.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Lllama</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P10/#16</link>
      <guid>http://www.alistapart.com/comments/randomizer/#16</guid>         
	  
      <description><![CDATA[One problem with the script is the way in which the list of files is generated.  You can have some problems with operating systems which generate preview icons for the files.  For example on OS X you get hidden files that contain the preview which are very similar in name to the actual image.  The important point is that they also have the same extention.  The filenames start as with a '.' and so do not show up in the Finder but are included in the list of images to circle through.  If the script decides to use one of these images then you will get no content displayed.  The only way to solve this problem (in OS X) is to use the Terminal to delete the icon previews and then not to open the pictures in an application that will generate them again.

Or you can modify the regular expressions used in the scripts to exclude files that start with a '.'.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Steven Spicer</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P10/#17</link>
      <guid>http://www.alistapart.com/comments/randomizer/#17</guid>         
	  
      <description><![CDATA[A small modification -- fill an array, then randomly sort -- allows multiple images to be selected without danger of showing the same image in two spots at once: see http://www.terriertribe.com/ for an example.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: August Trometer</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P10/#18</link>
      <guid>http://www.alistapart.com/comments/randomizer/#18</guid>         
	  
      <description><![CDATA[The script works exactly as promised and is useful, but I don't like that the height, width, and alt attributes are ignored. This causes problems both for accessibility and for validation. Obviously you could stick an alt="" to help validate, but that defeats the alt purpose.

Also without dimensions, you can't reliably float the image.

Since the server is running PHP you could, in theory, use &lt;% include "rotate.php?alt=alt_text"; %&gt; where rotate.php would generate the entire &lt;img&gt; tag, including height, width and alt.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Jon&#45;Paul LeClair</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P10/#19</link>
      <guid>http://www.alistapart.com/comments/randomizer/#19</guid>         
	  
      <description><![CDATA[There are a number of different ways of doing this via ASP...

Basically it involves consitantly naming your images, ie; image1.jpg, image2.jpg, etc...

then randomize a number and pass it to your image tag...

image&lt;%=i%&gt;.jpg

(obviously width, height, alt should be included)...

But it's as simple as that.

I've modified it to drop a cookie on the client for the time their browser's open, so if they return to the site during the same session, it'll draw the same image...if the bowser's closed...then the cookie deletes and they get a new image next time they visit...

Obviously there's probably a few other ways of doing this but this one works...

works for me...]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Steph Mineart</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P20/#20</link>
      <guid>http://www.alistapart.com/comments/randomizer/#20</guid>         
	  
      <description><![CDATA[I'll be interested to see the debugged version of this. I've been using a javascript  include to do this for several years. It's fairly simple and when I add new images, I just name them accordingly and edit the maxnumber to equal the highest image number. Seems to work fairly well.

[removed]
&lt;!--

var maxnumber=122;
var randomnumber=Math.floor(Math.random()*maxnumber)+1;
[removed] ("[url="/"]/art/logos/[/url]")

//--&gt;
[removed]]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Davezilla</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P20/#21</link>
      <guid>http://www.alistapart.com/comments/randomizer/#21</guid>         
	  
      <description><![CDATA[Always admired Hivelogic's image rotation, but mainly for the fabulous retro pics. ;^) 

Great article and loving the new ALA look.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Satellio Box</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P20/#22</link>
      <guid>http://www.alistapart.com/comments/randomizer/#22</guid>         
	  
      <description><![CDATA['scuse me while i'm being a newbie, but i'd also like a "text rotator", to display random silly proverbs and phrases... and, er… does this sort of things exist yet? 
(i'm sure it does… no?)]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Satellio Box</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P20/#23</link>
      <guid>http://www.alistapart.com/comments/randomizer/#23</guid>         
	  
      <description><![CDATA[… and if the randomly displayed text could use styles, it would be heaven…]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Jason</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P20/#24</link>
      <guid>http://www.alistapart.com/comments/randomizer/#24</guid>         
	  
      <description><![CDATA[I'm using a PHP script to change the background image for our new site that is in development. I'm looking at changing the image for national/state holidays, the seasons, school events, etc.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: p</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P20/#25</link>
      <guid>http://www.alistapart.com/comments/randomizer/#25</guid>         
	  
      <description><![CDATA[that was SO easy. luck was on my side today, because i had planned to write a randomizer script after i had read my daily links, but when i saw this article, i didn't have to write my own.

thanks dan, you're brilliant.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Matt</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P20/#26</link>
      <guid>http://www.alistapart.com/comments/randomizer/#26</guid>         
	  
      <description><![CDATA[Someone earlier mentioned using 302 temporary redirects to rotate the image. When Dan first released this method I wrote something that did this, available here:

http://photomatt.net/scripts/randomimage

This has given me some good ideas I'll incorporate into that script. The header method has another advantage that no file that couldn't already be accessed through your document_root is available, so you can readfile&#40;'/etc/passwd'&#41; or something similarly nasty like that.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: apartness</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P20/#27</link>
      <guid>http://www.alistapart.com/comments/randomizer/#27</guid>         
	  
      <description><![CDATA[The debugged script is online in the same location as the previous script, namely:

http://www.alistapart.com/d/randomizer/rotate.txt


]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Dan Benjamin</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P20/#28</link>
      <guid>http://www.alistapart.com/comments/randomizer/#28</guid>         
	  
      <description><![CDATA[It's been fixed and the new version is in place.  If you've already installed a copy on your server, consider grabbing the new file.

Thanks to Justin Greer and Milo Vermeulen for their suggestions!

]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: pattyb</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P20/#29</link>
      <guid>http://www.alistapart.com/comments/randomizer/#29</guid>         
	  
      <description><![CDATA[The script works great for me in Firebird, Safarai, and all other browsers I have tried. Thanks so much!

-Patty]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Kevin Miller</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P30/#30</link>
      <guid>http://www.alistapart.com/comments/randomizer/#30</guid>         
	  
      <description><![CDATA[Thanks for the great script.  Works well in Firebird 0.6.1, Opera 7.11 and Internet Explorer 6.0.  I even got it to work with Konqueror which surprised me.

Someone mentioned about accessibility and this script earlier.  I decided to add a longdesc of my rotating images to the script.  That way I could define my title and alt tags as Rotating Images...   I got it to validate XHTML 1.1 with no problem.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: miguel</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P30/#31</link>
      <guid>http://www.alistapart.com/comments/randomizer/#31</guid>         
	  
      <description><![CDATA[is it in any way possible to make this script work where each rotating image is linked to a different page...?]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Jesro Christoffer Cena</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P30/#32</link>
      <guid>http://www.alistapart.com/comments/randomizer/#32</guid>         
	  
      <description><![CDATA[Someone pointed out the issue of bandwidth in a comment in my blog. When people are connected to the internet by a dialup connection, they can no longer rely on caching to speed up their surfing, when they have to download a new image every time they enter a site or a new page within that site.

The fact of the matter is: Some people are still stuck with modems and having to wait a couple of seconds extra for every page to download might be a couple of seconds to much ...

Anyway, try not to use huge images for rotating purposes. :)]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Jeff Walden</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P30/#33</link>
      <guid>http://www.alistapart.com/comments/randomizer/#33</guid>         
	  
      <description><![CDATA[If as the article suggests you want your logo to be the same for a while, you can use their script and add ?img=URL to the query string in your HTML source.  Since the whole purpose of this was to eliminate source editing of the HTML, here's another solution:

http://www.troop326.us/jeff/rotate.txt

I've prominently marked the new sections; I've just added a new variable for the name of a default image (defaults to "default"), and when img isn't specified, it searches the directory for any file with that name and an extension in $extList.  The first file it finds it will use.  Now you can just upload a new file of any defined image type with (name==$defaultName) and the script will use it if no img is specified - no HTML editing if you want a certain image.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: jeffrey kerekes</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P30/#34</link>
      <guid>http://www.alistapart.com/comments/randomizer/#34</guid>         
	  
      <description><![CDATA[I tried using the script to rotate several images side by side but the script uses the same image for each iteration.  How can I adapt the script to randomly select a different image for each iteration in a string of images?

Thanks for your help!!!!

-Jeffrey Kerekes]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: jeffrey kerekes</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P30/#35</link>
      <guid>http://www.alistapart.com/comments/randomizer/#35</guid>         
	  
      <description><![CDATA[One option just occurred to me.  Create several directories of images with the rotate.php script in each.  For three images, for example, you might do something like this:

/images/rotate/rotate.php
/images/rotate2/rotate.php
/images/rotate3/rotate.php

create three directories with a series of images in them

/images/rotate/
/images/rotate2/
/images/rotate3/

Thanks anyway. Any other solutions welcome.

-Jeffrey Kerekes
]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: jeffrey kerekes</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P30/#36</link>
      <guid>http://www.alistapart.com/comments/randomizer/#36</guid>         
	  
      <description><![CDATA[be sure to edit your rotate.php folder destination:

$folder = "/images/rotate/";

in the second:

$folder = "/images/rotate2/";

in the third:

$folder = "/images/rotate3/";

I hope this helps.

-Jeffrey]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Joshua Hore</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P30/#37</link>
      <guid>http://www.alistapart.com/comments/randomizer/#37</guid>         
	  
      <description><![CDATA[The reason Abhi Malani's ASP script doesn't work 'raw' in most browsers is because it's missing a MIME-Type declaration. The bug can be fixed by adding the following lines:

if (img.indexOf(".jpg") !=-1 || img.indexOf(".jpeg") !=-1) &#123;type = "jpeg"&#125;;
if (img.indexOf(".gif") !=-1) &#123;type = "gif"&#125;;
if (img.indexOf(".png") !=-1) &#123;type = "png"&#125;;
//plus any other types of image you want to use
Response.ContentType = "image/" + type;

before the final line.
There's probably an easier/more efficent way to to this, but it works.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Abhi Malani</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P30/#38</link>
      <guid>http://www.alistapart.com/comments/randomizer/#38</guid>         
	  
      <description><![CDATA[Right on Joshua :)

The previous version of this script served the image via a binary stream thus increasing the bandwidth, the ContentType declaration was present then. Then i used Server.Transfer and removed it cuz i thought i didn't require that. I do. Updated.

Thanks!]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Amit</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P30/#39</link>
      <guid>http://www.alistapart.com/comments/randomizer/#39</guid>         
	  
      <description><![CDATA[Had written Dan about the problem with the previous version of it. The new one works like a song! Must drop him an email Good work!]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Karl Bedingfield</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P40/#40</link>
      <guid>http://www.alistapart.com/comments/randomizer/#40</guid>         
	  
      <description><![CDATA[Hi guys,

This is well cool :)

I wondered if anyone know if it is easy to create a photo gallery with this script?

Foe instance is it possible to have a 3 column 10 row gallery?

If anyone can help on this that would be great :)

Thanks
Karl]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Amanda</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P40/#41</link>
      <guid>http://www.alistapart.com/comments/randomizer/#41</guid>         
	  
      <description><![CDATA[Believe it or not I have a client that is demanding a very large site be fully functional in Net 4...does anyone know if this script works in Net 4, because I can't seem to get it to work...does anyone have a script like this that actually works in Net 4??

Thanks,

Amanda]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Steven Spicer</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P40/#42</link>
      <guid>http://www.alistapart.com/comments/randomizer/#42</guid>         
	  
      <description><![CDATA[A snip from terriertribe.com/index.php:
...
chdir( "./pics/200x100/" );
$pics = array();
$dir = opendir( "." );
while ( $f = readdir($dir) )
&#123;
  $ext = substr($f,-4);
  if ( $ext == ".jpg" 
  || $ext == ".gif" 
  || $ext == ".png" )
    $pics[] = "./pics/200x100/" . $f;
&#125;
closedir( $dir );
$p = array_rand( $pics, 3 );

?&gt;
&lt;body&gt;
&lt;div id="the3"&gt;
&lt;h1&gt;[url="./ttribe.php"]Terrier Tribe[/url]&lt;/h1&gt;
[img]&lt;?php print $pics[$p[0]]; ?&gt;
  width="200" height="100" alt="" [/img]
[img]&lt;?php print $pics[$p[1]]; ?&gt;
  width="200" height="100" alt="" [/img]
...

Hope that helps
]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Jeffrey Kerekes</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P40/#43</link>
      <guid>http://www.alistapart.com/comments/randomizer/#43</guid>         
	  
      <description><![CDATA[Thanks for the tip Steven Spicer!

-Jeffrey]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Bill</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P40/#44</link>
      <guid>http://www.alistapart.com/comments/randomizer/#44</guid>         
	  
      <description><![CDATA[Works great!

Is there a way to get ALT text in any of these images?  How have you been thinking about this in terms of screen readers?

]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Mindy</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P40/#45</link>
      <guid>http://www.alistapart.com/comments/randomizer/#45</guid>         
	  
      <description><![CDATA[I'm wondering if anyone knows of a way to get multiple images to randomize - but keep them in synch. I'm looking for something that will do it on refresh, not rotation.

I have two graphics on a homepage that need to match up; the client wants 3 different "random" versions of the homepage, meaning 3 different pairs. 

It seems I should be able to set a random number (1-3) and then use this random number to pick which images get displayed. I just can't find a script to do this.
Any ideas?

Thanks,
Mindy
]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Mindy</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P40/#46</link>
      <guid>http://www.alistapart.com/comments/randomizer/#46</guid>         
	  
      <description><![CDATA[Found a solution to my own problem; it may not be elegant, but it works. Here it is, if you're interested.

[removed]
&lt;!--
// Random numbers are generated using Math.random() JavaScript function
// Whole numbers between 0 and maxnumber
var randomnumber=Math.floor(Math.random()*3);


var ar = new Array(
"images/image1a.gif",
"images/image1b.gif",
"images/image1c.gif"
);


var ar2 = new Array(
"images/image2a.gif",
"images/image2b.gif",
"images/image2c.gif"
)

// --&gt;
[removed]

image one goes here:

script language="Javascript"&gt;
//write the array image corresponding to the random number selected
[removed](ar[randomnumber]);
// --&gt;[removed]

image two goes here:  

[removed]
//write the array image corresponding to the random number selected
[removed](ar2[randomnumber]);
// --&gt;[removed]



~Mindy]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: danny boy</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P40/#47</link>
      <guid>http://www.alistapart.com/comments/randomizer/#47</guid>         
	  
      <description><![CDATA[Great script! Just what I was looking for.  However, I was surprised to see that it didn't work with .swf files.  Anyone know how I can rotate .swf files as well?  I have a folder of .swf and static images, all same dimensions, that I'd love to rotate.

Thanks,
Dan]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Jake Liddell</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P40/#48</link>
      <guid>http://www.alistapart.com/comments/randomizer/#48</guid>         
	  
      <description><![CDATA[Hi all.  I've been playing with the script, and the one by Matt, (http://photomatt.net/scripts/randomimage).

I couldn't really consider using the script unless it could cope with alt tags too, 'cause the kind of sites I do need to be squeeky clean in the accessibility department.  I've done the following script, but I'm really new to php.  Please could anyone tell me whether it's going to be any use - seems almost too simple a solution?

&lt;?php
/*
  Image rotater, a little bit by Jake Liddell 
  Based almost entirely on Matt Mullenweg's script &gt; http://photomatt.net
    Inspired by Dan Benjamin &gt; http://hiveware.com/imagerotator.php
*/

// Make this the path containing the text files that you want to include, like "../img/random/".
// A blank folder gets substituted to the current directory.

$folder = './i/r/';

// Space seperated list of extensions, you probably won't have to change this, if your include files are txt.
$exts = 'txt';

$files = array(); $i = -1; // Initialize some variables
if ('' == $folder) $folder = './';
$handle = opendir($folder);
$exts = explode(' ', $exts);
while (false !== ($file = readdir($handle))) &#123;
    foreach($exts as $ext) &#123; // for each extension check the extension
        if (preg_match('/\.'.$ext.'$/i', $file, $test)) &#123; // faster than ereg, case insensitive
            $files[] = $file; // it's good
            ++$i;
            &#125;
        &#125;
    &#125;

closedir($handle); // We're not using it anymore
mt_srand((double)microtime()*1000000); // seed for PHP &lt; 4.2
$rand = mt_rand(0, $i); // $i was incremented as we went along

$res=require("$folder$files[$rand]");

?&gt;


To use it, you just have a line like this in your php html file:

&lt;img &gt;

and put the script in the same dir.  The script will look for, and include the contents of a random text file.  If you make the contents something like:

src="path/img.jpg" height="175" width="150" alt="test alt text"

your image is loaded, along with all the attributes you want.

Haven't tested on anything apart from IE6 yet, but I thought I'd see what you all thought - as I say, I'm really new to php so I don't have experience of security flaws, etc.  If it does work, though, you could use it for any random blocks of html, not just images.  Just put the html in the text files, and you're away.

Cheers,
Jake.

]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Ross Beyer</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P40/#49</link>
      <guid>http://www.alistapart.com/comments/randomizer/#49</guid>         
	  
      <description><![CDATA[I wrote random_gallery, which can be found at http://rossbeyer.net/software/random_gallery, that does this kind of thing. It is a Perl program that can be included via server side includes, therefore there isn't any client dependence. It actually returns a little snippet of HTML, rather than just a location for the src attribute (maybe I should modify it to do that, too).  This allows you to ask for the image, and/or a caption, etc.  The returned HTML is in the XHTML 1.0 standard and has some options for added class names, etc.

It isn't as simple as just dropping the script into a directory of images, however, there is a simple .conf file that the names of images need to be added to.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: mac</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P50/#50</link>
      <guid>http://www.alistapart.com/comments/randomizer/#50</guid>         
	  
      <description><![CDATA[i just got this going and testing in safari and its not working...

is their a fix for this?]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: paul</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P50/#51</link>
      <guid>http://www.alistapart.com/comments/randomizer/#51</guid>         
	  
      <description><![CDATA[someone asked earlier if this can work with .swf files.  will it?  i imagine all you have to do is add .swf to the $extList
i haven't done it yet but hopefully it works.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: brian</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P50/#52</link>
      <guid>http://www.alistapart.com/comments/randomizer/#52</guid>         
	  
      <description><![CDATA[Ok, I'm trying to view a local file &#40;its not on the server yet, just my comp&#41; and I get nothing, just a red x.  Is there something I'm missing here about php??]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Richard S. Kolseth</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P50/#53</link>
      <guid>http://www.alistapart.com/comments/randomizer/#53</guid>         
	  
      <description><![CDATA[Does the page the image link resides in need to have a .php extension, or will just .html do?
I've tried both at
http://artsaloft.com/rotate.html
and it doesn't seem to show up.
Anyone able to advise?]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: John Bendall</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P50/#54</link>
      <guid>http://www.alistapart.com/comments/randomizer/#54</guid>         
	  
      <description><![CDATA[Hi
Just wanted to add a big 'Thanks'
Installed the script and it worked first time, even mixed in on an asp page.
Can't really ask for more than that.
Keep up the great work, just starting with PHP and it helps a great deal to be able to view these sort of scripts
Again, thank you .....]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Keith</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P50/#55</link>
      <guid>http://www.alistapart.com/comments/randomizer/#55</guid>         
	  
      <description><![CDATA[All of the rotators I have seen are random. I realize that sequencing might require cookies or some messin' wit da session, but is it possible (I have no clue) to place all the file names in a text file and have them "walked through" instead of randomized?

This wouldn't work for this rotator (I don't think), but is there another out there that will sequence, maybe even without the cookies, etc.?

Now that would be cool. Five PAYPAL dollars are yours if you can point me to one that will.

There, the gauntlet hath been...um, lain.]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Richard S. Kolseth</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P50/#56</link>
      <guid>http://www.alistapart.com/comments/randomizer/#56</guid>         
	  
      <description><![CDATA[For some unknown reason, my server won't process php files unless they have the extension .php4

*sigh* have to ask tech support about that.
But the script does work, just fine!]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: Jason Davis</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P50/#57</link>
      <guid>http://www.alistapart.com/comments/randomizer/#57</guid>         
	  
      <description><![CDATA[can you make each image link to a differetn site? &lt;a ]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>

    <item>
      <title>Posted by: CE</title>
	  
	      <link>http://www.alistapart.com/comments/randomizer/P50/#58</link>
      <guid>http://www.alistapart.com/comments/randomizer/#58</guid>         
	  
      <description><![CDATA[I cant get any of the scripts to work? I've made folders...put them in with the images...made a page with an image...linked the php script?  all i get  is a red x...]]></description>
      <dc:subject></dc:subject>
      <dc:date>2012-01-31T13:00:49+00:00</dc:date>
    </item>


    </channel>
</rss>
