下面六久阁就告诉大家具体实现方法:
首先找到并打开/include/arc.archives.class.php文件,在大概第145行左右的位置找到如下代码:
$this->Fields['userip'] = $this->addTableRow['userip'];
在其下面添加如下代码:
$this->Fields['body2'] = $this->addTableRow['body'];
添加完成之后再继续查找如下代码:
$this->dsql->ExecuteNoneQuery("Update `dede_archives` SET ismake=1 WHERE id='".$this->ArcID."'");
找到后在其上面添加如下代码:
//阅读全文开始 if($this->TotalPage > 1) { //用正则匹配把分页符去掉
$this->Fields['body2'] = preg_replace('/# p#副标题#e #/U', '',$this->Fields['body2']);
//特别提醒:本教程不可直接输入分页标签,使用时,请把p前面和e后面两个空格去掉。
$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='http://www.lol9.cn/".$this->NameFirst."_all.".$this->ShortName."'>阅读全文</a>";
修改完成后,生成一下内容页就可以看到效果了,当文章内容太多分成多页之后就会在列表后面出现阅读全文的链接了,大家赶快试试放在里的效果吧。