帝国cms采用灵动标签时,一般用<?=$bqr[title]?>输出标题,如下:
[e:loop={"select title,titleurl from phome_ecms_news where classid = '$GLOBALS[navclassid]' order by newstime",1,24,0}]<li><a href="<?=$bqr[titleurl]?>"><?=$bqr[title]?></a></li>[/e:loop]一,帝国cms灵动标签截取标题字数的方法:将上面的<?=$bqr[title]?>换成<?=esub($bqr[title],30)?>,这里面的30代表字节数,也就是显示15个汉字二,帝国cms灵动标签显示标题属性的方法:1,在SQL语句中,将titlefont字段也要选取出来:select titlefont,title,titleurl from……2,将上面的<?=$bqr[title]?>换成<?=DoTitleFont($bqr[titlefont],$bqr[title])?>三,帝国cms灵动标签又要显示标题属性,又要截取标题字数的方法:将一、二方法综合一下,将<?=$bqr[title]?>换成<?=DoTitleFont($bqr[titlefont],esub($bqr[title],30))?>或者<?=DoTitleFont($bqr[titlefont],esub($bqr[title],30,'…'))?>