织梦可控输出上下篇链接、标题、缩略图、时间

打开/include/arc.archives.class.php文件

找到

else if($ctag->GetName()=='fieldlist')制

在它上面加入

else if($ctag->GetName()=='prenextdiy')

{

$innertext = trim($ctag->GetInnerText());

if($innertext)

{

$get = $ctag->GetAtt('get');

$diys['diy'] = $this->GetPreNext('diy');

$revalue = '';

$dtp2 = new DedeTagParse();

$dtp2->SetNameSpace('field','[',']');

$dtp2->LoadSource($innertext);

foreach($diys as $row)

{

foreach($dtp2->CTags as $tid=>$ctag2)

{

if(isset($row[$get][$ctag2->GetName()]))

{

$dtp2->Assign($tid,$row[$get][$ctag2->GetName()]);

}

}

$revalue .= $dtp2->GetResult();

}

if($row[$get]['id']) $this->dtp->Assign($i,$revalue);

}

}

1

继续找到

$this->PreNext['pre'] = "上一篇:<a href='$mlink'>{$preRow['title']}</a> ";

在它上面加入

$preRow['litpic'] = (empty($preRow['litpic'])) ? $GLOBALS['cfg_cmspath'].'/images/defaultpic.gif' : $preRow['litpic'];

$this->PreNext['diy']['pre']['id'] = $preRow['id'];

$this->PreNext['diy']['pre']['arcurl'] = $mlink;

$this->PreNext['diy']['pre']['title'] = $preRow['title'];

$this->PreNext['diy']['pre']['litpic'] = $preRow['litpic'];

$this->PreNext['diy']['pre']['pubdate'] = $preRow['senddate'];

2

继续找到

$this->PreNext['next'] = "下一篇:<a href='$mlink'>{$nextRow['title']}</a> ";

在它上面加入

$nextRow['litpic'] = (empty($nextRow['litpic'])) ? $GLOBALS['cfg_cmspath'].'/images/defaultpic.gif' : $nextRow['litpic'];

$this->PreNext['diy']['next']['id'] = $nextRow['id'];

$this->PreNext['diy']['next']['arcurl'] = $mlink;

$this->PreNext['diy']['next']['title'] = $nextRow['title'];

$this->PreNext['diy']['next']['litpic'] = $nextRow['litpic'];

$this->PreNext['diy']['next']['pubdate'] = $nextRow['senddate'];

3

继续找到

if($gtype=='pre')

在它上面加入

if($gtype=='diy') { return $this->PreNext['diy']; }

4

上下篇调用标签

上一篇

{dede:prenextdiy get='pre'}

<li>

<a href=https://www.91084.com/"[field:arcurl/]"><img src="[field:litpic/]" width="50" height="50"></a>

<p><a href=https://www.91084.com/"[field:arcurl/]">[field:title/]</a><span>时间:[field:pubdate function="MyDate('Y-m-d',@me)"/]</span></p>

</li>

{/dede:prenextdiy}

下一篇

{dede:prenextdiy get='next'}

<li>

<a href=https://www.91084.com/"[field:arcurl/]"><img src="[field:litpic/]" width="50" height="50"></a>

<p><a href=https://www.91084.com/"[field:arcurl/]">[field:title/]</a><span>时间:[field:pubdate function="MyDate('Y-m-d',@me)"/]</span></p>

</li>

{/dede:prenextdiy} 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zygdzs.html