How does Dreamweaver CMS implement the paging style of album thumbnails?
How does Dreamweaver CMS implement the paging style of album thumbnails?
DreamWeaver CMS secondary development tutorial to implement the paging style of album thumbnails
Recommended learning: Dreamweaver cms
梦Weaver CMS CMS5.7 version comes with three atlas styles by default. The template names are article_image.htm, article_image_cl.htm (Sina style), and article_image_new.htm (this is the graphic slideshow style only available in 5.7). Recently, when I was working on the album template that Women Talk about, I found that dede's default album template could not implement the paging style like the article. I asked Du Niang and Brother Gu many times to no avail, so I carefully studied the files of Weaver Dreams and found that Dede Dreams can come true in this way (as shown below). Now I will share the method with you. This is also the focus of everyone’s hottest attention on the Dream Weaver Forum!
Problem Analysis:
To implement this paging method, the first step is to call the thumbnail address when paging. However, when you open the paging tag file, you can see that there is no thumbnail data. What to do? We can only create a new function through secondary development specifically for album paging calls. If we want to change {dede:pagebreak/}, there may be problems with the paging method of the article. Therefore, it is recommended that we create a new function ourselves to avoid other problems.
Solution:
Step one: Open arc_archives_class.php, in the include directory, add the following code at the end:
/** * 获得动态页面图集中图片缩略列表 * * @access public * @param int $totalPage 总页数 * @param int $nowPage 当前页数 * @param int $aid 文档id * @return string */ function GetlitpicDM_list($totalPage,$nowPage,$aid) { global $dsql,$sqlCt; $attlist="desclen|80"; FillAttsDefault($ctag->CAttribute->Items,$attlist); extract($ctag->CAttribute->Items, EXTR_SKIP); if(!isset($this->addTableRow['imgurls'])) return ; $revalue = ''; $dtp = new DedeTagParse(); $dtp->LoadSource($this->addTableRow['imgurls']); $images = array(); if(is_array($dtp->CTags)) { $pagenum=1; foreach($dtp->CTags as $ctag1) { if($ctag1->GetName()=="img") { $litpic.='<LI> <DIV class=img><A title="'. $ctag1->GetAtt('text').'" href="view.php?aid='.$aid.'&pageno='.$pagenum.'"><img src="/static/imghwm/default1.png" data-src="'.$GLOBALS['cfg_templets_skin'].'/tukustyle/blankBg.gif" class="lazy" style="BACKGROUND-IMAGE: url('.$ctag1->GetAtt('ddimg').')" ></A></DIV><A href="view.php?aid='.$aid.'&pageno='.$pagenum.'">'.substr($ctag1->GetAtt('text'), 30).'</A> </LI>'; $pagenum++; } } } return $litpic; } /** * 获得静态页面图集中图片缩略列表 * * @access public * @param int $totalPage 总页数 * @param int $nowPage 当前页数 * @param int $aid 文档id * @return string */ function Getlitpic_list($totalPage,$nowPage,$aid) { global $dsql,$sqlCt; $attlist="desclen|80"; FillAttsDefault($ctag->CAttribute->Items,$attlist); extract($ctag->CAttribute->Items, EXTR_SKIP); if(!isset($this->addTableRow['imgurls'])) return ; $revalue = ''; $dtp = new DedeTagParse(); $dtp->LoadSource($this->addTableRow['imgurls']); $images = array(); if(is_array($dtp->CTags)) { $pagenum=1; foreach($dtp->CTags as $ctag1) { if($ctag1->GetName()=="img") { if($pagenum==1) { $litpic.='<LI> <DIV class=img><A title="'. $ctag1->GetAtt('text').'" href="'.$this->NameFirst.'.'.$this->ShortName.'"><img src="/static/imghwm/default1.png" data-src="'.$GLOBALS['cfg_templets_skin'].'/tukustyle/blankBg.gif" class="lazy" style="BACKGROUND-IMAGE: url('.$ctag1->GetAtt('ddimg').')" ></A></DIV><A href="'.$this->NameFirst.'_'.$pagenum.'.'.$this->ShortName.'">'.substr($ctag1->GetAtt('text'),0,30).'</A> </LI>'; } else { $litpic.='<LI> <DIV class=img><A title="'. $ctag1->GetAtt('text').'" href="'.$this->NameFirst.'_'.$pagenum.'.'.$this->ShortName.'"><img src="/static/imghwm/default1.png" data-src="'.$GLOBALS['cfg_templets_skin'].'/tukustyle/blankBg.gif" class="lazy" style="BACKGROUND-IMAGE: url('.$ctag1->GetAtt('ddimg').')" ></A></DIV><A href="'.$this->NameFirst.'_'.$pagenum.'.'.$this->ShortName.'">'.substr($ctag1->GetAtt('text'),0,30).'</A> </LI>'; } $pagenum++; } } } return $litpic; }
The last step is to call the template , I won’t go into details anymore, of course this is just one method!
The above is the detailed content of How does Dreamweaver CMS implement the paging style of album thumbnails?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 Chinese version
Chinese version, very easy to use
