Странициране!?!

kristiqn2

Registered
Здравейте,
Как мога да сложа странициране на тази галерия?
PHP:
<?php 
 // PHP Gallery Without Database 
 // By Dido_net 

 $dir = "img/"; // Директорията с картинките... 
 $picsOnRow = 4; // Картинки на ред... 
 $picsWidth = 120; // Ширина на картинките в пиксели... 
 $picsHeight = 120;// Дължина на картинките в пиксели...
 $position = 2; // Позиция. 1 = Ляво, 2 = Центрирано, 3 = Дясно... 
 $tableBorder = 5; // Бордер на таблицата... 
 $fileTypes = array("jpg", "gif", "png","gif","bmp"); // Файлови формати... 

 if($position==1)$pos=' align="left"'; 
 if($position==2)$pos=' align="center"'; 
 if($position==3)$pos=' align="right"'; 
 echo "<table border=\"".$tableBorder."\"".$pos.">"; 
 if ($handle = @opendir($dir)) { 
 $fileCount = 0; 
 while (false !== ($file = readdir($handle))) { 
 if ($file != "." && $file != "..") { 

 $ext = end(explode(".", $file)); 
 if(in_array($ext, $fileTypes)){ 
 if($fileCount == 0){ $fileCount = 1; echo "\n<tr>\n"; } 
 if($fileCount == $picsOnRow) $closeTr = "</tr>\n<tr>\n"; 
 echo '<td><a href="'.$dir.$file.'" target="_blank"><img src="'.$dir.$file.'" width="'.$picsWidth.'" Height="'.$picsHeight.'" border="0"></a>'."</td>\n"; 
 echo $closeTr; 
 $closeTr = false; 
 if($fileCount == $picsOnRow) $fileCount = 0; 
 $fileCount++; 
 } 
 } 
 } 
 closedir($handle); 
 } else echo "Can't read dir <b>( ".$dir." )</b>"; 
 echo '</tr>'; 
 echo '</table>'."\n"; 
 ?>
 

Back
Горе