DEDECMS homepage calls multiple pictures in the image set _ PHP Tutorial

Source: Internet
Author: User
The DEDECMS homepage calls multiple images in the image set. The DEDECMS homepage calls multiple images in the image set. This article will share with you how the homepage of the dream system calls multiple images in the image set, if you have the same requirements, refer to the DEDECMS homepage to call 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 ="

    ";

    Foreach ($ new_arr as $ key ){

    $ Pic_list. ="

  • ";

    }

    $ Pic_end ="

";

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.

In this article, I will share with you how to call multiple images in the image set on the homepage of the dream system. if you have the same requirements, refer to the following...

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.