mirror of https://github.com/helloxz/imgurl
dev
parent
70c703ecdd
commit
cdf26da132
|
@ -21,11 +21,17 @@
|
|||
//加载数据库模型
|
||||
$this->load->model('query','',TRUE);
|
||||
$siteinfo = $this->query->site_setting();
|
||||
//读取配置文件内容
|
||||
$this->load->library("basic");
|
||||
$conf = $this->basic->conf("info");
|
||||
|
||||
|
||||
$siteinfo = json_decode($siteinfo->values);
|
||||
$siteinfo->info = $conf->index_info;
|
||||
//echo $siteinfo->title;
|
||||
//$data['title'] = '图片上传';
|
||||
$this->load->view('user/header.php',$siteinfo);
|
||||
$this->load->view('user/home.php');
|
||||
$this->load->view('user/home.php',$siteinfo);
|
||||
$this->load->view('user/footer.php');
|
||||
}
|
||||
//首页多图上传
|
||||
|
|
|
@ -7,7 +7,12 @@
|
|||
$this->load->model('query','',TRUE);
|
||||
$siteinfo = $this->query->site_setting();
|
||||
$siteinfo = json_decode($siteinfo->values);
|
||||
|
||||
|
||||
//加载常用基本类库
|
||||
$this->load->library("basic");
|
||||
//获取配置文件信息的内容
|
||||
$conf = $this->basic->conf("info");
|
||||
//var_dump($conf->img_info);
|
||||
//过滤imgid
|
||||
$imgid = strip_tags($imgid);
|
||||
//计算imgid长度
|
||||
|
@ -60,6 +65,7 @@
|
|||
"size" => $size
|
||||
);
|
||||
|
||||
$datas['img_info'] = $conf->img_info;
|
||||
// $data['title'] = '图片浏览';
|
||||
// $data['url'] = $domain.$imginfo->path;
|
||||
// $data['date'] = $imginfo->date;
|
||||
|
|
|
@ -106,5 +106,33 @@
|
|||
|
||||
return $data;
|
||||
}
|
||||
//读取站点配置文件
|
||||
public function conf($arg = ''){
|
||||
//检查配置文件是否存在,并读取对应内容
|
||||
if(is_file(FCPATH."data/json/config.js")){
|
||||
$conf_path = FCPATH."data/json/config.js";
|
||||
}
|
||||
//配置文件不存在,读取默认配置
|
||||
else{
|
||||
$conf_path = FCPATH."data/json/config.simple.js";
|
||||
}
|
||||
$conf_path = str_replace("\\","/",$conf_path);
|
||||
//echo $conf_path;
|
||||
//读取配置文件内容
|
||||
$content = json_decode(file_get_contents($conf_path));
|
||||
|
||||
//根据传入的参数来返回不同的数据
|
||||
switch ($arg) {
|
||||
case 'alert':
|
||||
return $content->alert;
|
||||
break;
|
||||
case 'info':
|
||||
return $content->info;
|
||||
break;
|
||||
default:
|
||||
return $content;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -5,7 +5,7 @@
|
|||
<div id="main">
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<span class="alert-inner--icon"><i class="layui-icon"></i></span>
|
||||
<span class="alert-inner--text"><strong>注意:</strong>游客限制每日上传10张,单张图片不能超过5M,上传的图片将公开显示,使用之前请先阅读《<a href="/page/use">使用协议</a>》</span>
|
||||
<span class="alert-inner--text"><strong>注意:</strong><?php echo $info; ?></span>
|
||||
</div>
|
||||
<!-- 选择按钮 -->
|
||||
<!-- 上传地址 -->
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<span><a href="<?php echo $url; ?>" download = ""><i class="fa fa-cloud-download"></i> 下载</a></span>
|
||||
</p>
|
||||
<div class = "statement">
|
||||
<i class="fa fa-warning"></i> 此图片来自网友上传,不代表本站立场,若有侵权,请联系管理员删除!(QQ:337003006)
|
||||
<i class="fa fa-warning"></i> <?php echo $img_info; ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 评论按钮 -->
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"alert": "ImgURL配置文件,请使用json格式,修改后建议使用http://www.bejson.com/ 进行校验,以免出现异常。",
|
||||
"info": {
|
||||
"index_info": "游客限制每日上传10张,单张图片不能超过5M,上传的图片将公开显示,使用之前请先阅读《<a href = \"/page/use\">使用协议<\/a>》",
|
||||
"img_info": "此图片来自网友上传,不代表本站立场,若有侵权,请联系管理员删除!"
|
||||
}
|
||||
}
|
|
@ -1 +1 @@
|
|||
v2.1.2-20190406
|
||||
v2.1.3-20190407
|
Loading…
Reference in New Issue