0

0

相册程序

php中文网

php中文网

发布时间:2016-06-21 09:05:52

|

1925人浏览过

|

来源于php中文网

原创

程序

  • /*
    +---------------------------------------------------+
    | name : neatpic (无数据版本)
    +---------------------------------------------------+
    | created / modify : 2003-12-27 / 2004-4-13
    +---------------------------------------------------+
    | version : 1.2.3
    +---------------------------------------------------+
    | author : walkerlee, gouki
    +---------------------------------------------------+
    | powered by neatstudio 2002 - 2004
    +---------------------------------------------------+
    | qq : 808075
    | email : walkerlee@163.net
    | homepge : http://www.neatstudio.com
    | bbs : http://www.neatstudio.com/bbs/
    +---------------------------------------------------+
    | note :
    |
    | 1.本软件对于非商业用户完全免费,如果要使用在商业用途
    | 方面,必须取得作者的授权.
    |
    | 2.你可以任意传播以及修改本程序,但不能以任何形式删除
    | 本程序的版权.请记住,保留作者版权是对作者工作的尊敬.
    |
    | 3.如果有问题,可以通过上面提供的方式进行解答,但作者
    | 学业繁重,如果不能及时或者不解答,请谅解.
    |
    | 4.作者对使用该程序导致的问题,不予以负责.
    |
    | 5.本程序版权归 neatstudio 所有.禁止任何侵权行为!
    |
    +---------------------------------------------------+
    */

    /*
    +----------------------------------+
    | Config
    +----------------------------------+
    | C / M : 2003-12-28 / 2004-4-13
    +----------------------------------+
    */

    $configAdminPass  = "neatpic";         //管理员密码 注:安全起见,默认密码不能登陆管理
    $configWantedPass  = false;          //查看相册是否需要密码 需要:true 不需要:false
    $configOpenGzip   = true;           //是否压缩页面 压缩:true 不压缩:false
    $configShowPicSize  = false;          //是否显示图片的大小 (单位:KB) 显示:true 不显示:false (注:不显示,程序运行速度将提高)
    $configExt    = array('jpg', 'jpeg', 'gif', 'png', 'bmp'); //图片类型
    $strLenMax    = 25;           //文件名字限制长度 (防止撑破表格)
    $configEachPageMax  = 16;           //每页显示的图片数目
    $configEachLineMax  = 4;           //每行显示的图片数目
    $configTDWidth   = 185;           //表格宽度
    $configTDHeight   = 138;           //表格高度
    $configPageMax   = 5;           //分页前后预览数
    $configDirPasswordFile = "neatpicPassword.php";      //密码文件
    $configTilte   = "欢迎光临“开花的草”相册。设有精美小图、动态图片、人物图片、图文并茂、网页横幅、站长相关。";      //标题
    $configVer    = "1.2.3";          //程序版本号

    /*
    +----------------------------------+
    | Class
    +----------------------------------+
    | C / M : 2003-12-28 / 2003-12-29
    +----------------------------------+
    */

    Class neatpic
    {
     var $configWantedPass;
     var $configAdminPass;
     var $configOpenGzip;
     var $configShowPicSize;
     var $configExt = array();
     var $strLenMax;
     var $configEachPageMax;
     var $configEachLineMax;
     var $configTDHeight;
     var $configTDWidth;
     var $configPageMax;
     var $configTilte;
     var $configVer;

     var $dirOptionList;
     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;
     var $c;

     /*
     +----------------------------------+
     | Constructor
     +----------------------------------+
     | C / M : 2003-12-28 / 2003-12-29
     +----------------------------------+
     */
     
     function neatpic($configWantedPass, $configAdminPass, $configDirPasswordFile, $configOpenGzip, $configShowPicSize, $configExt, $strLenMax, $configEachPageMax, $configEachLineMax, $configTDHeight, $configTDWidth, $configPageMax, $configTilte, $configVer)
     {
      $this->configWantedPass    = & $configWantedPass;
      $this->configAdminPass    = & $configAdminPass;
      $this->configDirPasswordFile  = & $configDirPasswordFile;
      $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->configOpenGzip == true)
       ob_start("ob_gzhandler");
     }

     /*
     +----------------------------------+
     | Get the querystring
     +----------------------------------+
     | C / M : 2003-12-28 / 2003-12-29
     +----------------------------------+
     */

     function getVars()
     {
      $this->page = rawurldecode($_GET['page']);
      $this->path = rawurldecode($_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 pathLevelNum - 1; $i++)
      {
       $overPath = $overPath."/".$this->pathArray[$i];
      }

      $this->dirArray[] = $overPath;
      $this->dirNameArray[] = "上级目录";

      for($i = 1; $i pathLevelNum; $i++)
      {
       $this->encodePath .= rawurlencode($this->pathArray[$i])."/";
      }
     }

     /*
     +----------------------------------+
     | 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->picEncodeArray[] = "./" . $this->encodePath . rawurlencode($fileName);
         $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
     +----------------------------------+
     | C / M : 2003-12-28 / 2003-12-29
     +----------------------------------+
     */

    Designer
    Designer

    Microsoft推出的图形设计应用程序

    下载

     function makePageBar()
     {

      $this->pageTotal = ceil($this->picNum / $this->configEachPageMax);

      if (!$this->page or $this->page page = 1;
      if ($this->page > $this->pageTotal) $this->page = $this->pageTotal;

      $this->offSet = $this->configEachPageMax * $this->page;
      $this->start = $this->offSet - $this->configEachPageMax;

      if ($this->start start = 0;
      if ($this->offSet > $this->picNum) $this->offSet = $this->picNum;

      $this->pageStart = $this->page - $this->configPageMax;
      if ($this->pageStart pageStart = 1;

      $this->pageMiddle = $this->page + 1;
      $this->pageEnd = $this->pageMiddle + $this->configPageMax;
      
      if ($this->page configPageMax) $this->pageEnd = $this->configPageMax * 2 + 1;
      if ($this->pageEnd > $this->pageTotal) $this->pageEnd = $this->pageTotal + 1;
     }

     /*
     +----------------------------------+
     | Show page bar
     +----------------------------------+
     | C / M : 2003-12-28 / 2003-12-29
     +----------------------------------+
     */

     function showPageBar()
     {
      print("

    \n");
      print("
    ");
      print("[ path)."&style=".$this->style."&page=".($this->page - 1)."\" title=\"上一页\">上一页 ] ");
      
      print("path)."&style=".$this->style."&page=1\"  title=\"首页\">\n");

      for ($i = $this->pageStart; $i page; $i++)
       print("
    path)."&style=".$this->style."&page=".$i."\" title=\"第 ".$i." 页\">[".$i."] ");

      printf("[%s]", $this->page);

      for ($i = $this->pageMiddle; $i pageEnd; $i++)
       print("path)."&style=".$this->style."&page=".$i."\" title=\"第 ".$i." 页\">[".$i."] ");

      print("...path)."&style=".$this->style."&page=".$this->pageTotal."\" title=\"第 " . $this->pageTotal . " 页\">[" . $this->pageTotal . "]\n");
      
      print(" path)."&style=".$this->style."&page=".$this->pageTotal."\" title=\"尾页\">>>\n");

      print("[ path)."&style=".$this->style."&page=".($this->page + 1)."\" title=\"下一页\">下一页 ] 共 ".$this->pageTotal." 页  当前所在第 ".$this->page." 页");
      print("

    ");
      print("

    \n");
     }

     /*
     +----------------------------------+
     | Set picture ID
     +----------------------------------+
     | C / M : 2003-12-28 / --
     +----------------------------------+
     */

     function setPicID($id)
     {
      $this->picID = $id;
     }

     /*
     +----------------------------------+
     | Get picture dimension
     +----------------------------------+
     | C / M : 2003-12-28 / --
     +----------------------------------+
     */

     function getPicDim()
     {    

      $picSize = GetImageSize($this->picArray[$this->picID]);
      preg_match("!width=\"(.*)\" height=\"(.*)\"!", $picSize['3'], $tempSize);

      $this->picRealSizeWidth  = $tempSize['1'];
      $this->picRealSizeHeight = $tempSize['2'];

      /*
      $tempSize['1'] configTDWidth ? $this->temp['Width'] = $tempSize['1'] : $this->temp['Width'] = $this->configTDWidth;
      $tempSize['2'] configTDHeight ? $this->temp['Height'] = $tempSize['2'] : $this->temp['Height'] = $this->configTDHeight;
      */

      $tWidth = $this->picRealSizeWidth / $this->configTDWidth;
      $tHeight = $this->picRealSizeHeight / $this->configTDHeight;

      if ($this->picRealSizeWidth > $this->configTDWidth OR $this->picRealSizeHeight > $this->configTDHeight)
      {
       if ($tWidth > $tHeight)
       {
        $this->temp['Width'] = $this->configTDWidth;
        $this->temp['Height'] = number_format($this->picRealSizeHeight / $tWidth);
       }
       elseif ($tWidth    {
        $this->temp['Height'] = $this->configTDHeight;
        $this->temp['Width'] = number_format($this->picRealSizeWidth / $tHeight);
       }
       else
       {
        $this->temp['Width'] = $this->configTDWidth;
        $this->temp['Height'] = $this->configTDHeight;
       }
      }
      else
      {
       $this->temp['Width'] = $this->picRealSizeWidth;
       $this->temp['Height'] = $this->picRealSizeHeight;
      }
     }
     /*
     +----------------------------------+
     | Show the title javascript
     +----------------------------------+
     | C / M : 2003-12-29 / 2003-12-30
     +----------------------------------+
     */

     function ShowJS()
     {
      print('
      <script><br>  /******************************************************************************<br>    NEATPIC Show Title<br>    Modified by: walkerlee<br>    Date: 2003-12-30<br>    Based upon:  Crossday Studio and http://www.cnzzz.com<br>  *******************************************************************************/</script>

      tPopWait=20;
      showPopStep=10;
      popOpacity=85;

      sPop=null;
      curShow=null;
      tFadeOut=null;
      tFadeIn=null;
      tFadeWaiting=null;

      document.write("

      document.write("");
      document.write("

    ");


      function showPopupText(){
       var o=event.srcElement;
       MouseX=event.x;
       MouseY=event.y;
       if(o.alt!=null && o.alt!="") { o.pop=o.alt;o.alt="" }
        if(o.title!=null && o.title!=""){ o.pop=o.title;o.title="" }
        if(o.pop) { o.pop=o.pop.replace("\n","
    "); o.pop=o.pop.replace("\n","
    "); }
       if(o.pop!=sPop) {
        sPop=o.pop;
        clearTimeout(curShow);
        clearTimeout(tFadeOut);
        clearTimeout(tFadeIn);
        clearTimeout(tFadeWaiting); 
        if(sPop==null || sPop=="") {
         popLayer.innerHTML="";
         popLayer.style.filter="Alpha()";
         popLayer.filters.Alpha.opacity=0; 
        } else {
         if(o.dyclass!=null) popStyle=o.dyclass
         else popStyle="cPopText";
         curShow=setTimeout("showIt()",tPopWait);
        }
       }
      }

      function showIt() {
       popLayer.className=popStyle;
       popLayer.innerHTML=\'
      \'+sPop+\'  

    \';
       popWidth=popLayer.clientWidth;
       popHeight=popLayer.clientHeight;
       if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
        else popLeftAdjust=0;
       if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
        else popTopAdjust=0;
       popLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
       popLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
       popLayer.style.filter="Alpha(Opacity=0)";
       fadeOut();
      }

      function fadeOut(){
       if(popLayer.filters.Alpha.opacity    popLayer.filters.Alpha.opacity+=showPopStep;
        tFadeOut=setTimeout("fadeOut()",1);
       }
      }

      document.onmouseover=showPopupText;
        
      ');
     }

     /*
     +----------------------------------+
     | Show css
     +----------------------------------+
     | C / M : 2003-12-28 / --
     +----------------------------------+
     */

     function showCSS()
     {
      print("
      
      ");
     }

     /*
     +----------------------------------+
     | Show title
     +----------------------------------+
     | C / M : 2003-12-28 / --
     +----------------------------------+
     */

     function showTitle()
     {
      print("\n");

  • 本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

    热门AI工具

    更多
    DeepSeek
    DeepSeek

    幻方量化公司旗下的开源大模型平台

    豆包大模型
    豆包大模型

    字节跳动自主研发的一系列大型语言模型

    通义千问
    通义千问

    阿里巴巴推出的全能AI助手

    腾讯元宝
    腾讯元宝

    腾讯混元平台推出的AI助手

    文心一言
    文心一言

    文心一言是百度开发的AI聊天机器人,通过对话可以生成各种形式的内容。

    讯飞写作
    讯飞写作

    基于讯飞星火大模型的AI写作工具,可以快速生成新闻稿件、品宣文案、工作总结、心得体会等各种文文稿

    即梦AI
    即梦AI

    一站式AI创作平台,免费AI图片和视频生成。

    ChatGPT
    ChatGPT

    最最强大的AI聊天机器人程序,ChatGPT不单是聊天机器人,还能进行撰写邮件、视频脚本、文案、翻译、代码等任务。

    相关专题

    更多
    pixiv网页版官网登录与阅读指南_pixiv官网直达入口与在线访问方法
    pixiv网页版官网登录与阅读指南_pixiv官网直达入口与在线访问方法

    本专题系统整理pixiv网页版官网入口及登录访问方式,涵盖官网登录页面直达路径、在线阅读入口及快速进入方法说明,帮助用户高效找到pixiv官方网站,实现便捷、安全的网页端浏览与账号登录体验。

    286

    2026.02.13

    微博网页版主页入口与登录指南_官方网页端快速访问方法
    微博网页版主页入口与登录指南_官方网页端快速访问方法

    本专题系统整理微博网页版官方入口及网页端登录方式,涵盖首页直达地址、账号登录流程与常见访问问题说明,帮助用户快速找到微博官网主页,实现便捷、安全的网页端登录与内容浏览体验。

    126

    2026.02.13

    Flutter跨平台开发与状态管理实战
    Flutter跨平台开发与状态管理实战

    本专题围绕Flutter框架展开,系统讲解跨平台UI构建原理与状态管理方案。内容涵盖Widget生命周期、路由管理、Provider与Bloc状态管理模式、网络请求封装及性能优化技巧。通过实战项目演示,帮助开发者构建流畅、可维护的跨平台移动应用。

    42

    2026.02.13

    TypeScript工程化开发与Vite构建优化实践
    TypeScript工程化开发与Vite构建优化实践

    本专题面向前端开发者,深入讲解 TypeScript 类型系统与大型项目结构设计方法,并结合 Vite 构建工具优化前端工程化流程。内容包括模块化设计、类型声明管理、代码分割、热更新原理以及构建性能调优。通过完整项目示例,帮助开发者提升代码可维护性与开发效率。

    19

    2026.02.13

    Redis高可用架构与分布式缓存实战
    Redis高可用架构与分布式缓存实战

    本专题围绕 Redis 在高并发系统中的应用展开,系统讲解主从复制、哨兵机制、Cluster 集群模式及数据分片原理。内容涵盖缓存穿透与雪崩解决方案、分布式锁实现、热点数据优化及持久化策略。通过真实业务场景演示,帮助开发者构建高可用、可扩展的分布式缓存系统。

    23

    2026.02.13

    c语言 数据类型
    c语言 数据类型

    本专题整合了c语言数据类型相关内容,阅读专题下面的文章了解更多详细内容。

    29

    2026.02.12

    雨课堂网页版登录入口与使用指南_官方在线教学平台访问方法
    雨课堂网页版登录入口与使用指南_官方在线教学平台访问方法

    本专题系统整理雨课堂网页版官方入口及在线登录方式,涵盖账号登录流程、官方直连入口及平台访问方法说明,帮助师生用户快速进入雨课堂在线教学平台,实现便捷、高效的课程学习与教学管理体验。

    14

    2026.02.12

    豆包AI网页版入口与智能创作指南_官方在线写作与图片生成使用方法
    豆包AI网页版入口与智能创作指南_官方在线写作与图片生成使用方法

    本专题汇总豆包AI官方网页版入口及在线使用方式,涵盖智能写作工具、图片生成体验入口和官网登录方法,帮助用户快速直达豆包AI平台,高效完成文本创作与AI生图任务,实现便捷智能创作体验。

    421

    2026.02.12

    PostgreSQL性能优化与索引调优实战
    PostgreSQL性能优化与索引调优实战

    本专题面向后端开发与数据库工程师,深入讲解 PostgreSQL 查询优化原理与索引机制。内容包括执行计划分析、常见索引类型对比、慢查询优化策略、事务隔离级别以及高并发场景下的性能调优技巧。通过实战案例解析,帮助开发者提升数据库响应速度与系统稳定性。

    51

    2026.02.12

    热门下载

    更多
    网站特效
    /
    网站源码
    /
    网站素材
    /
    前端模板

    精品课程

    更多
    相关推荐
    /
    热门推荐
    /
    最新课程
    AngularJS教程
    AngularJS教程

    共24课时 | 3.7万人学习

    CSS3实现按钮特效视频教程
    CSS3实现按钮特效视频教程

    共15课时 | 3.3万人学习

    细说PHP第三季
    细说PHP第三季

    共58课时 | 11.4万人学习

    关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
    php中文网:公益在线php培训,帮助PHP学习者快速成长!
    关注服务号 技术交流群
    PHP中文网订阅号
    每天精选资源文章推送

    Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号