首先打开apps/admin/controller/content/ContentController.php文件
找到
// 文章修改 public function mod() { if (! ! $submit = post('submit')) { switch ($submit) { |
case 'pbootnet': // 修改文章访问量 $listall = post('listall'); if ($listall) { $visits = post('visits'); foreach ($listall as $key => $value) { if ($visits[$key] === '' || ! is_numeric($visits[$key])) $visits[$key] = visits; $this->model->modContent($value, "visits=" . $visits[$key]); } $likes = post('likes'); foreach ($listall as $key => $value) { if ($likes[$key] === '' || ! is_numeric($likes[$key])) $likes[$key] = likes; $this->model->modContent($value, "likes=" . $likes[$key]); } $this->log('修改内容访问量成功!'); success('修改成功!', - 1); } else { alert_back('修改失败,无任何内容!'); } break; |
添加完毕保存后
再打开/apps/admin/model/content/ContentModel.php文件
在每一个如下代码中添加'a.likes',
$field = array( 'a.id', 'b.name as sortname', 'a.scode', 'c.name as subsortname', 'a.subscode', 'a.title', 'a.subtitle', 'a.date', 'a.sorting', 'a.status', 'a.istop', 'a.isrecommend', 'a.isheadline', 'a.visits', 'a.likes', 'a.ico', 'a.pics', 'a.filename', 'a.outlink', 'd.urlname', 'b.filename as sortfilename' ); |
打开/apps/admin/view/default/content/content.html文件
找到
|
|
|
|
|
|
版权声明: 本站资源均来自互联网或会员发布,如果侵犯了您的权益请与我们联系,我们将在24小时内删除!谢谢!
转载请注明: pbootcms后台内容列表增加阅读量和点赞量自定义修改