search
HomeCMS TutorialDEDECMSHow does Dreamweaver CMS implement the paging style of album thumbnails?

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!

How does Dreamweaver CMS implement the paging style of album thumbnails?

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.=&#39;<LI>
<DIV class=img><A title="&#39;. $ctag1->GetAtt(&#39;text&#39;).&#39;"
href="view.php?aid=&#39;.$aid.&#39;&pageno=&#39;.$pagenum.&#39;"><img src="/static/imghwm/default1.png"  data-src="&#39;.$GLOBALS[&#39;cfg_templets_skin&#39;].&#39;/tukustyle/blankBg.gif"  class="lazy" 
style="BACKGROUND-IMAGE: url(&#39;.$ctag1->GetAtt(&#39;ddimg&#39;).&#39;)" ></A></DIV><A
href="view.php?aid=&#39;.$aid.&#39;&pageno=&#39;.$pagenum.&#39;">&#39;.substr($ctag1->GetAtt(&#39;text&#39;), 30).&#39;</A> </LI>&#39;;
$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[&#39;imgurls&#39;])) return ;
$revalue = &#39;&#39;;
$dtp = new DedeTagParse();
$dtp->LoadSource($this->addTableRow[&#39;imgurls&#39;]);
$images = array();
if(is_array($dtp->CTags))
{
$pagenum=1;
foreach($dtp->CTags as $ctag1)
{
if($ctag1->GetName()=="img")
{
if($pagenum==1)
{
$litpic.=&#39;<LI>
<DIV class=img><A title="&#39;. $ctag1->GetAtt(&#39;text&#39;).&#39;"
href="&#39;.$this->NameFirst.&#39;.&#39;.$this->ShortName.&#39;"><img src="/static/imghwm/default1.png"  data-src="&#39;.$GLOBALS[&#39;cfg_templets_skin&#39;].&#39;/tukustyle/blankBg.gif"  class="lazy" 
style="BACKGROUND-IMAGE: url(&#39;.$ctag1->GetAtt(&#39;ddimg&#39;).&#39;)" ></A></DIV><A
href="&#39;.$this->NameFirst.&#39;_&#39;.$pagenum.&#39;.&#39;.$this->ShortName.&#39;">&#39;.substr($ctag1->GetAtt(&#39;text&#39;),0,30).&#39;</A> </LI>&#39;;
}
else
{
$litpic.=&#39;<LI>
<DIV class=img><A title="&#39;. $ctag1->GetAtt(&#39;text&#39;).&#39;"
href="&#39;.$this->NameFirst.&#39;_&#39;.$pagenum.&#39;.&#39;.$this->ShortName.&#39;"><img src="/static/imghwm/default1.png"  data-src="&#39;.$GLOBALS[&#39;cfg_templets_skin&#39;].&#39;/tukustyle/blankBg.gif"  class="lazy" 
style="BACKGROUND-IMAGE: url(&#39;.$ctag1->GetAtt(&#39;ddimg&#39;).&#39;)" ></A></DIV><A
href="&#39;.$this->NameFirst.&#39;_&#39;.$pagenum.&#39;.&#39;.$this->ShortName.&#39;">&#39;.substr($ctag1->GetAtt(&#39;text&#39;),0,30).&#39;</A> </LI>&#39;;
}
$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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Atom editor mac version download

Atom editor mac version download

The most popular open source editor