
dedecmsHow to get multiple pictures in the picture album?
dedecms implementation method of obtaining multiple pictures in a picture set (loop output)
Each case requires many pictures, and they are displayed with certain effects. The effect achieved by the calling method of DreamWeaver is to call multiple parameters at one time, and the displayed effect is not what I need. The following is the method of searching from Baidu. You can refer to it
Recommended learning: 梦Weavercms
The effect that needs to be achieved when making a website for a customer is that each case needs a lot of pictures and is displayed with a certain effect. However, I found that the effect achieved by DreamWeaver's own calling method was to call multiple parameters at once, and the effect displayed was not what I needed. I was very confused at the time. Later, I thought about it myself, but unfortunately I didn't succeed. Finally, I found the implementation method through Baidu search.
The implementation method has two steps:
1. Add the method in /include/common.func.php //Loop to output multiple pictures function
Code As follows:
function Getimgs($aid, $imgwith = 300, $imgheight = 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 = 0;$i < $num;$i++){
if($style == 'li'){
$imglist .= "<li><ahref=#" . $i . "><img src="/static/imghwm/default1.png" data-src=". trim($wordcount[2][$i]) . " class="lazy" style="max-width:90%" height=" . $imgheight . " alt="How to get multiple pictures in dedecms picture collection" ></li></a>";
}else{
$imglist .= "<img src= " . trim($wordcount[2][$i]) . " style="max-width:90%"height=" . $imgheight . " alt="How to get multiple pictures in dedecms picture collection" >";
}
}
return $imglist;
}2. Call the method {dede:field.id function="Getimgs(@me,400,400,10)" /}
in the templateThe above is the detailed content of How to get multiple pictures in dedecms picture collection. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft





