当前位置:网站首页>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
边栏推荐
- 用伪元素before实现元素的等比例缩放
- LeetCode每日一练 —— 206. 反转链表
- Second uncle, why is it so hot?
- Obtain website shell permission based on file upload vulnerability
- Automatic classification of e-commerce UGC pictures using Baidu PaddlePaddle easydl
- Face recognition 5.1- insightface face face detection model training practice notes
- CPDA | how to have data analysis thinking?
- 访问共享文件夹时提示“因为文件共享不安全 SMB1协议”请使用SMB2协议
- LeetCode每日一练 —— 876. 链表的中间结点
- MAPGIS 3D pipeline modeling awakens the pulse of urban underground pipelines
猜你喜欢

MAPGIS 3D scene rendering technology and Application

NPDP | what kind of product manager can be called excellent?

PHP代码审计6—文件包含漏洞

LeetCode-136-只出现一次的数字

sscanf 导致地址越界

使用百度飞桨EasyDL实现电商UGC图片自动分类

Leetcode-136-a number that appears only once

基于文件上传漏洞获得网站 shell 权限

Read Plato & nbsp; Eplato of farm and the reasons for its high premium

“收割”NFT:200元淘宝买图,上链卖30万元
随机推荐
How to check the Bluetooth version of Bluetooth headset
飞桨框架体验评测交流会,产品的使用体验由你来决定!
进程管理 进程的监控与管理 ps/pstree/top/lsof
常见ArrayLIst面试题
Brief description of tenant and multi tenant concepts in cloud management platform
PHP code audit 6 - file contains vulnerability
One of IOU target tracking: IOU tracker
Sre related question answering
LabVIEW learning note 9: capture the "value change" event generated by the program modifying the control value
Knowledge management system promotes the development of enterprise informatization
What if the start button doesn't respond after the win11 system updates kb5014668?
Installation and use tutorial of the latest version of Web vulnerability scanning tool appscan\awvs\xray
Hexagon_ V65_ Programmers_ Reference_ Manual(9)
API gateway introduction
Obtain website shell permission based on file upload vulnerability
Repeated DNA sequence [hash determination repetition + sliding window + bit operation of binary coding]
Understanding Network Model OSI model
知识管理系统推动企业信息化发展
Win11用户名和密码备份方法
二舅,为什么火了?