function ShowTagLikeArc_by_id($titleLen,$rowCount,$typeid,$aid){
$dsql = new DedeSql(false);
if ($typeid!="0") $sql = TypeGetSunID($typeid,$dsql);
else $sql =" 1=1 ";
//找到所有的tag id
$query="Select tid from #@__tag_list where aid=$aid";
$dsql->SetQuery($query);
$dsql->Execute();
while($row=$dsql->GetObject()){
$kwsqlarr[] = " (tl.tid='".$row->tid."') ";
}
$where = implode(' OR ',$kwsqlarr);
if (trim($where)=="") $where=" 1<>1 ";
$sql="Select DISTINCT tp.namerule,tp.typedir,#@__archives.* From #@__tag_list tl left join #@__archives on tl.aid=#@__archives.ID left join #@__arctype tp on #@__archives.typeid=tp.ID where {$sql} and ( $where) and #@__archives.ID<>$aid order by #@__archives.litpic desc,#@__archives.click desc limit 0, $rowCount"; //排序按有缩略图、点击率高的排名靠前