DEDECMS Home Call multiple pictures in the picture set, Dedecms Picture Collection _php Tutorial

Source: Internet
Author: User

DEDECMS Home Call multiple pictures in the picture set, Dedecms picture collection


First find the include/common.inc.php file, paste the following code (I posted on my website, the specific 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 '];//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 Results}

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

Dede:arclist tag invocation and dede:list list invocation

[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

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

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

{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

{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/1011945.html www.bkjia.com true http://www.bkjia.com/PHPjc/1011945.html techarticle Dedecms Home Call pictures in the collection of pictures, dedecms picture set to find the include/common.inc.php file, the following code to paste in (I posted on my website, the specific can be 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.