http://hehuiahui.blog.163.com/blog/static/147350020112113103074/
ceshi.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>DEDE模板引擎</title>
</head>
<body>
我的测试<br/>
<?php echo $cfg_basehost;?>
{dede:php} echo $bc;{/dede:php}
{dede:global.cfg_webname/}-{dede:demotag/}
{dede:tagname runphp='yes'}
$aaa = @me;
@me = "123456";
{/dede:tagname}
<!--最新文档-->
{dede:arclist row=14 titlelen=32 noflag='h'}
<li><a href="[field:arcurl/]">[field:title/]</a></li>
{/dede:arclist}
<!--//最新文档-->
---------------------------------------------------
{dede:ceshi}
<dd>
<span><a href="[field:arcurl/]">[field:title/]</a></span>
</dd>
{/dede:ceshi}
=====================//{dede:sql sql=""}底层模板{/dede:sql}
<dd>
{dede:sql sql="SELECT * FROM `dede_archives` LIMIT 0 , 5"}
<span><a href="">[field:id/]---[field:title/]</a></span>
[field:array runphp='yes']@me = (@me['id']==3 ? "好的" : "可以吗"); [/field:array]
{/dede:sql}
</dd>
</body>
</html>
ceshi.php
<?php
/*require_once (dirname(__FILE__) . "/include/common.inc.php"); '//这个两行就是连接数据成功了 $dsql.方法(执行SQL语句完毕);
print_r($dsql);*/
require_once (dirname(__FILE__) . "/include/common.inc.php");
require_once DEDEINC."/arc.partview.class.php";
require_once('include/dedetemplate.class.php');
$GLOBALS['_arclistEnv'] = 'ceshi';
//echo ("Select * From `#@__homepageset`"); == dede_homepageset
//exit(); //$row['templet'] //default/index.htm
//echo DEDEINC; //F:/software/DedeCmsV5.7.325-GBK-Final/uploads/include
$row = $dsql->GetOne("Select * From `#@__homepageset`");
$row['templet'] = MfTemplet($row['templet']); echo $row['templet']."===============>>"; //default/index.htm
$row['templet']="default/ceshi.htm";
$pv = new PartView();
$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);
$row['showmod'] = isset($row['showmod'])? $row['showmod'] : 0;
$row['showmod']=0;
$cfg_basehost = 'http://www.dedecmsv5.com';
$bc="我要显示变量";
{dede:aaa}
//echo $row['templet'];
//echo $bj;
//--------------------------------------------------Execute('me',$dsql); //查询 $dsql->Execute('me',$sql);
/* $new=array();
$dsql->Execute('f',"Select * From `dede_archives`");
while($frow = $dsql->GetArray('f'))
{
//echo $frow['title']."pppppppppppppp";
array_push($new,$frow); //把查询结过放到数组里面
}*/
//$row2 = $dsql->GetOne("Select * From `dede_archives`");
/*$new=array();
while($arr = $row2)
{
array_push($new,$arr); //把查询结过放到数组里面
}*/
$pv->Display();
exit();
?>