$rbtext = preg_replace("/\[field:logo([\/\s]{0,})\]/isU", $row['logo'], $rbtext); |
$rbtext = preg_replace("/\[field:link([\/\s]{0,})\]/isU", $link, $rbtext); |
}<BR> //返回替换处理好的字符串<BR> return $revalue; |
如果有读者对方法的参数&$ctag,&$refObj不是很清楚,请从index.php中的处理开始查看,具体的应该是在include目录下的Dedetag.class.php中。
下面,我们仿照上面的例子自己去写一个标签
if (! defined ( 'DEDEINC' )) { |
exit ( "Request Error!" ); |
function lib_aaa(&$ctag, &$refObj) |
$attlist = "topid|0,row|10"; |
FillAttsDefault ( $ctag->CAttribute->Items, $attlist ); |
extract ( $ctag->CAttribute->Items, EXTR_SKIP ); |
$condtion.=" where topid=0"; |
$condtion.=" where topid <> 0"; |
$equery="select * from `dede_arctype` $condtion"; |
if(trim($ctag->GetInnerText())=='') $innertext = "<li>[field:typename /]</li>"; |