DEDECMS棣栭〉鍜屽垪琛ㄩ〉璋冪敤鍥剧墖闆嗗寮犲浘鐗囩殑鍔炴硶

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DEDECMS棣栭〉鍜屽垪琛ㄩ〉璋冪敤鍥剧墖闆嗗寮犲浘鐗囩殑鍔炴硶相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/bsp' title='bsp'>bsp   ring   source   鏄剧ず鍥剧墖   dtp   att   tab   mon   sele   

dede:arclist 鏍囩璋冪敤鍜宒ede:list 鍒楄〃璋冪敤  
 
1 1
2 [field:id function="Getimg(@me,80,80,7)" /]
 
鏂囩珷鍐呴〉璋冪敤
 
1 1
2 {dede:field.id function="Getimg(@me,80,80,7)" /}
 
80鍜?0鍜?鍒嗗埆鏄鏄剧ず鍥剧墖鐨勫搴?鐪佺暐涓?10)鍜岄珮搴?鐪佺暐涓?10)鍜岃皟鐢ㄥ紶鏁帮紙鐪佺暐涓烘墍鏈?(0))锛?/div>
 
include/common.func.php澧炲姞涓€鍑芥暟

01 01
02 function Getimg($aid,$imgwith=110,$imgheight=110,$num=0)
03 02
04 {
05 03
06 global $dsql;
07 04
08 $imgurls = 鈥樷€?/code>;
09 05
10 $row =$dsql->getone( "Select aid,imgurls From `dede_addonimages` where aid=鈥?aid鈥?");
11 06
12 $id=$row[鈥榓id鈥?/code>];
13 07
14 $imgurls= $row[鈥榠mgurls鈥?/code>];
15 08
16 $dtp = new DedeTagParse();
17 09
18 $dtp->LoadSource($imgurls);
19 10
20 if(is_array($dtp->CTags))
21 11
22 {
23 12
24     $i=0;
25 13
26     foreach($dtp->CTags as $ctag)
27 14
28          {
29 15
30             if($i<$num){
31 16
32                 if($ctag->GetName()=="img")
33 17
34                  {
35 18
36                      $bigimg = trim($ctag->GetInnerText());
37 19
38                      if($ctag->GetAtt(鈥榙dimg鈥?/code>) != $bigimg && $ctag->GetAtt(鈥榙dimg鈥?/code>)!=鈥樷€?/code>)
39 20
40                      {
41 21
42                             $litimg = $ctag->GetAtt(鈥榙dimg鈥?/code>);
43 22
44                      }
45 23
46                      $title=$ctag->GetAtt(鈥榯ext鈥?/code>);
47 24
48                      $imglist.=鈥?lt;li><a title="鈥?/code>.$title.鈥? href="/plus/view.php?aid=鈥?/code>.$id.鈥?><img src="鈥?/code>.$bigimg.鈥? width="鈥?/code>.$imgwith.鈥? height="鈥?/code>.$imgheight.鈥? alt="鈥?/code>.$title.鈥?></a></li>鈥?/code>;
49 25
50                      $i++;
51 26
52                  }
53 27
54             }
55 28
56         }
57 29
58     }
59 30
60 return $imglist;
61 31
62   
63 32
64 }

以上是关于DEDECMS棣栭〉鍜屽垪琛ㄩ〉璋冪敤鍥剧墖闆嗗寮犲浘鐗囩殑鍔炴硶的主要内容,如果未能解决你的问题,请参考以下文章

Python 妯″潡璋冪敤

IHttpClientFactory璋冪敤鎺ュ彛

PHP瀹炵幇杩滅▼杩囩▼璋冪敤RPC

濂楁帴瀛椾箣sendmsg绯荤粺璋冪敤

寰俊api璋冪敤闄愬埗锛?5009 reach max api daily quota limit 瑙e喅鏂规硶

灏忕▼搴忎簯鍑芥暟璋冪敤webservice鎺ュ彛