织梦如何在内容页调用其他文章,不包含自己本身呢?
代码如下
{dede:FIELD.aid runphp='yes'}
$aid = @me;
$sql = "s elect * from dede_archives where id =".$aid." limit 1";
$query = mysql_query($sql);
$row = mysql_fetch_array($query);
$typeid = $row["typeid"];
$sql = "S ELECT * from dede_archives a LEFT JOIN dede_addonshop b on b.aid=a.id where a.id<>".$aid." and a.typeid =".$typeid." order by id desc limit 5";
$query = mysql_query($sql);
@me = "";
while($row = mysql_fetch_array($query)){
$id = $row["id"];
$picname = $row["litpic"];
$zb = $row["zb"];
$brand = $row["brand"];
$price = $row["price"];
$title = cn_substr($row["title"],80,0);
$urlarray = GetOneArchive($id);
$url = $urlarray['arcurl'];
@me.= '<li><a href="'.$url.'" title="'.$title.'" target="_blank"><img src="'.$picname.'"><strong>'.$title.'<img src="/skin/picture/cont1_3.png"></strong><p class="top">'.$brand.'</p><p class="bot">投资:<span>'.$price.'</span> 总部:<span>'.$zb.'</span></p></a></li>';
}
{/dede:FIELD.aid}