<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Adjusting PHP Code for Photo Gallery</title>
	<link>http://ask.metafilter.com/90209/Adjusting-PHP-Code-for-Photo-Gallery/</link>
	<description>Comments on Ask MetaFilter post Adjusting PHP Code for Photo Gallery</description>
	<pubDate>Wed, 30 Apr 2008 13:01:14 -0800</pubDate>
	<lastBuildDate>Wed, 30 Apr 2008 13:01:14 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Adjusting PHP Code for Photo Gallery</title>
		<link>http://ask.metafilter.com/90209/Adjusting-PHP-Code-for-Photo-Gallery</link>	
		<description>Non-programmer needs help with some PHP code for an online gallery. &lt;br /&gt;&lt;br /&gt; I&apos;m doing a favor for a friend, and creating a simple portfolio site. I &lt;a href=&quot;http://dasme.org/imagegal/demo/#&quot;&gt;downloaded a cool bit of code&lt;/a&gt; that will let you dump images and descriptions (as text files with the same names), in a directory and have a gallery created - I&apos;m basically creating a gallery for each piece of this artists&apos; work, to show a main image and have several clickable thumbs that give alternate views - I&apos;d like to force the first image in each discreet gallery to open whenever someone visits that gallery, but it looks like it&apos;s set to random. Here&apos;s what I think is the relevant part:&lt;br&gt;
&lt;br&gt;
$rand_class=&quot;&quot;; $rand_caption=&quot;&quot;;  // zero some stuff out&lt;br&gt;
$rand_img = $a_img[mt_rand(0, $tot_img-1)]; // grab a random starting image...&lt;br&gt;
$rand_caption = $desc_img[$rand_img]; // ...and it&apos;s caption if it exists&lt;br&gt;
$rand_class= ($rand_caption!=&quot;&quot;)?&quot;asdasd&quot;:&quot;hidden&quot;; // if it exists, we&apos;ll want to show it.&lt;br&gt;
&lt;br&gt;
How can I adjust that second line to not grab a random image, but always go to the first?</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2008:site.90209</guid>
		<pubDate>Wed, 30 Apr 2008 12:54:58 -0800</pubDate>
		<dc:creator>jalexei</dc:creator>
		
			<category>PHP</category>
		
			<category>photo</category>
		
			<category>gallery</category>
		
	</item> <item>
		<title>By: enn</title>
		<link>http://ask.metafilter.com/90209/Adjusting-PHP-Code-for-Photo-Gallery#1324632</link>	
		<description>I don&apos;t know PHP in particular, I&apos;m going to guess you want to change the second line to:&lt;br&gt;
&lt;br&gt;
$rand_img = $a_img[0]; // grab the first image</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.90209-1324632</guid>
		<pubDate>Wed, 30 Apr 2008 13:01:14 -0800</pubDate>
		<dc:creator>enn</dc:creator>
	</item><item>
		<title>By: le morte de bea arthur</title>
		<link>http://ask.metafilter.com/90209/Adjusting-PHP-Code-for-Photo-Gallery#1324638</link>	
		<description>I know PHP. enn is absolutely correct.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.90209-1324638</guid>
		<pubDate>Wed, 30 Apr 2008 13:04:38 -0800</pubDate>
		<dc:creator>le morte de bea arthur</dc:creator>
	</item><item>
		<title>By: cgg</title>
		<link>http://ask.metafilter.com/90209/Adjusting-PHP-Code-for-Photo-Gallery#1324647</link>	
		<description>Ditto le morte.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.90209-1324647</guid>
		<pubDate>Wed, 30 Apr 2008 13:11:37 -0800</pubDate>
		<dc:creator>cgg</dc:creator>
	</item><item>
		<title>By: jalexei</title>
		<link>http://ask.metafilter.com/90209/Adjusting-PHP-Code-for-Photo-Gallery#1324655</link>	
		<description>Worked like a charm! - Thanks folks, you&apos;ve saved the right-brained designer from a giant &quot;I don&apos;t understand this gibberish&quot; headache.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.90209-1324655</guid>
		<pubDate>Wed, 30 Apr 2008 13:15:44 -0800</pubDate>
		<dc:creator>jalexei</dc:creator>
	</item>
	</channel>
</rss>
