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= "
";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 ...