The DEDECMS homepage calls multiple images in the image set.

Source: Internet
Author: User

The DEDECMS homepage calls multiple images in the image set.

This article will share with you the method of calling multiple images in the image set on the homepage of the dream system. If you have the same requirements, refer.

First, find the include/common. inc. php file and paste the following code (I am posting the code on my website, which 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']; // retrieves field data

Preg_match_all ("/\}. + jpg/", $ imgurls, $ matches); // retrieve the qualified

$ New_arr = array_unique ($ matches [0]); // remove repeated values from the 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; // The returned result.

}

I. Call method on the dedecms homepage and list page:

Dede: arclist label call and dede: list call

?

1

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

The width (Omitted as 110), height (Omitted as 110), and number of calls (Omitted as (0) indicate all images) to be displayed ).

If there are multiple image sets, add the category id of the image set as follows:

?

1

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

Ii. dedecms:

?

1

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

If there are multiple image sets, add the category id of the image set as follows:

?

1

{Dede: field. id typeid = ''function =" Getimg (@ me, 80, 80, 7 )"/}

The width (Omitted as 110), height (Omitted as 110), and number of calls (Omitted as (0) indicate all images) to be displayed ).

The above is all the content of this article, hoping to help you master dedecms.

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.