$query = "select arc.*,ch.addtable,ch.fieldset from `dede_arctiny` as arc left join `dede_channeltype` as ch on arc.channel=ch.id where arc.id=$arcid";
$row = $dsql->GetOne($query);
if(empty($row)) return ;
$addtable = $row['addtable'];
$fieldset = $row['fieldset'];
include_once(DEDEINC.'./dedetag.class.php');
$dtp = new DedeTagParse();
$dtp->SetNameSpace('field','<','>');
$dtp->LoadSource($fieldset);
if(is_array($dtp->CTags))
{
foreach($dtp->CTags as $tid=>$tag)
{
if($tag->GetAtt('type')=='htmltext')
{
$body = $tag->GetName();
break;
}
}
}
if(!empty($body))
{
$query = "select $body from `$addtable` where aid=$arcid";