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

admin4年前前端技术809

设置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下载


相关文章

Navigate down the menu through jquery development

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

ios 手机端 input 框上方有内阴影

解决方案1:<!--如果 ui 样式里有边框,可以用外层盒子设置边框-->input{     border:none; }...

关于css的position参数自我领悟心得整理

relative :相对与最近的DOM定位   absolute :相对里面的绝对定位,跟relative 一起用,起到随心所欲定位的效果sticky :滚顶地位定位,用与鼠标滚动...

jquery 生成的dom无法触发click事件的解决方案

原因是程序找不到此节点在jQuery中有“向未来的元素添加事件处理程序”方法说明,也正是动态创建元素无法触发事件的原因所在。正确的写法应该是:$(‘父元素’).on(‘click’,’动态的子元素’,...

jquery默认设置第一个类的css或者属性

var me=$("#cima>input");me.eq(0).css...

发表评论    

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