标签:bsp ring source 显示图片 dtp att tab mon sele
1
2
[field:
id
function
=
"Getimg(@me,80,80,7)"
/]
{dede:field.
/}
01
02
Getimg($aid,$imgwith=110,$imgheight=110,$num=0)
03
04
{
05
06
global $dsql;
07
08
$imgurls =
‘‘
;
09
10
$row =$dsql->getone(
"Select aid,imgurls From `dede_addonimages` where aid=‘$aid‘ "
);
11
12
$
=$row[
‘aid‘
];
13
14
$imgurls= $row[
‘imgurls‘
15
16
$dtp = new DedeTagParse();
17
18
$dtp->LoadSource($imgurls);
19
20
if
(is_array($dtp->CTags))
21
22
23
24
$i=0;
25
26
foreach($dtp->CTags as $ctag)
27
28
29
30
($i<$num){
31
32
($ctag->GetName()==
"img"
)
33
34
35
36
$bigimg = trim($ctag->GetInnerText());
37
38
($ctag->GetAtt(
‘ddimg‘
) != $bigimg && $ctag->GetAtt(
)!=
39
40
41
42
$litimg = $ctag->GetAtt(
43
44
}
45
46
$title=$ctag->GetAtt(
‘text‘
47
48
$imglist.=
‘<li><a title="‘
.$title.
‘" href="/plus/view.php?aid=‘
.$
.
‘"><img src="‘
.$bigimg.
‘" width="‘
.$imgwith.
‘" height="‘
.$imgheight.
‘" alt="‘
‘"></a></li>‘
49
50
$i++;
51
52
53
54
55
56
57
58
59
60
return
$imglist;
61
62
63
64
DEDECMS首页和列表页调用图片集多张图片的办法
原文地址:https://www.cnblogs.com/zqw111/p/13036596.html