<?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: Simple PHP Gallery Pagination</title>
	<atom:link href="http://www.lateralcode.com/simple-php-gallery-pagination/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lateralcode.com/simple-php-gallery-pagination/</link>
	<description>A Web Development Blog Focused on Code and Technology</description>
	<lastBuildDate>Thu, 09 Sep 2010 08:55:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
	<item>
		<title>By: chip</title>
		<link>http://www.lateralcode.com/simple-php-gallery-pagination/#comment-2513</link>
		<dc:creator>chip</dc:creator>
		<pubDate>Tue, 27 Jul 2010 10:21:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.lateralcode.com/?p=687#comment-2513</guid>
		<description>pagination code for thanx.</description>
		<content:encoded><![CDATA[<p>pagination code for thanx.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hyder</title>
		<link>http://www.lateralcode.com/simple-php-gallery-pagination/#comment-1097</link>
		<dc:creator>Hyder</dc:creator>
		<pubDate>Sun, 16 May 2010 18:20:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.lateralcode.com/?p=687#comment-1097</guid>
		<description>Nice article .nowadays there&#039;s  another sort of pagination similar to facebook and twitter . 
it&#039;s worth reading , see it guys 
http://youhack.me/2010/05/14/an-alternative-to-pagination-facebook-and-twitter-style/</description>
		<content:encoded><![CDATA[<p>Nice article .nowadays there&#8217;s  another sort of pagination similar to facebook and twitter .<br />
it&#8217;s worth reading , see it guys<br />
<a href="http://youhack.me/2010/05/14/an-alternative-to-pagination-facebook-and-twitter-style/" rel="nofollow">http://youhack.me/2010/05/14/an-alternative-to-pagination-facebook-and-twitter-style/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dvdljns</title>
		<link>http://www.lateralcode.com/simple-php-gallery-pagination/#comment-1079</link>
		<dc:creator>dvdljns</dc:creator>
		<pubDate>Fri, 07 May 2010 05:51:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.lateralcode.com/?p=687#comment-1079</guid>
		<description>I am trying to use your script but have one problem. everything works fine untill I click on the thumbnail to see the full size image then it shows up larger then my screen. is there any way to get he script to detect the screen size and give the image that size. If I just go to the folder and click on the image it shows up the right size, so I probally got something wrong. But do not know enough to fix it. can you help me here.</description>
		<content:encoded><![CDATA[<p>I am trying to use your script but have one problem. everything works fine untill I click on the thumbnail to see the full size image then it shows up larger then my screen. is there any way to get he script to detect the screen size and give the image that size. If I just go to the folder and click on the image it shows up the right size, so I probally got something wrong. But do not know enough to fix it. can you help me here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dman99</title>
		<link>http://www.lateralcode.com/simple-php-gallery-pagination/#comment-1003</link>
		<dc:creator>dman99</dc:creator>
		<pubDate>Wed, 24 Feb 2010 08:10:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.lateralcode.com/?p=687#comment-1003</guid>
		<description>I saw some people asking if it were possible to have the newest results displayed first.  This is exactly how I wanted it to function, so I rewrote the script using sort() and array.  This will allow you to sort the pictures however you wish.  All of my images were named with time(), so the larger the name, the newer the image.
&lt;?php
	# SETTINGS
	$max_width = 100;
	$max_height = 100;
	$per_page = 10;
	
	$page = $_GET[&#039;page&#039;];
	
	$has_previous = false;
	$has_next = false;
	
	function getPictures() {
		global $page, $per_page, $has_previous, $has_next;
		if ( $handle = opendir(&quot;.&quot;) ) {
			$files = array();
			while ( ($file = readdir($handle)) !== false ) {
				$files[] = $file;
			}
			Rsort($files);
			$lightbox = rand();
			echo &#039;&#039;;
			
			$skip = $page * $per_page;		
			$count = $skip;
			
			if ( $skip != 0 ) {
				$has_previous = true;
			}
			if ( ! in_array(&quot;thumbs&quot;, $files) ) {
				mkdir(&#039;thumbs&#039;);
			}

			while ( ($count &lt; $per_page + $skip) &amp;&amp; isset($files[$count]) ) {
				$count++;
				if ( !is_dir($files[$count]) &amp;&amp; ($type = getPictureType(&quot;img/&quot;.$files[$count])) != &#039;&#039; ) {
					if ( ! file_exists(&#039;thumbs/&#039;.$files[$count]) ) {
						makeThumb($files[$count], $type );
					}
					echo &#039;&lt;a href=&quot;&#039;.$files[$count].&#039;&quot; rel=&quot;nofollow&quot;&gt;&#039;;
					echo &#039;&#039;;
					echo &#039;&lt;/a&gt;&#039;;
					
					
				}
			}
			echo &#039;&#039;;
			
			while ( isset($files[$count]) ) {
				if ( !is_dir($files[$count]) &amp;&amp; ($type = getPictureType($files[$count])) != &#039;&#039; ) {
					$has_next = true;
					break;
				}
				$count++;
			}
		}
	}
	
	function getPictureType($file) {
		$split = explode(&#039;.&#039;, $file); 
		$ext = $split[count($split) - 1];
		if ( preg_match(&#039;/jpg&#124;jpeg/i&#039;, $ext) ) {
			return &#039;jpg&#039;;
		} else if ( preg_match(&#039;/png/i&#039;, $ext) ) {
			return &#039;png&#039;;
		} else if ( preg_match(&#039;/gif/i&#039;, $ext) ) {
			return &#039;gif&#039;;
		} else {
			return &#039;&#039;;
		}
	}
	
	function makeThumb( $file, $type ) {
		global $max_width, $max_height;
		if ( $type == &#039;jpg&#039; ) {
			$src = imagecreatefromjpeg($file);
		} else if ( $type == &#039;png&#039; ) {
			$src = imagecreatefrompng($file);
		} else if ( $type == &#039;gif&#039; ) {
			$src = imagecreatefromgif($file);
		}
		if ( ($oldW = imagesx($src)) 




Pictures


body {
	margin:0 auto;
}
#pictures li {
	float:left;
	height:px;
	list-style:none outside;
	width:px;
	text-align:center;
}
img {
	border:0;
	outline:none;
}
.prev {
	float:left;
}
.next {
	float:right;
}








&lt;?php
	if ( $has_previous )
		echo &#039;&lt;a href=&quot;?page=&#039;.($page - 1).&#039;&quot; rel=&quot;nofollow&quot;&gt;&#8592; Previous Page&lt;/a&gt;&#039;;

	if ( $has_next )
		echo &#039;&lt;a href=&quot;?page=&#039;.($page + 1).&#039;&quot; rel=&quot;nofollow&quot;&gt;Next Page &#8594;&lt;/a&gt;&#039;;
?&gt;







</description>
		<content:encoded><![CDATA[<p>I saw some people asking if it were possible to have the newest results displayed first.  This is exactly how I wanted it to function, so I rewrote the script using sort() and array.  This will allow you to sort the pictures however you wish.  All of my images were named with time(), so the larger the name, the newer the image.<br />
&lt;?php<br />
	# SETTINGS<br />
	$max_width = 100;<br />
	$max_height = 100;<br />
	$per_page = 10;</p>
<p>	$page = $_GET[&#039;page&#039;];</p>
<p>	$has_previous = false;<br />
	$has_next = false;</p>
<p>	function getPictures() {<br />
		global $page, $per_page, $has_previous, $has_next;<br />
		if ( $handle = opendir(&quot;.&quot;) ) {<br />
			$files = array();<br />
			while ( ($file = readdir($handle)) !== false ) {<br />
				$files[] = $file;<br />
			}<br />
			Rsort($files);<br />
			$lightbox = rand();<br />
			echo &#039;&#8217;;</p>
<p>			$skip = $page * $per_page;<br />
			$count = $skip;</p>
<p>			if ( $skip != 0 ) {<br />
				$has_previous = true;<br />
			}<br />
			if ( ! in_array(&#8220;thumbs&#8221;, $files) ) {<br />
				mkdir(&#8216;thumbs&#8217;);<br />
			}</p>
<p>			while ( ($count &lt; $per_page + $skip) &amp;&amp; isset($files[$count]) ) {<br />
				$count++;<br />
				if ( !is_dir($files[$count]) &amp;&amp; ($type = getPictureType(&quot;img/&quot;.$files[$count])) != &#039;&#039; ) {<br />
					if ( ! file_exists(&#039;thumbs/&#039;.$files[$count]) ) {<br />
						makeThumb($files[$count], $type );<br />
					}<br />
					echo &#039;<a href="'.$files[$count].'" rel="nofollow">&#8216;;<br />
					echo &#8221;;<br />
					echo &#8216;</a>&#8216;;</p>
<p>				}<br />
			}<br />
			echo &#8221;;</p>
<p>			while ( isset($files[$count]) ) {<br />
				if ( !is_dir($files[$count]) &amp;&amp; ($type = getPictureType($files[$count])) != &#8221; ) {<br />
					$has_next = true;<br />
					break;<br />
				}<br />
				$count++;<br />
			}<br />
		}<br />
	}</p>
<p>	function getPictureType($file) {<br />
		$split = explode(&#8216;.&#8217;, $file);<br />
		$ext = $split[count($split) - 1];<br />
		if ( preg_match(&#8216;/jpg|jpeg/i&#8217;, $ext) ) {<br />
			return &#8216;jpg&#8217;;<br />
		} else if ( preg_match(&#8216;/png/i&#8217;, $ext) ) {<br />
			return &#8216;png&#8217;;<br />
		} else if ( preg_match(&#8216;/gif/i&#8217;, $ext) ) {<br />
			return &#8216;gif&#8217;;<br />
		} else {<br />
			return &#8221;;<br />
		}<br />
	}</p>
<p>	function makeThumb( $file, $type ) {<br />
		global $max_width, $max_height;<br />
		if ( $type == &#8216;jpg&#8217; ) {<br />
			$src = imagecreatefromjpeg($file);<br />
		} else if ( $type == &#8216;png&#8217; ) {<br />
			$src = imagecreatefrompng($file);<br />
		} else if ( $type == &#8216;gif&#8217; ) {<br />
			$src = imagecreatefromgif($file);<br />
		}<br />
		if ( ($oldW = imagesx($src)) </p>
<p>Pictures</p>
<p>body {<br />
	margin:0 auto;<br />
}<br />
#pictures li {<br />
	float:left;<br />
	height:px;<br />
	list-style:none outside;<br />
	width:px;<br />
	text-align:center;<br />
}<br />
img {<br />
	border:0;<br />
	outline:none;<br />
}<br />
.prev {<br />
	float:left;<br />
}<br />
.next {<br />
	float:right;<br />
}</p>
<p>&lt;?php<br />
	if ( $has_previous )<br />
		echo &#039;<a href="?page='.($page - 1).'" rel="nofollow">&larr; Previous Page</a>&#8216;;</p>
<p>	if ( $has_next )<br />
		echo &#8216;<a href="?page='.($page + 1).'" rel="nofollow">Next Page &rarr;</a>&#8216;;<br />
?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: milena</title>
		<link>http://www.lateralcode.com/simple-php-gallery-pagination/#comment-978</link>
		<dc:creator>milena</dc:creator>
		<pubDate>Sat, 30 Jan 2010 19:14:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.lateralcode.com/?p=687#comment-978</guid>
		<description>lightbox doesnt work as it should, only half of the screen is black when zoom picture?? Does anyone had this problem???</description>
		<content:encoded><![CDATA[<p>lightbox doesnt work as it should, only half of the screen is black when zoom picture?? Does anyone had this problem???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boris</title>
		<link>http://www.lateralcode.com/simple-php-gallery-pagination/#comment-958</link>
		<dc:creator>Boris</dc:creator>
		<pubDate>Thu, 14 Jan 2010 13:46:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.lateralcode.com/?p=687#comment-958</guid>
		<description>I know this is an old question but I have recently been looking at the question of a function which would read the description of an image from a single text file. I saved the file as described: &#039;description.txt&#039; and added the resulting file to the root, but still no result???</description>
		<content:encoded><![CDATA[<p>I know this is an old question but I have recently been looking at the question of a function which would read the description of an image from a single text file. I saved the file as described: &#8216;description.txt&#8217; and added the resulting file to the root, but still no result???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boris</title>
		<link>http://www.lateralcode.com/simple-php-gallery-pagination/#comment-955</link>
		<dc:creator>Boris</dc:creator>
		<pubDate>Wed, 13 Jan 2010 17:26:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.lateralcode.com/?p=687#comment-955</guid>
		<description>I am a nubi at php but have been looking for this function in a site I&#039;m building ... however I cannot add any includes, (footer, menu etc) if I add an include and can add some text characters within the body of the include, these characters are displayed but none of the gallery images can be seen.</description>
		<content:encoded><![CDATA[<p>I am a nubi at php but have been looking for this function in a site I&#8217;m building &#8230; however I cannot add any includes, (footer, menu etc) if I add an include and can add some text characters within the body of the include, these characters are displayed but none of the gallery images can be seen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 2desdes</title>
		<link>http://www.lateralcode.com/simple-php-gallery-pagination/#comment-949</link>
		<dc:creator>2desdes</dc:creator>
		<pubDate>Mon, 11 Jan 2010 18:08:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.lateralcode.com/?p=687#comment-949</guid>
		<description>It`s possible to add an alphabetic file name ordering when linting the images?
Thank you!</description>
		<content:encoded><![CDATA[<p>It`s possible to add an alphabetic file name ordering when linting the images?<br />
Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ryan</title>
		<link>http://www.lateralcode.com/simple-php-gallery-pagination/#comment-896</link>
		<dc:creator>ryan</dc:creator>
		<pubDate>Sun, 29 Nov 2009 22:18:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.lateralcode.com/?p=687#comment-896</guid>
		<description>Here&#039;s a simple image pagination that you don&#039;t need to use Lightbox for...I never did get the above script to work...the directory gets image uploads only...

&lt;?
$directory = &quot;images/uploads/&quot;;
$filecount = count(glob(&quot;&quot; . $directory . &quot;*.*&quot;));
//echo &quot;THE TOTAL COUNT &quot; . $filecount  . &quot;&quot;;


$num_rows = 1;

if($_GET[&#039;start&#039;]){
$start = $_GET[&#039;start&#039;];
} else {
  $start = 1;
}

$prev_start = $start - $num_rows;
$next_start = $start + $num_rows;

//echo &quot;prev_start: &quot; . $prev_start . &quot;&quot;;
//echo &quot;next_start: &quot; . $next_start . &quot;&quot;;
if ($prev_start &gt; 0) {
   echo &#039;&lt;a href=&quot;photos.php?start=&#039; . $prev_start . &#039;&quot; rel=&quot;nofollow&quot;&gt;previous picture&lt;/a&gt; &#039;;
 }

if ($prev_start &gt; 0 &amp;&amp; $next_start &lt;= $filecount) {
   echo &#039;  &#124; &#039;;
 }
 
if ($next_start &lt;= $filecount) {
 echo &#039;&lt;a href=&quot;photos.php?start=&#039; . $next_start . &#039;&quot; rel=&quot;nofollow&quot;&gt;next picture&lt;/a&gt;&#039;;
 }
echo &quot; &#160; (&quot; . $filecount . &quot; pix)&quot; . &quot; &quot; . &quot;\n&quot; . &quot;&quot; . &quot;\n&quot;;
$loopcount = 1;
$handle = @opendir(&quot;images/uploads/&quot;);
if(!empty($handle)) {
  while(false !== ($file = readdir($handle))) {
    if (strlen($file) &gt; 4) {
      chmod(&quot;images/uploads/&quot; .$file, 644);
      if (($loopcount &gt; ($start - 1)) &amp;&amp; ($loopcount &lt; ($start + $num_rows))) {
        echo &quot;&quot; . &quot;\n&quot;;
        echo &#039;#&#039;  .$loopcount . &#039;&lt;a href=&quot;images/uploads/&#039; . $file . &#039;&quot; rel=&quot;nofollow&quot;&gt;&lt;/a&gt;&#039; . &quot;\n&quot;;
        $imagecount++;
      }//end filecount loop
     $loopcount++;
    }//end strlen loop
  } //end while
} //end emptyhandle loop

echo &quot;&quot;;

/*if(!empty($handle)) {
  while(false !== ($file = readdir($handle))) {
     if(is_file(&quot;images/uploads/&quot; . $file)) {
       chmod(&quot;images/uploads/&quot; .$file, 644);
       echo &#039;&lt;a href=&quot;images/uploads/&#039; . $file . &#039;&quot; rel=&quot;nofollow&quot;&gt;&lt;/a&gt;&#039;;
      }
   }  
}*/

closedir($handle);
?&gt;</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a simple image pagination that you don&#8217;t need to use Lightbox for&#8230;I never did get the above script to work&#8230;the directory gets image uploads only&#8230;</p>
<p>&lt;?<br />
$directory = &#8220;images/uploads/&#8221;;<br />
$filecount = count(glob(&#8220;&#8221; . $directory . &#8220;*.*&#8221;));<br />
//echo &#8220;THE TOTAL COUNT &#8221; . $filecount  . &#8220;&#8221;;</p>
<p>$num_rows = 1;</p>
<p>if($_GET['start']){<br />
$start = $_GET['start'];<br />
} else {<br />
  $start = 1;<br />
}</p>
<p>$prev_start = $start &#8211; $num_rows;<br />
$next_start = $start + $num_rows;</p>
<p>//echo &#8220;prev_start: &#8221; . $prev_start . &#8220;&#8221;;<br />
//echo &#8220;next_start: &#8221; . $next_start . &#8220;&#8221;;<br />
if ($prev_start &gt; 0) {<br />
   echo &#8216;<a href="photos.php?start=' . $prev_start . '" rel="nofollow">previous picture</a> &#8216;;<br />
 }</p>
<p>if ($prev_start &gt; 0 &amp;&amp; $next_start &lt;= $filecount) {<br />
   echo &#8216;  | &#8216;;<br />
 }</p>
<p>if ($next_start &lt;= $filecount) {<br />
 echo &#8216;<a href="photos.php?start=' . $next_start . '" rel="nofollow">next picture</a>&#8216;;<br />
 }<br />
echo &#8221; &nbsp; (&#8221; . $filecount . &#8221; pix)&#8221; . &#8221; &#8221; . &#8220;\n&#8221; . &#8220;&#8221; . &#8220;\n&#8221;;<br />
$loopcount = 1;<br />
$handle = @opendir(&#8220;images/uploads/&#8221;);<br />
if(!empty($handle)) {<br />
  while(false !== ($file = readdir($handle))) {<br />
    if (strlen($file) &gt; 4) {<br />
      chmod(&#8220;images/uploads/&#8221; .$file, 644);<br />
      if (($loopcount &gt; ($start &#8211; 1)) &amp;&amp; ($loopcount &lt; ($start + $num_rows))) {<br />
        echo &#8220;&#8221; . &#8220;\n&#8221;;<br />
        echo &#8216;#&#8217;  .$loopcount . &#8216;<a href="images/uploads/' . $file . '" rel="nofollow"></a>&#8216; . &#8220;\n&#8221;;<br />
        $imagecount++;<br />
      }//end filecount loop<br />
     $loopcount++;<br />
    }//end strlen loop<br />
  } //end while<br />
} //end emptyhandle loop</p>
<p>echo &#8220;&#8221;;</p>
<p>/*if(!empty($handle)) {<br />
  while(false !== ($file = readdir($handle))) {<br />
     if(is_file(&#8220;images/uploads/&#8221; . $file)) {<br />
       chmod(&#8220;images/uploads/&#8221; .$file, 644);<br />
       echo &#8216;<a href="images/uploads/' . $file . '" rel="nofollow"></a>&#8216;;<br />
      }<br />
   }<br />
}*/</p>
<p>closedir($handle);<br />
?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pogi</title>
		<link>http://www.lateralcode.com/simple-php-gallery-pagination/#comment-802</link>
		<dc:creator>Pogi</dc:creator>
		<pubDate>Fri, 09 Oct 2009 21:30:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.lateralcode.com/?p=687#comment-802</guid>
		<description>Hello, thanks for this simple gallery with pagination. Is there a way you could make this a plugin for wordpress? I&#039;m using wordpress, and I usually post a batch of icons in each post. Is there a way I could implement this into wordpress? Thanks again.</description>
		<content:encoded><![CDATA[<p>Hello, thanks for this simple gallery with pagination. Is there a way you could make this a plugin for wordpress? I&#8217;m using wordpress, and I usually post a batch of icons in each post. Is there a way I could implement this into wordpress? Thanks again.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
