首先打開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('修改內(nèi)容訪問量成功!'); success('修改成功!', - 1); } else { alert_back('修改失敗,無任何內(nèi)容!'); } 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文件
找到
|
|
|
|
|
|
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會員發(fā)布,如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: pbootcms后臺內(nèi)容列表增加閱讀量和點贊量自定義修改