{dede:arclist typeid=’1’ row=’1’ flag=’j’ addfields=’redirecturl’ channelid=’1’ orderby=’pubdate’}
<a href="[field:redirecturl/]" target="_blank">[field:title/]</a>
{/dede:arclist}
{dede:arclist typeid=’1’ row=’1’ flag=’j’ addfields=’redirecturl’ channelid=’1’ orderby=’pubdate’}
<a href="[field:array runphp=’yes’] if(@me[’redirecturl’]==’’) @me=@me[’arcurl’];
else @me=@me[’redirecturl’];[/field:array]" target="_blank"> [field:title/]</a>
{/dede:arclist}
if(preg_match(’/hot|click|lastpost/’, $orderby))
{
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,
tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
$addField
FROM `#@__archives` arc
LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id
$addJoin
WHERE {$this->addSql} $ordersql LIMIT $limitstart,$row";
}
$addField .= ’,’.$addtable.’.redirecturl’;
{dede:list row=’1’ addfields=’redirecturl’ orderby=’pubdate’}
<a href="[field:redirecturl/]" target="_blank">[field:title/]</a>
{/dede:list}
也能夠根據redirecturl是否爲空,實現直接跳轉仍是跳轉到站內, 示例代碼以下:
{dede:list row=’1’ addfields=’redirecturl’ orderby=’pubdate’}
<a href="[field:array runphp=’yes’] if(@me[’redirecturl’]==’’) @me=@me[’arcurl’];
else @me=@me[’redirecturl’];[/field:array]" target="_blank"> [field:title/]</a>
{/dede:list}