<?php
/*
+---------------------------------------------------+
| Name : NEATPIC (无数据版本)
+---------------------------------------------------+
| Created / Modify : 2003-12-27 / 2004-1-1
+---------------------------------------------------+
| Version : 1.1.8
+---------------------------------------------------+
| Author : walkerlee
+---------------------------------------------------+
| QQ : 808075
| Email : walkerlee@163.net
| Homepge : http://www.walkerlee.net
| BBS : http://www.walkerlee.net/bbs/
+---------------------------------------------------+
| Note :
|
| 1.本软件对于非商业用户完全免费,如果要使用在商业用途
| 方面,必须取得作者的授权.
|
| 2.你可以任意传播以及修改本程序,但不能以任何形式删除
| 本程序的版权.请记住,保留作者版权是对作者工作的尊敬.
|
| 3.如果有问题,可以通过上面提供的方式进行解答,但作者
| 学业繁重,如果不能及时或者不解答,请谅解.
|
| 4.作者对使用该程序导致的问题,不予以负责.
|
| 5.本程序版权归 NeatStudio 所有.禁止任何侵权行为!
|
+---------------------------------------------------+
*/
/*
+----------------------------------+
| Config
+----------------------------------+
| C / M : 2003-12-28 / 2003-12-30
+----------------------------------+
*/
$configAdminPass = "neatpic"; //管理员密码
$configWantedPass = false; //查看相册是否需要密码 需要:true 不需要:false
$configOpenGzip = true; //是否压缩页面 压缩:true 不压缩:false
$configShowPicSize = false; //是否显示图片的大小 (单位:KB) 显示:true 不显示:false (注:不显示,程序运行速度将提高)
$configExt = array('jpg', 'jpeg', 'gif', 'png'); //图片类型
$strLenMax = 25; //文件名字限制长度 (防止撑破表格)
$configEachPageMax = 20; //每页显示的图片数目
$configEachLineMax = 5; //每行显示的图片数目
$configTDWidth = 185; //表格宽度
$configTDHeight = 150; //表格高度
$configPageMax = 5; //分页前后预览数
$configTilte = "NEATPIC (目录直读版)"; //标题
$configVer = "1.1.8"; //程序版本号
/*
+----------------------------------+
| Class
+----------------------------------+
| C / M : 2003-12-28 / 2003-12-29
+----------------------------------+
*/
Class neatpic
{
var $configWantedPass;
var $configOpenGzip;
var $configShowPicSize;
var $configExt = array();
var $strLenMax;
var $configEachPageMax;
var $configEachLineMax;
var $configTDHeight;
var $configTDWidth;
var $configPageMax;
var $configTilte;
var $configVer;
var $timer;
var $usedTime;
var $pathLevelNum;
var $nowDirNmae;
var $dirNum;
var $picNum;
var $pageTotal;
var $start;
var $offSet;
var $pageStart;
var $pageMiddle;
var $pageEnd;
var $temp;
var $picID;
var $picRealSizeWidth;
var $picRealSizeHeight;
var $picArray = array();
var $picFileArray = array();
var $dirArray = array();
var $dirNameArray = array();
var $pathArray = array();
var $pathError = false;
var $page;
var $path;
var $style;
/*
+----------------------------------+
| Constructor
+----------------------------------+
| C / M : 2003-12-28 / 2003-12-29
+----------------------------------+
*/
function neatpic($configWantedPass, $configOpenGzip, $configShowPicSize, $configExt, $strLenMax, $configEachPageMax, $configEachLineMax, $configTDHeight, $configTDWidth, $configPageMax, $configTilte, $configVer)
{
$this->configWantedPass = $configWantedPass;
$this->configOpenGzip = $configOpenGzip;
$this->configShowPicSize = $configShowPicSize;
$this->configExt = $configExt;
$this->strLenMax = $strLenMax;
$this->configEachPageMax = $configEachPageMax;
$this->configEachLineMax = $configEachLineMax;
$this->configTDHeight = $configTDHeight ;
$this->configTDWidth = $configTDWidth;
$this->configPageMax = $configPageMax;
$this->configTilte = $configTilte;
$this->configVer = $configVer;
}
/*
+----------------------------------+
| Open gzip
+----------------------------------+
| C / M : 2003-12-29 / --
+----------------------------------+
*/
function gzip()
{
if ($this->openGzip == true) ob_start("ob_gzhandler");
}
/*
+----------------------------------+
| Get the querystring
+----------------------------------+
| C / M : 2003-12-28 / 2003-12-29
+----------------------------------+
*/
function getVars()
{
$this->page = urldecode($_GET['page']);
$this->path = $_GET['path'];
$this->style = $_GET['style'];
if (!$this->style) $this->style = "small";
if (!$this->path) $this->path = ".";
}
/*
+----------------------------------+
| Check error
+----------------------------------+
| C / M : 2003-12-28 / 2004-1-1
+----------------------------------+
*/
function checkError()
{
if (preg_match("/\.\./", $this->path)) $pathError = true;
if (!is_dir($this->path)) $pathError = true;
if ($pathError == true)
{
header("location:".$_SERVER['PHP_SELF']);
exit;
}
}
/*
+----------------------------------+
| Path array initialize
+----------------------------------+
| C / M : 2003-12-28 / 2003-12-29
+----------------------------------+
*/
function pathArrayInitialize()
{
if (!$this->path) $this->path = ".";
$this->pathArray = explode("/", $this->path);
$this->pathLevelNum = count($this->pathArray);
$this->nowDirName = $this->pathArray[$this->pathLevelNum - 1];
if ($this->nowDirName == ".") $this->nowDirName = "根目录";
}
/*
+----------------------------------+
| Timer
+----------------------------------+
| C / M : 2003-12-29 / --
+----------------------------------+
*/
function timer()
{
$time = explode( " ", microtime());
$usec = (double)$time[0];
$sec = (double)$time[1];
$this->timer = $usec + $sec;
}
/*
+----------------------------------+
| Show used time
+----------------------------------+
| C / M : 2003-12-29 / --
+----------------------------------+
*/
function usedTime()
{
$startTime = $this->timer;
$this->timer();
$endTime = $this->timer;
$usedTime = $endTime - $startTime;
$this->usedTime = sprintf("%0.4f", $usedTime);
}
/*
+----------------------------------+
| Make over direct
+----------------------------------+
| C / M : 2003-12-28 / 2003-12-29
+----------------------------------+
*/
function makeOverdirect()
{
$overPath = ".";
for($i = 1; $i < $this->pathLevelNum - 1; $i++)
{
$overPath = $overPath."/".$this->pathArray[$i];
}
$this->dirArray[] = $overPath;
$this->dirNameArray[] = "上级目录";
}
/*
+----------------------------------+
| GetFileExt
+----------------------------------+
| C / M : 2003-12-28 / --
+----------------------------------+
*/
function getFileExt($fileName)
{
$pos = strrpos($fileName, '.');
return strtolower(substr($fileName, $pos+1, (strlen($fileName)-$pos-1)));
}
/*
+----------------------------------+
| Make direct list
+----------------------------------+
| C / M : 2003-12-28 / 2003-12-29
+----------------------------------+
*/
function makeDirList()
{
$dir = dir($this->path);
while($file = $dir->read())
{
if ($file <> "." and $file <> "..")
{
$fileName = $file;
$file = $this->path."/".$file;
if (is_dir($file))
{
$this->dirArray[] = $file;
$this->dirNameArray[] = $fileName;
}
if (in_array($this->getFileExt($file), $this->configExt))
{
$this->picArray[] = $file;
$this->picFileArray[] = $fileName;
}
}
}
}
/*
+----------------------------------+
| Get each array number
+----------------------------------+
| C / M : 2003-12-28 / --
+----------------------------------+
*/
function getEachArrayNum()
{
$this->dirNum = count($this->dirArray);
$this->picNum = count($this->picArray);
}
/*
+----------------------------------+
| Make page bar
没有合适的资源?快使用搜索试试~ 我知道了~
NEATPIC 图片管理程序(目录直读版) v1.1.8
共1个文件
php:1个
需积分: 50 73 下载量 128 浏览量
2004-08-19
16:40:37
上传
评论 2
收藏 8KB RAR 举报
温馨提示
简单实用,上传到图片目录,就可以列出图片目录。支持缩图模式和真实尺寸模式。无需数据库,无需生成任何数据文件。支持无限向下读取子目录。支持分页。多种参数可供您选择。同时,支持登录认证
资源推荐
资源详情
资源评论
收起资源包目录
20040819044387.rar (1个子文件)
neatpic_rdv_118
neatpic_rdv_118
index.php 27KB
共 1 条
- 1
资源评论
xintc110
- 粉丝: 0
- 资源: 1953
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功