root/1.php
<?php
//判断是否已经按装成功
//如果缓存标识存在,并且index.html文件不存在
//则生成index.html文件。
if(isset($_GET['upcache']) || !file_exists("1.html")){
require_once (dirname(__FILE__) . "/include/common.inc.php");
require_once DEDEINC."/arc.partview.class.php";
$GLOBALS['_arclistEnv'] = '1';
//我不需要获得这个数据库的首页表的值行
//********
//引入视图类
$pv = new PartView();
//echo $cfg_basedir; //D:/phpstudy_pro/WWW/www.dede.com
//echo $cfg_templets_dir; //D:/phpstudy_pro/WWW/www.dede.com/templets
$pv->SetTemplet("D:/phpstudy_pro/WWW/www.dede.com/templets/default/1.htm");
//保存结果为文件
$pv->SaveToHtml(dirname(__FILE__).'/1.html');
//引入这个文件名
include(dirname(__FILE__).'/1.html');
$pv->Display();
}else{
header('HTTP/1.1 301 Moved Permanently');
header('Location:1.html');
}
D:/phpstudy_pro/WWW/www.dede.com/templets/default/1.htm
<div class="header_top">
<div class="w960 center">
<span id="time" class="time">织梦CMS - 轻松建站从此开始!</span>
<div class="toplinks"><a href="global.cfg_cmsurl/}/plus/heightsearch.php" target="_blank" rel="noopener noreferrer">高级搜索</a>|<a href="global.cfg_cmsurl/}/data/sitemap.html" target="_blank" rel="noopener noreferrer">网站地图</a>|<a href="{dede:global.cfg_cmsurl/}/tags.php">TAG标签</a><a href="{dede:global.cfg_dataurl/}/rssmap.html" class="rss">RSS订阅</a><span>[<a href=""onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('{dede:global.cfg_basehost/}');">设为首页</a>] [<a href="javascript:window.external.AddFavorite('{dede:global.cfg_basehost/}','{dede:global.cfg_webname/}')">加入收藏</a>]</span></div>
</div>
</div>
<div class="header">
<div class="top w960 center">
<div class="title">
<h1><a href="{dede:global.cfg_basehost/}"><img src="{dede:global.cfg_templets_skin/}/images/logo.gif" height="54" width="216" alt="{dede:global.cfg_webname/}"/></a> </h1>
</div>
<div class="banner">{dede:mda name='468x60_SSP'/}</div>
</div><!-- //top -->
<!-- //菜单 -->
<div class="module blue mT10 wrapper w963">
<div class="top">
<!-- //如果不使用currentstyle,可以在channel标签加入 cacheid='channeltoplist' 属性提升性能 -->
<div id="navMenu">
<ul>
<li><a href='{dede:global.cfg_cmsurl/}/'><span>主页</span></a></li>
{dede:channel type='top' row='10' currentstyle="<li class='hover'><a href='~typelink~' ~rel~><span>~typename~</span></a></li>"}
<li><a href='[field:typeurl/]' [field:rel/]><span>[field:typename/]</span></a></li>
{/dede:channel}
</ul>
</div>
<div class="search">
<form name="formsearch" action="{dede:global.cfg_cmsurl/}/plus/search.php">
<div class="form">
<h4>搜索</h4>
<input type="hidden" name="kwtype" value="0" />
<input name="q" type="text" class="search-keyword" id="search-keyword" value="在这里搜索..." onfocus="if(this.value=='在这里搜索...'){this.value='';}" onblur="if(this.value==''){this.value='在这里搜索...';}" />
<select name="searchtype" class="search-option" id="search-option">
<option value="title" selected='1'>检索标题</option>
<option value="titlekeyword">智能模糊</option>
</select>
<button type="submit" class="search-submit">搜索</button>
</div>
</form>
<div class="tags">
<h4>热门标签:</h4>
<ul>
{dede:tag row='10' getall='1' sort='month'}
<li><a href='[field:link/]'>[field:tag /]</a></li>
{/dede:tag}
</ul>
</div>
</div><!-- //search -->
</div>
</div>
</div><!-- //header -->
<div class="banner2 w960 center">{dede:mda name='950x90_SSP'/}</div>
《dedecms 生成HTML 的案例写法》有1条评论