The DEDECMS homepage calls multiple images in the image set. the dedecms image set _ PHP Tutorial

Source: Internet
Author: User
The DEDECMS homepage calls multiple images in the image set and dedecms image set. The DEDECMS homepage calls multiple images in the image set. the dedecms image set first finds includecommon. inc. php file, paste the following code (I am posting on my website, you can call multiple images in the image set on the DEDECMS homepage as needed, dedecms image set

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 ):

Function Getimg ($ aid, $ imgwith, $ imgheight) {global $ dsql; $ imgurls = ''; $ row = $ dsql-> getone ("select imgurls from dede_addonimages where aid = '$ aid'"); $ imgurls = $ row ['imgurls']; // Obtain the field data preg_match_all ("/\}. + jpg/", $ imgurls, $ matches); // Retrieve the $ new_arr = array_unique ($ matches [0]) that meets the conditions; // remove the repeated values in the array $ pic_num1 ="
 
 
    "; Foreach ($ new_arr as $ key) {$ pic_list. ="
  • ";}$ Pic_end ="
"; Return $ pic_num1. $ pic_list. $ pic_end; // return result}

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

Dede: arclist label call and dede: list call

[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:

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

II. dedecms:

{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:

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

First, find the include/common. inc. php file and paste the following code (I am posting the code on my website. you can refer to the following code as needed...

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.