All pastes #673879 Raw Edit

Untitled

public text v1 · immutable
#673879 ·published 2007-08-28 19:28 UTC
rendered paste body
				<?php
					if($_GET['page']=='' && $_GET['del']) {
						$page = $_GET['page'];
						$page = $page==''?1:$page;
						$nPage = $page + 1;
						$pPage = $page - 1;
						$pPage = $page==1?'Previous Page':'<a href="pictures.php?page='.$pPage.'">Previous Page</a> ';
						$nPage = "| <a href='pictures.php?page=".$nPage."'>Next Page</a>";
						$initdir = 'http://seekond.com/images';
						$dh  = opendir($initdir);
						while (false !== ($filename = readdir($dh))) {
							$ext = mb_convert_case(substr($filename,-4), MB_CASE_UPPER, "UTF-8");
							if($ext==".JPG"||$ext=="JPEG"||$ext==".GIF") { $files[] = $filename; }
						}
						$c = count($files);
						$nPage=$c<($page+1)*20+1?'':$nPage;
						$c=$c-2;
						$cc = ($page-1)*20+1;
						$cf = ($page-1)*20+21;
						for($i=$cc;$i<$cf;$i++) {
							$ext = mb_convert_case(substr($files[$i],-4), MB_CASE_UPPER, "UTF-8");
							if($ext==".JPG"||$ext=="JPEG"||$ext==".GIF") {
								echo '<a href="http://seekond.com/images/'.$files[$i].'" class="highslide" onclick="return hs.expand(this)"><img src="images/'.$files[$i].'" title="Click to enlarge" width="120px" height="80px" />'.$i.'</a>&nbsp;&nbsp;';
							}
						}
						echo "<br />".$pPage.$nPage;
					}
				?>