{dede:field.aid runphp='yes'}
$aid = @me;
$sql = "select * from dede_archives where id =".$aid." limit 1";
$query = mysql_query($sql);
$row = mysql_fetch_array($query);
$typeid = $row["typeid"];
$sql = "SELECT * FROM dede_archives where id<>".$aid." and typeid =".$typeid." order by id desc limit 15";
$query = mysql_query($sql);
@me = "";
while($row = mysql_fetch_array($query)){
$id = $row["id"];
$title = cn_substr($row["title"],80,0);
$urlarray = GetOneArchive($id);
$url = $urlarray['arcurl'];
$time = strftime("%Y-%m-%d",$row["sortrank"]);
@me.= '<li><a href="'.$url.'" title="'.$title.'" target="_blank">'.$title.'</a><span>'.$time.'</span></li>';
}
{/dede:field.aid}
说明:
红色代码表示排除当前文章,如果不需要排除删掉即可。
橙色代码是循环拼接的html,注意单双引号和点号。