PHP if(!defined('DEDEINC'))exit('Request Error!');
functionlib_arctag(&$ctag,&$refObj)
{
$ar="row|10";
FillAttsDefault($ctag->CAttribute->Items);
extract($ctag->CAttribute->Items);
$innertext=$ctag->GetInnerText();
$tcp=newDedeTagParse();
$tcp->SetNameSpace("field","[","]");
$tcp->LoadSource($innertext);
$aid=$refObj->Fields['id'];
$revalue='';
if($aid){
$ids=array();
$tag=array();
$d
sql->Execute("f","select tag from dede_taglist where aid = '$aid'");
while($re=$d
sql->GetArray("f")){
$tag[] =$re['tag'];
}
if($tag){
foreach($tagas$tk){
$d
sql->Execute("f1","select aid from dede_taglist where tag = '$tk'");
while($re1=$d
sql->GetArray("f1")){
$ids[] =$re1['aid'];
}
}
}
if($ids){
$ids =array_unique($ids);
$sqa="(".join(",",$ids).")";
$query= "SELECT se.*,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
FROM `dede_archives` se LEFT JOIN `dede_arctype` tp ON se.typeid=tp.id WHERE se.id in$sqalimit$row";
$d
sql->Execute("f2",$query);
while($row1=$d
sql->GetArray("f2")){
$row1['arcurl'] = GetFileUrl($row1['id'],$row1['typeid'],$row1['senddate'],$row1['title'],
$row1['ismake'],
$row1['arcrank'],$row1['namerule'],$row1['typedir'],$row1['money'],
$row1['filename'],$row1['moresite'],$row1['siteurl'],$row1['sitepath']);
$row1['title'] = cn_substr($row1['title'],10);
foreach($tcp->CTagsas$tid=>$tt){
$tcp->Assign($tid,$row1[$tt->GetName()]);
}
$revalue.=$tcp->GetResult();
}
}
}
return$revalue;
}