DEDECMS home Page Call multiple pictures in a picture set

Source: Internet
Author: User
Tags php file

This article for you to share is the dream system in the first call picture set of multiple pictures in the way, there are the same needs of small partners can refer to.

First find the include/common.inc.php file, put the following code in (I posted on my website, can be modified according to the need):

?

1 2 3 4, 5 6 7 8 9 10 11 12 13 14 15 function getimg ($aid, $imgwith, $imgheight) {global $dsql; $imgurls = '; $row = $dsql->getone ("Select Imgurls from Dede _addonimages where aid= ' $aid '); $imgurls = $row [' Imgurls '];//get field data Preg_match_all ("/}.+jpg/", $imgurls, $matches);//Remove Eligible $new _arr=array_unique ($ MATCHES[0];//Remove duplicate values in array $pic _num1= "<dt><div class=tu_big></div></dt><dd><ul>"; foreach ($new _arr as $key) {$pic _list.= ' <li></li> "; $pic _end= "</ul></dd>"; Return $pic _num1. $pic _list. $pic _end;//Returns results}

First, the DEDECMS Web site in the home page and list pages of the call method:

Dede:arclist tag calls and Dede:list list calls

?

1 [Field:id function= "getimg (@me, 80,80,7)"/]

The 80 and 80 and 7 respectively are to display the width of the picture (omitted to 110) and the height (omitted to 110) and the call number (omitted to (0), representing all the sheets).

If you have more than one picture set, then add the class ID of the picture set, as follows

?

1 [Field:id typeid= ' function= "getimg (@me, 80,80,7)"/]

Two, the DEDECMS article inside the page calls the picture set several pictures the invocation method:

?

1 {dede:field.id function= "getimg (@me, 80,80,7)"/}

If you have more than one picture set, then add the class ID of the picture set, as follows

?

1 {dede:field.id typeid= ' function= ' getimg (@me, 80,80,7) "/}

The 80 and 80 and 7 respectively are to display the width of the picture (omitted to 110) and the height (omitted to 110) and the call number (omitted to (0), representing all the sheets).

The above mentioned is the entire content of this article, hope to be able to master dedecms to be helpful to everybody.

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.