Browse Source

detail

master
林一峰 8 years ago
parent
commit
eaabde8c56
  1. 35
      app/Common/function.php
  2. 5
      app/Http/Controllers/Admin/IndexController.php
  3. 12
      app/Http/Controllers/Api/CommonController.php
  4. 86
      app/Http/Controllers/Api/IndexController.php
  5. 55
      app/Http/Controllers/Home/IndexController.php
  6. 93
      lqycms.sql
  7. 2
      public/js/ad.js
  8. 2
      resources/views/home/common/footer.blade.php
  9. 8
      resources/views/home/index/category.blade.php
  10. 8
      resources/views/home/index/category2.blade.php
  11. 4
      resources/views/home/index/page.blade.php
  12. 7
      routes/web.php

35
app/Common/function.php

@ -163,6 +163,12 @@ function arclist(array $param)
if(!empty($where)){$model = $model->where($where);}
//排序
if(isset($param['sql']))
{
$model = $model->whereRaw($param['sql']);
}
//排序
if(isset($param['orderby']))
{
@ -276,10 +282,10 @@ function get_article_prenext(array $param)
*/
function get_listnav(array $param)
{
$catid=$param["catid"];
$pagenow=$param["pagenow"];
$prepage = $nextpage = '';
$prepagenum = $pagenow-1;
$catid = $param["catid"];
$pagenow = $param["pagenow"];
$prepage = $nextpage = '';
$prepagenum = $pagenow-1;
$nextpagenum = $pagenow+1;
$counts=$param["counts"];
@ -309,14 +315,14 @@ function get_listnav(array $param)
{
if($pagenow == 2)
{
$prepage.="<li><a href='/".$urltype.$catid.".html'>上一页</a></li>";
$prepage.="<li><a href='/".$urltype.$catid."'>上一页</a></li>";
}
else
{
$prepage.="<li><a href='/".$urltype.$catid."/$prepagenum.html'>上一页</a></li>";
$prepage.="<li><a href='/".$urltype.$catid."/$prepagenum'>上一页</a></li>";
}
$indexpage="<li><a href='/".$urltype.$catid.".html'>首页</a></li>";
$indexpage="<li><a href='/".$urltype.$catid."'>首页</a></li>";
}
else
{
@ -324,8 +330,8 @@ function get_listnav(array $param)
}
if($pagenow!=$totalpage && $totalpage>1)
{
$nextpage.="<li><a href='/".$urltype.$catid."/$nextpagenum.html'>下一页</a></li>";
$endpage="<li><a href='/".$urltype.$catid."/$totalpage.html'>末页</a></li>";
$nextpage.="<li><a href='/".$urltype.$catid."/$nextpagenum'>下一页</a></li>";
$endpage="<li><a href='/".$urltype.$catid."/$totalpage'>末页</a></li>";
}
else
{
@ -352,11 +358,11 @@ function get_listnav(array $param)
{
if($minnum==1)
{
$listdd.="<li><a href='/".$urltype.$catid.".html'>$minnum</a></li>";
$listdd.="<li><a href='/".$urltype.$catid."'>$minnum</a></li>";
}
else
{
$listdd.="<li><a href='/".$urltype.$catid."/$minnum.html'>$minnum</a></li>";
$listdd.="<li><a href='/".$urltype.$catid."/$minnum'>$minnum</a></li>";
}
}
}
@ -407,17 +413,17 @@ function get_prenext(array $param)
}
elseif($pagenow==2)
{
$prepage='<a class="prep" href="/'.$urltype.$cat.'.html">上一页</a> &nbsp; ';
$prepage='<a class="prep" href="/'.$urltype.$cat.'">上一页</a> &nbsp; ';
}
else
{
$prepage='<a class="prep" href="/'.$urltype.$cat.'/'.$prepagenum.'.html">上一页</a> &nbsp; ';
$prepage='<a class="prep" href="/'.$urltype.$cat.'/'.$prepagenum.'">上一页</a> &nbsp; ';
}
//获取下一页
if($pagenow<$totalpage && $totalpage>1)
{
$nextpage='<a class="nextp" href="/'.$urltype.$cat.'/'.$nextpagenum.'.html">下一页</a>';
$nextpage='<a class="nextp" href="/'.$urltype.$cat.'/'.$nextpagenum.'">下一页</a>';
}
$plist = '';
@ -427,6 +433,7 @@ function get_prenext(array $param)
return $plist;
}
/**
* 获取分页列表
* @access public

5
app/Http/Controllers/Admin/IndexController.php

@ -19,13 +19,14 @@ class IndexController extends CommonController
public function upconfig()
{
cache()->forget('sysconfig'); //删除缓存
success_jump('更新成功!', route('admin_sysconfig'));
success_jump('更新成功!');
}
//更新缓存
public function upcache()
{
cache()->forget('sysconfig'); //删除缓存
success_jump('更新成功!', route('admin_sysconfig'));
dir_delete(storage_path().'/framework/cache/data/');
success_jump('更新成功!');
}
}

12
app/Http/Controllers/Api/CommonController.php

@ -0,0 +1,12 @@
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
class CommonController extends Controller
{
public function __construct()
{
parent::__construct();
}
}

86
app/Http/Controllers/Api/IndexController.php

@ -0,0 +1,86 @@
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Api\CommonController;
use Illuminate\Support\Facades\DB;
class IndexController extends CommonController
{
public function __construct()
{
parent::__construct();
}
//文章列表页
public function listarc()
{
$res["code"] = 0;
$res["msg"] = "success";
$res["data"] = "";
$where = array();
$result = "";
$PageIndex = request('PageIndex',1);
$PageSize = request('PageSize', sysconfig('CMS_PAGESIZE'));
$skip = ($PageIndex-1)*$PageSize;
$typeid = request('typeid');if(!empty($typeid)){ $where['typeid']=$typeid; }
$tuijian = request('tuijian');if(!empty($tuijian)){ $where['tuijian']=$tuijian; }
$field = array('field','id,typeid,click,title,writer,litpic,pubdate');
$orderby = request('orderby',['pubdate','desc']);
$mname = request('mname','article');
$model = DB::table($mname);
if($where){$model->where($where);}
$count = $model->count();
$list = object_to_array($model->orderBy($orderby[0], $orderby[1])->skip($skip)->take($PageSize)->get());
if(!empty($list) && $PageIndex<=10)
{
/* foreach($list as $key=>$row)
{
//$list[$key]["pubdate"] = date("Y-m-d", $list[$key]["pubdate"]);
$result .= '<div class="list">';
if(!empty($row['litpic']) && file_exists($_SERVER['DOCUMENT_ROOT'].$row['litpic']))
{
$result .= '<a class="';
//判断图片长宽
if(getimagesize($row['litpic'])[0]>getimagesize($row['litpic'])[1])
{
$result .= 'limg';
}
else
{
$result .= 'simg';
}
$result .= '" href="'.WEBHOST.'/p/'.$row['id'].'"><img alt="'.$row['title'].'" src="'.$row['litpic'].'"></a>';
}
$result .= '<strong class="tit"><a href="'.WEBHOST.'/p/'.$row['id'].'">'.$row['title'].'</a></strong><p>'.mb_strcut(strip_tags($row['description']),0,126,'UTF-8').'..<a href="'.WEBHOST.'/p/'.$row['id'].'" class="more">[详情]</a></p>';
$result .= '<div class="info"><span class="fl"><i class="pub-v"></i><em>'.date("Y-m-d H:i",$row['pubdate']).'</em></span><span class="fr"><em>'.$row['click'].'</em>人阅读</span></div><div class="cl"></div></div>';
} */
foreach($list as $key=>$row)
{
$list[$key]["url"] = get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content'));
}
$res["data"] = $list;
}
/* $result['List']=$list;
$result['Count']=$count>0?$count:0; */
//return $res;
exit(json_encode($res));
}
//测试页面
public function test()
{
return date("Y-m-d H:i:s",strtotime("2017-04"));
}
}

