Xianger2120 發表於 2021-12-15 13:08:50

单页制作教程 For Discuz!X2(DIY/左右边栏/标签选项卡)

作者:体无完肤<br />首先,单页包括该单页的php文件和该单页的模板(.htm)文件,比如:host.php、host.htm<br /><br /><strong>普通单页的php文件内容如下:</strong><br /><ol><li>&lt;?php<br /><li>define('CURSCRIPT', 'test');<br /><li>require './source/class/class_core.php';//引入系统核心文件<br /><li>$discuz = &amp; discuz_core::instance();//以下代码为创建及初始化对象<br /><li>$discuz-&gt;init();<br /><li>$navtitle = '官方QQ群列表';<br /><li>$metakeywords = 'QQ群,官方,discuz,DRC,7drc,QQ';<br /><li>$metadescription = '该页面展示Discuz! Rescue Centre 官方QQ群系,加入本站官方QQ群可及时了解掌握最新动态、插件、模版第一手信息。请勿加入多个QQ群,珍惜有限的群资源。';<br /><li>include template('forum/host');//调用单页模版文件<br /><li>?&gt;</ol>这里需要注意的是,host为模板文件名,不需要加.htm扩展名,模板文件存放于默认风格目录下的forum目录;<br />单页的php文件存放于论坛根目录;<br /><br />$navtitle = '官方QQ群列表'; 这一句是定义单页的标题,显示于浏览器顶部的网页标题<br />$metakeywords = 'QQ群,官方,discuz,DRC,7drc,QQ'; 是单页的关键词信息<br />$metadescription 是单页的描述信息。<br /><br />可DIY的单页PHP文件代码内容如下:<ol><li>&lt;?php<br /><li>define('CURSCRIPT', 'test');<br /><li>require './source/class/class_core.php';//引入系统核心文件<br /><li>$discuz = &amp; discuz_core::instance();//以下代码为创建及初始化对象<br /><li>$discuz-&gt;init();<br /><li>loadcache('diytemplatename');<br /><li>$navtitle = '官方QQ群列表';<br /><li>$metakeywords = 'QQ群,官方,discuz,DRC,7drc,QQ';<br /><li>$metadescription = '该页面展示Discuz! Rescue Centre 官方QQ群系,加入本站官方QQ群可及时了解掌握最新动态、插件、模版第一手信息。请勿加入多个QQ群,珍惜有限的群资源。';<br /><li>include template('diy:forum/host');//调用单页模版文件<br /><li>?&gt;</ol><font color="Red">注:其中 loadcache('diytemplatename'); 为Discuz!X2对DIY这一块做的更新,DIY要载入缓存,所以以前X1.5的单页制作教程做出来的单页DIY会无法保存。DIY的单页模版文件,修改单页模版内容后需要更新缓存才能刷新出来。<br /></font><br /><br />php文件创建完毕,现在开始创建模版文件,基本代码如下:<br /><br /><strong><br />普通单页的模版文件代码:</strong><ol><li>&lt;!--{template common/header}--&gt;<br /><li>&lt;style id=&quot;diy_style&quot; type=&quot;text/css&quot;&gt;&lt;/style&gt;<br /><li>&lt;div id=&quot;pt&quot; class=&quot;bm cl&quot;&gt;<br /><li>&nbsp; &nbsp; &lt;div class=&quot;z&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;a href=&quot;./&quot; class=&quot;nvhm&quot; title=&quot;{lang homepage}&quot;&gt;$_G&lt;/a&gt;&lt;em&gt;&amp;raquo;&lt;/em&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;a href=&quot;forum.php&quot;&gt;$_G&lt;/a&gt;&lt;em&gt;&amp;raquo;&lt;/em&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;a href=&quot;javascript:;&quot;&gt;$navtitle&lt;/a&gt;<br /><li>&nbsp; &nbsp; &lt;/div&gt;<br /><li>&lt;/div&gt;<br /><li>&lt;div id=&quot;ct&quot; class=&quot;wp cl&quot;&gt;<br /><li>&nbsp; &nbsp; &lt;div class=&quot;mn bm cl&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm_c&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;p style=&quot;width:300px; margin:200px auto; text-align:center;&quot;&gt;这里是单页正文内容区域&lt;/p&gt;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp; &lt;/div&gt;<br /><li>&lt;/div&gt;<br /><li>&lt;!--{template common/footer}--&gt;</ol><strong>效果如下:</strong><br /><br /><img title="1.jpg" id="aimg_13060" aid="13060" src1="static/image/common/none.gif" zoom="https://www.dismall.com/data/attachment/forum/202112/15/130916pt39ln1r3zldr1yp.jpg" src="https://www.dismall.com/data/attachment/forum/202112/15/130916pt39ln1r3zldr1yp.jpg" class="zoom" onclick="zoom(this, this.src, 0, 0, 0)" width="600" inpost="1" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" /><br /><br />-------------------------------------------------------------------------------------<br /><br /><strong>可DIY的单页模版文件代码如下:</strong><ol><li>&lt;!--{template common/header}--&gt;<br /><li>&lt;style id=&quot;diy_style&quot; type=&quot;text/css&quot;&gt;&lt;/style&gt;<br /><li>&lt;div id=&quot;pt&quot; class=&quot;bm cl&quot;&gt;<br /><li>&nbsp; &nbsp; &lt;div class=&quot;z&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;a href=&quot;./&quot; class=&quot;nvhm&quot; title=&quot;{lang homepage}&quot;&gt;$_G&lt;/a&gt;&lt;em&gt;&amp;raquo;&lt;/em&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;a href=&quot;forum.php&quot;&gt;$_G&lt;/a&gt;&lt;em&gt;&amp;raquo;&lt;/em&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;a href=&quot;javascript:;&quot;&gt;$navtitle&lt;/a&gt;<br /><li>&nbsp; &nbsp; &lt;/div&gt;<br /><li>&lt;/div&gt;<br /><li><br /><li>&lt;div class=&quot;wp&quot;&gt;<br /><li>&lt;!----&gt;&lt;div id=&quot;diy2&quot; class=&quot;area&quot;&gt;&lt;/div&gt;&lt;!----&gt;<br /><li>&lt;/div&gt;<br /><li><br /><li><br /><li>&lt;div id=&quot;ct&quot; class=&quot;wp cl&quot;&gt;<br /><li>&nbsp; &nbsp; &lt;div class=&quot;mn bm cl&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm_c&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;p style=&quot;width:300px; margin:200px auto; text-align:center;&quot;&gt;这里是单页正文内容区域&lt;/p&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp; &lt;/div&gt;<br /><li>&lt;/div&gt;<br /><li><br /><li>&lt;!--{template common/footer}--&gt;</ol>其中:<ol><li>&lt;div class=&quot;wp&quot;&gt;<br /><li>&lt;!----&gt;&lt;div id=&quot;diy2&quot; class=&quot;area&quot;&gt;&lt;/div&gt;&lt;!----&gt;<br /><li>&lt;/div&gt;</ol>这段代码就是DIY区域的代码,之前X1.5的单页教程里面我们也讲到过,可以在单页的任意位置插入DIY区域,即:<ol><li>&lt;!----&gt;&lt;div id=&quot;diy2&quot; class=&quot;area&quot;&gt;&lt;/div&gt;&lt;!----&gt;</ol><font color="Red">注意:如果一个页面要插入多个DIY区域,注意修改上面DIY区域的编号ID,几个DIY区域的ID编号不能相同。</font><br />-------------------------------------------------------------------------------------<br /><br /><strong>带有右侧边栏的单页模版文件代码:</strong><ol><li>&lt;!--{subtemplate common/header}--&gt;<br /><li>&lt;style id=&quot;diy_style&quot; type=&quot;text/css&quot;&gt;&lt;/style&gt;<br /><li><br /><li>&lt;div id=&quot;pt&quot; class=&quot;bm cl&quot;&gt;<br /><li>&nbsp; &nbsp; &lt;div class=&quot;z&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;a href=&quot;./&quot; class=&quot;nvhm&quot; title=&quot;{lang homepage}&quot;&gt;$_G&lt;/a&gt;&lt;em&gt;&amp;raquo;&lt;/em&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;a href=&quot;forum.php&quot;&gt;$_G&lt;/a&gt;&lt;em&gt;&amp;raquo;&lt;/em&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;a href=&quot;javascript:;&quot;&gt;$navtitle&lt;/a&gt;<br /><li>&nbsp; &nbsp; &lt;/div&gt;<br /><li>&lt;/div&gt;<br /><li><br /><li>&lt;div id=&quot;ct&quot; class=&quot;wp cl ct2&quot;&gt;<br /><li>&nbsp; &nbsp; &lt;div class=&quot;mn bm cl&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm_h&quot;&gt;标题栏&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm_c&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;p style=&quot;width:300px; margin:220px auto; text-align:center;&quot;&gt;这里是单页正文内容区域&lt;/p&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp; &lt;/div&gt;<br /><li>&nbsp; &nbsp; <br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;sd&quot;&gt;<br /><li>&nbsp; &nbsp; <br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_h&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;h2&gt;公告栏&lt;/h2&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_c&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;p class=&quot;xl xl2 cl&quot; style=&quot;line-height:25px;&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;这里可以放一些公告通知类的文字内容这里可以放一些公告通知类的文字内容这里可以放一些公告通知类的文字内容这里可以放一些公告通知类的文字内容这里可以放一些公告通知类的文字内容这里可以放一些公告通知类的文字内容<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;/p&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_h&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;h2&gt;操作菜单&lt;/h2&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_c&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;ul class=&quot;xl xl2 cl&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单一&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单二&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单三&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单四&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单五&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单六&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;/ul&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;/div&gt;<br /><li><br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_h&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;h2&gt;版权信息&lt;/h2&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_c&quot; style=&quot;line-height:25px;&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;ul&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;作者:&lt;a href=&quot;http://www.mutoulee.cn&quot; target=&quot;_blank&quot;&gt;体无完肤&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;网站:&lt;a href=&quot;http://bbs.7drc.com&quot; target=&quot;_blank&quot;&gt;bbs.7drc.com&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;版权:Discuz! Rescue Centre&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;/ul&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br /><li>&nbsp; &nbsp; &lt;/div&gt;<br /><li>&nbsp; &nbsp; <br /><li>&lt;/div&gt;<br /><li><br /><li>&lt;!--{subtemplate common/footer}--&gt;</ol><strong>效果如下:</strong><br /><img title="2.jpg" id="aimg_13061" aid="13061" src1="static/image/common/none.gif" zoom="https://www.dismall.com/data/attachment/forum/202112/15/130916bjod0458hcu40pz8.jpg" src="https://www.dismall.com/data/attachment/forum/202112/15/130916bjod0458hcu40pz8.jpg" class="zoom" onclick="zoom(this, this.src, 0, 0, 0)" width="600" inpost="1" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" /><br /><br /><br /><br />-------------------------------------------------------------------------------------<br /><br /><strong>带有左侧边栏的单页模版文件代码:</strong><ol><li>&lt;!--{subtemplate common/header}--&gt;<br /><li>&lt;style id=&quot;diy_style&quot; type=&quot;text/css&quot;&gt;&lt;/style&gt;<br /><li><br /><li>&lt;div id=&quot;pt&quot; class=&quot;bm cl&quot;&gt;<br /><li>&nbsp; &nbsp; &lt;div class=&quot;z&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;a href=&quot;./&quot; class=&quot;nvhm&quot; title=&quot;{lang homepage}&quot;&gt;$_G&lt;/a&gt;&lt;em&gt;&amp;raquo;&lt;/em&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;a href=&quot;forum.php&quot;&gt;$_G&lt;/a&gt;&lt;em&gt;&amp;raquo;&lt;/em&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;a href=&quot;javascript:;&quot;&gt;$navtitle&lt;/a&gt;<br /><li>&nbsp; &nbsp; &lt;/div&gt;<br /><li>&lt;/div&gt;<br /><li><br /><li>&lt;div id=&quot;ct&quot; class=&quot;wp cl ct2&quot;&gt;<br /><li>&nbsp; &nbsp; &lt;div class=&quot;mn bm cl&quot; style=&quot;float:right;&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm_h&quot;&gt;标题栏&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm_c&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;p style=&quot;width:300px; margin:220px auto; text-align:center;&quot;&gt;这里是单页正文内容区域&lt;/p&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp; &lt;/div&gt;<br /><li>&nbsp; &nbsp; <br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;sd&quot; style=&quot;float:left;&quot;&gt;<br /><li>&nbsp; &nbsp; <br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_h&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;h2&gt;公告栏&lt;/h2&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_c&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;p class=&quot;xl xl2 cl&quot; style=&quot;line-height:25px;&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;这里可以放一些公告通知类的文字内容这里可以放一些公告通知类的文字内容这里可以放一些公告通知类的文字内容这里可以放一些公告通知类的文字内容这里可以放一些公告通知类的文字内容这里可以放一些公告通知类的文字内容<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;/p&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_h&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;h2&gt;操作菜单&lt;/h2&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_c&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;ul class=&quot;xl xl2 cl&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单一&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单二&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单三&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单四&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单五&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单六&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;/ul&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;/div&gt;<br /><li><br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_h&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;h2&gt;版权信息&lt;/h2&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_c&quot; style=&quot;line-height:25px;&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;ul&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;作者:&lt;a href=&quot;http://www.mutoulee.cn&quot; target=&quot;_blank&quot;&gt;体无完肤&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;网站:&lt;a href=&quot;http://bbs.7drc.com&quot; target=&quot;_blank&quot;&gt;bbs.7drc.com&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;版权:Discuz! Rescue Centre&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;/ul&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br /><li>&nbsp; &nbsp; &lt;/div&gt;<br /><li>&nbsp; &nbsp; <br /><li>&lt;/div&gt;<br /><li><br /><li>&lt;!--{subtemplate common/footer}--&gt;</ol>注意观察这个左侧边栏的模版代码和右侧边栏的模版代码,可以发现,代码其实都一样,只是更改一下CSS样式。<br /><br />&lt;div class=&quot;mn bm cl&quot;&gt; 给这个div加一个向右浮动,即:<ol><li>&lt;div class=&quot;mn bm cl&quot; style=&quot;float:right;&quot;&gt;</ol>再给 &lt;div class=&quot;sd&quot;&gt; 这个div加一个向左浮动的CSS样式,即:<ol><li>&lt;div class=&quot;sd&quot; style=&quot;float:left;&quot;&gt;</ol>就是说只是左右对调一下。<br /><br /><strong>演示效果如下:</strong><br /><br /><img title="3.jpg" id="aimg_13064" aid="13064" src1="static/image/common/none.gif" zoom="https://www.dismall.com/data/attachment/forum/202112/15/131439fh695d0aved5kh05.jpg" src="https://www.dismall.com/data/attachment/forum/202112/15/131439fh695d0aved5kh05.jpg" class="zoom" onclick="zoom(this, this.src, 0, 0, 0)" width="600" inpost="1" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" /><br /><br />-------------------------------------------------------------------------------------<br /><br /><br />带有标签选项卡的单页模版:<ol><li>&lt;!--{subtemplate common/header}--&gt;<br /><li>&lt;style id=&quot;diy_style&quot; type=&quot;text/css&quot;&gt;&lt;/style&gt;<br /><li><br /><li>&lt;div id=&quot;pt&quot; class=&quot;bm cl&quot;&gt;<br /><li>&nbsp; &nbsp; &lt;div class=&quot;z&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;a href=&quot;./&quot; class=&quot;nvhm&quot; title=&quot;{lang homepage}&quot;&gt;$_G&lt;/a&gt;&lt;em&gt;&amp;raquo;&lt;/em&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;a href=&quot;forum.php&quot;&gt;$_G&lt;/a&gt;&lt;em&gt;&amp;raquo;&lt;/em&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;a href=&quot;javascript:;&quot;&gt;$navtitle&lt;/a&gt;<br /><li>&nbsp; &nbsp; &lt;/div&gt;<br /><li>&lt;/div&gt;<br /><li><br /><li>&lt;div id=&quot;ct&quot; class=&quot;wp cl ct2&quot;&gt;<br /><li>&nbsp; &nbsp; &lt;div class=&quot;mn bm cl&quot; style=&quot;float:right;&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm_h&quot;&gt;标题栏&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm_c&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;ul class=&quot;tb cl&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li &lt;!--{if empty($_G) || $_G == 'new'}--&gt;class=&quot;a&quot;&lt;!--{/if}--&gt;&gt;&lt;a href=&quot;test.php?viewtype=new&quot;&gt;最新发布&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li &lt;!--{if $_G == 'view'}--&gt;class=&quot;a&quot;&lt;!--{/if}--&gt;&gt;&lt;a href=&quot;test.php?viewtype=view&quot;&gt;浏览排行&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li &lt;!--{if $_G == 'comment'}--&gt;class=&quot;a&quot;&lt;!--{/if}--&gt;&gt;&lt;a href=&quot;test.php?viewtype=comment&quot;&gt;回复排行&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;li &lt;!--{if $_G == 'rate'}--&gt;class=&quot;a&quot;&lt;!--{/if}--&gt;&gt;&lt;a href=&quot;test.php?viewtype=rate&quot;&gt;评分排行&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/ul&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;p style=&quot;width:300px; margin:200px auto; text-align:center;&quot;&gt;这里是单页正文内容区域&lt;/p&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp; &lt;/div&gt;<br /><li>&nbsp; &nbsp; <br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;sd&quot; style=&quot;float:left;&quot;&gt;<br /><li>&nbsp; &nbsp; <br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_h&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;h2&gt;公告栏&lt;/h2&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_c&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;p class=&quot;xl xl2 cl&quot; style=&quot;line-height:25px;&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;这里可以放一些公告通知类的文字内容这里可以放一些公告通知类的文字内容这里可以放一些公告通知类的文字内容这里可以放一些公告通知类的文字内容这里可以放一些公告通知类的文字内容这里可以放一些公告通知类的文字内容<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;/p&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_h&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;h2&gt;操作菜单&lt;/h2&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_c&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;ul class=&quot;xl xl2 cl&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单一&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单二&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单三&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单四&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单五&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;#&quot;&gt;测试菜单六&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;/ul&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;/div&gt;<br /><li><br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;div class=&quot;bm&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_h&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;h2&gt;版权信息&lt;/h2&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;div class=&quot;bm_c&quot; style=&quot;line-height:25px;&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;ul&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;作者:&lt;a href=&quot;http://www.mutoulee.cn&quot; target=&quot;_blank&quot;&gt;体无完肤&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;网站:&lt;a href=&quot;http://bbs.7drc.com&quot; target=&quot;_blank&quot;&gt;bbs.7drc.com&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li&gt;版权:Discuz! Rescue Centre&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;/ul&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;/div&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br /><li>&nbsp; &nbsp; &lt;/div&gt;<br /><li>&nbsp; &nbsp; <br /><li>&lt;/div&gt;<br /><li><br /><li>&lt;!--{subtemplate common/footer}--&gt;</ol>注意观察你会发现,选项卡这一部分跟X1.5一样的,就是在模版的正文区域的div内增加一段代码:<ol><li>&lt;ul class=&quot;tb cl&quot;&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li &lt;!--{if empty($_G) || $_G == 'new'}--&gt;class=&quot;a&quot;&lt;!--{/if}--&gt;&gt;&lt;a href=&quot;test.php?viewtype=new&quot;&gt;最新发布&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li &lt;!--{if $_G == 'view'}--&gt;class=&quot;a&quot;&lt;!--{/if}--&gt;&gt;&lt;a href=&quot;test.php?viewtype=view&quot;&gt;浏览排行&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&lt;li &lt;!--{if $_G == 'comment'}--&gt;class=&quot;a&quot;&lt;!--{/if}--&gt;&gt;&lt;a href=&quot;test.php?viewtype=comment&quot;&gt;回复排行&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &lt;li &lt;!--{if $_G == 'rate'}--&gt;class=&quot;a&quot;&lt;!--{/if}--&gt;&gt;&lt;a href=&quot;test.php?viewtype=rate&quot;&gt;评分排行&lt;/a&gt;&lt;/li&gt;<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&lt;/ul&gt;</ol><strong>效果如下:</strong><br /><br /><img title="4.jpg" id="aimg_13065" aid="13065" src1="static/image/common/none.gif" zoom="https://www.dismall.com/data/attachment/forum/202112/15/131847yag0ahxt40tppaos.jpg" src="https://www.dismall.com/data/attachment/forum/202112/15/131847yag0ahxt40tppaos.jpg" class="zoom" onclick="zoom(this, this.src, 0, 0, 0)" width="600" inpost="1" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" /><br /><br />此次教程整理结束。<br /><br />单页<em>, </em>文件<em>, </em>php<em>, </em>如下<em>, </em>hide

CG小霸王 發表於 2021-12-15 13:31:13

学习学习

Xianger2120 發表於 2021-12-15 21:12:35

学习学习

玩慈利网 發表於 2021-12-18 10:00:51

<br />include template('forum/host');//调用单页模版文件<br />如果调用的模板里面有加载其他数据,直接调用单页模板不显示页面的数据,这个应该怎么加呢

無名 發表於 2021-12-18 13:12:04

<br />不知道你说什么

ysx24 發表於 2021-12-20 11:59:02

厉害厉害,dz我还是只摸到皮毛,向大佬学习

xiongmao 發表於 2021-12-20 20:26:04

感谢分享!

bkevin0829 發表於 2021-12-21 20:00:02

模板不错

沅澧 發表於 2021-12-26 16:25:47

666666666666666666666

精神科李主任 發表於 2021-12-26 22:03:03

这个很牛啊。学习一下
頁: [1]
查看完整版本: 单页制作教程 For Discuz!X2(DIY/左右边栏/标签选项卡)