GetAtt('aid'); $type = $ctag->GetAtt('type'); $revalue = ""; if (in_array($type, array("pre", "next")) && get_class($refObj) === "Archives") { //在文档页面获取上一篇下一篇文档 $asql = "WHERE id<{$refObj->Fields['id']}"; if ($type === "next") { $asql = "WHERE id>{$refObj->Fields['id']}"; } $row = $dsql->GetOne("SELECT id,channel FROM `#@__arctiny` $asql AND arcrank>-1 AND typeid='{$refObj->Fields['typeid']}' ORDER BY id DESC"); $channel = new ChannelUnit($row['channel'], $refObj->Fields['id']); $fields = $dsql->GetOne("SELECT * FROM `{$channel->ChannelInfos['addtable']}` WHERE aid = {$row['id']}"); } if (!empty($aid)) { //指定ID获取文档 $row = $dsql->GetOne("SELECT id,channel FROM `#@__arctiny` WHERE id={$aid} AND arcrank>-1"); $channel = new ChannelUnit($row['channel'], $aid); $fields = $dsql->GetOne("SELECT * FROM `{$channel->ChannelInfos['addtable']}` WHERE aid = {$row['id']}"); } $innerText = trim($ctag->GetInnerText()); $ctp = new DedeTagParse(); $ctp->SetNameSpace('field', '[', ']'); $ctp->LoadSource($innerText); if (is_array($ctp->CTags)) { foreach ($ctp->CTags as $tagid => $ctag) { if (isset($fields[$ctag->GetName()])) { $ctp->Assign($tagid, $fields[$ctag->GetName()]); } } $revalue .= $ctp->GetResult(); } return $revalue; } ?>