55
app/Http/Controllers/Home/IndexController.php

@ -2,10 +2,7 @@
namespace App\Http\Controllers\Home;
use App\Http\Controllers\Home\CommonController;
use App\Http\Model\Article;
use App\Http\Model\Arctype;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
class IndexController extends CommonController
{
@ -21,40 +18,40 @@ class IndexController extends CommonController
}
//列表页
public function category($cat, $page)
public function category($cat, $page=0)
{
$pagenow=page;
$pagenow = $page;
if(empty($cat) || !preg_match('/[0-9]+/',$cat)){error_jump('您访问的页面不存在或已被删除!', route('page404'));}
if(cache("catid$cat")){$post=cache("catid$cat");}else{$post = db('arctype')->where("id=$cat")->find();if(empty($post)){error_jump('您访问的页面不存在或已被删除!', route('page404'));}cache("catid$cat",$post,2592000);}
$this->assign('post',$post);
if(cache("catid$cat")){$post = cache("catid$cat");}else{$post = object_to_array(DB::table('arctype')->where('id', $cat)->first(), 1);if(empty($post)){error_jump('您访问的页面不存在或已被删除!', route('page404'));} cache(["catid$cat"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));}
$data['post'] = $post;
$subcat="";$sql="";
$post2=db('arctype')->field('id')->where("reid=$cat")->select();
$post2 = object_to_array(DB::table('arctype')->select('id')->where('reid', $cat)->get());
if(!empty($post2)){foreach($post2 as $row){$subcat=$subcat."typeid=".$row["id"]." or ";}}
$subcat=$subcat."typeid=".$cat;
$sql=$subcat." or typeid2 in (".$cat.")";//echo $subcat2;exit;
$this->assign('sql',$sql);
$data['sql'] = $sql;
$counts=db("article")->where($sql)->count('id');
if($counts>CMS_MAXARC){$counts=CMS_MAXARC;}
$pagesize=CMS_PAGESIZE;$page=0;
$counts = DB::table("article")->whereRaw($sql)->count();
if($counts>sysconfig('CMS_MAXARC')){$counts=sysconfig('CMS_MAXARC');dd($counts);}
$pagesize = sysconfig('CMS_PAGESIZE');$page=0;
if($counts % $pagesize){//取总数据量除以每页数的余数
$pages = intval($counts/$pagesize) + 1; //如果有余数,则页数等于总数据量除以每页数的结果取整再加一,如果没有余数,则页数等于总数据量除以每页数的结果
}else{$pages = $counts/$pagesize;}
if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){header("HTTP/1.0 404 Not Found");error_jump('您访问的页面不存在或已被删除!', route('page404'));}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;}
$this->assign('page',$page);
$this->assign('pages',$pages);
$this->assign('counts',$counts);
$start=$page*$pagesize;
if(!empty($pagenow)){if($pagenow==1 || $pagenow>$pages){error_jump('您访问的页面不存在或已被删除!', route('page404'));}$page = $pagenow-1;$nextpage=$pagenow+1;$previouspage=$pagenow-1;}else{$page = 0;$nextpage=2;$previouspage=0;}
$data['page'] = $page;
$data['pages'] = $pages;
$data['counts'] = $counts;
$start = $page*$pagesize;
$this->assign('posts',arclist(array("sql"=>$sql,"limit"=>"$start,$pagesize"))); //获取列表
$this->assign('pagenav',get_listnav(array("counts"=>$counts,"pagesize"=>$pagesize,"pagenow"=>$page+1,"catid"=>$cat))); //获取分页列表
$data['posts'] = arclist(array("sql"=>$sql, "limit"=>"$start,$pagesize")); //获取列表
$data['pagenav'] = get_listnav(array("counts"=>$counts,"pagesize"=>$pagesize,"pagenow"=>$page+1,"catid"=>$cat)); //获取分页列表
if($post['templist']=='category2'){if(!empty($pagenow)){error_jump('您访问的页面不存在或已被删除!', route('page404'));}}
return $this->fetch($post['templist']);
return view('home.index.index');
return view('home.index.'.$post['templist'], $data);
}
//文章详情页
@ -89,10 +86,10 @@ class IndexController extends CommonController
if(empty($tag) || !preg_match('/[0-9]+/',$tag)){error_jump('您访问的页面不存在或已被删除!', route('page404'));}
if(cache("tagid$tag")){$post=cache("tagid$tag");}else{$post = db('tagindex')->where("id=$tag")->find();cache("tagid$tag",$post,2592000);}
if(cache("tagid$tag")){$post=cache("tagid$tag");}else{$post = DB::table('tagindex')->where("id=$tag")->first();cache("tagid$tag",$post,2592000);}
$this->assign('post',$post);
$counts=db("taglist")->where("tid=$tag")->count('aid');
$counts=DB::table("taglist")->where("tid=$tag")->count('aid');
if($counts>CMS_MAXARC){$counts=CMS_MAXARC;}
$pagesize=CMS_PAGESIZE;$page=0;
if($counts % $pagesize){//取总数据量除以每页数的余数
@ -104,7 +101,7 @@ class IndexController extends CommonController
$this->assign('counts',$counts);
$start=$page*$pagesize;
$posts=db("taglist")->where("tid=$tag")->order('aid desc')->limit("$start,$pagesize")->select();
$posts=DB::table("taglist")->where("tid=$tag")->order('aid desc')->limit("$start,$pagesize")->select();
foreach($posts as $row)
{
$aid[] = $row["aid"];
@ -150,7 +147,7 @@ class IndexController extends CommonController
$map['title'] = array('LIKE',"%$keyword%");
$this->assign('posts',db("article")->field('body',true)->where($map)->order('id desc')->limit(30)->select());
$this->assign('posts',DB::table("article")->field('body',true)->where($map)->order('id desc')->limit(30)->select());
$this->assign('keyword',$keyword);
}
else
@ -164,14 +161,16 @@ class IndexController extends CommonController
//单页面
public function page($id)
{
$data = [];
if(!empty($id) && preg_match('/[a-z0-9]+/',$id))
{
$map['filename']=$id;
if(cache("pageid$id")){$post=cache("pageid$id");}else{$post = db('page')->where($map)->find();cache("pageid$id",$post,2592000);}
if(cache("pageid$id")){$post=cache("pageid$id");}else{$post = object_to_array(DB::table('page')->where($map)->first(), 1);cache("pageid$id", $post, 2592000);cache(["pageid$id"=>$post], \Carbon\Carbon::now()->addMinutes(2592000));}
if($post)
{
$this->assign('post',$post);
$data['post'] = $post;
}
else
{
@ -184,7 +183,7 @@ class IndexController extends CommonController
error_jump('您访问的页面不存在或已被删除!', route('page404'));
}
return view('home.index.'.$post['template']);
return view('home.index.'.$post['template'], $data);
}
//sitemap页面

93
lqycms.sql
File diff suppressed because it is too large
View File

2
public/js/ad.js

@ -1,4 +1,4 @@
function count_js(){document.writeln(" <div class=\"tm\"><img src=\"http://www.lqycms.com/images/2weima.gif\" width=\"115px\" height=\"150px\"><\/div> ");}
function count_js(){document.writeln("");}
function itopjs(){document.writeln("<img width=960px height=90px src=\"http://www.lqycms.com/images/banner.gif\">");}
function tjs(){document.writeln("<img width=960px height=90px src=\"http://www.lqycms.com/images/banner.gif\">");}
function navjs(){document.writeln("");}

2
resources/views/home/common/footer.blade.php

@ -1 +1 @@
<div id="footer" class="box">&copy;<?php echo sysconfig('CMS_WEBNAME'); ?> 部分文章来源于网络,如果侵犯了您的权益,请<a href="<?php echo sysconfig('CMS_BASEHOST'); ?>/contact.html">联系我们</a>。<a target="_blank" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/sitemap.xml">网站地图</a><div class="m-auto"><script>count_js();</script></div></div>
<div id="footer" class="box">&copy; <?php echo sysconfig('CMS_WEBNAME'); ?> 部分文章来源于网络,如果侵犯了您的权益,请<a href="<?php echo sysconfig('CMS_BASEHOST'); ?>/contact.html">联系我们</a>。<a target="_blank" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/sitemap.xml">网站地图</a><div class="m-auto"><script>count_js();</script></div></div>

8
resources/views/home/index/category.blade.php

@ -1,5 +1,5 @@
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /><meta http-equiv="Cache-Control" content="no-siteapp" /><meta http-equiv="Cache-Control" content="no-transform" /><meta name="mobile-agent" content="format=xhtml;url=http://m.bnbni.com<?php echo GetCurUrl(); ?>">
<title><?php echo $post['seotitle'];if($page!=0){echo ' '.($page+1);} ?></title><meta name="keywords" content="<?php echo $post["keywords"]; ?>" /><meta name="description" content="<?php echo $post["description"]; ?>" /><link rel="stylesheet" href="<?php echo CMS_BASEHOST; ?>/images/style.css" media="all"><script type="text/javascript" src="<?php echo CMS_BASEHOST; ?>/js/jquery.min.js"></script><script type="text/javascript" src="<?php echo CMS_BASEHOST; ?>/js/ad.js"></script><script>uaredirect("http://m.bnbni.com/cat{dede:type}[field:ID /]{/dede:type}");</script></head><body><script>site();</script>
<title><?php echo $post['seotitle'];if($page!=0){echo ' '.($page+1);} ?></title><meta name="keywords" content="<?php echo $post["keywords"]; ?>" /><meta name="description" content="<?php echo $post["description"]; ?>" /><link rel="stylesheet" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/css/style.css" media="all"><script type="text/javascript" src="<?php echo sysconfig('CMS_BASEHOST'); ?>/js/jquery.min.js"></script><script type="text/javascript" src="<?php echo sysconfig('CMS_BASEHOST'); ?>/js/ad.js"></script><script>uaredirect("http://m.bnbni.com/cat{dede:type}[field:ID /]{/dede:type}");</script></head><body><script>site();</script>
@include('home.common.header')<div id="tad"><script>tjs();</script></div>
<div class="box mt10"><div class="fl_640"><div class="zinfo"><h1><?php echo $post['typename']; ?></h1><?php if(!empty($post['content'])){echo '<div class="zdes">'.$post['content'].'</div>';} ?></div><div id="lad1"><script>ljs1();</script></div>
@ -12,17 +12,17 @@
<div class="fr_300"><div id="rad1"><script>rjs1();</script></div>
<div class="side"><div class="stit"><h3>热门文章</h3><a href="javascript:getmore({PageSize:5,typeid:<?php echo $post['id']; ?>,tuijian:1,mode:1,orderby:'rand()'});" class="more">换一换</a><div class="cl"></div></div>
<ul class="uli chs" id="xglist"><?php $posts=arclist(array("row"=>5,"typeid"=>$post['id'],"tuijian"=>1));foreach($posts as $row){ ?><li><a target="_blank" href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?></a></li><?php } ?></ul><div class="cl"></div></div>
<ul class="uli chs" id="xglist"><?php $posts=arclist(array("row"=>5,"typeid"=>$post['id'],"tuijian"=>1));if($posts){foreach($posts as $row){ ?><li><a target="_blank" href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?></a></li><?php }} ?></ul><div class="cl"></div></div>
<div id="rad3"><script>rjs3();</script></div>
<div class="side"><div class="stit"><h3>猜你喜欢</h3><a href="javascript:getmore({PageSize:5,typeid:<?php echo $post['id']; ?>,mode:2,orderby:'rand()'});" class="more">换一换</a><div class="cl"></div></div>
<div class="uli2" id="xglike"><?php $posts=arclist(array("row"=>5,"typeid"=>$post['id'],"orderby"=>'rand()'));foreach($posts as $row){ ?><div class="suli"><?php if(!empty($row['litpic'])){ ?><a class="limg" href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><img alt="<?php echo $row['title']; ?>" src="<?php echo $row['litpic']; ?>"></a><?php } ?><a target="_blank" href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?></a><div class="sulii"><?php if(!empty($row['writer'])){echo '<span class="time">'.$row['writer'].'</span>';}elseif(!empty($row['source'])){echo '<span class="time">'.$row['source'].'</span>';} ?> 阅读(<?php echo $row['click']; ?>)</div><div class="cl"></div></div><?php } ?><div class="cl"></div></div></div>
<div class="uli2" id="xglike"><?php $posts=arclist(array("row"=>5,"typeid"=>$post['id'],"orderby"=>'rand()'));if($posts){foreach($posts as $row){ ?><div class="suli"><?php if(!empty($row['litpic'])){ ?><a class="limg" href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><img alt="<?php echo $row['title']; ?>" src="<?php echo $row['litpic']; ?>"></a><?php } ?><a target="_blank" href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?></a><div class="sulii"><?php if(!empty($row['writer'])){echo '<span class="time">'.$row['writer'].'</span>';}elseif(!empty($row['source'])){echo '<span class="time">'.$row['source'].'</span>';} ?> 阅读(<?php echo $row['click']; ?>)</div><div class="cl"></div></div><?php }} ?><div class="cl"></div></div></div>
<div id="rad2"><script>rjs2();</script></div></div><!-- fr_300 end --></div><!-- box end -->
<script>
function getmore(condition)
{
var url = "<?php echo CMS_BASEHOST; ?>/api/listarc";
var url = "<?php echo sysconfig('CMS_BASEHOST'); ?>/api/listarc";
//var typeid = "";
$.post(url,condition,function(res){
if(res.code==0)

8
resources/views/home/index/category2.blade.php

@ -1,5 +1,5 @@
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /><meta http-equiv="Cache-Control" content="no-siteapp" /><meta http-equiv="Cache-Control" content="no-transform" /><meta name="mobile-agent" content="format=xhtml;url=http://m.bnbni.com<?php echo GetCurUrl(); ?>">
<title><?php echo $post['seotitle'];if($page!=0){echo ' '.($page+1);} ?></title><meta name="keywords" content="<?php echo $post["keywords"]; ?>" /><meta name="description" content="<?php echo $post["description"]; ?>" /><link rel="stylesheet" href="<?php echo CMS_BASEHOST; ?>/images/style.css" media="all"><script type="text/javascript" src="<?php echo CMS_BASEHOST; ?>/js/jquery.min.js"></script><script type="text/javascript" src="<?php echo CMS_BASEHOST; ?>/js/ad.js"></script><script>uaredirect("http://m.bnbni.com/cat{dede:type}[field:ID /]{/dede:type}");</script></head><body><script>site();</script>
<title><?php echo $post['seotitle'];if($page!=0){echo ' '.($page+1);} ?></title><meta name="keywords" content="<?php echo $post["keywords"]; ?>" /><meta name="description" content="<?php echo $post["description"]; ?>" /><link rel="stylesheet" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/images/style.css" media="all"><script type="text/javascript" src="<?php echo sysconfig('CMS_BASEHOST'); ?>/js/jquery.min.js"></script><script type="text/javascript" src="<?php echo sysconfig('CMS_BASEHOST'); ?>/js/ad.js"></script><script>uaredirect("http://m.bnbni.com/cat{dede:type}[field:ID /]{/dede:type}");</script></head><body><script>site();</script>
@include('home.common.header')<div id="tad"><script>tjs();</script></div>
<div class="box mt10"><div class="fl_640"><h1 class="arct"><?php echo $post["typename"]; ?></h1>
@ -7,17 +7,17 @@
<div class="fr_300"><div id="rad1"><script>rjs1();</script></div>
<div class="side"><div class="stit"><h3>热门文章</h3><a href="javascript:getmore({PageSize:5,typeid:<?php echo $post['id']; ?>,tuijian:1,mode:1,orderby:'rand()'});" class="more">换一换</a><div class="cl"></div></div>
<ul class="uli chs" id="xglist"><?php $posts=arclist(array("row"=>5,"typeid"=>$post['id'],"tuijian"=>1));foreach($posts as $row){ ?><li><a target="_blank" href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?></a></li><?php } ?></ul><div class="cl"></div></div>
<ul class="uli chs" id="xglist"><?php $posts=arclist(array("row"=>5,"typeid"=>$post['id'],"tuijian"=>1));if($posts){foreach($posts as $row){ ?><li><a target="_blank" href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?></a></li><?php }} ?></ul><div class="cl"></div></div>
<div id="rad3"><script>rjs3();</script></div>
<div class="side"><div class="stit"><h3>猜你喜欢</h3><a href="javascript:getmore({PageSize:5,typeid:<?php echo $post['id']; ?>,mode:2,orderby:'rand()'});" class="more">换一换</a><div class="cl"></div></div>
<div class="uli2" id="xglike"><?php $posts=arclist(array("row"=>5,"typeid"=>$post['id'],"orderby"=>'rand()'));foreach($posts as $row){ ?><div class="suli"><?php if(!empty($row['litpic'])){ ?><a class="limg" href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><img alt="<?php echo $row['title']; ?>" src="<?php echo $row['litpic']; ?>"></a><?php } ?><a target="_blank" href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?></a><div class="sulii"><?php if(!empty($row['writer'])){echo '<span class="time">'.$row['writer'].'</span>';}elseif(!empty($row['source'])){echo '<span class="time">'.$row['source'].'</span>';} ?> 阅读(<?php echo $row['click']; ?>)</div><div class="cl"></div></div><?php } ?><div class="cl"></div></div></div>
<div class="uli2" id="xglike"><?php $posts=arclist(array("row"=>5,"typeid"=>$post['id'],"orderby"=>'rand()'));if($posts){foreach($posts as $row){ ?><div class="suli"><?php if(!empty($row['litpic'])){ ?><a class="limg" href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><img alt="<?php echo $row['title']; ?>" src="<?php echo $row['litpic']; ?>"></a><?php } ?><a target="_blank" href="<?php echo get_front_url(array("id"=>$row['id'],"catid"=>$row['typeid'],"type"=>'content')); ?>"><?php echo $row['title']; ?></a><div class="sulii"><?php if(!empty($row['writer'])){echo '<span class="time">'.$row['writer'].'</span>';}elseif(!empty($row['source'])){echo '<span class="time">'.$row['source'].'</span>';} ?> 阅读(<?php echo $row['click']; ?>)</div><div class="cl"></div></div><?php }} ?><div class="cl"></div></div></div>
<div id="rad2"><script>rjs2();</script></div></div><!-- fr_300 end --></div><!-- box end -->
<script>
function getmore(condition)
{
var url = "<?php echo CMS_BASEHOST; ?>/api/listarc";
var url = "<?php echo sysconfig('CMS_BASEHOST'); ?>/api/listarc";
//var typeid = "";
$.post(url,condition,function(res){
if(res.code==0)

4
resources/views/home/index/page.blade.php

@ -1,5 +1,5 @@
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /><meta http-equiv="Cache-Control" content="no-siteapp" /><meta http-equiv="Cache-Control" content="no-transform" /><meta name="mobile-agent" content="format=xhtml;url=http://m.bnbni.com/cat{dede:type}[field:id/]{/dede:type}/id{dede:field name='aid' /}">
<title><?php if(empty($post["seotitle"])){echo $post["title"];}else{echo $post["seotitle"];} ?>_<?php echo sysconfig('CMS_WEBNAME'); ?></title><meta name="keywords" content="<?php echo $post["keywords"]; ?>" /><meta name="description" content="<?php echo $post["description"]; ?>" /><link rel="stylesheet" href="<?php echo CMS_BASEHOST; ?>/images/style.css" media="all"><script type="text/javascript" src="<?php echo CMS_BASEHOST; ?>/js/ad.js"></script><script>uaredirect("http://m.bnbni.com/cat{dede:type}[field:id/]{/dede:type}/id{dede:field name='aid' /}");</script></head><body><script>site();</script>
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /><meta http-equiv="Cache-Control" content="no-siteapp" /><meta http-equiv="Cache-Control" content="no-transform" /><meta name="mobile-agent" content="format=xhtml;url=">
<title><?php if(empty($post["seotitle"])){echo $post["title"];}else{echo $post["seotitle"];} ?>_<?php echo sysconfig('CMS_WEBNAME'); ?></title><meta name="keywords" content="<?php echo $post["keywords"]; ?>" /><meta name="description" content="<?php echo $post["description"]; ?>" /><link rel="stylesheet" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/css/style.css" media="all"><script type="text/javascript" src="<?php echo sysconfig('CMS_BASEHOST'); ?>/js/ad.js"></script><script>uaredirect("http://m.bnbni.com/cat{dede:type}[field:id/]{/dede:type}/id{dede:field name='aid' /}");</script></head><body><script>site();</script>
@include('home.common.header')<div id="tad"><script>tjs();</script></div>
<div class="box mt10">

7
routes/web.php

@ -52,8 +52,8 @@ Route::group(['namespace' => 'Home'], function () {
//后台路由
Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['web']], function () {
Route::get('/', 'IndexController@index')->name('admin');
Route::get('/index/upconfig', 'IndexController@upconfig')->name('admin_index_upconfig');
Route::get('/index/upconfig', 'IndexController@upconfig')->name('admin_index_upconfig'); //更新系统参数配置
Route::get('/index/upcache', 'IndexController@upcache')->name('admin_index_upcache'); //更新缓存
//文章
Route::get('/article', 'ArticleController@index')->name('admin_article');
Route::get('/article/add', 'ArticleController@add')->name('admin_article_add');
@ -153,7 +153,8 @@ Route::group(['prefix' => 'fladmin', 'namespace' => 'Admin', 'middleware' => ['w
});
//接口路由
Route::group(['prefix' => 'Api'], function () {
Route::group(['prefix' => 'api', 'namespace' => 'Api', 'middleware' => ['web']], function () {
Route::get('/listarc', 'IndexController@listarc')->name('api_listarc');
Route::get('/ccc', function () {
// 匹配 "/api/users" URL
});

Loading…
Cancel
Save