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.