如图所示:
往下 大概 145行 找到 $this->Fields['userip'] = $this->addTableRow['userip'];
在下面一行添加:$this->Fields['body2'] = $this->addTableRow['body'];
第二步查找:$this->dsql->ExecuteNoneQuery("Update `#@__archives` SET ismake=1 WHERE id='".$this->ArcID."'");
在上一行添加以下代码
代码如下
//阅读全文开始
if($this->TotalPage > 1) {
//用正则匹配把分页符去掉
$this->Fields['body2'] = preg_replace('/#p#副标题#e#/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');
}
}
//阅读全文结束
第三步:查找 获得静态页面分页列表
代码如下
/**
* 获得静态页面分页列表
*
* @access public
* @param int $totalPage 总页数
* @param int $nowPage 当前页数
* @param int $aid 文档id
* @return string
*/
function GetPagebreak($totalPage, $nowPage, $aid)
{
if($totalPage==1)
{
return "";
}
//$PageList = " 共".(HdhCmsTest111cn.net)$totalPage."页: ";
$PageList = "";
$nPage = $nowPage-1;
$lPage = $nowPage+1;
if($nowPage==1)
{
$PageList.=" }
else
{
if($nPage==1)
{
$PageList.="NameFirst.".".$this->ShortName."' target='_self'> }
else
{
$PageList.="NameFirst."_".$nPage.".".$this->ShortName."' target='_self'> }
}
for($i=1;$i {
if($i==1)
{
if($nowPage!=1)
{
$PageList.="NameFirst.".".$this->ShortName."' target='_self'>1";
}
else
{
$PageList.="1";
}
}
else
{
$n = $i;
if($nowPage!=$i)
{
$PageList.="NameFirst."_".$i.".".$this->ShortName."' target='_self'>".$n."";
}
else
{
$PageList.="{$n}";
}
}
}
if($lPage {
$PageList.="NameFirst."_".$lPage.".".$this->ShortName."' target='_self'>>";
}
else
{
$PageList.= ">";
}
$PageList.= "NameFirst."_all.".$this->ShortName."'>阅读全文";
return $PageList;
}
也就是在return $PageList 上一行添加了一行代码,
$PageList.= "NameFirst."_all.".$this->ShortName."'>阅读全文";
修改完成后,保存文件,更新一下页面就可以看到效果了。
from:http://HdhCmsTest111cn.net/wy/Dedecms/66572.htm
查看更多关于dedecms5.7文章实现阅读全文功能二次开发_html/css_WEB-ITnose的详细内容...