diff --git a/app/common.php b/app/common.php index 1a3b343..a86f569 100644 --- a/app/common.php +++ b/app/common.php @@ -43,10 +43,12 @@ try { //$mail->AltBody =$user ; - return $mail->send(); - echo 'Message has been sent'; + $mail->send(); + //echo 'Message has been sent'; + return true; } catch (Exception $e) { - echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo; + //echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo; + return false; } } diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index 5e75ff8..35fe739 100644 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -73,7 +73,7 @@ class Article extends BaseController case 'jie': $artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie,pv')->with([ 'cate' => function($query){ - $query->where('delete_time',0)->field('id,catename'); + $query->where('delete_time',0)->field('id,catename,ename'); }, 'user' => function($query){ $query->field('id,name,nickname,user_img,area_id,vip'); @@ -89,7 +89,7 @@ class Article extends BaseController case 'hot': $artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie,pv')->with([ 'cate' => function($query){ - $query->where('delete_time',0)->field('id,catename'); + $query->where('delete_time',0)->field('id,catename,ename'); }, 'user' => function($query){ $query->field('id,name,nickname,user_img,area_id,vip'); @@ -105,7 +105,7 @@ class Article extends BaseController case 'top': $artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie,pv')->with([ 'cate' => function($query){ - $query->where('delete_time',0)->field('id,catename'); + $query->where('delete_time',0)->field('id,catename,ename'); }, 'user' => function($query){ $query->field('id,name,nickname,user_img,area_id,vip'); @@ -121,7 +121,7 @@ class Article extends BaseController default: $artList = ArticleModel::field('id,title,title_color,cate_id,user_id,create_time,is_top,is_hot,jie,pv')->with([ 'cate' => function($query){ - $query->where('delete_time',0)->field('id,catename'); + $query->where('delete_time',0)->field('id,catename,ename'); }, 'user' => function($query){ $query->field('id,name,nickname,user_img,area_id,vip'); @@ -153,11 +153,12 @@ class Article extends BaseController public function detail($id) { $article = Cache::get('article_'.$id); + if(!$article){ //查询文章 $article = ArticleModel::field('id,title,content,status,cate_id,user_id,is_top,is_hot,is_reply,pv,jie,upzip,tags,title_color,create_time')->where('status',1)->with([ 'cate' => function($query){ - $query->where('delete_time',0)->field('id,catename'); + $query->where('delete_time',0)->field('id,catename,ename'); }, 'user' => function($query){ $query->field('id,name,nickname,user_img,area_id,vip'); @@ -172,7 +173,7 @@ class Article extends BaseController $comments = $article->comments()->where('status',1)->order(['cai'=>'asc','create_time'=>'asc'])->paginate(10); $article->inc('pv')->update(); $pv = Db::name('article')->field('pv')->where('id',$id)->value('pv'); - $download = download($article->upzip,'file'); + $download = $article->upzip ? download($article->upzip,'file') : ''; /* $nt = time(); diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index 360092f..f117379 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -30,7 +30,7 @@ class Index extends BaseController if(!$artTop){ $artTop = Article::field('id,title,title_color,cate_id,user_id,create_time,is_top,jie,pv')->where(['is_top'=>1,'status'=>1,'delete_time'=>0])->with([ 'cate' => function($query){ - $query->where('delete_time',0)->field('id,catename'); + $query->where('delete_time',0)->field('id,catename,ename'); }, 'user' => function($query){ $query->field('id,name,nickname,user_img,area_id,vip'); @@ -44,7 +44,7 @@ class Index extends BaseController if(!$artList){ $artList = Article::field('id,title,title_color,cate_id,user_id,create_time,is_hot,jie,pv')->with([ 'cate' => function($query){ - $query->where('delete_time',0)->field('id,catename'); + $query->where('delete_time',0)->field('id,catename,ename'); }, 'user' => function($query){ $query->field('id,name,nickname,user_img,area_id,vip'); diff --git a/app/index/controller/Login.php b/app/index/controller/Login.php index d3f1b93..0b06f0a 100644 --- a/app/index/controller/Login.php +++ b/app/index/controller/Login.php @@ -95,7 +95,7 @@ class Login extends BaseController $result = $user->reg($data); if ($result == 1) { - $res = ['code'=>0,'msg'=>'注册成功','url'=>'/index/login']; + $res = ['code'=>0,'msg'=>'注册成功','url'=>(string) url('login/index')]; }else { $res = ['code'=>-1,'msg'=>$result]; } @@ -128,7 +128,7 @@ class Login extends BaseController $result = mailto($data['email'],'重置密码','Hi亲爱的'.$user['name'].':
您正在维护您的信息,请在10分钟内验证,您的验证码为:'.$code); if($result){ Cache::set('repass',1,60); //设置repass标志为1存入Cache - $res = ['code'=>0,'msg'=>'验证码已发送成功,请去邮箱查看!','url'=>'/index/postcode']; + $res = ['code'=>0,'msg'=>'验证码已发送成功,请去邮箱查看!','url'=>(string) url('login/postcode')]; } else { $res = ['code'=>-1,'msg'=>'验证码发送失败!']; } @@ -144,7 +144,7 @@ class Login extends BaseController public function postcode() { if(Cache::get('repass') != 1){ - return redirect('/index/forget'); + return redirect((string) url('login/forget')); } if(Request::isAjax()){ $code = Request::only(['code']); @@ -159,7 +159,7 @@ class Login extends BaseController if(Cache::get('code')==$code['code']) { //无任何输入情况下需排除code为0和Cache为0的情况 //Cache::delete('repass'); Cache::set('repass',2,60); - $res = ['code'=>0,'msg'=>'验证成功','url'=>'/index/respass']; + $res = ['code'=>0,'msg'=>'验证成功','url'=>(string) url('login/respass')]; } else { $res = ['code'=>-1,'msg'=>'验证码错误或已过期!']; } @@ -172,7 +172,7 @@ class Login extends BaseController public function respass() { if(Cache::get('repass') != 2){ - return redirect('/index/forget'); + return redirect((string) url('login/forget')); } if(Request::isAjax()){ $data = Request::param(); @@ -188,7 +188,7 @@ class Login extends BaseController $user = new \app\common\model\User(); $res = $user->respass($data); if ($res == 1) { - return json(['code'=>0,'msg'=>'修改成功','url'=>'/index/login']); + return json(['code'=>0,'msg'=>'修改成功','url'=>(string) url('login/index')]); } else { return json(['code'=>-1,'msg'=>'$res']); } diff --git a/app/index/lang/en-us.php b/app/index/lang/en-us.php index 379b622..9b21017 100644 --- a/app/index/lang/en-us.php +++ b/app/index/lang/en-us.php @@ -8,7 +8,7 @@ return [ //menu 'index' => 'Index', - 'home page' => 'Home page', + 'home page' => 'Home', 'user center' => 'Center', 'set info' => 'Set info', 'my message' => 'Message', @@ -24,12 +24,15 @@ return [ 'timeline' => 'Timeline', //帖子 + 'poster' => 'poster', 'title color' => 'Title color', 'add_post' => 'Add post', + 'collection' => 'collection', 'my collection' => 'My collection', 'cancel collection' => 'cancel collection', 'all' => 'All', 'finished' => 'Finished', + 'end' => 'End', 'no finished' => 'no finished', 'hot' => 'Hot', 'top' => 'Top', @@ -43,7 +46,7 @@ return [ 'links list' => 'Links list', 'statement' => 'Statement', 'trends' => 'Trends', - 'sponsor' => 'Sponsor sponsor', + 'sponsor' => 'Super sponsor', 'i want to join' => 'i want to join', 'official products' => 'Official products', 'no comments' => 'No comments', diff --git a/app/index/lang/zh-cn.php b/app/index/lang/zh-cn.php index 38e5fda..b38d821 100644 --- a/app/index/lang/zh-cn.php +++ b/app/index/lang/zh-cn.php @@ -24,12 +24,14 @@ return [ 'timeline' => '框架日志', //帖子 + 'poster' => '贴主', 'title color' => '颜色', 'add_post' => '添加帖子', 'my collection' => '我的收藏', 'cancel collection' => '取消收藏', 'all' => '综合', 'finished' => '已结', + 'end' => '已结', 'no finished' => '未结', 'hot' => '热贴', 'top' => '精贴', diff --git a/app/index/lang/zh-tw.php b/app/index/lang/zh-tw.php index 752e4cf..80ec258 100644 --- a/app/index/lang/zh-tw.php +++ b/app/index/lang/zh-tw.php @@ -24,12 +24,14 @@ return [ 'timeline' => '框架日誌', //帖子 + 'poster' => '贴主', 'title color' => '顏色', 'add_post' => '添加帖子', 'my collection' => '我的收藏', 'cancel collection' => '取消收藏', 'all' => '綜合', 'finished' => '已結', + 'end' => '已結', 'no finished' => '未結', 'hot' => '熱貼', 'top' => '精貼', diff --git a/public/static/res/mods/jie.js b/public/static/res/mods/jie.js index 8767a56..1b9dedb 100644 --- a/public/static/res/mods/jie.js +++ b/public/static/res/mods/jie.js @@ -124,9 +124,9 @@ layui.define('fly', function(exports){ cid: div.data('id') }, function(res){ if(type === 'add'){ - othis.data('type', 'remove').html('取消收藏').addClass('layui-btn-danger'); + othis.data('type', 'remove').html(langCancelCollection).addClass('layui-btn-danger'); } else if(type === 'remove'){ - othis.data('type', 'add').html('收藏').removeClass('layui-btn-danger'); + othis.data('type', 'add').html(langCollection).removeClass('layui-btn-danger'); } }); } @@ -145,7 +145,7 @@ layui.define('fly', function(exports){ fly.json(collectionFind, { cid: div.data('id') }, function(res){ - jieAdmin.append(''+ (res.data.collection ? '取消收藏' : '收藏') +''); + jieAdmin.append(''+ (res.data.collection ? langCancelCollection : langCollection) +''); }); } }(); @@ -200,7 +200,6 @@ layui.define('fly', function(exports){ layer.prompt({ formType: 2 ,value: data.content - ,maxlength: 100000 ,title: '编辑回帖' ,area: ['738px', '310px'] diff --git a/view/taoler/index/article/cate.html b/view/taoler/index/article/cate.html index 1587283..b273936 100644 --- a/view/taoler/index/article/cate.html +++ b/view/taoler/index/article/cate.html @@ -18,7 +18,7 @@ {$art.user.name}

- {$art.cate.catename} + {:cookie('think_lang') == 'en-us' ? $art.cate.ename : $art.cate.catename} {$art.title}

@@ -35,7 +35,7 @@ {$art.create_time|date='Y-m-d'} {$art.pv} - {if ($art.jie == 1)}{:lang('finished')}{/if} + {if ($art.jie == 1)}{:lang('end')}{/if} {$art.comments_count} @@ -76,7 +76,7 @@
- 这里可作为广告区域 + {:lang('ads area')}
{volist name="ad_comm" id="vo"} diff --git a/view/taoler/index/article/detail.html b/view/taoler/index/article/detail.html index 0109f17..79a2ea9 100644 --- a/view/taoler/index/article/detail.html +++ b/view/taoler/index/article/detail.html @@ -14,7 +14,7 @@
- {$article.cate.catename} + {:cookie('think_lang') == 'en-us' ? $article.cate.ename : $article.cate.catename} {if ($article.jie == 0)} {:lang('no finished')} {else /} @@ -85,7 +85,7 @@
    - {volist name="comments" id="vo" empty="lang('no comments')"} + {volist name="comments" id="vo" empty= ""}
  • @@ -100,7 +100,7 @@ VIP3 {if condition="$article.user.id eq $vo.user.id"} - (贴主) + ({:lang('poster')}) {/if}