| 帝国CMS模板程序扩展变量说明:通过这些变量可实现各种更复杂的显示格式。 | 
| 一、列表/封面模板变量说明:(栏目页或专题页中使用) | 
| (一)、当前栏目ID或专题ID:$GLOBALS[navclassid] | 
| 通过这个变量可以输出这个栏目id的所有数据(如:select * from phome_enewsclass where classid='$GLOBALS[navclassid]') | 
| (二)、使用范例:调用当前栏目下的栏目简介。 | 
| 用SQL标签调用: [e:loop={"select intro from phome_enewsclass where classid='$GLOBALS[navclassid]'",1,24,0}] <?=$bqr[intro]?> [/e:loop]  | 
  
| 或用PHP调用: | 
| <?php $cr=$empire->fetch1("select intro from phome_enewsclass where classid='$GLOBALS[navclassid]'"); echo $cr[intro]; ?>  | 
  
| 二、内容模板变量说明:(信息内容页中使用) | 
| (一)、字段值数组:$navinfor | 
| 调用方法:$navinfor['字段名'],比如要显示"信息ID字段",那在模板里用:<?=$navinfor['id']?>即可输出(单引号加不加均可) | 
| (二)、使用范例1:调用与当前信息的标题相同的下载信息。 | 
| 灵动标签调用: [e:loop={'download',10,18,0,"title='$navinfor[title]'"}] <a href="<?=$bqsr[titleurl]?>"><?=$bqr[title]?></a> <br> [/e:loop]  | 
  
| (三)、使用范例2:显示当前商城信息的“市场价格(tprice)”与“购买价格(price)”的差额。 | 
<?php  | 
  
| (四)、使用范例3:当前信息的标题截取4个字符。 | 
| 标题前面四个字符为:<?=esub($navinfor['title'],4)?> | 
| (五)、使用范例4:当前信息的关键字加上链接。 | 
<?php  | 
  
| (六)、使用范例5:在自定义函数中引用当前信息的字段。 | 
| function user_EchoInfoField($ecms){ global $empire,$public_r,$class_r,$navinfor; $title=$navinfor['title']; echo"标题:".$title; }  |