// 获取指定id
if(!function_exists('getarc'))
{
function getarc($aid,$field)
{
global $dsql;
if(empty($aid) || empty($field)){ return '';}
//获取指定字段值
$row = $dsql->GetOne("SELECT $field FROM `#【分隔符】@__addonarticle` WHERE aid = '$aid'");
$idlist= $row["$field"];
$resualt='';
if($idlist != '')
{
$query = "SELECT arc.*,tp.* FROM `#【分隔符】@__archives` arc left join `#【分隔符】@__addonarticle` tp on arc.id=tp.aid WHERE arc.id in($idlist) ORDER BY arc.id ";
$dsql->Execute('me',$query);
while($rs = $dsql->GetArray('me'))
{
$url = GetOneArchive($rs['id']) ;
$resualt .="<dl><dt><a href='".$url['arcurl']."'>".$rs['title']."</a></dt><dd>".cn_substr($rs['body'],230)."</dd></dl>";
}
}
return $resualt;
}
}
|