DEDECMS Home Call multiple pictures in picture set _php tutorial

Source: Internet
Author: User

DEDECMS Home Call multiple pictures in the picture set


This article to you to share is the dream system in the home page call picture collection of multiple images of the method, have the same needs of the small partners can refer to.

First find the include/common.inc.php file, paste the following code (I posted on my website, the specific can be modified as needed):

?

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 the Eligible

$new _arr=array_unique ($matches [0]);//Remove duplicate values from the array

$pic _num1= "

    ";

    foreach ($new _arr as $key) {

    $pic _list.= "

  • ";

    }

    $pic _end= "

";

Return $pic _num1. $pic _list. $pic _end;//return result

}

First, Dedecms the calling method in the homepage and List page of the website:

Dede:arclist tag invocation and dede:list list invocation

?

1

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

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

If there are multiple picture sets, then the class ID of the add-on set is as follows

?

1

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

Second, the DEDECMS article inside the page calls the picture collection multiple pictures call method:

?

1

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

If there are multiple picture sets, then the class ID of the add-on set is as follows

?

1

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

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

The above is the whole content of this article, I hope to be able to master the Dedecms to help you.

http://www.bkjia.com/PHPjc/1012362.html www.bkjia.com true http://www.bkjia.com/PHPjc/1012362.html techarticle Dedecms Home Call pictures in the collection of pictures in this article to share is the dream system in the home page call picture collection of multiple pictures of the method, have the same needs of the small partners can refer to the next ...

  • 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.