else $innertext = $ctag->GetInnerText(); |
//设置查询条件并执行查询 |
$dsql->SetQuery($equery); |
$dsql->Execute();<BR> //通过循环获取查询的对象<BR> while($dbrow=$dsql->GetObject()) |
{<BR> if($type=='text'||$type=='textall') |
{ |
$link = "<a href='".$dbrow->url."' target='_blank'>".cn_substr($dbrow->webname,$titlelen)."</a> "; |
} |
else if($type=='image') |
{ |
$link = "<a href='".$dbrow->url."' target='_blank'><img src='".$dbrow->logo."' width='88' height='31' border='0'></a> "; |
} |
else |
{ |
if($dbrow->logo=='') |
{ |
$link = "<a href='".$dbrow->url."' target='_blank'>".cn_substr($dbrow->webname,$titlelen)."</a> "; |
} |
else |
{ |
$link = "<a href='".$dbrow->url."' target='_blank'><img src='".$dbrow->logo."' width='88' height='31' border='0'></a> "; |
} |
}<BR> //对innertext中的字符串进行值替换(暂时不清楚为什么标签里面的row只是一个数值,但是却在这里能成为一个数组,求解答)<BR> $rbtext = preg_replace("/\[field:url([\/\s]{0,})\]/isU", $row['url'], $innertext); |
$rbtext = preg_replace("/\[field:webname([\/\s]{0,})\]/isU", $row['webname'], $rbtext); |
标签:
dedecms自定义标签