為您解碼網(wǎng)站建設(shè)的點(diǎn)點(diǎn)滴滴
發(fā)表日期:2019-12 文章編輯:小燈 瀏覽次數(shù):4245
Phpcms默認(rèn)不支持調(diào)用全站最新文章,需要修改文件:\phpcms\modules\content\classes\content_tag.class.php,找到以下函數(shù):
修改為:
- /**
- * 列表頁(yè)標(biāo)簽
- * @param $data
- */
- public function lists($data) {
- $catid = intval($data['catid']);
- if(!$this->set_modelid($catid)) return false;
- if(isset($data['where'])) {
- $sql = $data['where'];
- } else {
- $thumb = intval($data['thumb']) ? " AND thumb != ''" : '';
- if($this->category[$catid]['child']) {
- $catids_str = $this->category[$catid]['arrchildid'];
- $pos = strpos($catids_str,',')+1;
- $catids_str = substr($catids_str, $pos);
- $sql = "status=99 AND catid IN ($catids_str)".$thumb;
- } else {
- $sql = "status=99 AND catid='$catid'".$thumb;
- }
- }
- $order = $data['order'];
- $return = $this->db->select($sql, '*', $data['limit'], $order, '', 'id');
- //調(diào)用副表的數(shù)據(jù)
- if (isset($data['moreinfo']) && intval($data['moreinfo']) == 1) {
- $ids = array();
- foreach ($return as $v) {
- if (isset($v['id']) && !emptyempty($v['id'])) {
- $ids[] = $v['id'];
- } else {
- continue;
- }
- }
- if (!emptyempty($ids)) {
- $this->db->table_name = $this->db->table_name.'_data';
- $ids = implode('\',\'', $ids);
- $r = $this->db->select("`id` IN ('$ids')", '*', '', '', '', 'id');
- if (!emptyempty($r)) {
- foreach ($r as $k=>$v) {
- if (isset($return[$k])) $return[$k] = array_merge($v, $return[$k]);
- }
- }
- }
- }
- return $return;
- }
修改代碼后,即能調(diào)取全站最新文章。
- /**
- * 列表頁(yè)標(biāo)簽
- * @param $data
- */
- public function lists($data) {
- $catid = intval($data['catid']);
- if(isset($data['where'])) {
- $sql = $data['where'];
- } else {
- $thumb = intval($data['thumb']) ? " AND thumb != ''" : '';
- if(!emptyempty($catid)) {
- if(!$this->set_modelid($catid)) return false;
- if($this->category[$catid]['child']) {
- $catids_str = $this->category[$catid]['arrchildid'];
- $pos = strpos($catids_str,',')+1;
- $catids_str = substr($catids_str, $pos);
- $sql = "status=99 AND catid IN ($catids_str)".$thumb;
- } else {
- $sql = "status=99 AND catid='$catid'".$thumb;
- }
- }
- else {
- $sql = "status=99".$thumb;
- }
- }
- $order = $data['order'];
- $return = $this->db->select($sql, '*', $data['limit'], $order, '', 'id');
- //調(diào)用副表的數(shù)據(jù)
- if (isset($data['moreinfo']) && intval($data['moreinfo']) == 1) {
- $ids = array();
- foreach ($return as $v) {
- if (isset($v['id']) && !emptyempty($v['id'])) {
- $ids[] = $v['id'];
- } else {
- continue;
- }
- }
- if (!emptyempty($ids)) {
- $this->db->table_name = $this->db->table_name.'_data';
- $ids = implode('\',\'', $ids);
- $r = $this->db->select("`id` IN ('$ids')", '*', '', '', '', 'id');
- if (!emptyempty($r)) {
- foreach ($r as $k=>$v) {
- if (isset($return[$k])) $return[$k] = array_merge($v, $return[$k]);
- }
- }
- }
- }
- return $return;
- }
日期:2019-12 瀏覽次數(shù):4695
日期:2019-12 瀏覽次數(shù):4135
日期:2019-12 瀏覽次數(shù):3878
日期:2019-12 瀏覽次數(shù):4124
日期:2019-12 瀏覽次數(shù):4244
日期:2019-12 瀏覽次數(shù):4028
日期:2019-12 瀏覽次數(shù):4299
日期:2019-12 瀏覽次數(shù):3947
日期:2019-12 瀏覽次數(shù):4459
日期:2019-12 瀏覽次數(shù):4475
日期:2019-12 瀏覽次數(shù):4230
日期:2019-12 瀏覽次數(shù):4802
日期:2019-12 瀏覽次數(shù):4191
日期:2019-12 瀏覽次數(shù):4017
日期:2019-12 瀏覽次數(shù):4080
日期:2019-12 瀏覽次數(shù):3998
日期:2019-12 瀏覽次數(shù):4271
日期:2019-12 瀏覽次數(shù):4085
日期:2019-12 瀏覽次數(shù):4096
日期:2019-12 瀏覽次數(shù):5468
日期:2019-12 瀏覽次數(shù):4559
日期:2019-12 瀏覽次數(shù):3935
日期:2019-12 瀏覽次數(shù):3978
日期:2019-12 瀏覽次數(shù):4051
日期:2019-12 瀏覽次數(shù):4773
日期:2019-12 瀏覽次數(shù):3923
日期:2019-12 瀏覽次數(shù):3852
日期:2019-12 瀏覽次數(shù):4171
日期:2019-12 瀏覽次數(shù):3793
日期:2019-12 瀏覽次數(shù):4081
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.