讲师中心 微信公众号

工具推荐

视频效率加速
updream

一键生成高质量推广成片

立刻MV
立刻MV

低成本歌曲 MV、视频生成

剧云
剧云

中文短剧剧本制作平台

SoundView
SoundView

字幕擦除翻译、配音口型同步

相册程序

小静小哥_7745

小静小哥_7745

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

|

1965人浏览过

|

来源于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
     +----------------------------------+
     */

     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");
      print("

    ".$this->configTilte."\n");
      print("\n");
      print("\n");
      print("
    \n");
      print("
    \n");
      print($this->configTilte);
      print("
    \n");
      print("

    \n");
     }

     /*
     +----------------------------------+
     | Show state
     +----------------------------------+
     | C / M : 2003-12-28 / 2004-4-9
     +----------------------------------+
     */

     function showState()
     {
      print("

    \n");
      print("\n");
      print("\n");
      print("\n");
      print("
    \n");
      print("
    褰
  • 热门AI工具

    更多
    Lovart
    Lovart Hot

    一款面向视觉设计创作的AI设计平台,可通过智能体和画布工作流辅助制作海报、Logo、网页、PPT及其他视觉内容。

    SoundView
    SoundView Hot

    SoundView是一款面向跨境电商的视频翻译、配音和本地化 AI 创作平台。

    讯飞智文

    一款面向学习和办公场景的AI文档创作工具,可辅助生成PPT与Word文档,提高资料整理和内容制作效率。

    DeepSeek

    DeepSeek是一款面向对话、写作、编程和推理场景的AI大模型工具。

    Loomy
    Loomy Hot

    一款AI工具,主要用于科大讯飞发布的桌面级 AI 助理,比 OpenClaw 更易用、更安全!,适合需要提升相关任务效率的用户。

    豆包大模型

    豆包大模型是一款由字节跳动推出的企业级大语言模型服务平台。

    VibeKnow
    VibeKnow Hot

    一款AI视频创作工具,主要用于全球首个AI知识视频创作平台,文档、文章、网页,一键生成视频,适合需要提升相关任务效率的用户。

    WorkBuddy

    一款AI办公效率工具,主要用于腾讯云推出的AI原生桌面智能体工作台,适合需要提升相关任务效率的用户。

    UP简历
    UP简历 Hot

    一款AI办公效率工具,主要用于基于AI技术的免费在线简历制作工具,适合需要提升相关任务效率的用户。

    相关专题

    更多
    Go-Zero API开发使用教程
    Go-Zero API开发使用教程

    本专题聚焦Go-Zero的API开发,拆解.api描述文件的语法结构、路由与分组定义、参数绑定与校验规则,说明统一响应体、JWT鉴权、跨域与接口文档生成的落地方式,并给出网关聚合与接口测试的实践建议。

    160

    2026.11.12

    Go-Zero安装与goctl环境配置教程
    Go-Zero安装与goctl环境配置教程

    本专题围绕Go-Zero的安装与工具链配置展开,讲清Go版本要求、goctl安装方式、代理镜像、protoc依赖与环境变量设置,说明多版本共存、升级回退与CI流水线安装的做法,并整理安装阶段的常见报错与验证步骤。

    100

    2026.11.12

    Go-Zero零基础入门教程
    Go-Zero零基础入门教程

    本专题整理Go-Zero的入门知识,从框架定位、环境准备到跑通第一个API服务,讲清目录分层、配置加载、日志与中间件的基本用法,并对比Gin、Kratos的差异,帮助Go开发者建立整体认知,判断它是否适合当前项目。

    100

    2026.11.12

    Postman身份认证怎么配置
    Postman身份认证怎么配置

    本专题从实际API接口调试场景出发,讲解Postman身份认证的完整配置流程,包括常见认证协议介绍、授权参数设置、访问令牌填写、OAuth 2.0授权及认证失败排查,帮助用户正确完成接口授权与访问验证。

    180

    2026.11.06

    Postman请求头Headers怎么设置
    Postman请求头Headers怎么设置

    围绕Postman HTTP请求头配置展开,讲解Headers选项的具体使用方式,包括Key和Value参数填写、请求头信息添加、常见Header字段设置及请求头修改方法,帮助用户解决接口调试过程中遇到的请求头配置问题。

    140

    2026.11.06

    Postman接口请求发送教程
    Postman接口请求发送教程

    详细介绍Postman接口请求的创建与发送方法,涵盖GET和POST请求、URL配置、请求参数、Headers请求头、Body请求体设置以及响应结果查看,帮助用户掌握Postman接口请求的完整操作流程。

    120

    2026.11.06

    DBeaver怎么导入数据
    DBeaver怎么导入数据

    DBeaver数据导入专题,整理Excel、CSV、SQL、TXT等常见文件的数据导入方法,涵盖目标数据库选择、数据表创建、字段映射、数据类型设置及导入参数配置等操作,帮助用户将本地文件中的数据写入数据库,并了解批量导入、重复数据处理和导入失败等常见问题的解决方法。

    120

    2026.11.05

    DBeaver安全防护教程大全
    DBeaver安全防护教程大全

    DBeaver安全防护专题,围绕数据库连接安全、账号密码保护和访问权限管理展开,整理SSL/TLS加密连接、SSH隧道、数据库凭据保存及证书验证等配置方法,同时介绍敏感信息保护、远程连接风险和高权限账号使用等注意事项,帮助用户提高数据库日常管理的安全性。

    100

    2026.11.05

    DBeaver连接创建与配置教程
    DBeaver连接创建与配置教程

    本专题聚焦DBeaver数据库连接配置与管理,覆盖从新建连接、选择数据库类型到填写连接参数和验证连接的完整流程。针对MySQL、PostgreSQL、SQL Server等常见数据库,整理相应的连接设置方法,并提供驱动缺失、认证失败和连接异常等问题的排查方向。

    120

    2026.11.04

    热门下载

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

    精品课程

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

    共24课时 | 7.9万人学习

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

    共15课时 | 3.8万人学习

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

    共58课时 | 13.6万人学习

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

    Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn