---------已知 [field:softlinks/]標(biāo)簽可調(diào)出如下數(shù)據(jù):
{dede:link text='網(wǎng)址名1'} http://網(wǎng)址1 {/dede:link}
{dede:link text='網(wǎng)址名2'} http://網(wǎng)址2 {/dede:link}
...
{dede:link text='網(wǎng)址名n'} http://網(wǎng)址n {/dede:link}
------------想要顯示的內(nèi)容:
<a href="http://網(wǎng)址1" title="網(wǎng)址名1"><img src="http://網(wǎng)址1.png" width="18" height="18" alt="網(wǎng)址名1"></a>
<a href="http://網(wǎng)址2" title="網(wǎng)址名2"><img src="http://網(wǎng)址2.png" width="18" height="18" alt="網(wǎng)址名2"></a>
...
<a href="http://網(wǎng)址n" title="網(wǎng)址名n"><img src="http://網(wǎng)址n.png" width="18" height="18" alt="網(wǎng)址名n"></a>
-----------參考代碼
代碼寫(xiě)法如下:
[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]