当前位置:网站首页>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
边栏推荐
- What are the application scenarios of real name authentication in the cultural tourism industry?
- R language uses dplyr package to perform data aggregation statistics, calculate sliding window statistics, calculate sliding group mean, and merge the generated statistical data into the original data
- Understand the communication mode of transmission media
- PHP code audit 5 - XSS vulnerability
- Leetcode-209- subarray with the smallest length
- 论文赏析[EMNLP18]针对自顶向下和中序移进归约成分句法分析的Dynamic Oracles
- Dobot Magician 机器臂-简介
- 访问共享文件夹时提示“因为文件共享不安全 SMB1协议”请使用SMB2协议
- MAPGIS 3D pipeline modeling awakens the pulse of urban underground pipelines
- Natapp intranet penetration tool Internet access personal projects
猜你喜欢

多人协作开发规范

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

一种比读写锁更快的锁,还不赶紧认识一下

Rust variable characteristics

Leetcode daily practice - 876. Intermediate node of linked list

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

What if the start button doesn't respond after the win11 system updates kb5014668?

飞信卒于2022:中国移动一手好牌被打烂,5亿用户成“僵尸”

力扣 919. 完全二叉树插入器

The use experience of the product is up to you in the evaluation and exchange meeting of the flying oar frame experience!
随机推荐
力扣 919. 完全二叉树插入器
Get the method registered in the delegate
Hexagon_ V65_ Programmers_ Reference_ Manual(5)
飞信卒于2022:中国移动一手好牌被打烂,5亿用户成“僵尸”
Conquer 3 pieces of IT equipment for all programmers →
建筑云渲染的应用正在扩大,越来越多的行业急需可视化服务
LeetCode每日一练 —— CM11 链表分割
A review of component parsing (Second Edition)
访问共享文件夹时提示“因为文件共享不安全 SMB1协议”请使用SMB2协议
Sre: Google operation and maintenance decryption
How to realize document collaboration?
Five celebrities' worries about AI
Read Plato & nbsp; Eplato of farm and the reasons for its high premium
Understanding of reg type variables in Verilog HDL
数字化工厂管理系统有哪些价值
Repeated DNA sequence [hash determination repetition + sliding window + bit operation of binary coding]
Leetcode-209- subarray with the smallest length
Set up discuz forum and break the stolen database
PG free space map & visibility map
PHP code audit 6 - file contains vulnerability