---------已知 [field:softlinks/]標簽可調出如下數據:
{dede:link text='網址名1'} http://網址1 {/dede:link}
{dede:link text='網址名2'} http://網址2 {/dede:link}
...
{dede:link text='網址名n'} http://網址n {/dede:link}
------------想要顯示的內容:
<a href="http://網址1" title="網址名1"><img src="http://網址1.png" width="18" height="18" alt="網址名1"></a>
<a href="http://網址2" title="網址名2"><img src="http://網址2.png" width="18" height="18" alt="網址名2"></a>
...
<a href="http://網址n" title="網址名n"><img src="http://網址n.png" width="18" height="18" alt="網址名n"></a>
-----------參考代碼
代碼寫法如下:
[field:softlinks runphp='yes']
preg_match_all('/=\&;(.+?)\&;} (.+?) {/sim', @me, $strResult, PREG_PATTERN_ORDER);
$aaa=array();
for($p=0;$p<count($strResult[0]);$p++){
$aaa[]='<a class=tooltip href='.$strResult[2][$p].' title='.$strResult[1][$p].'><img src='.$strResult[2][$p].'.png width=18 height=18 alt='.$strResult[1][$p].'></a>';
}
$aaa=implode('',$aaa);
@me=$aaa;
[/field:softlinks]