织梦DedeCMS文章页实现阅读全文功能
/U','',$this->Fields['body2']); $this->SplitFields = explode("#p2222#",$this->Fields['body2']); $this->Fields['tmptitle'] = (empty($this->Fields['tmptitle']) ? $this->Fields['title'] : $this->Fields['tmptitle']); $this->Fields['title'] = $this->Fields['tmptitle']; $this->TotalPage = count($this->SplitFields); $this->Fields['totalpage'] = $this->TotalPage; $TRUEfilenameall = $this->GetTruePath().$fileFirst."_all.".$this->ShortName; $this->ParseDMFields(1,0); $this->dtp->SaveTo($TRUEfilenameall); if($cfg_remote_site=='Y' && $isremote == 1) { //分析远程文件路径 $remotefile = str_replace(DEDEROOT,$TRUEfilename); $localfile = '..'.$remotefile; //创建远程文件夹 $remotedir = preg_replace("#[^\/]*\.html#",$remotefile); $this->ftp->rmkdir($remotedir); $this->ftp->upload($localfile,$remotefile,'ascii'); } } //阅读全文结束 添加完成之后继续在里面查找获得静态页面分页列表的代码,里面有 return $PageList; 在其上面添加如下代码: $PageList.= "<a href='".$this->NameFirst."_all.".$this->ShortName."'>阅读全文</a>"; 修改完成后,生成一下内容页就可以看到效果了,当文章内容太多分成多页之后就会在列表后面出现阅读全文的链接了,大家赶快试试吧。 以上内容由PHP站长网【52php.cn】收集整理供大家参考研究如果以上内容对您有帮助,欢迎收藏、点赞、推荐、分享。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |