In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces dedecms how to obtain multiple pictures of the picture collection, the article is very detailed, has a certain reference value, interested friends must read it!
How does dedecms get multiple pictures from a collection of pictures?
The realization method of obtaining multiple pictures from a picture set by dedecms (circular output)
Each case requires a lot of pictures and is displayed with a certain effect. The effect of the retrieval method that comes with weaving dreams is to call multiple parameters at once, and the effect shown is not what I need. The following is the method of searching from Baidu. You can refer to it.
When making a website for customers, the effect you need to do is to have a lot of pictures in each case, and show it with a certain effect. However, I found that the effect of the retrieval method of weaving dream itself was to call multiple parameters at once, and the effect was not what I needed, and it was very tangled at that time. Later, I thought about it by myself, but unfortunately I didn't succeed. Finally, the realization method is found through the network Baidu search.
There are two steps to implement the method:
1. Add the method / / to / include/common.func.php to output multiple images function.
The code is as follows:
Function Getimgs ($aid, $imgwith = 300,270, $num = 0, $style =') {global $dsql; $imgurls =''; $row = $dsql-> getone ("Select imgurls from `dede _ addonimages` where aid='$aid'"); / / $imgurls = $row ['imgurls']; preg_match_all ("/ {dede:img (. *)} (. *) {\ / dede:img/isU", $imgurls, $wordcount); $count = count ($wordcount [2]); if ($num > $count | | $num = = 0) {$num = $count } for ($I = 0x / s)
< $num;$i++){ if($style == 'li'){ $imglist .= ""; }else{ $imglist .= "";}} return $imglist;}
2. Call the method {dede:field.id function= "Getimgs (@ me,400,400,10)" /} in the template
The above is how dedecms gets all the contents of multiple pictures in the picture collection. Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.