Dream CMS Two development tutorials to implement the paging style for Atlas thumbnails

Source: Internet
Author: User

Intermediary transaction SEO diagnosis Taobao guest Cloud host technology Hall

First dream of the CMS system is not too much introduction, weaving dream good, good dream!

Dream CMS5.7 version of the default with three Atlas styles, template names are article_image.htm, article_image_cl.htm (Sina style), article_image_new.htm ( This is a 5.7-only graphics and text slideshow style). Recently, when I was working on a woman's Atlas template, I found Dede the default Atlas template does not implement the paging style as an article, many times ask Niang, Google have no fruit, so carefully to dream of the document research found that weaving dream can achieve this style (pictured below). Now the method to share to everyone, this is also the Dream Forum on the hottest focus of attention Oh!

  

Problem Analysis:

To implement this way of paging, the first is to call the address of the thumbnail at the time of paging, but when you open the paging label file, there is no thumbnail data. What about that? We can only create a new function that is specifically used to make a page call through two development, and if you want to change {dede:pagebreak/}, there may be a problem with the article's relative paging. It is therefore recommended that we create our own functions to avoid other problems.

Workaround:

Step One: Open arc_archives_class.php, and in the Include directory, add the following code at the end:

/**


* Get a picture thumbnail list in a dynamic page map


*


* @access Public


* @param int $totalPage Total pages


* @param int $nowPage current page


* @param int $aid Document 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 $ctag 1)


{


if ($ctag 1->getname () = "img")


{


$litpic. = ' <LI>


<div class=img><a title= "'. $ctag 1->getatt (' text '). "


href= "View.php?aid= '. $aid." &pageno= '. $pagenum. ><img


style= "Background-image:url ('. $ctag 1->getatt (' ddimg ')")


Src= "'. $GLOBALS [' Cfg_templets_skin ']. ' /tukustyle/blankbg.gif "></a></div><a


href= "View.php?aid= '. $aid." &pageno= '. $pagenum. > '. substr ($ctag 1->getatt (' text '), 30). ' </A> </LI> ';





$pagenum + +;


}


}


}





return $litpic;


}


/**


* Get a picture thumbnail list in a static page map


*


* @access Public


* @param int $totalPage Total pages


* @param int $nowPage current page


* @param int $aid Document 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 $ctag 1)


{


if ($ctag 1->getname () = "img")


{


if ($pagenum ==1)


{


$litpic. = ' <LI>


<div class=img><a title= "'. $ctag 1->getatt (' text '). "


href= "'. $this->namefirst. $this->shortname. ><img


style= "Background-image:url ('. $ctag 1->getatt (' ddimg ')")


src= "'. $GLOBALS [' Cfg_templets_skin ']. ' /tukustyle/blankbg.gif "></a></div><a


Href= "'. $this->namefirst. _ '. $pagenum. $this->shortname. > '. substr ($ctag 1->getatt (' text '), 0,30). ' </A> </LI> ';


}


Else


{


$litpic. = ' <LI>


<div class=img><a title= "'. $ctag 1->getatt (' text '). "


href= "'. $this->namefirst. _ '. $pagenum. $this->shortname. ><img


style= "Background-image:url ('. $ctag 1->getatt (' ddimg ')")


src= "'. $GLOBALS [' Cfg_templets_skin ']. ' /tukustyle/blankbg.gif "></a></div><a


href= "'. $this->namefirst. _ '. $pagenum. $this->shortname. > '. substr ($ctag 1->getatt (' text '), 0,30). ' </A> </LI> ';


}


$pagenum + +;


}


}


}





return $litpic;


}

The last is the template call, which is no longer in detail, of course, this is only a way! This article is the first webmaster network, women say original content, reproduced please indicate the source. Like a friend can go to a woman say look at the actual effect http://tuku.nvsay.com

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.