[問題] 相片張數分頁的問題?
請問各位高手大大
使用下列程式碼的方式程現照片
但不管多少照片都呈現在都一頁
我也寫一個分頁程式,但不管我按
第一頁或第二頁它都呈現1~14張
(我一頁呈現14張)
請各位大大指導一下 我是否那邊
有錯 謝謝
<?php include "header.php" ?>
<link rel="stylesheet" rev="contents" href="Styles/album.css" />
<?php
if( is_null( $_GET['book'] ) ) exit;
$book = $_GET['book'];
$dirs = scandir("Album");
$AlbumName = iconv("big5","utf-8", $dirs[$book] );
$img = scandir( "Album/".$dirs[$book])
?>
<h1>活動剪影 - <?=$AlbumName?></h1>
<div style="width:90%; overflow:hidden; margin-bottom:50px;">
<?php
$listnum=14; //顯示的張數
$bb=ceil(count($img)/$listnum); //頁數 count($img):總數
if($k<=$bb)
{
$start=($k-1)*13+1; //開始的筆數
$D =$k*13; //結束的筆數
for($i=$start ;$i<=$D; $i++ )
{
$imgPath = "Album/".$dirs[$book]."/".$img[$i];
if( is_dir($imgPath) ) continue;
$photoName = iconv( "big5", "utf-8", $img[$i] );
if( $photoName == "Thumbs.db" ) continue;
$size = getimagesize( $imgPath );
if( $size[0] > $size[1] )
{
$ratio = 100/$size[0];
$height = $size[1]*$ratio;
$limit = ' width="100" style="margin-top:'.round((100-$height)/2).'px;
margin-bottom:'.round((100-$height)/2).'px" ';
}
else
$limit = ' height="100" ';
?>
<li class="photoLi" onmouseover="Over(this)" onmouseout="Out(this)"
onclick="showPic(<?=$i?>)">
<img src="<?=iconv("big5","utf-8",$imgPath)?>" border="0" <?=$limit?>
/><br />
<span style="font-size:12px"><?=$photoName?></span>
</li>
<?
}}
?>
<?php
?>
</div>
<?php
for($k=1;$k<$bb;$k++)
{ ?>
<a href="AlbumShow.php?book=<?=$book?>&page=<?=$k?>"><? echo $k?></a>
<?
}
?>
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 125.227.129.203
→
07/04 21:54, , 1F
07/04 21:54, 1F
→
07/04 22:21, , 2F
07/04 22:21, 2F