<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Tutorial: Dynamic slideshow with PHP &amp; JQuery</title>
	<atom:link href="http://www.ampedwebstandards.com/2009/03/16/tutorial-dynamic-image-slideshow-with-php-jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ampedwebstandards.com/2009/03/16/tutorial-dynamic-image-slideshow-with-php-jquery/</link>
	<description>Discussion, code examples, and tutorials on web standards and web programming.</description>
	<lastBuildDate>Thu, 19 Aug 2010 08:39:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Alexpt</title>
		<link>http://www.ampedwebstandards.com/2009/03/16/tutorial-dynamic-image-slideshow-with-php-jquery/comment-page-1/#comment-8314</link>
		<dc:creator>Alexpt</dc:creator>
		<pubDate>Thu, 19 Aug 2010 08:39:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.ampedwebstandards.com/?p=95#comment-8314</guid>
		<description>I was looking for that php code.. works fine.. tks</description>
		<content:encoded><![CDATA[<p>I was looking for that php code.. works fine.. tks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.ampedwebstandards.com/2009/03/16/tutorial-dynamic-image-slideshow-with-php-jquery/comment-page-1/#comment-8286</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Wed, 18 Aug 2010 03:29:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.ampedwebstandards.com/?p=95#comment-8286</guid>
		<description>For anyone that was experiencing the same problem as me, I finally figured out the one broken image thing, it was because the slideshow was taking the .DS_store hidden file in the folder as an image and trying to display it, so deleting it did the trick. I feel pretty stupid lol</description>
		<content:encoded><![CDATA[<p>For anyone that was experiencing the same problem as me, I finally figured out the one broken image thing, it was because the slideshow was taking the .DS_store hidden file in the folder as an image and trying to display it, so deleting it did the trick. I feel pretty stupid lol</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niels</title>
		<link>http://www.ampedwebstandards.com/2009/03/16/tutorial-dynamic-image-slideshow-with-php-jquery/comment-page-1/#comment-8199</link>
		<dc:creator>Niels</dc:creator>
		<pubDate>Fri, 13 Aug 2010 08:30:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.ampedwebstandards.com/?p=95#comment-8199</guid>
		<description>Alan,

Great article, but I&#039;ve problems with the $(document).ready(function()-function in all latest browsers: all images load shortly before the WordPress-page loads.
It&#039;s very frustrating, because I&#039;ve read a lot of articles about this problem.
Can you help me ?

The code in header.php:




$(document).ready(function(){
	$(&#039;#myslides&#039;).cycle({
		fit: 1, pause: 2
	});
});



&lt;?php
$directory = &#039;wp-content/themes/iblog2/images/slideshow/&#039; . $row[&#039;imageName&#039;];  	
try {    	
	// Styling for images	
	echo &quot;&quot;;	
	foreach ( new DirectoryIterator($directory) as $item ) {			
		if ($item-&gt;isFile()) {
			$path = $directory . &quot;/&quot; . $item;	
			echo &quot;&quot;;	
		}
	}	
	echo &quot;&quot;;
}	
catch(Exception $e) {
	echo &#039;No images found for this slideshow.&#039;;	
}
?&gt;

Thanks in advance,

Niels</description>
		<content:encoded><![CDATA[<p>Alan,</p>
<p>Great article, but I&#8217;ve problems with the $(document).ready(function()-function in all latest browsers: all images load shortly before the WordPress-page loads.<br />
It&#8217;s very frustrating, because I&#8217;ve read a lot of articles about this problem.<br />
Can you help me ?</p>
<p>The code in header.php:</p>
<p>$(document).ready(function(){<br />
	$(&#8216;#myslides&#8217;).cycle({<br />
		fit: 1, pause: 2<br />
	});<br />
});</p>
<p>&lt;?php<br />
$directory = &#039;wp-content/themes/iblog2/images/slideshow/&#039; . $row[&#039;imageName&#039;];<br />
try {<br />
	// Styling for images<br />
	echo &quot;&#8221;;<br />
	foreach ( new DirectoryIterator($directory) as $item ) {<br />
		if ($item-&gt;isFile()) {<br />
			$path = $directory . &#8220;/&#8221; . $item;<br />
			echo &#8220;&#8221;;<br />
		}<br />
	}<br />
	echo &#8220;&#8221;;<br />
}<br />
catch(Exception $e) {<br />
	echo &#8216;No images found for this slideshow.&#8217;;<br />
}<br />
?&gt;</p>
<p>Thanks in advance,</p>
<p>Niels</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KP</title>
		<link>http://www.ampedwebstandards.com/2009/03/16/tutorial-dynamic-image-slideshow-with-php-jquery/comment-page-1/#comment-7927</link>
		<dc:creator>KP</dc:creator>
		<pubDate>Thu, 29 Jul 2010 17:02:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.ampedwebstandards.com/?p=95#comment-7927</guid>
		<description>Alen:

Got it fixed. yes, it does need to be single quote.  I did not notice the quotes were wrong.  thanks for helping.</description>
		<content:encoded><![CDATA[<p>Alen:</p>
<p>Got it fixed. yes, it does need to be single quote.  I did not notice the quotes were wrong.  thanks for helping.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KP</title>
		<link>http://www.ampedwebstandards.com/2009/03/16/tutorial-dynamic-image-slideshow-with-php-jquery/comment-page-1/#comment-7926</link>
		<dc:creator>KP</dc:creator>
		<pubDate>Thu, 29 Jul 2010 17:01:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.ampedwebstandards.com/?p=95#comment-7926</guid>
		<description>Alen:

Got it fixed. yes, it does need to be single quote.  I don&#039;t see very well and I did not notice the quotes were wrong.  thanks for helping.</description>
		<content:encoded><![CDATA[<p>Alen:</p>
<p>Got it fixed. yes, it does need to be single quote.  I don&#8217;t see very well and I did not notice the quotes were wrong.  thanks for helping.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alan</title>
		<link>http://www.ampedwebstandards.com/2009/03/16/tutorial-dynamic-image-slideshow-with-php-jquery/comment-page-1/#comment-7865</link>
		<dc:creator>alan</dc:creator>
		<pubDate>Mon, 26 Jul 2010 16:24:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.ampedwebstandards.com/?p=95#comment-7865</guid>
		<description>No problem KP - I&#039;m happy to try and help. I think the issue might be from the way my WordPress theme has styled the characters, or the way I cut and paste the code sample.

Make sure the quote right after !preg_match is not the back-tick character. It should be a straight single quote. I think that&#039;s why you are getting a syntax error from PHP. The ending quote also needs to be a single quote.

Let me try again to show that line of code here:

if ($item-&gt;isFile() &amp;&amp; !preg_match(&#039;/^thumb_/&#039;, $item)) {

Basically, what that line of code does is check to see if the current item in the loop IS a file and IS NOT a file starting with the name &quot;thumb_&quot;.

NOTE: After posting this comment, I can see it has the same issue... must be something in this theme that I need to look into. Anyway, on your keyboard, make sure you replace the quote after &lt;b&gt;!preg_match(&lt;/b&gt; with the one below the double quotes key next to the Enter key on a standard keyboard. Also fix the ending quote immediately after &lt;strong&gt;^thumb_/&lt;/strong&gt;. If this doesn&#039;t work, I&#039;ll try and post the entire example file here as a download this week.

Let me know how it goes!</description>
		<content:encoded><![CDATA[<p>No problem KP &#8211; I&#8217;m happy to try and help. I think the issue might be from the way my WordPress theme has styled the characters, or the way I cut and paste the code sample.</p>
<p>Make sure the quote right after !preg_match is not the back-tick character. It should be a straight single quote. I think that&#8217;s why you are getting a syntax error from PHP. The ending quote also needs to be a single quote.</p>
<p>Let me try again to show that line of code here:</p>
<p>if ($item->isFile() &#038;&#038; !preg_match(&#8216;/^thumb_/&#8217;, $item)) {</p>
<p>Basically, what that line of code does is check to see if the current item in the loop IS a file and IS NOT a file starting with the name &#8220;thumb_&#8221;.</p>
<p>NOTE: After posting this comment, I can see it has the same issue&#8230; must be something in this theme that I need to look into. Anyway, on your keyboard, make sure you replace the quote after <b>!preg_match(</b> with the one below the double quotes key next to the Enter key on a standard keyboard. Also fix the ending quote immediately after <strong>^thumb_/</strong>. If this doesn&#8217;t work, I&#8217;ll try and post the entire example file here as a download this week.</p>
<p>Let me know how it goes!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KP</title>
		<link>http://www.ampedwebstandards.com/2009/03/16/tutorial-dynamic-image-slideshow-with-php-jquery/comment-page-1/#comment-7835</link>
		<dc:creator>KP</dc:creator>
		<pubDate>Sat, 24 Jul 2010 18:28:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.ampedwebstandards.com/?p=95#comment-7835</guid>
		<description>Alan:

sorry to bother.  I get an error with the new php line.  My code currently reads:

$directory = &#039;uploads/images/slideshow/&#039; . $row[&#039;imageName&#039;]; 
try {    
	// Styling for images
	echo &quot;&quot;;
	foreach ( new DirectoryIterator(&quot;&quot; . $directory) as $item ) {			
	//	if ($item-&gt;isFile()) {
	if ($item-&gt;isFile() &amp;&amp; !preg_match(‘/^thumb_/’, $item)) {
			$path = &quot;/newsite/&quot; . $directory . &quot;/&quot; . $item;
			echo &quot;&quot;;
		}    
	}
	echo &quot;&quot;;
}

catch(Exception $e) {
	echo &#039;No images found for this player.&#039;;
}

the error is:
# invalid code entered.
# Parse error: syntax error, unexpected &#039;^&#039;  eval()&#039;d code on line 7 

any ideas?  the website is http://keepsakefamilytreevideo.com/newsite/

thanks for your help.  

kp</description>
		<content:encoded><![CDATA[<p>Alan:</p>
<p>sorry to bother.  I get an error with the new php line.  My code currently reads:</p>
<p>$directory = &#8216;uploads/images/slideshow/&#8217; . $row['imageName'];<br />
try {<br />
	// Styling for images<br />
	echo &#8220;&#8221;;<br />
	foreach ( new DirectoryIterator(&#8220;&#8221; . $directory) as $item ) {<br />
	//	if ($item-&gt;isFile()) {<br />
	if ($item-&gt;isFile() &amp;&amp; !preg_match(‘/^thumb_/’, $item)) {<br />
			$path = &#8220;/newsite/&#8221; . $directory . &#8220;/&#8221; . $item;<br />
			echo &#8220;&#8221;;<br />
		}<br />
	}<br />
	echo &#8220;&#8221;;<br />
}</p>
<p>catch(Exception $e) {<br />
	echo &#8216;No images found for this player.&#8217;;<br />
}</p>
<p>the error is:<br />
# invalid code entered.<br />
# Parse error: syntax error, unexpected &#8216;^&#8217;  eval()&#8217;d code on line 7 </p>
<p>any ideas?  the website is <a href="http://keepsakefamilytreevideo.com/newsite/" rel="nofollow">http://keepsakefamilytreevideo.com/newsite/</a></p>
<p>thanks for your help.  </p>
<p>kp</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KP</title>
		<link>http://www.ampedwebstandards.com/2009/03/16/tutorial-dynamic-image-slideshow-with-php-jquery/comment-page-1/#comment-7829</link>
		<dc:creator>KP</dc:creator>
		<pubDate>Sat, 24 Jul 2010 01:21:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.ampedwebstandards.com/?p=95#comment-7829</guid>
		<description>Hey Allan:

I&#039;m no php programmer so let me make sure i understand.

I should replace 

$directory = &#039;uploads/images/slideshow&#039; . $row[&#039;image&#039;]; 
try {    
	// Styling for images

	echo &quot;&quot;;
	foreach ( new DirectoryIterator(&quot;&quot; . $directory) as $item ) {			
        if ($item-&gt;isFile()) {
              $path = &quot;/newsite/&quot; . $directory . &quot;/&quot; . $item;
              echo &quot;&quot;;
             }
}
         echo &quot;&quot;;
}

catch(Exception $e) {
	echo &#039;No images found for this player.&#039;;
}

WITH
$directory = &#039;uploads/images/slideshow&#039; . $row[&#039;image&#039;]; 
try {    
	// Styling for images

	echo &quot;&quot;;
	foreach ( new DirectoryIterator(&quot;&quot; . $directory) as $item ) {			
        if ($item-&gt;isFile() &amp;&amp; !preg_match(‘/^thumb_/’, $item)) {
              $path = &quot;/newsite/&quot; . $directory . &quot;/&quot; . $item;
              echo &quot;&quot;;
             }
}
         echo &quot;&quot;;
}

catch(Exception $e) {
	echo &#039;No images found for this player.&#039;;
}</description>
		<content:encoded><![CDATA[<p>Hey Allan:</p>
<p>I&#8217;m no php programmer so let me make sure i understand.</p>
<p>I should replace </p>
<p>$directory = &#8216;uploads/images/slideshow&#8217; . $row['image'];<br />
try {<br />
	// Styling for images</p>
<p>	echo &#8220;&#8221;;<br />
	foreach ( new DirectoryIterator(&#8220;&#8221; . $directory) as $item ) {<br />
        if ($item-&gt;isFile()) {<br />
              $path = &#8220;/newsite/&#8221; . $directory . &#8220;/&#8221; . $item;<br />
              echo &#8220;&#8221;;<br />
             }<br />
}<br />
         echo &#8220;&#8221;;<br />
}</p>
<p>catch(Exception $e) {<br />
	echo &#8216;No images found for this player.&#8217;;<br />
}</p>
<p>WITH<br />
$directory = &#8216;uploads/images/slideshow&#8217; . $row['image'];<br />
try {<br />
	// Styling for images</p>
<p>	echo &#8220;&#8221;;<br />
	foreach ( new DirectoryIterator(&#8220;&#8221; . $directory) as $item ) {<br />
        if ($item-&gt;isFile() &amp;&amp; !preg_match(‘/^thumb_/’, $item)) {<br />
              $path = &#8220;/newsite/&#8221; . $directory . &#8220;/&#8221; . $item;<br />
              echo &#8220;&#8221;;<br />
             }<br />
}<br />
         echo &#8220;&#8221;;<br />
}</p>
<p>catch(Exception $e) {<br />
	echo &#8216;No images found for this player.&#8217;;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alan</title>
		<link>http://www.ampedwebstandards.com/2009/03/16/tutorial-dynamic-image-slideshow-with-php-jquery/comment-page-1/#comment-7819</link>
		<dc:creator>alan</dc:creator>
		<pubDate>Thu, 22 Jul 2010 07:31:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.ampedwebstandards.com/?p=95#comment-7819</guid>
		<description>&lt;strong&gt;jingle&lt;/strong&gt;:

Do you want to show 3 images at the same time, but pull them from a database rather than a folder on the server?

&lt;strong&gt;KP&lt;/strong&gt;: 

You should be able to just add a regexp to the if statement that checks if the current item is a file in the PHP file... that will filter out your auto-generated thumbnails from the CMS.

Try this new version of line 6:
	if ($item-&gt;isFile() &amp;&amp; !preg_match(&#039;/^thumb_/&#039;, $item)) {

I also created a &lt;a href=&quot;http://www.ampedwebstandards.com/demos/dynamic-image-slideshow-php-jquery/demo3.php&quot; rel=&quot;nofollow&quot;&gt;new demo to show it working&lt;/a&gt;. The top slideshow will display the thumbnail, the bottom one doesn&#039;t.</description>
		<content:encoded><![CDATA[<p><strong>jingle</strong>:</p>
<p>Do you want to show 3 images at the same time, but pull them from a database rather than a folder on the server?</p>
<p><strong>KP</strong>: </p>
<p>You should be able to just add a regexp to the if statement that checks if the current item is a file in the PHP file&#8230; that will filter out your auto-generated thumbnails from the CMS.</p>
<p>Try this new version of line 6:<br />
	if ($item-&gt;isFile() &amp;&amp; !preg_match(&#8216;/^thumb_/&#8217;, $item)) {</p>
<p>I also created a <a href="http://www.ampedwebstandards.com/demos/dynamic-image-slideshow-php-jquery/demo3.php" rel="nofollow">new demo to show it working</a>. The top slideshow will display the thumbnail, the bottom one doesn&#8217;t.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KP</title>
		<link>http://www.ampedwebstandards.com/2009/03/16/tutorial-dynamic-image-slideshow-with-php-jquery/comment-page-1/#comment-7791</link>
		<dc:creator>KP</dc:creator>
		<pubDate>Mon, 19 Jul 2010 22:22:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.ampedwebstandards.com/?p=95#comment-7791</guid>
		<description>Hi:

I&#039;ve been looking for a php script that automates jQuery slideshows.  this is a gem of a find.  thank  you.

I have a quick question.  I&#039;m using this script in a cms.  Any image upload will generate an auto thumbnail.  how can i modify the php code to bypass the thumbnails?  currently, both image1.jpg and thumb_image1.jpg are showing.  

thank you.</description>
		<content:encoded><![CDATA[<p>Hi:</p>
<p>I&#8217;ve been looking for a php script that automates jQuery slideshows.  this is a gem of a find.  thank  you.</p>
<p>I have a quick question.  I&#8217;m using this script in a cms.  Any image upload will generate an auto thumbnail.  how can i modify the php code to bypass the thumbnails?  currently, both image1.jpg and thumb_image1.jpg are showing.  </p>
<p>thank you.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
