diff --git a/app/BaseController.php b/app/BaseController.php
index 3238768..a46f3ec 100644
--- a/app/BaseController.php
+++ b/app/BaseController.php
@@ -202,16 +202,15 @@ abstract class BaseController
protected function getArticleAllpic($str)
{
//正则匹配
- $pattern = "/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/";
+ $pattern = "/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png|\.jpeg]))[\'|\"].*?[\/]?>/";
preg_match_all($pattern,$str,$matchContent);
if(isset($matchContent[1])){
- $img = $matchContent[1];
+ $imgArr = $matchContent[1];
}else{
$temp = "./images/no-image.jpg";//在相应位置放置一张命名为no-image的jpg图片
}
-
- return $img;
-
+
+ return $imgArr;
}
//下载远程图片
@@ -234,9 +233,9 @@ abstract class BaseController
{
$filename = pathinfo($url, PATHINFO_BASENAME);
//$dirname = pathinfo(parse_url($url, PHP_URL_PATH), PATHINFO_DIRNAME);
- $dirname = date('Ymd',time());
+
//路径
- $path = 'storage/download/article_pic/' . $dirname . '/';
+ $path = 'storage/download/article_pic/' . date('Ymd',time()) . '/';
//绝对文件夹
$fileDir = public_path() . $path;
//文件绝对路径
@@ -271,12 +270,12 @@ abstract class BaseController
if(count($images)) {
foreach($images as $image){
//1.带http地址的图片,2.非本站的网络图片 3.非带有?号等参数的图片
- if((stripos($image,'http') !== false) && (stripos($image, Request::domain()) === false) && (stripos($image, '?') === false)) {
+ if((stripos($image,'http') !== false) && (stripos($image, Request::domain()) == false) && (stripos($image, '?') == false)) {
// 如果图片中没有带参数或者加密可下载
//下载远程图片(可下载)
$newImageUrl = $this->downloadImage($image);
//替换图片链接
- $content = str_replace($image,Request::domain().$newImageUrl,$content);
+ $content = str_replace($image, Request::domain().$newImageUrl, $content);
}
}
//不可下载的图片,如加密或者带有参数的图片如?type=jpeg,直接返回content
diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php
index 33c975b..fccb26a 100644
--- a/app/admin/controller/Index.php
+++ b/app/admin/controller/Index.php
@@ -21,6 +21,7 @@ use app\admin\model\Cunsult;
use think\facade\Config;
use taoler\com\Api;
use app\common\lib\facade\HttpHelper;
+use app\common\model\Comment;
class Index extends AdminController
{
@@ -61,15 +62,28 @@ class Index extends AdminController
public function console2()
{
// 评论、帖子状态
- $comm = Db::name('comment')->field('id')->where(['delete_time'=>0,'status'=>0])->select();
+ $comm = Db::name('comment')->field('id,content,create_time')->where(['delete_time'=>0,'status'=>0])->select();
$forum = Db::name('article')->field('id')->where(['delete_time'=>0,'status'=>0])->select();
$user = Db::name('user')->field('id')->where(['delete_time'=>0,'status'=>0])->select();
+ // 回复评论
+ $comments = Comment::field('id,article_id,content,create_time,delete_time')->where(['delete_time'=>0])->order('create_time desc')->limit(10)->select();
+ $commData = [];
+ foreach($comments as $v) {
+ $commData[] = [
+ 'id' => $v->id,
+ 'content' => strip_tags($v['content']),
+ 'create_time' => $v['create_time'],
+ 'url' => $this->getArticleUrl($v['article_id'], 'index', $v->article->cate->ename)
+ ];
+ }
View::assign([
'pendComms' => count($comm),
'pendForums' => count($forum),
'pendUser' => count($user),
+ 'comments' => $commData,
]);
+
return View::fetch('console2');
}
diff --git a/app/admin/controller/content/Forum.php b/app/admin/controller/content/Forum.php
index 2115e08..232040c 100644
--- a/app/admin/controller/content/Forum.php
+++ b/app/admin/controller/content/Forum.php
@@ -87,7 +87,7 @@ class Forum extends AdminController
$where[] = ['title', 'like', '%'.$data['title'].'%'];
}
- $list = $this->model->getList($where, input('limit'), input('page'));
+ $list = $this->model->getAllStatusList($where, input('limit'), input('page'));
$res = [];
if($list['total']){
foreach($list['data'] as $v) {
diff --git a/app/admin/controller/user/User.php b/app/admin/controller/user/User.php
index 252b684..700f6b7 100644
--- a/app/admin/controller/user/User.php
+++ b/app/admin/controller/user/User.php
@@ -19,7 +19,6 @@ use app\common\lib\Uploads;
use app\common\validate\User as userValidate;
use think\exception\ValidateException;
-
class User extends AdminController
{
@@ -204,5 +203,13 @@ class User extends AdminController
}
return true;
}
+
+ //登录用过户中心
+ public function goUserHome() {
+ $id = (int)input('id');
+ $user_home_url = $this->getUserHome($id);
+
+ return redirect($user_home_url);
+ }
}
diff --git a/app/admin/view/content/forum/add.html b/app/admin/view/content/forum/add.html
index 222af21..779d370 100644
--- a/app/admin/view/content/forum/add.html
+++ b/app/admin/view/content/forum/add.html
@@ -113,7 +113,7 @@
show: true,
indent: 15,
strict: false,
- expandedKeys: true
+ expandedKeys: false
},
tips: '请选择'
});
@@ -203,6 +203,8 @@
});
+ {// 编辑器}
+ {:hook('ueditor')}
{:hook('taonyeditor')}
{// 百度标题词条}
{:hook('seoBaiduTitle')}
diff --git a/app/admin/view/content/forum/edit.html b/app/admin/view/content/forum/edit.html
index a09e262..51bb7b0 100644
--- a/app/admin/view/content/forum/edit.html
+++ b/app/admin/view/content/forum/edit.html
@@ -154,7 +154,7 @@
show: true,
indent: 15,
strict: false,
- expandedKeys: true
+ expandedKeys: false
},
tips: '请选择'
});
@@ -222,6 +222,8 @@
});
+ {// 编辑器}
+ {:hook('ueditor')}
{:hook('taonyeditor')}
{// 百度标题词条}
{:hook('seoBaiduTitle')}
diff --git a/app/admin/view/content/forum/index.html b/app/admin/view/content/forum/index.html
index ca29f30..61d96d0 100644
--- a/app/admin/view/content/forum/index.html
+++ b/app/admin/view/content/forum/index.html
@@ -104,7 +104,7 @@
diff --git a/app/admin/view/user/user/index.html b/app/admin/view/user/user/index.html
index 9670816..a3a0940 100644
--- a/app/admin/view/user/user/index.html
+++ b/app/admin/view/user/user/index.html
@@ -82,6 +82,9 @@
+