ubbedit实现遍历绝对目录绑定cookie查询以前上传的图片

admin4年前前端技术784

设置cookie ,$user_id=$_COOKIE["user_email"];

设置path   , $path =  "/".$user_id.$CONFIG['fileManagerListPath'];

获取文件列表: 修改成如下

/* 获取文件列表 */  
//$path = $_SERVER['DOCUMENT_ROOT'] . (substr($path, 0, 1) == "/" ? "":"/") . $path;
$path = "C:/Users/frank/Desktop/website/images.ubb.com".$path;


遍历获取目录下的指定类型的文件

 修改:'url'=> substr($path2, strlen("C:/Users/frank/Desktop/website/images.ubb.com")),

function getfiles($path, $allowFiles, &$files = array())
{
    if (!is_dir($path)) return null;
    if(substr($path, strlen($path) - 1) != '/') $path .= '/';
    $handle = opendir($path);
    while (false !== ($file = readdir($handle))) {
        if ($file != '.' && $file != '..') {
            $path2 = $path . $file;
            if (is_dir($path2)) {
                getfiles($path2, $allowFiles, $files);
            } else {
                if (preg_match("/\.(".$allowFiles.")$/i", $file)) {
                    $files[] = array(
                        'url'=> substr($path2, strlen("C:/Users/frank/Desktop/website/images.ubb.com")),
                        'mtime'=> filemtime($path2)
                    );
                }
            }
        }
    }
    return $files;
}

action_list.php文件下载


完整精简配置好的UBB下载


相关文章

分享与定时自动跳转

<!DOCTYPE html> <html> <head> <meta charset="utf-8">...

js获取客户端电脑硬件信息

js获取客户端电脑硬件信息

只能在IE下运行,下载地址如下js_get_hard_information.zipIE要开启:...

ueditor在php环境实现绝对路径存储,实现cookie指定目录,加域名前缀,实现了独立部署图片站点的功能完成,可以实现完全静态化的操作,大大提高服务器的安全性

ueditor在php环境实现绝对路径存储,实现cookie指定目录,加域名前缀,实现了独立部署图片站点的功能完成,可以实现完全静态化的操作,大大提高服务器的安全性

ueditor在php环境实现绝对路径存储,加域名前缀,实现了独立部署图片站点的功能完成,可以实现完全静态化的操作,大大提高服务器的安全性重点修改部位php/config.json  的11...

让javascrip函数内的局部变量能为全局使用的方法

<script type="text/javascript">   var mine;  function&nbs...

js与jquery自动触发a链接的方法

自动触发a链接的方法如下:1.<body >  <a  href="http://www.shengmake.net"&...

Navigate down the menu through jquery development

The core knowledge is to use jquery's hover method to achieve, The animation effe...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。