当前位置:网站首页>Dedecms dream weaving last article next article free controllable output link, title, thumbnail, time
Dedecms dream weaving last article next article free controllable output link, title, thumbnail, time
2022-07-27 21:18:00 【User 9841292】
Without affecting the original function of the program , Secondary development Let the tags of the previous article and the next article freely and controllably output links 、 title 、 thumbnail 、 Time , Don't output anything without the previous or next article
Implementation tutorial
open /include/arc.archives.class.php find In about 735 Right and left
else if($ctag->GetName()=='fieldlist') system In its above Join in
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);
}
} Copy Pictured
Continue to find , In about 852 Right and left
$this->PreNext['pre'] = " Last one :<a href='$mlink'>{$preRow['title']}</a> ";In its above Join in
$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'];Pictured
Continue to find , In about 875 Right and left
$this->PreNext['next'] = " Next :<a href='$mlink'>{$nextRow['title']}</a> ";In its above Join in
$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'];Pictured
Continue to find , In about 889 Right and left
if($gtype=='pre')In its above Join in
if($gtype=='diy')
{
return $this->PreNext['diy'];
}Pictured
In the content page template, the previous article and the next article call the label writing method
Last one
{dede:prenextdiy get='pre'}
<li>
<a href="[field:arcurl/]"><img src="[field:litpic/]" width="50" height="50"></a>
<p><a href="[field:arcurl/]">[field:title/]</a><span> Time :[field:pubdate function="MyDate('Y-m-d',@me)"/]</span></p>
</li>
{/dede:prenextdiy}
Next
{dede:prenextdiy get='next'}
<li>
<a href="[field:arcurl/]"><img src="[field:litpic/]" width="50" height="50"></a>
<p><a href="[field:arcurl/]">[field:title/]</a><span> Time :[field:pubdate function="MyDate('Y-m-d',@me)"/]</span></p>
</li>
{/dede:prenextdiy} Be careful : Labels are custom dede:prenextdiy
边栏推荐
- Qt opengl 让物体在关照下动起来,形成动画
- Verilog HDL中的reg型变量的理解
- Codeforces 1706E 并查集 + 启发式合并 + ST 表
- Diffuse reflection of QT OpenGL light
- redis cook book.notes.
- The application of building cloud rendering is expanding, and more and more industries are in urgent need of visualization services
- redis cook book.notes.
- Automatic classification of e-commerce UGC pictures using Baidu PaddlePaddle easydl
- 论文赏析[EMNLP18]用序列标注来进行成分句法分析
- [anti shake and throttling]
猜你喜欢

Sscanf caused the address to be out of bounds

How to make personalized recommendations instantly accessible? Cloud native database gaussdb (for redis) to help

Typoa spelling check: missing dictionary file for Chinese

Dobot magician robot arm - Introduction

电脑微软账户登录一直转圈怎么解决问题

“地理-语言”大模型文心ERNIE-GeoL及应用

Automated testing ----- selenium (II)

IOU target tracking II: viou tracker

建筑云渲染的应用正在扩大,越来越多的行业急需可视化服务

LeetCode每日一练 —— 203. 移除链表元素
随机推荐
MAPGIS 3D pipeline modeling awakens the pulse of urban underground pipelines
Remember that resttemplate.getforentity failed to carry headers once, resttemplate exchange
Understanding network model TCPIP model
LabVIEW learning note 5: you cannot return to the original state after pressing the button
Understanding Network Model OSI model
Hexagon_ V65_ Programmers_ Reference_ Manual(8)
Leetcode daily practice 206. Reverse the linked list
Overview of understanding the physical layer of transmission media
Understanding network model overview of network model
Five celebrities' worries about AI
Qt 链接MSSQL
Understanding of reg type variables in Verilog HDL
MapGIS三维管线建模,唤醒城市地下管线脉搏
论文赏析[EMNLP18]针对自顶向下和中序移进归约成分句法分析的Dynamic Oracles
飞桨框架体验评测交流会,产品的使用体验由你来决定!
Rust变量特点
Paper appreciation [aaai18] meta multi task learning for sequence modeling
实名认证在文旅出行行业的应用场景有哪些?
R language dplyr package summary_ The at function calculates the count number, mean and median of multiple data columns (specified by vectors) in the dataframe data, and specifies the function list us
Unity installs personal free edition