define('MAXPAGE',1);
define('LIBDIR', '../m/admin/_inc/');
require_once( LIBDIR."config.php" );
require_once( LIBDIR."tool.php" );
require_once( LIBDIR."form.php" );
require_once( LIBDIR."data.php" );
require_once( LIBDIR."gazou.php" );
require_once( LIBDIR."db.php" );
$tmp_y='';
$dir=fnc_get('d');
$yyy=0;
define('MYPAGE', 'dirimg.php?d='.$dir);
#条件検索画面、エリア検索画面用
db_open();
$sql="select title from tbl_dirimg where delflg!='1' and dirname='".dbdata_set($dir)."'";
$title=get_sqldata($sql);
$sql="select memostr from tbl_dirimg where delflg!='1' and dirname='".dbdata_set($dir)."'";
$memostr=get_sqldata($sql);
define('IMGDIR', '../uploadimgdir/'.$dir.'/');
$rs_tmp=array();
$rs_list=array();
#page
$pg = fnc_get('n');
if (!is_numeric($pg) || $pg<1){
$pg=0;
}else{
$pg-=1;
}
if ($pg>0){
if (fnc_get('mode')=='kikai'){
$pgmsg=' <<前へ ';
}else{
$pgmsg=' <<前へ ';
}
}
for($i=4;$i>=0;$i--){
if (($pg-($i))>0){
if ($i==4){
$pgmsg.=' ... | ';
}else{
$pgmsg.=' '.($pg-($i)).' | ';
}
}
}
$objDir=dir(IMGDIR);
$cnt=0;
while($objFle=$objDir->read()){
if ($objFle!='.' && $objFle!='..'){
if (strpos($objFle,'.jpg')>0 || strpos($objFle,'.JPG')>0 || strpos($objFle,'.jpeg')>0 || strpos($objFle,'.JPEG')>0){
$rs_tmp+=array($cnt=>$objFle);
$cnt++;
}
}
}
$objDir->close();
asort($rs_tmp);
$icnt=0;
$cnt=0;
foreach($rs_tmp as $key => $vl){
if ((MAXPAGE*$pg)<=$cnt && $cnt<(MAXPAGE+(MAXPAGE*$pg))){
$icnt++;
$img=''.fnc_img_400(IMGDIR.$vl).'';
$himg=IMGDIR.$vl;
$flg_exists=1;
}
$cnt++;
}
if ($pg!='0' || $cnt>MAXPAGE){
$pgmsg.=''.($pg+1).' | ';
}
for($i=1;$i<=5;$i++){
if ($cnt>(MAXPAGE*($pg+$i))){
if ($i==5){
$pgmsg.=' ... | ';
}else{
$pgmsg.=' '.($pg+($i+1)).' | ';
}
}
}
if (strlen($pgmsg)>3){
$pgmsg=substr($pgmsg,0,strlen($pgmsg)-2);
}
if ($cnt>(MAXPAGE*($pg+1))){
$pgmsg.=' 次へ>> ';
}
function fnc_img_150($path) {
list($w, $h) = getimagesize($path);
if ($w>$h && $w>0){
$x=150;
$y=floor(150*($h/$w));
}elseif ($h>0){
$x=floor(150*($w/$h));
$y=150;
}
return '';
}
function fnc_img_400($path) {
global $yyy;
list($w, $h) = getimagesize($path);
$kijyun=480;
if ($w>$h && $w>0){
$x=$kijyun;
$y=floor($kijyun*($h/$w));
$yyy=floor(($kijyun-$y)/2);
}elseif ($h>0){
$x=floor($kijyun*($w/$h));
$y=$kijyun;
}
return '
';
}
?>