优化多分类多模板
This commit is contained in:
parent
ccedaa685c
commit
040f6eece8
@ -7,8 +7,8 @@
|
||||
* 后台:http://adm.aieok.com:888
|
||||
* 账号:test
|
||||
* 密码:test123
|
||||
* 版本:TaoLer 1.7.25
|
||||
* 日期:2021.7.23
|
||||
* 版本:TaoLer 1.7.28
|
||||
* 日期:2021.8.03
|
||||
|
||||
#### 项目地址
|
||||
|
||||
|
@ -12,7 +12,9 @@ use think\facade\View;
|
||||
use think\facade\Request;
|
||||
use think\facade\Db;
|
||||
use think\facade\Session;
|
||||
use think\facade\Cache;
|
||||
use think\exception\ValidateException;
|
||||
use taoler\com\Files;
|
||||
|
||||
class Forum extends AdminController
|
||||
{
|
||||
@ -150,63 +152,66 @@ class Forum extends AdminController
|
||||
$res['count']= count($list);
|
||||
$res['data'] = [];
|
||||
foreach($list as $k=>$v){
|
||||
$res['data'][] = ['sort'=>$v['sort'],'id' => $v['id'],'tags'=>$v['catename'],'ename'=>$v['ename'],'icon'=>$v['icon'],'is_hot'=>$v['is_hot'],'desc'=>$v['desc']];
|
||||
$res['data'][] = ['sort'=>$v['sort'],'id' => $v['id'],'tags'=>$v['catename'],'ename'=>$v['ename'],'detpl'=>$v['detpl'],'icon'=>$v['icon'],'is_hot'=>$v['is_hot'],'desc'=>$v['desc']];
|
||||
}
|
||||
}
|
||||
return json($res);
|
||||
}
|
||||
//详情模板
|
||||
$sys = $this->getSystem();
|
||||
$template = Files::getDirName('../view/'.$sys['template'].'/index/article/');
|
||||
View::assign(['template'=>$template]);
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
//添加帖子分类
|
||||
public function addtags()
|
||||
//添加和编辑帖子分类
|
||||
public function tagsform()
|
||||
{
|
||||
$addOrEdit = !is_null(input('id'));//true是编辑false新增
|
||||
$msg = $addOrEdit ? lang('edit') : lang('add');
|
||||
if(Request::isAjax()){
|
||||
$data = Request::param();
|
||||
$list = Db::name('cate')->cache('catename')->save($data);
|
||||
|
||||
if($list){
|
||||
return json(['code'=>0,'msg'=>'添加分类成功']);
|
||||
return json(['code'=>0,'msg'=> $msg.'分类成功']);
|
||||
}else{
|
||||
return json(['code'=>-1,'msg'=>'添加分类失败']);
|
||||
return json(['code'=>-1,'msg'=> $msg.'分类失败']);
|
||||
}
|
||||
}
|
||||
return view('tagsform');
|
||||
|
||||
$tplname = $addOrEdit ? Db::name('cate')->where('id',input('id'))->value('detpl') : '';
|
||||
//详情模板
|
||||
$sys = $this->getSystem();
|
||||
$template = Files::getDirName('../view/'.$sys['template'].'/index/article/');
|
||||
View::assign(['template'=>$template,'tplname'=>$tplname]);
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
//编辑帖子分类
|
||||
public function tagsform()
|
||||
//详情页模板设置
|
||||
public function tplSet()
|
||||
{
|
||||
if(Request::isAjax()){
|
||||
$data = Request::param();
|
||||
$list = Db::name('cate')->cache('catename')->update($data);
|
||||
|
||||
if($list){
|
||||
return json(['code'=>0,'msg'=>'修改分类成功']);
|
||||
}else{
|
||||
return json(['code'=>-1,'msg'=>'修改分类失败']);
|
||||
}
|
||||
if(Request::isPost()){
|
||||
$data = Request::only(['id','detpl']);
|
||||
Db::name('cate')->cache('catename')->update($data);
|
||||
}
|
||||
return View::fetch();
|
||||
|
||||
}
|
||||
|
||||
//删除帖子分类
|
||||
public function tagsdelete()
|
||||
{
|
||||
if(Request::isAjax()){
|
||||
$data = Request::param();
|
||||
$id = Request::param('id');
|
||||
|
||||
$cate = new Cate;
|
||||
$result = $cate->del($data);
|
||||
$result = $cate->del($id);
|
||||
|
||||
|
||||
if($result == 1){
|
||||
Cache::tag('catename')->clear();
|
||||
return json(['code'=>0,'msg'=>'删除分类成功']);
|
||||
}else{
|
||||
return json(['code'=>-1,'msg'=>'删除分类失败']);
|
||||
}
|
||||
if($result == 1){
|
||||
Cache::tag('catename')->clear();
|
||||
return json(['code'=>0,'msg'=>'删除分类成功']);
|
||||
}else{
|
||||
return json(['code'=>-1,'msg'=>$result]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\controller\BaseController;
|
||||
use app\common\controller\AdminController;
|
||||
use think\facade\View;
|
||||
use think\facade\Request;
|
||||
use think\facade\Db;
|
||||
use app\common\model\UserSignrule;
|
||||
|
||||
class Sign extends BaseController
|
||||
class Sign extends AdminController
|
||||
{
|
||||
//添加签到积分规则
|
||||
public function add()
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\controller\BaseController;
|
||||
use app\common\controller\AdminController;
|
||||
use think\facade\View;
|
||||
use think\facade\Request;
|
||||
use think\facade\Db;
|
||||
use app\common\model\UserViprule;
|
||||
|
||||
class Vip extends BaseController
|
||||
class Vip extends AdminController
|
||||
{
|
||||
//添加VIP积分规则
|
||||
public function add()
|
||||
|
@ -1,5 +1,19 @@
|
||||
{extend name="public:base" /}
|
||||
{block name="css"}
|
||||
<style type="text/css">
|
||||
.layui-table-body, .layui-table-box, .layui-table-cell{
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/* 设置下拉框的高度与表格单元相同 */
|
||||
td .layui-table-cell .layui-form-select {
|
||||
margin-top: -10px;
|
||||
margin-left: -15px;
|
||||
margin-right: -15px;
|
||||
}
|
||||
|
||||
</style>
|
||||
{/block}
|
||||
{block name="body"}
|
||||
<div class="layui-fluid">
|
||||
<div class="layui-card">
|
||||
@ -10,6 +24,13 @@
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<table id="LAY-app-content-tags" lay-filter="LAY-app-content-tags"></table>
|
||||
<script type="text/html" id="inputSel">
|
||||
<select name="detpl" lay-filter="detpl" id="{{d.id}}" >
|
||||
{volist name="template" id="vo"}
|
||||
<option value="{$vo}" {{# if (d.detpl == "{$vo}"){ }} selected {{# } }}>{$vo}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</script>
|
||||
<script type="text/html" id="buttonHot">
|
||||
{if condition="checkRuleButton('admin/Forum/tagshot')"}<input type="checkbox" name="is_hot" lay-skin="primary" lay-filter="menu-show" {{# if(d.is_hot ==1){ }}checked value="0"{{# } else { }}value="1"{{# } }} id="{{d.id}}" >
|
||||
{else /}<input type="checkbox" title="禁用" disabled> {/if}
|
||||
@ -60,6 +81,7 @@
|
||||
,sort = othis.find('input[name="sort"]').val()
|
||||
,tags = othis.find('input[name="tags"]').val()
|
||||
,ename = othis.find('input[name="ename"]').val()
|
||||
,detpl = othis.find('select[name="detpl"]').val()
|
||||
,icon = othis.find('input[name="icon"]').val()
|
||||
,desc = othis.find('input[name="desc"]').val();
|
||||
|
||||
@ -67,22 +89,14 @@
|
||||
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('admin/Forum/addtags')}",
|
||||
data:{"sort":sort,"catename":tags,"ename":ename,"icon":icon,"desc":desc},
|
||||
url:"{:url('admin/Forum/tagsform')}",
|
||||
data:{"sort":sort,"catename":tags,"ename":ename,"detpl":detpl,"icon":icon,"desc":desc},
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
});
|
||||
layer.msg(data.msg,{icon:6,time:2000});
|
||||
} else {
|
||||
layer.open({
|
||||
title:'添加失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
anim:6
|
||||
});
|
||||
layer.open({title:'添加失败',content:data.msg,icon:5,anim:6});
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -93,6 +107,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
//详情页模板选择控制
|
||||
form.on('select(detpl)', function(data){
|
||||
var detpl = data.value;
|
||||
$.post("{:url('admin/Forum/tplSet')}",{"id":data.elem.id,"detpl":detpl});
|
||||
//执行重载
|
||||
table.reload('LAY-app-content-tags', {
|
||||
where: detpl
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//分类热点控制
|
||||
form.on('checkbox(menu-show)', function(data){
|
||||
var data = data.elem;
|
||||
@ -104,17 +129,9 @@
|
||||
dataType:'json',
|
||||
success:function(data){
|
||||
if(data.code == 0){
|
||||
layer.msg(data.msg,{
|
||||
icon:6,
|
||||
time:2000
|
||||
});
|
||||
layer.msg(data.msg,{icon:6,time:2000});
|
||||
} else {
|
||||
layer.open({
|
||||
title:'修改失败',
|
||||
content:data.msg,
|
||||
icon:5,
|
||||
adim:6
|
||||
})
|
||||
layer.open({title:'修改失败',content:data.msg,icon:5,adim:6});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -12,6 +12,14 @@
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="ename" lay-verify="required" placeholder="英文名*" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<label class="layui-form-label">详情页模板</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="detpl" lay-filter="detpl">
|
||||
{volist name="template" id="vo"}
|
||||
<option value="{$vo}" {if($vo == $tplname)}selected{/if}>{$vo}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
<label class="layui-form-label">图标</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="icon" placeholder="图标*" id="iconPicker" lay-filter="iconPicker" style="display:none;" class="layui-input">
|
||||
|
@ -46,12 +46,12 @@
|
||||
<div class="layui-form-item">
|
||||
<table id="sign-rule" lay-filter="sign-rule"></table>
|
||||
<script type="text/html" id="sign-rule-button">
|
||||
{if condition="checkRuleButton('admin/Sin/edit')"}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i></a>
|
||||
{else /}<a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-disabled"><i class="layui-icon layui-icon-edit"></i></a>{/if}
|
||||
{if condition="checkRuleButton('admin/Sign/edit')"}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
|
||||
{else /}<a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-disabled"><i class="layui-icon layui-icon-edit"></i>编辑</a>{/if}
|
||||
{if condition="checkRuleButton('admin/Sign/delete')"}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i></a>
|
||||
{else /}<a class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled"><i class="layui-icon layui-icon-delete"></i></a>{/if}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
|
||||
{else /}<a class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled"><i class="layui-icon layui-icon-delete"></i>删除</a>{/if}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -40,10 +40,10 @@
|
||||
<th>{$vo.slid_over|date='Y-m-d'}</th>
|
||||
<th>{$vo.slid_status ?'显示':'禁止'}</th>
|
||||
<th>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" id-data="{$vo.id}"><i class="layui-icon layui-icon-edit"></i>编辑</a>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit" id-data="{$vo.id}"><i class="layui-icon layui-icon-edit"></i></a>
|
||||
{if condition="checkRuleButton('admin/Slider/delete')"}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" id-data="{$vo.id}"><i class="layui-icon layui-icon-delete"></i>删除</a>
|
||||
{else /}<a class="layui-btn layui-btn-disabled layui-btn-danger layui-btn-xs"><i class="layui-icon layui-icon-delete"></i>删除</a>{/if}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" id-data="{$vo.id}"><i class="layui-icon layui-icon-delete"></i></a>
|
||||
{else /}<a class="layui-btn layui-btn-disabled layui-btn-danger layui-btn-xs"><i class="layui-icon layui-icon-delete"></i></a>{/if}
|
||||
</th>
|
||||
</tr>
|
||||
{/volist}
|
||||
|
@ -91,7 +91,7 @@ function getCateDesc($ename)
|
||||
//过滤文章摘要
|
||||
function getArtContent($content)
|
||||
{
|
||||
return mb_substr(strip_tags($content),0,100).'...';
|
||||
return mb_substr(strip_tags($content),0,50).'...';
|
||||
}
|
||||
|
||||
|
||||
|
@ -59,6 +59,7 @@ class BaseController extends BaseCtrl
|
||||
|
||||
//2.将catelist变量赋给模板 公共模板nav.html
|
||||
View::assign('cateList',$cateList);
|
||||
return $cateList;
|
||||
|
||||
}
|
||||
|
||||
@ -95,6 +96,7 @@ class BaseController extends BaseCtrl
|
||||
Cache::set('footlinks',$foot_links,3600);
|
||||
}
|
||||
View::assign(['sysInfo'=>$sysInfo,'headlinks'=>$head_links,'footlinks'=>$foot_links]);
|
||||
return $sysInfo;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ class Article extends Model
|
||||
$artList = $this::field('id,title,title_color,cate_id,user_id,create_time,is_hot,pv,jie,upzip,has_img,has_video,has_audio')
|
||||
->with([
|
||||
'cate' => function($query){
|
||||
$query->where('delete_time',0)->field('id,catename,ename');
|
||||
$query->where('delete_time',0)->field('id,catename,ename,detpl');
|
||||
},
|
||||
'user' => function($query){
|
||||
$query->field('id,name,nickname,user_img,area_id,vip');
|
||||
@ -209,7 +209,7 @@ class Article extends Model
|
||||
switch ($type) {
|
||||
//查询文章,15个分1页
|
||||
case 'jie':
|
||||
$artList = $this::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([
|
||||
$artList = $this::field('id,title,content,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([
|
||||
'cate' => function($query){
|
||||
$query->where('delete_time',0)->field('id,catename,ename');
|
||||
},
|
||||
@ -225,7 +225,7 @@ class Article extends Model
|
||||
break;
|
||||
|
||||
case 'hot':
|
||||
$artList = $this::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([
|
||||
$artList = $this::field('id,title,content,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([
|
||||
'cate' => function($query){
|
||||
$query->where('delete_time',0)->field('id,catename,ename');
|
||||
},
|
||||
@ -241,7 +241,7 @@ class Article extends Model
|
||||
break;
|
||||
|
||||
case 'top':
|
||||
$artList = $this::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([
|
||||
$artList = $this::field('id,title,content,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([
|
||||
'cate' => function($query){
|
||||
$query->where('delete_time',0)->field('id,catename,ename');
|
||||
},
|
||||
@ -256,8 +256,24 @@ class Article extends Model
|
||||
]);
|
||||
break;
|
||||
|
||||
case 'wait':
|
||||
$artList = $this::field('id,title,content,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([
|
||||
'cate' => function($query){
|
||||
$query->where('delete_time',0)->field('id,catename,ename');
|
||||
},
|
||||
'user' => function($query){
|
||||
$query->field('id,name,nickname,user_img,area_id,vip');
|
||||
}
|
||||
])->withCount(['comments'])->where('status',1)->where($where)->where('jie',0)->order(['is_top'=>'desc','create_time'=>'desc'])
|
||||
->paginate([
|
||||
'list_rows' => 15,
|
||||
'page' => $page,
|
||||
'path' =>$url.'[PAGE]'.$suffix
|
||||
]);
|
||||
break;
|
||||
|
||||
default:
|
||||
$artList = $this::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([
|
||||
$artList = $this::field('id,title,content,title_color,cate_id,user_id,create_time,is_top,is_hot,pv,jie,upzip,has_img,has_video,has_audio')->with([
|
||||
'cate' => function($query){
|
||||
$query->where('delete_time',0)->field('id,catename,ename');
|
||||
},
|
||||
|
@ -11,15 +11,15 @@ class Cate extends Model
|
||||
protected $deleteTime = 'delete_time';
|
||||
protected $defaultSoftDelete = 0;
|
||||
|
||||
public function del($data)
|
||||
public function del($id)
|
||||
{
|
||||
$cates = $this->find($data['id']);
|
||||
$cates = $this->find($id);
|
||||
|
||||
$res = $cates->delete();
|
||||
if($res){
|
||||
return 1;
|
||||
}else{
|
||||
return -1;
|
||||
return '删除分类失败';
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ class Article extends BaseController
|
||||
//获取分类ID
|
||||
$ename = Request::param('ename');
|
||||
$type = Request::param('type') ?? 'all';
|
||||
|
||||
$tpl = Db::name('cate')->where('ename',$ename)->value('detpl');
|
||||
//分页伪静态
|
||||
$str = Request::baseUrl(); //不带参数在url
|
||||
$patterns = "/\d+/"; //数字正则
|
||||
@ -74,7 +74,7 @@ class Article extends BaseController
|
||||
$ad_comm = $ad->getSliderList(6);
|
||||
|
||||
View::assign(['type'=>$type,'artList'=>$artList,'artHot'=>$artHot,'ad_cateImg'=>$ad_cateImg,'ad_comm'=>$ad_comm,'jspage'=>'jie']);
|
||||
return View::fetch();
|
||||
return View::fetch('article/'.$tpl.'/cate');
|
||||
}
|
||||
|
||||
//文章详情页
|
||||
@ -82,6 +82,8 @@ class Article extends BaseController
|
||||
{
|
||||
$article = new ArticleModel();
|
||||
$artDetail = $article->getArtDetail($id);
|
||||
$arId = $artDetail->cate->id;
|
||||
$tpl = Db::name('cate')->where('id',$arId)->value('detpl');
|
||||
if(!$artDetail){
|
||||
// 抛出 HTTP 异常
|
||||
throw new \think\exception\HttpException(404, '异常消息');
|
||||
@ -94,21 +96,6 @@ class Article extends BaseController
|
||||
$pv = Db::name('article')->field('pv')->where('id',$id)->value('pv');
|
||||
$download = $artDetail->upzip ? download($artDetail->upzip,'file') : '';
|
||||
|
||||
/*
|
||||
$nt = time();
|
||||
$ft = $article->comments;
|
||||
$ct[] = [];
|
||||
foreach($ft as $c){
|
||||
$t = $c->create_time;
|
||||
$ct[] = intval(($nt - strtotime($t))/86400);
|
||||
}
|
||||
dump($nt);
|
||||
dump($ct);
|
||||
$this->assign('ct',$ct);
|
||||
$article->append(['comment.ct'])->toArray();
|
||||
//halt($article);
|
||||
*/
|
||||
|
||||
// 热议文章
|
||||
$artHot = $article->getArtHot(10);
|
||||
//广告
|
||||
@ -119,7 +106,7 @@ class Article extends BaseController
|
||||
$ad_comm = $ad->getSliderList(7);
|
||||
|
||||
View::assign(['article'=>$artDetail,'pv'=>$pv,'comments'=>$comments,'artHot'=>$artHot,'ad_art'=>$ad_artImg,'ad_comm'=>$ad_comm,$download,'jspage'=>'jie']);
|
||||
return View::fetch();
|
||||
return View::fetch('article/'.$tpl.'/detail');
|
||||
}
|
||||
|
||||
//文章评论
|
||||
@ -167,7 +154,7 @@ class Article extends BaseController
|
||||
{
|
||||
if (Request::isAjax()) {
|
||||
$data = Request::only(['cate_id', 'title', 'title_color', 'user_id', 'content', 'upzip', 'tags', 'captcha']);
|
||||
$validate = new \app\common\validate\Article; //调用验证器
|
||||
$validate = new \app\common\validate\Article; //调用验证器
|
||||
$result = $validate->scene('Artadd')->check($data); //进行数据验证
|
||||
if (true !== $result) {
|
||||
return Msgres::error($validate->getError());
|
||||
|
@ -270,6 +270,7 @@ CREATE TABLE `tao_cate` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
|
||||
`catename` varchar(20) NOT NULL COMMENT '导航名称',
|
||||
`ename` varchar(20) NOT NULL DEFAULT '' COMMENT '分类别名',
|
||||
`detpl` varchar(20) NOT NULL COMMENT '详情模板',
|
||||
`icon` varchar(50) DEFAULT NULL COMMENT '图标',
|
||||
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
|
||||
`status` enum('0','1') NOT NULL DEFAULT '1' COMMENT '状态1启用0禁用',
|
||||
@ -286,9 +287,9 @@ CREATE TABLE `tao_cate` (
|
||||
-- ----------------------------
|
||||
-- Records of tao_cate
|
||||
-- ----------------------------
|
||||
INSERT INTO `tao_cate` VALUES ('1', '提问', 'ask', 'layui-icon-help', '1', '1', '0', 'TaoLer社区提问专栏1', '0', '0', '0', '0');
|
||||
INSERT INTO `tao_cate` VALUES ('2', '分享', 'share', 'layui-icon-share', '2', '1', '0', '', '0', '0', '0', '0');
|
||||
INSERT INTO `tao_cate` VALUES ('3', '讨论', 'talk', 'layui-icon-dialogue', '3', '1', '0', '', '1', '0', '0', '0');
|
||||
INSERT INTO `tao_cate` VALUES ('1', '提问', 'ask', 'ask', 'layui-icon-help', '1', '1', '0', 'TaoLer社区提问专栏1', '0', '0', '0', '0');
|
||||
INSERT INTO `tao_cate` VALUES ('2', '分享', 'share', 'posts', 'layui-icon-share', '2', '1', '0', '', '0', '0', '0', '0');
|
||||
INSERT INTO `tao_cate` VALUES ('3', '讨论', 'talk', 'posts', 'layui-icon-dialogue', '3', '1', '0', '', '1', '0', '0', '0');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for tao_collection
|
||||
|
@ -7,7 +7,7 @@ return [
|
||||
//应用名,此项不可更改
|
||||
'appname' => 'TaoLer',
|
||||
//版本配置
|
||||
'version' => '1.7.27',
|
||||
'version' => '1.7.28',
|
||||
//加盐
|
||||
'salt' => 'taoler',
|
||||
//数据库备份目录
|
||||
|
@ -35,6 +35,29 @@ class Files
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取目录下文件
|
||||
* @param $path string 目录
|
||||
* @return array
|
||||
*/
|
||||
public static function getDirFiles($path,$type)
|
||||
{
|
||||
if (is_dir($path)) {
|
||||
$arr = array();
|
||||
$data = scandir($path);
|
||||
foreach ($data as $value){
|
||||
if($value !='.' && $value != '..'){
|
||||
if($type == 1){//获取文件夹下文件名 index.html
|
||||
$arr[] = $value;
|
||||
}else{//获取无后缀名称 index
|
||||
$arr[] = basename($value,".html");
|
||||
}
|
||||
}
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 列出目录下的所有文件,包括子目录文件,不包含sql目录
|
||||
* @param $dirName
|
||||
|
@ -220,11 +220,9 @@ layui.define(['table', 'form'], function(exports){
|
||||
,{field: 'id', title: 'ID',width: 60}
|
||||
,{field: 'tags', title: '分类名', minWidth: 100}
|
||||
,{field: 'ename', title: 'EN别名', minWidth: 100}
|
||||
,{
|
||||
title: '图标', align: 'center',
|
||||
templet: '<p><i class="layui-icon {{d.icon}}"></i></p>'
|
||||
}
|
||||
,{field: 'is_hot', title: '热门', templet: '#buttonHot'}
|
||||
,{field: 'detpl',title: '模板', align: 'center',width: 100,templet: '#inputSel'}
|
||||
,{title: '图标', align: 'center',width: 50,templet: '<p><i class="layui-icon {{d.icon}}"></i></p>'}
|
||||
,{field: 'is_hot', title: '热门', align: 'center',width: 50, templet: '#buttonHot'}
|
||||
,{field: 'desc', title: '描述', minWidth: 100}
|
||||
,{title: '操作', width: 100, align: 'center', toolbar: '#layuiadmin-app-cont-tagsbar'}
|
||||
]]
|
||||
@ -276,6 +274,7 @@ layui.define(['table', 'form'], function(exports){
|
||||
,sort = othis.find('input[name="sort"]').val()
|
||||
,tags = othis.find('input[name="tags"]').val()
|
||||
,ename = othis.find('input[name="ename"]').val()
|
||||
,detpl = othis.find('select[name="detpl"]').val()
|
||||
,icon = othis.find('input[name="icon"]').val()
|
||||
,desc = othis.find('input[name="desc"]').val();
|
||||
|
||||
@ -284,7 +283,7 @@ layui.define(['table', 'form'], function(exports){
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:forumTagsForm,
|
||||
data:{"id":data.id,"sort":sort,"catename":tags,"ename":ename,"icon":icon,"desc":desc},
|
||||
data:{"id":data.id,"sort":sort,"catename":tags,"ename":ename,"detpl":detpl,"icon":icon,"desc":desc},
|
||||
daType:"json",
|
||||
success:function (data){
|
||||
if (data.code == 0) {
|
||||
|
@ -539,5 +539,3 @@ html{background-color: #f2f2f2; color: #666;}
|
||||
.xm-body .xm-option.hide-icon.selected {
|
||||
background-color: #1890ff !important;
|
||||
}
|
||||
|
||||
|
||||
|
@ -63,148 +63,77 @@ i{font-style: normal;}
|
||||
}
|
||||
|
||||
.icon-zan:before { content: "\e612"; }
|
||||
|
||||
.icon-jiazaizhong:before { content: "\e60e"; }
|
||||
|
||||
.icon-sousuo:before { content: "\e621"; }
|
||||
|
||||
.icon-quanpingpad:before { content: "\e61d"; }
|
||||
|
||||
.icon-shezhi:before { content: "\e607"; }
|
||||
|
||||
.icon-renzhengv:before { content: "\e62b"; }
|
||||
|
||||
.icon-shijian:before { content: "\e60a"; }
|
||||
|
||||
.icon-guanbi:before { content: "\e614"; }
|
||||
|
||||
.icon-tianjia:before { content: "\e616"; }
|
||||
|
||||
.icon-tuichu:before { content: "\e601"; }
|
||||
|
||||
.icon-shui:before { content: "\e602"; }
|
||||
|
||||
.icon-qq:before { content: "\e618"; }
|
||||
|
||||
.icon-weibo:before { content: "\e617"; }
|
||||
|
||||
.icon-tupian:before { content: "\e608"; }
|
||||
|
||||
.icon-logo:before { content: "\e603"; }
|
||||
|
||||
.icon-daima:before { content: "\e609"; }
|
||||
|
||||
.icon-biaoqing:before { content: "\e60f"; }
|
||||
|
||||
.icon-nan:before { content: "\e619"; }
|
||||
|
||||
.icon-nv:before { content: "\e61a"; }
|
||||
|
||||
.icon-quitquanping:before { content: "\e61e"; }
|
||||
|
||||
.icon-zuichun:before { content: "\e61c"; }
|
||||
|
||||
.icon-charushuipingxian:before { content: "\e622"; }
|
||||
|
||||
.icon-yulan:before { content: "\e60d"; }
|
||||
|
||||
.icon-liulanyanjing:before { content: "\e60b"; }
|
||||
|
||||
.icon-touxiang:before { content: "\e604"; }
|
||||
|
||||
.icon-caina:before { content: "\e613"; }
|
||||
|
||||
.icon-room:before { content: "\e615"; }
|
||||
|
||||
.icon-svgmoban53:before { content: "\e610"; }
|
||||
|
||||
.icon-shichang:before { content: "\e600"; }
|
||||
|
||||
.icon-shouye:before { content: "\e605"; }
|
||||
|
||||
.icon-tishilian:before { content: "\e629"; }
|
||||
|
||||
.icon-fabu:before { content: "\e606"; }
|
||||
|
||||
.icon-pinglun:before { content: "\e60c"; }
|
||||
|
||||
.icon-zan1:before { content: "\e611"; }
|
||||
|
||||
.icon-chengshi:before { content: "\e61b"; }
|
||||
|
||||
.icon-lianjie:before { content: "\e620"; }
|
||||
|
||||
.icon-yulan1:before { content: "\e785"; }
|
||||
|
||||
.icon-renshu:before { content: "\e61f"; }
|
||||
|
||||
.icon-huizongzuoyoutuodong:before { content: "\e623"; }
|
||||
|
||||
.icon-404:before { content: "\e627"; }
|
||||
|
||||
.icon-iconmingxinganli:before { content: "\e652"; }
|
||||
|
||||
.icon-wenda:before { content: "\e626"; }
|
||||
|
||||
.icon-top:before { content: "\e624"; }
|
||||
|
||||
.icon-ui:before { content: "\e625"; }
|
||||
|
||||
.icon-fengexian:before { content: "\e63a"; }
|
||||
|
||||
.icon-jiacu:before { content: "\e62f"; }
|
||||
|
||||
.icon-kiss:before { content: "\e6cd"; }
|
||||
|
||||
.icon-biaoqing1:before { content: "\e63b"; }
|
||||
|
||||
.icon-liwu:before { content: "\e9c5"; }
|
||||
|
||||
.icon-emwdaima:before { content: "\e62a"; }
|
||||
|
||||
.icon-quanzi:before { content: "\e7bb"; }
|
||||
|
||||
.icon-wendang:before { content: "\e722"; }
|
||||
|
||||
.icon-jifen:before { content: "\e632"; }
|
||||
|
||||
.icon-aqrenzheng:before { content: "\e62d"; }
|
||||
|
||||
.icon-pinglun1:before { content: "\e631"; }
|
||||
|
||||
.icon-web:before { content: "\e6e9"; }
|
||||
|
||||
.icon-yxj-expression:before { content: "\e628"; }
|
||||
|
||||
.icon-tongzhi:before { content: "\e647"; }
|
||||
|
||||
.icon-kaifashili:before { content: "\e638"; }
|
||||
|
||||
.icon-huiyuan:before { content: "\e637"; }
|
||||
|
||||
.icon-pinglun2:before { content: "\e62c"; }
|
||||
|
||||
.icon-alipay:before { content: "\e630"; }
|
||||
|
||||
.icon-jiaoliu:before { content: "\e6b7"; }
|
||||
|
||||
.icon-chanpin:before { content: "\e634"; }
|
||||
|
||||
.icon-renzheng:before { content: "\e62e"; }
|
||||
|
||||
.icon-tiezi:before { content: "\e635"; }
|
||||
|
||||
.icon-rizhi:before { content: "\e69d"; }
|
||||
|
||||
.icon-weixinzhifu:before { content: "\e633"; }
|
||||
|
||||
.icon-yinyong:before { content: "\e636"; }
|
||||
|
||||
.icon-xiazai:before { content: "\e78e"; }
|
||||
|
||||
|
||||
|
||||
|
||||
/* 辅助 */
|
||||
a:hover{color: #009688; transition: all .3s;}
|
||||
pre{position: relative; margin: 10px 0; padding: 15px; line-height: 20px; border: 1px solid #ddd; border-left-width: 6px; background-color: #F2F2F2; color: #333; font-family: Courier New; font-size: 12px;}
|
||||
@ -378,6 +307,17 @@ pre{position: relative; margin: 10px 0; padding: 15px; line-height: 20px; border
|
||||
.layui-textarea:hover,
|
||||
.layui-textarea:focus{border-color: #e6e6e6 !important;}
|
||||
|
||||
/* 主页置顶列表 */
|
||||
.fly-panel-top{margin-bottom: 15px; padding: 5px 5px 10px 0px;border-radius: 2px; background-color: #fff; box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);}
|
||||
.fly-panel-top[pad20]{padding: 20px;}
|
||||
.fly-list-top li{position: relative; height: 20px; line-height: 20px; padding: 8px 15px 10px 20px; border-bottom: 1px dotted #e2e2e2;}
|
||||
.fly-list-top li:last-child{border-bottom: none;}
|
||||
.fly-list-top .top-list-tag{float:left;}
|
||||
.fly-list-info-top{position: relative;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
|
||||
.fly-list-info-top span{font-size: 10px; color: #cccccc;}
|
||||
.fly-list-top li h2{position: relative; left:15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
|
||||
.fly-list-top li h2 a{display: inline-block; padding-right: 10px; font-size: 16px;}
|
||||
|
||||
/* 列表 */
|
||||
.fly-list li{position: relative; height: 45px; line-height: 22px; padding: 15px 15px 15px 75px; border-bottom: 1px dotted #e2e2e2;}
|
||||
.fly-list li:last-child{border-bottom: none;}
|
||||
@ -417,7 +357,26 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.layui-edit-face ul li{cursor: pointer; float: left; border: 1px solid #e8e8e8; height: 22px; width: 26px; overflow: hidden; margin: -1px 0 0 -1px; padding: 4px 2px; text-align: center;}
|
||||
.layui-edit-face ul li:hover{position: relative; z-index: 2; border: 1px solid #eb7350; background: #fff9ec;}
|
||||
|
||||
/* 签到 */
|
||||
/*问题列表*/
|
||||
.question-list{width: 100%;}
|
||||
.question-list li{line-height: 30px; padding: 10px 15px 15px 20px; border-bottom: 1px dotted #e2e2e2; }
|
||||
.que-sta-jie,
|
||||
.que-sta-ask{float: left; margin-top:5px; margin-right:10px; text-align:center; padding:2px; width:38px; height:38px; line-height: 20px; border-radius: 10%; color: #fff;}
|
||||
.que-sta-jie{background: #5FB878;}
|
||||
.que-sta-ask{background: #FF5722;}
|
||||
.que-body{width:100%; padding: 0px; }
|
||||
.que-body h2{margin-right:10px; line-height: 26px; font-size: 16px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;}
|
||||
.que-body h2 a{display: inline-block; max-width: 95%; height: 20px; font-size: 16px;}
|
||||
.que-body .que-user-info{display: block; text-overflow: ellipsis;}
|
||||
.que-body .que-user-info a{margin-right: 10px;}
|
||||
.que-body .que-user-info .que-avatar{top: 20px;}
|
||||
.que-body .que-user-info .que-avatar img{width: 25px; height: 25px; margin-top: 10; border-radius: 100%;}
|
||||
.que-body .que-user-info .que-avatar i{position: absolute; left: 35px; top: 15px; }
|
||||
.que-body .que-user-info span{display: inline-block; font-size: 12px; padding-left: 5px;}
|
||||
.que-content{font-size: 14px; color:#999;}
|
||||
|
||||
|
||||
/* 签到 */
|
||||
.fly-signin cite{padding: 0 5px; color: #FF5722; font-style: normal;}
|
||||
.fly-signin .layui-badge-dot{top: -7px; margin-left: 0px;}
|
||||
.fly-signin-list{padding: 0; line-height: 30px;}
|
||||
@ -471,8 +430,12 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.jie-row li .jie-user img{position:relative; top: 16px; width: 35px; height: 35px;}
|
||||
|
||||
/* Detail页 */
|
||||
.detail-box{padding-left: 20px; padding-top: 15px; padding-right: 20px; padding-bottom: 20px;}
|
||||
.detail-box{position: relative;padding-left: 20px; padding-top: 15px; padding-right: 20px; padding-bottom: 20px;}
|
||||
.detail h1{font-size: 22px; line-height: 36px; padding-bottom:10px;}
|
||||
.detail .fly-avatar{position: absolute; left: 15px; top: 10px;}
|
||||
.detail .fly-avatar img{display: block; width: 45px; height: 45px; margin: 0; border-radius: 100%;}
|
||||
.detail .fly-avatar .icon-renzheng{display: inline-block; width: 15px; height: 15px; line-height: 15px; top: 25px; left: 32px; background-color: #FFB800; color: #fff; border-radius: 50%; font-size: 14px;}
|
||||
|
||||
.fly-detail-info{position: relative; margin: 10px 0 15px;}
|
||||
.fly-detail-info .layui-btn{height: 20px; line-height: 20px; vertical-align: top; border-radius: 0;}
|
||||
.fly-detail-info .layui-btn+.layui-btn{margin-left: 0;}
|
||||
@ -483,9 +446,9 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.detail-about .jie-status, .detail-about .jie-status-ok{color:#fff;}
|
||||
.detail-about .fly-jing{padding:0 6px; background-color:#c00; color:#fff;}
|
||||
.detail-about .detail-hits{position: relative; top: 5px; line-height: 20px;}
|
||||
.detail-about .icon-renzheng{display: inline-block; width: 15px; height: 15px; line-height: 15px; top: 25px; left: 35px; background-color: #FFB800; color: #fff; border-radius: 50%; font-size: 10px;}
|
||||
.fly-detail-user{white-space: nowrap; overflow: hidden;}
|
||||
.fly-detail-user a{padding-right: 10px; font-size: 14px;}
|
||||
.fly-detail-user .icon-renzheng{top: 1px;}
|
||||
.fly-detail-user .guanzhu{position: absolute; right:10px; }
|
||||
|
||||
.detail-assist{position: relative; height:22px; margin-top: 10px; line-height: 15px; padding: 5px 10px 5px 10px; font-size: 13px; background-color: #f8f8f8; color: #999;border-radius:5px;}
|
||||
@ -515,6 +478,30 @@ body .layui-edit-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.detail-body ul>li{margin-top: 0;}
|
||||
.detail-body .layui-elem-quote{margin: 10px 0; font-size: 14px; line-height: 26px;}
|
||||
|
||||
/*详情页-问答*/
|
||||
.user-questions{position:relative; margin: 5px 0 15px;}
|
||||
.user-questions .user-avatar img{width: 25px; height: 25px; margin-top: 10; border-radius: 100%;}
|
||||
.user-questions .user-questions-right{position:absolute; right:0px; display: inline-block; font-size: 14px; padding-left: 5px;}
|
||||
.user-questions .user-questions-right i{padding: 0 3px 0 15px; font-size: 22px; color: #999;}
|
||||
|
||||
.detail-body-wenda{margin: 10px 0 5px; line-height: 26px; font-size: 16px; color: #999; word-wrap: break-word;}
|
||||
.detail-body-wenda p{margin-bottom:15px;}
|
||||
.detail-body-wenda img{max-width: 100%; cursor: pointer;}
|
||||
.detail-body-wenda .layui-btn{margin: 0 10px 10px 0;}
|
||||
.detail-body-wenda .layui-btn a{color: #fff;}
|
||||
.detail-body-wenda ul>li{margin-top: 0;}
|
||||
.detail-body-wenda .layui-elem-quote{margin: 10px 0; font-size: 14px; line-height: 26px;}
|
||||
.layui-form-pane{position:relative; width:100%;}
|
||||
.que-comments{position:absolute;right:20px;bottom:5px;}
|
||||
|
||||
.wenda-user{height:200px; margin: 0,auto; text-align: center; pardding-top:20px;}
|
||||
.wenda-user .user-img{posation:relative; width:100%;}
|
||||
.wenda-user .user-img img{width:150px;height:150px; border-radius: 100%;}
|
||||
.wenda-user .user-img i{posation:absolute;right:20px;top:30px;width: 25px; height:25px; color:#fff; font-site:18px; border-radius: 100%;background-color:#FFB800;}
|
||||
.wenda-user .questions{height:30px;margin:20px 20px;}
|
||||
|
||||
|
||||
|
||||
/* 详情页的底部操作条 */
|
||||
.site-tree-mobile-detail-bottom{display: block!important; position: fixed; z-index: 1000; bottom: 0px; left: 0px; width: 100%; height: 30px; line-height: 30px; border-radius: 2px; text-align: center; color: #e2e2e2;background:#eeeeee}
|
||||
.site-home .site-tree-mobile-detail-bottom{display: none!important;}
|
||||
|
@ -1097,12 +1097,11 @@ layui.define(['layer', 'laytpl', 'form', 'element', 'upload', 'util', 'imgcom'],
|
||||
shade: [0.2, '#000']
|
||||
});
|
||||
var url = $(this).data('url');
|
||||
var locationurl = $(this).attr('location-url');
|
||||
$.getJSON(url, function(data) {
|
||||
if (data.code == 200) {
|
||||
layer.close(loading);
|
||||
layer.msg(data.msg, { icon: 1, time: 1000 }, function() {
|
||||
location.href = locationurl;
|
||||
location.href = data.url;
|
||||
});
|
||||
} else {
|
||||
layer.close(loading);
|
||||
|
118
view/taoler/index/article/ask/cate.html
Normal file
118
view/taoler/index/article/ask/cate.html
Normal file
@ -0,0 +1,118 @@
|
||||
{extend name="public/base" /}
|
||||
{block name="title"}{$Request.param.ename|getCateName}-{$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$Request.param.ename|getCateName},{$sysInfo.webname}{/block}
|
||||
{block name="description"}{$Request.param.ename|getCateDesc}{/block}
|
||||
{block name="column"}{include file="/public/column" /}{/block}
|
||||
|
||||
{block name="content"}
|
||||
<div class="layui-container">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md8">
|
||||
<div class="fly-panel" style="margin-bottom: 0;">
|
||||
<div class="layui-tab-card">
|
||||
<ul class="layui-tab-title">
|
||||
<li {if condition="$type eq 'all'" } class="layui-this" {/if}><a href="{:url('article/cate',['ename' => $Request.param.ename ?:'all','type' => 'all'])} " >{:lang('all')}</a></li>
|
||||
<li {if condition="$type eq 'jie'" } class="layui-this" {/if}><a href="{:url('article/cate',['ename' => $Request.param.ename ?:'all','type' => 'jie'])} ">{:lang('end')}</a></li>
|
||||
<li {if condition="$type eq 'wait'" } class="layui-this" {/if}><a href="{:url('article/cate',['ename' => $Request.param.ename ?:'all' ,'type' => 'wait'])}">{:lang('未解决')}</a> </li>
|
||||
</ul>
|
||||
</div>
|
||||
<ul class="question-list">
|
||||
{volist name="artList" id="art"}
|
||||
<li>
|
||||
{if ($art.jie == 1)}
|
||||
<div class="que-sta-jie">
|
||||
<span >已解</span>
|
||||
<span >√</span>
|
||||
</div>
|
||||
{else /}
|
||||
<div class="que-sta-ask">
|
||||
<span>未解</span>
|
||||
<span >?</span>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="que-body">
|
||||
<h2>
|
||||
<a href="{:url('article/detail',['id' => $art.id])}" style="color:{$art.title_color};">{$art.title}</a>
|
||||
</h2>
|
||||
<div class="que-user-info">
|
||||
<a href="{:url('user/home',['id'=>$art.user.id])}" class="que-avatar">
|
||||
<img src="{$art.user.user_img}" alt="{$art.user.name}">
|
||||
<cite>{$art.user.nickname ?: $art.user.name}</cite>
|
||||
</a>
|
||||
{$art.create_time|date='Y-m-d'}
|
||||
<span title="浏览">浏览{$art.pv}</span>
|
||||
<span >
|
||||
<i class="iconfont icon-pinglun1" title="回答"></i> {$art.comments_count}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="que-content">{:getArtContent($art.content)}</div>
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
|
||||
<div style="text-align: center" id="page">{$artList|raw}</div>
|
||||
<!--div style="text-align: center" id="pages"></div-->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<div class="fly-panel">
|
||||
<div class="fly-panel" style="padding: 5px 0; text-align: center;">
|
||||
{volist name="ad_cateImg" id="vo"}
|
||||
<a href="{$vo.slid_href}" target="_blank"><img src="{$vo.slid_img}" style="max-width: 100%;"></a>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
<dl class="fly-panel fly-list-one layui-hide-xs">
|
||||
<dt class="fly-panel-title">{:lang('hot post list')}</dt>
|
||||
{volist name="artHot" id="vo"}
|
||||
<dd>
|
||||
<a href="{:url('article/detail',['id' => $vo.id])}">{$vo.title}</a>
|
||||
<span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
|
||||
</dd>
|
||||
{/volist}
|
||||
</dl>
|
||||
|
||||
<div class="fly-panel">
|
||||
<div class="fly-panel-title">{:lang('sponsor')}<span style="padding: 0 3px;">-</span>
|
||||
<a href="" class="fly-link fly-joinad ">{:lang('i want to join')}</a>
|
||||
</div>
|
||||
<div class="fly-panel-main">
|
||||
{volist name="ad_comm" id="vo"}
|
||||
<a href="{$vo.slid_href}" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: {$vo.slid_color};">{$vo.slid_name}</a>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="public/menu" /}
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script>
|
||||
layui.use(['laypage'], function(){
|
||||
var laypage = layui.laypage;
|
||||
|
||||
//执行一个laypage实例
|
||||
laypage.render({
|
||||
elem: 'pages' //注意,这里的 test1 是 ID,不用加 # 号
|
||||
,count: 50 //数据总数,从服务端得到
|
||||
,limit: 15
|
||||
,curr :{$Request.param.page ?: 1} //获取起始页
|
||||
,jump: function(obj, first){
|
||||
//obj包含了当前分页的所有参数,比如:
|
||||
//console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。
|
||||
//console.log(obj.limit); //得到每页显示的条数
|
||||
|
||||
//首次不执行
|
||||
if(!first){
|
||||
//do something
|
||||
//window.location.href= url+obj.curr+'&limit='+obj.limit+'#collection'; //跳转
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
341
view/taoler/index/article/ask/detail.html
Normal file
341
view/taoler/index/article/ask/detail.html
Normal file
@ -0,0 +1,341 @@
|
||||
{extend name="public/base" /}
|
||||
|
||||
{block name="title"}{$article.title}-{$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$article.title},{$article.tags}{/block}
|
||||
{block name="description"}{$article.title},{:getArtContent($article.content)}{/block}
|
||||
{block name="link"}<link rel="stylesheet" href="/static/res/css/plyr.css" charset="utf-8">{/block}
|
||||
{block name="column"}<div class="layui-hide-xs">{include file="/public/column" /}</div>{/block}
|
||||
{block name="content"}
|
||||
<div class="layui-container">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md8 content detail">
|
||||
<div class="fly-panel detail-box">
|
||||
{//标题}
|
||||
<h1 style="color:{$article.title_color};">{$article.title}
|
||||
{if ($article.jie == 0)}
|
||||
<span class="layui-btn layui-btn-xs" style="background-color: #FF5722;">{:lang('no finished')}</span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs" style="background-color: #009688;">{:lang('finished')}</span>
|
||||
{/if}
|
||||
<span id="LAY_jieAdmin" data-id="{$article['id']}"></span>
|
||||
<span class="layui-hide-xs"><div onclick="PhoneDown();" style="" class="detail_qrcode" id="mobile"></div></span>
|
||||
</h1>
|
||||
|
||||
{//图标}
|
||||
<div class="user-questions">
|
||||
<a class="user-avatar" href="{:url('user/home',['id'=>$article.user.id])}">
|
||||
<img src="{$article.user.user_img}" alt="{$article.user.name}">
|
||||
<cite>{$article.user.nickname ?: $article.user.name}</cite>
|
||||
</a>
|
||||
<span class="user-post-time" data="{$article.create_time}" style="padding-top: 5px;">2019-12-01</span>
|
||||
<span class="user-questions-right">
|
||||
<i class="iconfont" title="{:lang('reply')}"></i>{$comments->count()}<i class="iconfont" title="浏览"></i>{$pv}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{//问题内容}
|
||||
<div class="detail-body-wenda photos">问题描述:{$article.content|raw}</div>
|
||||
|
||||
{//管理}
|
||||
{if (($article.upzip !== '') || session('?user_name'))}
|
||||
<div class="detail-assist">
|
||||
{notempty name="$article.upzip"}
|
||||
<button type="button" class="layui-btn layui-btn-xs" id="zip-download"><i class="layui-icon layui-icon-download-circle"></i>{:lang('download files')}: {$article.downloads}次</button>
|
||||
{/notempty}
|
||||
<div class="fly-admin-box" data-id="{$article.id}">
|
||||
{if ($user.auth ?? '')}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="del"><i class="layui-icon layui-icon-delete"></i></span>
|
||||
{if($article.is_top == 0)}<span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" rank="1"><i class="layui-icon layui-icon-top"></i></span>
|
||||
{else /}<span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" rank="0" style="background-color:#ccc;">{:lang('cancel topping')}</span>{/if}
|
||||
{if($article.is_hot == 0)}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="hot" rank="1"><i class="layui-icon layui-icon-fire"></i></span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="hot" rank="0" style="background-color:#ccc;">{:lang('cancel hoting')}</span>
|
||||
{/if}
|
||||
{if($article.is_reply == 1)}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="reply" rank="0"><i class="layui-icon layui-icon-face-cry"></i></span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="reply" rank="1" style="background-color:#ccc;">{:lang('enable reply')}</span>
|
||||
{/if}
|
||||
<span id="color">{:lang('title color')}</span>
|
||||
{/if}
|
||||
{if(session('user_name')==$article.user.name || ($user.auth ?? ''))}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="edit"><a href="{:url('article/edit',['id'=>$article.id])}">{:lang('edit')}</a></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{//评论区}
|
||||
{if condition="$article.is_reply == 1"}
|
||||
<div class="layui-form layui-form-pane">
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<a name="comment"></a>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea fly-editor" style="height: 150px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item que-comments">
|
||||
<input type="hidden" name="article_id" value="{$article.id}">
|
||||
<input type="hidden" name="user_id" value="{:session('user_id')}">
|
||||
<button class="layui-btn layui-btn-danger" lay-filter="user-comment" lay-submit>{:lang('submit comments')}</button>
|
||||
</div>
|
||||
</div>
|
||||
{else /}
|
||||
<blockquote class="layui-elem-quote layui-quote-nm layui-disabled" style="margin: 100px 0 20px; padding: 50px 20px; text-align: center; color: #999!important;">本帖已设置禁止回复</blockquote>
|
||||
{/if}
|
||||
{//评论内容}
|
||||
<div class="fly-panel detail-box" id="flyReply">
|
||||
<span style="font-size:18px;">评论 {$comments->count()}</span>
|
||||
<ul class="jieda" id="jieda">
|
||||
{volist name="comments" id="vo" empty= ""}
|
||||
<li data-id="{$vo.id}" class="jieda-daan">
|
||||
<a name="item-1111111111"></a>
|
||||
<div class="detail-about detail-about-reply">
|
||||
<a class="fly-avatar" href="{:url('user/home',['id'=>$vo.user.id])}">
|
||||
<img src="{$vo.user.user_img}" alt=" ">{if($vo.user.vip > 0)}<i class="iconfont icon-renzheng" title="认证信息"></i>{/if}
|
||||
</a>
|
||||
<div class="fly-detail-user">
|
||||
<a href="{:url('user/home',['id'=>$vo.user.id])}" class="fly-link">
|
||||
<cite>{$vo.user.nickname ?: $vo.user.name}</cite>
|
||||
</a>
|
||||
{if condition="$article.user.id eq $vo.user.id"}<span>({:lang('poster')})</span>{/if}
|
||||
</div>
|
||||
<div class="detail-hits"><span class="post-time" data="{$vo.create_time}"></span></div>
|
||||
{if $vo.cai == 1}<i class="iconfont icon-caina" title="最佳答案"></i>{/if}
|
||||
</div>
|
||||
<div class="detail-body jieda-body photos">{$vo.content|raw}</div>
|
||||
<div class="jieda-reply">
|
||||
<span class="jieda-zan {if($vo.zan != 0)}zanok{/if}" type="zan">
|
||||
<i class="iconfont icon-zan"></i><em>{$vo.zan}</em>赞
|
||||
</span>
|
||||
<span type="reply"><i class="iconfont icon-svgmoban53"></i>{:lang('reply')}</span>
|
||||
{//评论编辑删除采纳权限}
|
||||
<div class="jieda-admin">
|
||||
{if ((session('user_id') == $vo.user.id) && (getLimtTime($vo.create_time) < 2)) OR ($user.auth ?? '')}
|
||||
<span type="edit">{:lang('edit')}</span>
|
||||
<span type="del">{:lang('delete')}</span>
|
||||
{/if}
|
||||
{if ($vo.cai == 0) && ((session('user_id') == $article.user_id) OR ($user.auth ?? '')) /}<span class="jieda-accept" type="accept">{:lang('accept')}</span>{/if}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
<div style="text-align: center">{$comments|raw}</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
|
||||
<div class="fly-panel">
|
||||
<div class="fly-panel-main wenda-user">
|
||||
<div class="user-img">
|
||||
<a href="{:url('user/home',['id'=>$article.user.id])}">
|
||||
<img class="" src="{$article.user.user_img}" alt="{$article.user.name}">
|
||||
{if($article.user.vip > 0)}<i class="iconfont icon-renzheng" title="认证信息"></i>{/if}
|
||||
</a>
|
||||
</div>
|
||||
<div class="questions">
|
||||
<span class="layui-badge layui-bg-green">回答 100</span> <span class="layui-badge layui-bg-green">提问 100</span> <span class="layui-badge layui-bg-green">+ 关注</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fly-panel">
|
||||
<div class="fly-panel-title">{:lang('sponsor')}<span style="padding: 0 3px;">-</span>
|
||||
<a href="" class="fly-link fly-joinad">{:lang('i want to join')}</a>
|
||||
</div>
|
||||
<div class="fly-panel-main">
|
||||
{volist name="ad_comm" id="vo"}
|
||||
<a href="{$vo.slid_href}" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: {$vo.slid_color};">{$vo.slid_name}</a>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
<dl class="fly-panel fly-list-one">
|
||||
<dt class="fly-panel-title">{:lang('hot post list')}</dt>
|
||||
{volist name="artHot" id="vo"}
|
||||
<dd>
|
||||
<a href="{:url('article/detail',['id' => $vo.id])}">{$vo.title}</a>
|
||||
<span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
|
||||
</dd>
|
||||
{/volist}
|
||||
</dl>
|
||||
<div class="fly-panel" style="padding: 5px 0; text-align: center;">
|
||||
{volist name="ad_art" id="vo"}
|
||||
<a href="{$vo.slid_href}" target="_blank"><img src="{$vo.slid_img}" style="max-width: 100%;"></a>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--底部栏-->
|
||||
<div class="site-tree-mobile-detail-bottom layui-hide-md">
|
||||
<div id="LAY_jieAdmin1" data-id="{$article['id']}"></div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="public/menu" /}
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script>
|
||||
var collectionFind = "{:url('Collection/find')}",
|
||||
articleJieset = "{:url('Article/jieset')}",
|
||||
articleDelete = "{:url('Article/delete')}",
|
||||
commentJiedaZan = "{:url('Comment/jiedaZan')}",
|
||||
commentJiedaCai = "{:url('Comment/jiedaCai')}",
|
||||
commentGetDa = "{:url('Comment/getDa')}",
|
||||
commentUpdateDa = "{:url('Comment/updateDa')}",
|
||||
commentJiedaDelete = "{:url('Comment/jiedaDelete')}",
|
||||
langCollection = "{:lang('collection')}",
|
||||
langCancelCollection = "{:lang('cancel collection')}";
|
||||
var collection = "{:url('collection/')}";
|
||||
|
||||
layui.use(['fly', 'face','colorpicker','plyr'], function(){
|
||||
var $ = layui.jquery
|
||||
,form = layui.form
|
||||
,fly = layui.fly
|
||||
,colorpicker = layui.colorpicker
|
||||
,plyr = layui.plyr;
|
||||
var laytpl = layui.laytpl;
|
||||
var uid = layui.cache.user.uid;
|
||||
|
||||
//tpl模板给发布时间赋值
|
||||
$('div.user-questions').children('span.user-post-time').each(function(){
|
||||
var othis = $(this), html = othis.html();
|
||||
var string = laytpl('{{ d.time }}').render({
|
||||
//time: html
|
||||
time: othis.attr('data')
|
||||
});
|
||||
var posttime = layui.util.timeAgo(string, 1);
|
||||
|
||||
othis.text(posttime);
|
||||
//console.log(othis.attr('data'));
|
||||
});
|
||||
//tpl模板给发布时间赋值
|
||||
$('div.detail-hits').children('span.post-time').each(function(){
|
||||
var othis = $(this), html = othis.html();
|
||||
var string = laytpl('{{ d.time }}').render({
|
||||
//time: html
|
||||
time: othis.attr('data')
|
||||
});
|
||||
var posttime = layui.util.timeAgo(string, 1);
|
||||
|
||||
othis.text(posttime);
|
||||
//console.log(othis.attr('data'));
|
||||
});
|
||||
|
||||
|
||||
//预定义颜色项
|
||||
colorpicker.render({
|
||||
elem: '#color'
|
||||
,color: '#393d49'
|
||||
,predefine: true // 开启预定义颜色
|
||||
,size: 'xs'
|
||||
,done: function(color){
|
||||
//改变标题颜色
|
||||
$('h1').css("color", color);
|
||||
var id = {$article.id};
|
||||
$.ajax({
|
||||
type:'post',
|
||||
url:"{:url('Article/titleColor')}",
|
||||
data:{id: id,title_color: color},
|
||||
dataType:'json',
|
||||
success:function(data){
|
||||
if(data.code == 0){
|
||||
layer.msg(data.msg,{icon:6,time:2000
|
||||
});
|
||||
} else {
|
||||
layer.open({content:data.msg,icon:5,adim:6});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//评论需要登陆
|
||||
form.on('submit(user-comment)',function (data){
|
||||
var filed = data.field;
|
||||
if (uid == -1) {
|
||||
layer.msg('请先登陆',{icon:5,time:2000},function(){
|
||||
location.href = "{:url('login/index')}";
|
||||
});
|
||||
} else {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "{:url('article/comment')}",
|
||||
data: filed,
|
||||
dataType: "json",
|
||||
success:function (data) {
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg,{icon:6,time:2000},function () {
|
||||
location.reload(true);
|
||||
});
|
||||
}else {
|
||||
layer.open({title:'评论失败',content:data.msg,icon:5,anim:6});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//下载
|
||||
$('#zip-download').click(function (){
|
||||
var id = "{$article.id}";
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('article/download')}",
|
||||
data:{id:id},
|
||||
success:function (data) {
|
||||
location.href = "{:url('article/download',['id'=>$article.id])}";
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
|
||||
$('.detail-body-wenda').each(function(){
|
||||
var othis = $(this), html = othis.html();
|
||||
othis.html(fly.content(html));
|
||||
});
|
||||
$('.detail-body').each(function(){
|
||||
var othis = $(this), html = othis.html();
|
||||
othis.html(fly.content(html));
|
||||
});
|
||||
//加载播放器
|
||||
plyr.setup();
|
||||
|
||||
});
|
||||
|
||||
//扫码阅读
|
||||
$("#rdown").hover(function(){
|
||||
$("#phonedl").show().stop();
|
||||
},function(){
|
||||
$("#phonedl").hide().stop();
|
||||
});
|
||||
|
||||
$("#phonedl").hover(function(){
|
||||
$("#phonedl").show().stop();
|
||||
},function(){
|
||||
$("#phonedl").hide().stop();
|
||||
});
|
||||
|
||||
function PhoneDown(){
|
||||
layer.open({
|
||||
title: "扫码查阅",
|
||||
skin: 'layui-layer',
|
||||
content: "<img src='/qrcode/?text={$Request.domain}{:url('article/detail',['id' => $article.id])}&size=230'>"
|
||||
});
|
||||
}
|
||||
//推送百度收录服务
|
||||
(function(){
|
||||
var bp = document.createElement('script');
|
||||
var curProtocol = window.location.protocol.split(':')[0];
|
||||
if (curProtocol === 'https') {
|
||||
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
|
||||
}
|
||||
else {
|
||||
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
|
||||
}
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(bp, s);
|
||||
})();
|
||||
</script>
|
||||
{/block}
|
109
view/taoler/index/article/posts/cate.html
Normal file
109
view/taoler/index/article/posts/cate.html
Normal file
@ -0,0 +1,109 @@
|
||||
{extend name="public/base" /}
|
||||
{block name="title"}{$Request.param.ename|getCateName}-{$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$Request.param.ename|getCateName},{$sysInfo.webname}{/block}
|
||||
{block name="description"}{$Request.param.ename|getCateDesc}{/block}
|
||||
{block name="column"}{include file="/public/column" /}{/block}
|
||||
|
||||
{block name="content"}
|
||||
<div class="layui-container">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md8">
|
||||
<div class="fly-panel" style="margin-bottom: 0;">
|
||||
<ul class="fly-list">
|
||||
{volist name="artList" id="art"}
|
||||
<li>
|
||||
<a href="{:url('user/home',['id'=>$art.user.id])}" class="fly-avatar">
|
||||
<img src="{$art.user.user_img}" alt="{$art.user.name}">
|
||||
</a>
|
||||
<h2>
|
||||
{if config('taoler.config.cate_show') == 1}<a class="layui-badge">{:cookie('think_lang') == 'en-us' ? $art.cate.ename : $art.cate.catename}</a>{/if}
|
||||
<a href="{:url('article/detail',['id' => $art.id])}" style="color:{$art.title_color};">{$art.title}</a>
|
||||
</h2>
|
||||
<div class="fly-list-info">
|
||||
<a href="{:url('user/home',['id'=>$art.user.id])}" link>
|
||||
{if config('taoler.config.area_show') == 1}<span class="layui-badge layui-bg-green " title="来自哪简称">{:getAsing($art.user.area_id) ?: '无'}</span>{/if}
|
||||
<cite>{$art.user.nickname ?: $art.user.name}</cite>
|
||||
<i>{$art.create_time|date='Y-m-d'}</i>
|
||||
</a>
|
||||
<span>
|
||||
{$art.has_img ?= ' <i class="layui-icon layui-icon-picture" style=" color: #5FB878;"></i>'}
|
||||
{$art.has_video ?= ' <i class="layui-icon layui-icon-play" style="color: #FF5722;"></i>'}
|
||||
{$art.has_audio ?= ' <i class="layui-icon layui-icon-speaker" style="color: #000000;"></i>'}
|
||||
{$art.upzip ?= ' <i class="layui-icon layui-icon-file-b" style="color: #009688;" title="附件"></i>'}
|
||||
</span>
|
||||
<span class="layui-hide-xs" title="浏览"><i class="iconfont" title="浏览"></i> {$art.pv}</span>
|
||||
<span class="fly-list-nums">
|
||||
<i class="iconfont icon-pinglun1" title="回答"></i> {$art.comments_count}
|
||||
</span>
|
||||
</div>
|
||||
<div class="fly-list-badge">
|
||||
{if ($art.is_hot == 1)}<i class="layui-icon layui-icon-fire layui-hide-md" style="font-size: 20px; color: #FF5722;"></i><span class="layui-badge layui-bg-red layui-hide-xs">{:lang('hot')}</span> {/if}
|
||||
</div>
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
<div style="text-align: center" id="page">{$artList|raw}</div>
|
||||
<!--div style="text-align: center" id="pages"></div-->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<div class="fly-panel">
|
||||
<div class="fly-panel" style="padding: 5px 0; text-align: center;">
|
||||
{volist name="ad_cateImg" id="vo"}
|
||||
<a href="{$vo.slid_href}" target="_blank"><img src="{$vo.slid_img}" style="max-width: 100%;"></a>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
<dl class="fly-panel fly-list-one layui-hide-xs">
|
||||
<dt class="fly-panel-title">{:lang('hot post list')}</dt>
|
||||
{volist name="artHot" id="vo"}
|
||||
<dd>
|
||||
<a href="{:url('article/detail',['id' => $vo.id])}">{$vo.title}</a>
|
||||
<span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
|
||||
</dd>
|
||||
{/volist}
|
||||
</dl>
|
||||
|
||||
<div class="fly-panel">
|
||||
<div class="fly-panel-title">{:lang('sponsor')}<span style="padding: 0 3px;">-</span>
|
||||
<a href="" class="fly-link fly-joinad ">{:lang('i want to join')}</a>
|
||||
</div>
|
||||
<div class="fly-panel-main">
|
||||
{volist name="ad_comm" id="vo"}
|
||||
<a href="{$vo.slid_href}" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: {$vo.slid_color};">{$vo.slid_name}</a>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="public/menu" /}
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script>
|
||||
layui.use(['laypage'], function(){
|
||||
var laypage = layui.laypage;
|
||||
|
||||
//执行一个laypage实例
|
||||
laypage.render({
|
||||
elem: 'pages' //注意,这里的 test1 是 ID,不用加 # 号
|
||||
,count: 50 //数据总数,从服务端得到
|
||||
,limit: 15
|
||||
,curr :{$Request.param.page ?: 1} //获取起始页
|
||||
,jump: function(obj, first){
|
||||
//obj包含了当前分页的所有参数,比如:
|
||||
//console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。
|
||||
//console.log(obj.limit); //得到每页显示的条数
|
||||
|
||||
//首次不执行
|
||||
if(!first){
|
||||
//do something
|
||||
//window.location.href= url+obj.curr+'&limit='+obj.limit+'#collection'; //跳转
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
315
view/taoler/index/article/posts/detail.html
Normal file
315
view/taoler/index/article/posts/detail.html
Normal file
@ -0,0 +1,315 @@
|
||||
{extend name="public/base" /}
|
||||
|
||||
{block name="title"}{$article.title}-{$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$article.title},{$article.tags}{/block}
|
||||
{block name="description"}{$article.title},{:getArtContent($article.content)}{/block}
|
||||
{block name="link"}<link rel="stylesheet" href="/static/res/css/plyr.css" charset="utf-8">{/block}
|
||||
{block name="column"}<div class="layui-hide-xs">{include file="/public/column" /}</div>{/block}
|
||||
{block name="content"}
|
||||
<div class="layui-container">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md8 content detail">
|
||||
<div class="fly-panel detail-box">
|
||||
{//标题}
|
||||
<h1 style="color:{$article.title_color};">{$article.title}
|
||||
<span class="layui-hide-xs"><div onclick="PhoneDown();" style="" class="detail_qrcode" id="mobile"></div></span>
|
||||
</h1>
|
||||
{//图标}
|
||||
<div class="fly-detail-info">
|
||||
<span class="layui-badge layui-bg-green fly-detail-column">{:cookie('think_lang') == 'en-us' ? $article.cate.ename : $article.cate.catename}</span>
|
||||
{if ($article.is_top == 1)}<span class="layui-badge layui-bg-black">{:lang('top')}</span>{/if}
|
||||
{if ($article.is_hot == 1)}<span class="layui-badge layui-bg-red">{:lang('hot')}</span>{/if}
|
||||
<span id="LAY_jieAdmin" data-id="{$article['id']}"></span>
|
||||
<span class="fly-list-nums">
|
||||
<a href="#comment"><i class="iconfont" title="{:lang('reply')}"></i>{$comments->count()}</a><i class="iconfont" title="浏览"></i>{$pv}
|
||||
</span>
|
||||
</div>
|
||||
{//作者}
|
||||
<div class="detail-about">
|
||||
<a class="fly-avatar" href="{:url('user/home',['id'=>$article.user.id])}">
|
||||
<img src="{$article.user.user_img}" alt="{$article.user.name}">
|
||||
<i class="iconfont icon-renzheng" title="认证信息"></i>
|
||||
</a>
|
||||
<div class="fly-detail-user">
|
||||
<a href="{:url('user/home',['id'=>$article.user.id])}" class="fly-link">
|
||||
{if config('taoler.config.area_show') == 1}<i class="layui-badge layui-bg-green " title="">{:getAsing($article.user.area_id) ?: '无'}</i>{/if}
|
||||
<cite>{$article.user.nickname ?: $article.user.name}</cite>
|
||||
</a>
|
||||
<span class="layui-btn layui-btn-xs guanzhu" >关注</span>
|
||||
</div>
|
||||
<div class="detail-hits">
|
||||
<!--span style="padding-right: 10px; color: #FF7200">悬赏:60飞吻</span-->
|
||||
<span class="post-time" data="{$article.create_time}" style="padding-top: 5px;"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-body photos">{$article.content|raw}</div>
|
||||
{//管理}
|
||||
{if (($article.upzip !== '') || session('?user_name'))}
|
||||
<div class="detail-assist">
|
||||
{notempty name="$article.upzip"}
|
||||
<button type="button" class="layui-btn layui-btn-xs" id="zip-download"><i class="layui-icon layui-icon-download-circle"></i>{:lang('download files')}: {$article.downloads}次</button>
|
||||
{/notempty}
|
||||
<div class="fly-admin-box" data-id="{$article.id}">
|
||||
{if ($user.auth ?? '')}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="del"><i class="layui-icon layui-icon-delete"></i></span>
|
||||
{if($article.is_top == 0)}<span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" rank="1"><i class="layui-icon layui-icon-top"></i></span>
|
||||
{else /}<span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" rank="0" style="background-color:#ccc;">{:lang('cancel topping')}</span>{/if}
|
||||
{if($article.is_hot == 0)}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="hot" rank="1"><i class="layui-icon layui-icon-fire"></i></span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="hot" rank="0" style="background-color:#ccc;">{:lang('cancel hoting')}</span>
|
||||
{/if}
|
||||
{if($article.is_reply == 1)}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="reply" rank="0"><i class="layui-icon layui-icon-face-cry"></i></span>
|
||||
{else /}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="set" field="reply" rank="1" style="background-color:#ccc;">{:lang('enable reply')}</span>
|
||||
{/if}
|
||||
<span id="color">{:lang('title color')}</span>
|
||||
{/if}
|
||||
{if(session('user_name')==$article.user.name || ($user.auth ?? ''))}
|
||||
<span class="layui-btn layui-btn-xs jie-admin" type="edit"><a href="{:url('article/edit',['id'=>$article.id])}">{:lang('edit')}</a></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{//评论}
|
||||
<div class="fly-panel detail-box" id="flyReply">
|
||||
<span style="font-size:18px;">评论 {$comments->count()}</span>
|
||||
<ul class="jieda" id="jieda">
|
||||
{volist name="comments" id="vo" empty= ""}
|
||||
<li data-id="{$vo.id}" class="jieda-daan">
|
||||
<a name="item-1111111111"></a>
|
||||
<div class="detail-about detail-about-reply">
|
||||
<a class="fly-avatar" href="{:url('user/home',['id'=>$vo.user.id])}">
|
||||
<img src="{$vo.user.user_img}" alt=" "><i class="iconfont icon-renzheng" title="认证信息"></i>
|
||||
</a>
|
||||
<div class="fly-detail-user">
|
||||
<a href="{:url('user/home',['id'=>$vo.user.id])}" class="fly-link">
|
||||
{if config('taoler.config.area_show') == 1}<i class="layui-badge layui-bg-green " title="">{:getAsing($vo.user.area_id) ?: '无'}</i>{/if}
|
||||
<cite>{$vo.user.nickname ?: $vo.user.name}</cite>
|
||||
</a>
|
||||
{if condition="$article.user.id eq $vo.user.id"}<span>({:lang('poster')})</span>{/if}
|
||||
</div>
|
||||
<div class="detail-hits"><span class="post-time" data="{$vo.create_time}"></span></div>
|
||||
</div>
|
||||
<div class="detail-body jieda-body photos">{$vo.content|raw}</div>
|
||||
<div class="jieda-reply">
|
||||
<span class="jieda-zan {if($vo.zan != 0)}zanok{/if}" type="zan">
|
||||
<i class="iconfont icon-zan"></i><em>{$vo.zan}</em>
|
||||
</span>
|
||||
<span type="reply"><i class="iconfont icon-svgmoban53"></i>{:lang('reply')}</span>
|
||||
{//评论编辑删除采纳权限}
|
||||
<div class="jieda-admin">
|
||||
{if ((session('user_id') == $vo.user.id) && (getLimtTime($vo.create_time) < 2)) OR ($user.auth ?? '')}
|
||||
<span type="edit">{:lang('edit')}</span>
|
||||
<span type="del">{:lang('delete')}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
<div style="text-align: center">{$comments|raw}</div>
|
||||
{if condition="$article.is_reply == 1"}
|
||||
<div class="layui-form layui-form-pane">
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<a name="comment"></a>
|
||||
<div class="layui-input-block">
|
||||
<textarea id="L_content" name="content" required lay-verify="required" placeholder="{:lang('please input the content')}" class="layui-textarea fly-editor" style="height: 150px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<input type="hidden" name="article_id" value="{$article.id}">
|
||||
<input type="hidden" name="user_id" value="{:session('user_id')}">
|
||||
<button class="layui-btn" lay-filter="user-comment" lay-submit>{:lang('submit comments')}</button>
|
||||
</div>
|
||||
</div>
|
||||
{else /}
|
||||
<blockquote class="layui-elem-quote layui-quote-nm layui-disabled" style="margin: 100px 0 20px; padding: 50px 20px; text-align: center; color: #999!important;">本帖已设置禁止回复</blockquote>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<div class="fly-panel">
|
||||
<div class="fly-panel-title">{:lang('sponsor')}<span style="padding: 0 3px;">-</span>
|
||||
<a href="" class="fly-link fly-joinad">{:lang('i want to join')}</a>
|
||||
</div>
|
||||
<div class="fly-panel-main">
|
||||
{volist name="ad_comm" id="vo"}
|
||||
<a href="{$vo.slid_href}" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: {$vo.slid_color};">{$vo.slid_name}</a>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
<dl class="fly-panel fly-list-one">
|
||||
<dt class="fly-panel-title">{:lang('hot post list')}</dt>
|
||||
{volist name="artHot" id="vo"}
|
||||
<dd>
|
||||
<a href="{:url('article/detail',['id' => $vo.id])}">{$vo.title}</a>
|
||||
<span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
|
||||
</dd>
|
||||
{/volist}
|
||||
</dl>
|
||||
<div class="fly-panel" style="padding: 5px 0; text-align: center;">
|
||||
{volist name="ad_art" id="vo"}
|
||||
<a href="{$vo.slid_href}" target="_blank"><img src="{$vo.slid_img}" style="max-width: 100%;"></a>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--底部栏-->
|
||||
<div class="site-tree-mobile-detail-bottom layui-hide-md">
|
||||
<div id="LAY_jieAdmin1" data-id="{$article['id']}"></div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="public/menu" /}
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script>
|
||||
var collectionFind = "{:url('Collection/find')}",
|
||||
articleJieset = "{:url('Article/jieset')}",
|
||||
articleDelete = "{:url('Article/delete')}",
|
||||
commentJiedaZan = "{:url('Comment/jiedaZan')}",
|
||||
commentJiedaCai = "{:url('Comment/jiedaCai')}",
|
||||
commentGetDa = "{:url('Comment/getDa')}",
|
||||
commentUpdateDa = "{:url('Comment/updateDa')}",
|
||||
commentJiedaDelete = "{:url('Comment/jiedaDelete')}",
|
||||
langCollection = "{:lang('collection')}",
|
||||
langCancelCollection = "{:lang('cancel collection')}";
|
||||
var collection = "{:url('collection/')}";
|
||||
|
||||
layui.use(['fly', 'face','colorpicker','plyr'], function(){
|
||||
var $ = layui.jquery
|
||||
,form = layui.form
|
||||
,fly = layui.fly
|
||||
,colorpicker = layui.colorpicker
|
||||
,plyr = layui.plyr;
|
||||
var laytpl = layui.laytpl;
|
||||
var uid = layui.cache.user.uid;
|
||||
|
||||
//tpl模板给发布时间赋值
|
||||
$('div.detail-hits').children('span.post-time').each(function(){
|
||||
var othis = $(this), html = othis.html();
|
||||
var string = laytpl('{{ d.time }}').render({
|
||||
//time: html
|
||||
time: othis.attr('data')
|
||||
});
|
||||
var posttime = layui.util.timeAgo(string, 1);
|
||||
|
||||
othis.text(posttime);
|
||||
//console.log(othis.attr('data'));
|
||||
});
|
||||
|
||||
|
||||
//预定义颜色项
|
||||
colorpicker.render({
|
||||
elem: '#color'
|
||||
,color: '#393d49'
|
||||
,predefine: true // 开启预定义颜色
|
||||
,size: 'xs'
|
||||
,done: function(color){
|
||||
//改变标题颜色
|
||||
$('h1').css("color", color);
|
||||
var id = {$article.id};
|
||||
$.ajax({
|
||||
type:'post',
|
||||
url:"{:url('Article/titleColor')}",
|
||||
data:{id: id,title_color: color},
|
||||
dataType:'json',
|
||||
success:function(data){
|
||||
if(data.code == 0){
|
||||
layer.msg(data.msg,{icon:6,time:2000
|
||||
});
|
||||
} else {
|
||||
layer.open({content:data.msg,icon:5,adim:6});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//评论需要登陆
|
||||
form.on('submit(user-comment)',function (data){
|
||||
var filed = data.field;
|
||||
if (uid == -1) {
|
||||
layer.msg('请先登陆',{icon:5,time:2000},function(){
|
||||
location.href = "{:url('login/index')}";
|
||||
});
|
||||
} else {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "{:url('article/comment')}",
|
||||
data: filed,
|
||||
dataType: "json",
|
||||
success:function (data) {
|
||||
if (data.code == 0) {
|
||||
layer.msg(data.msg,{icon:6,time:2000},function () {
|
||||
location.reload(true);
|
||||
});
|
||||
}else {
|
||||
layer.open({title:'评论失败',content:data.msg,icon:5,anim:6});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//下载
|
||||
$('#zip-download').click(function (){
|
||||
var id = "{$article.id}";
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('article/download')}",
|
||||
data:{id:id},
|
||||
success:function (data) {
|
||||
location.href = "{:url('article/download',['id'=>$article.id])}";
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
|
||||
$('.detail-body').each(function(){
|
||||
var othis = $(this), html = othis.html();
|
||||
othis.html(fly.content(html));
|
||||
});
|
||||
//加载播放器
|
||||
plyr.setup();
|
||||
|
||||
});
|
||||
|
||||
//扫码阅读
|
||||
$("#rdown").hover(function(){
|
||||
$("#phonedl").show().stop();
|
||||
},function(){
|
||||
$("#phonedl").hide().stop();
|
||||
});
|
||||
|
||||
$("#phonedl").hover(function(){
|
||||
$("#phonedl").show().stop();
|
||||
},function(){
|
||||
$("#phonedl").hide().stop();
|
||||
});
|
||||
|
||||
function PhoneDown(){
|
||||
layer.open({
|
||||
title: "扫码查阅",
|
||||
skin: 'layui-layer',
|
||||
content: "<img src='/qrcode/?text={$Request.domain}{:url('article/detail',['id' => $article.id])}&size=230'>"
|
||||
});
|
||||
}
|
||||
//推送百度收录服务
|
||||
(function(){
|
||||
var bp = document.createElement('script');
|
||||
var curProtocol = window.location.protocol.split(':')[0];
|
||||
if (curProtocol === 'https') {
|
||||
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
|
||||
}
|
||||
else {
|
||||
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
|
||||
}
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(bp, s);
|
||||
})();
|
||||
</script>
|
||||
{/block}
|
11
view/taoler/index/article/说明.txt
Normal file
11
view/taoler/index/article/说明.txt
Normal file
@ -0,0 +1,11 @@
|
||||
article目录下的子目录为多模板文件夹
|
||||
文件夹下可包含:
|
||||
cate.html 为分类模板
|
||||
detail.html 为详情页模板
|
||||
add.html 添加模板
|
||||
edit.html 编辑模板
|
||||
|
||||
|
||||
可据此增加更多的模板文件放入相应的文件夹,
|
||||
不放入文件夹的为公共文件
|
||||
|
@ -28,7 +28,6 @@
|
||||
</div>
|
||||
<!--文章列表-->
|
||||
<div class="fly-panel" style="margin-bottom: 0;">
|
||||
{include file="public/filter" /}
|
||||
<ul class="fly-list">
|
||||
{volist name="artList" id="art" empty="还没有帖子"}
|
||||
{include file="public/index-forumlist" /}
|
||||
|
@ -7,7 +7,7 @@
|
||||
</div>
|
||||
<div class="site-mobile-shade-top"></div>
|
||||
{//移动端LOGO}
|
||||
<a class="fly-logo layui-hide-md" href="/" style="padding-left:32%;"><img src="{$sysInfo.logo}" alt="layui" width="135" height="37"></a>
|
||||
<a class="fly-logo layui-hide-md" href="/" style="padding-left:30%;"><img src="{$sysInfo.logo}" alt="layui" width="135" height="37"></a>
|
||||
<ul class="layui-nav fly-nav layui-hide-xs">
|
||||
{volist name="headlinks" id="vo"}
|
||||
<li class="layui-nav-item">
|
||||
@ -34,7 +34,7 @@
|
||||
<dd><a href="{:url('user/message')}"><i class="iconfont icon-tongzhi" style="top: 4px;"></i>{:lang('my message')}</a></dd>
|
||||
<dd><a href="{:url('user/home',['id'=>session('user_id')])}"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;"></i>{:lang('my page')}</a></dd>
|
||||
<hr style="margin: 5px 0;">
|
||||
<dd><a data-url="{:url('user/logout')}" location-url="{:url('index/index')}" href="javascript:void(0)" class="logi_logout" style="text-align: center;">{:lang('logout')}</a></dd>
|
||||
<dd><a data-url="{:url('user/logout')}" href="javascript:void(0)" class="logi_logout" style="text-align: center;">{:lang('logout')}</a></dd>
|
||||
</dl>
|
||||
</li>
|
||||
{else /}
|
||||
|
@ -19,8 +19,6 @@
|
||||
{$art.upzip ?= ' <i class="layui-icon layui-icon-file-b" style="color: #009688;" title="附件"></i>'}
|
||||
</span>
|
||||
<span class="layui-hide-xs" title="浏览"><i class="iconfont" title="浏览"></i> {$art.pv}</span>
|
||||
{if ($art.jie == 1)}<span class="layui-badge fly-badge-accept layui-hide-xs">{:lang('end')}</span>{/if}
|
||||
|
||||
<span class="fly-list-nums">
|
||||
<i class="iconfont icon-pinglun1" title="回答"></i>{$art.comments_count}
|
||||
</span>
|
||||
|
@ -7,7 +7,7 @@
|
||||
{block name="content"}
|
||||
<div class="fly-home fly-panel" style="background-image: url();">
|
||||
<img src="{$u.user_img}" alt="{$u.name}">
|
||||
<i class="iconfont icon-renzheng" title="Fly社区认证"></i>
|
||||
{if($u.vip > 0)}<i class="iconfont icon-renzheng" title="Fly社区认证"></i>{/if}
|
||||
<h1>
|
||||
{$u.nickname ?: $u.name}
|
||||
{if($u.sex==0)}<i class="iconfont icon-nan"></i>
|
||||
|
Loading…
x
Reference in New Issue
Block a user