Home  >  Article  >  php教程  >  discuz3.2 自定义带diy单页面

discuz3.2 自定义带diy单页面

WBOY
WBOYOriginal
2016-06-06 19:38:311747browse

discuz3.2自定义带diy单页面 单页包括该单页的php文件和该单页的模板(.htm)文件,比如:index2.php、index2.htm 无 ?phprequire './source/class/class_core.php';//引入系统核心文件$discuz = discuz_core::instance();//以下代码为创建及初始化对象$discu

discuz3.2  自定义带diy单页面

单页包括该单页的php文件和该单页的模板(.htm)文件,比如:index2.php、index2.htm
<?php
require './source/class/class_core.php';//引入系统核心文件
$discuz = & discuz_core::instance();//以下代码为创建及初始化对象
$discuz->cachelist = $cachelist;
$discuz->init();
include template('diy:forum/index2');//调用单页模版文件
?>
{subtemplate common/header}
<div id="pt" class="wp">
        <a href="index.php" class="nvhm">$_G[setting][bbname]</a> ? 导航 面包屑
</div>
<style id="diy_style" type="text/css"></style>
<div id="ct" class="wp cl w">
        <div class="mn mw">
                <div class="content">
                     <!--[diy=diy1]--><div id="diy1" class="area"></div><!--[/diy]-->
                     <!--[diy=diy2]--><div id="diy2" class="area"></div><!--[/diy]-->
                     <!--[diy=diy3]--><div id="diy3" class="area"></div><!--[/diy]-->
                </div>
        </div>
</div>
{subtemplate common/footer}
{subtemplate common/header}
<div id="pt" class="wp"><a href="index.php" class="nvhm">$_G[setting][bbname]</a> ? 会员风采</div>
<div id="ct" class="wp cl n">
        <div class="mn">
            <div class="bm">
                        <h1 class="mt"><img class="vm" src="static/image/feed/profile.gif" alt="profile"> 分类浏览</h1>
                        <div class="datalist" style="margin:10px 0;">
                               这里是正文区域代码
                        </div>
                </div>
        </div>
        <!--边栏区域代码开始-->
        <div id="psd" class="sd">
        <div class="bn">
                <p><strong>栏目名称</p>
                <p><a href="#">边栏菜单名称</a></p>
                <p><a href="#">边栏菜单名称</a></p>
                <p><a href="#">边栏菜单名称</a></p>
        </div>
        <div class="bn">
                <p><strong>管理面板</strong></p>
                <p><a href="#">添加分类</a></p>
                <p><a href="#">管理分类</a></p>
                <p><a href="#">返回会员风采</a></p>
        </div>
        <div class="bn" style="border-bottom:none;">
                <p><strong>版权信息</strong></p>
                <p>作者:峰子</p>
                <p>版权:</p>
                <p>网站:</p>
        </div>
        </div>
        <!--边栏区域代码结束-->
</div>
{subtemplate common/footer}



//其中:边栏区域代码中,每个<div class="bn">区块为一个边栏菜单区域;
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn