Discuz!NT官方社区

首页 » Discuz!NT开发与测试 » Discuz!NT插件开发 » 左侧导航菜单插件,兼容IE6,IE7,firefox(没人喜欢??)
zhuyuelee - 2008-6-24 17:53:00
先反映个bug:我gif图片上传不说,说格式不下载。在我的论坛里也有这个bug;
就请到我的网站上去效果吧:bbs.durcai.com

预览:
调试过浏览器版本:IE6,IE7,firefox
使用说明:

安装
一、解压到网站根目录下 templates\您想使用的模板名 下


调用代码就有:

            <link rel="stylesheet" href="templates/{templatepath}/newMenu/menuStyle.css" type="text/css" />
                //样式文件
            <div id="forumMain">
                <%template _newmenu%>//模板页
                <div id="mainRighDIV">
                    </div>
                </div>
        <script type="text/javascript" src="templates/{templatepath}/newMenu/docDidWidth.js"></script>//js。为适用firefox,我使用JS强制mainRighDIV和container的宽


另:在IE7中有些标题背景条不会平铺:可在标题DIV中加入如下代码:

<div class="open">
                </div>


如在新帖、精华帖showtopiclist.htm的

<div class="ntforumbox">
          <div class="titlebar">
                <h2>
                <%if {forumid}>0%>
                <%set {aspxrewriteurl} = this.ShowForumAspxRewrite({forum.fid},0)%>
                <a href="{aspxrewriteurl}">{forum.name}</a>
                <%else if {type}=="digest"%>
                        精华帖
                <%else%>
                        新帖
                <%/if%>
                </h2>
                <div class="open">
                </div>
        </div>


我就加入了如上代码

使用
二、首页调用
1、在forumindex.htm大概55行
          原代码

<%template _pagewordadlist%>
          <%template _newpmmsgbox%>
          <%set (int){lastforumlayer} = -1%>
          <%set (int){lastcolcount} = 1%>
          <!--forumtopic-->


在<!--forumtopic-->下添加如下代码:

<link rel="stylesheet" href="templates/{templatepath}/newMenu/menuStyle.css" type="text/css" />
            <div id="forumMain">
                <%template _newmenu%>
                <div id="mainRighDIV">


2、在forumindex.htm大概221行
        原代码

<!--forumtopic-->

        <%if {forumlinkcount}>0%>
        <div class="ntforumbox forumlink">
        <span class="open"><a href="###" onclick="toggle_collapse('linklist');" class="opentopic"><img id ="linklist_img" src="templates/{templatepath}/images/open_no.gif" alt="展开/收起" /></a></span>
        <h4>友情链接</h4>


在<!--forumtopic-->上添加如下代码:

  </div>
                </div>
<script type="text/javascript" src="templates/{templatepath}/newMenu/docDidWidth.js"></script>


首页调用成功

三、列表页调用
1、在showforum.htm大概58行
        原代码

<!--position area end-->
        <%if {showforumlogin}==1%>
            <div class="ntforumbox">
                <div class="titlebar">
                        <h2>本版块已经被管理员设置了密码</h2>
                </div>


在<!--position area end-->下添加如下代码

<link rel="stylesheet" href="templates/lemon/newMenu/menuStyle.css" type="text/css" />
            <div id="forumMain">
                <%template _newmenu%>
                <div  id="mainRighDIV">


2、在showforum.htm大概108行
        原代码

<%if {subforumcount}>0%>
          <%template _subforum%>
        <%/if%>


在<%template _subforum%>下添加如下代码

</div>
          </div>


3、在showforum.htm大概455行
        原代码

<%if {canquickpost}%>
        <!--快速发表主题-->
                <%template _quickpost%>
        <%/if%>

                <div id="forumjumping">


在<%/if%>下添加如下代码

</div>
          </div>


4、在showforum.htm大概617行或最后
        原代码

<%template _copyright%>


下添加如下代码

<script type="text/javascript" src="templates/{templatepath}/newMenu/docDidWidth.js"></script>


四、新帖精华帖页调用
1、在showtopiclist.htm大概37行
        原代码

<!--TheCurrent end-->
<%if {showforumlogin}==1%>


在<!--TheCurrent end-->下添加如下代码

<link rel="stylesheet" href="templates/lemon/newMenu/menuStyle.css" type="text/css" />
            <div id="forumMain">
                <%template _newmenu%>
                <div  id="mainRighDIV">


2、在showtopiclist.htm大概37行
        原代码

</form>
        <div id="forumjumping">


在</form>下添加如下代码

</div>
            </div>
<script type="text/javascript" src="templates/{templatepath}/newMenu/docDidWidth.js"></script>


致此,在我网站上三个页面调用已经结束。其它页面如您还想调用。请自己查看试调用。

附件: newMenu.rar
zhuyuelee - 2008-6-24 18:00:00
我首页的三格调用,大家要是喜欢,改天再共享给大家吧
grayhound - 2008-6-24 18:24:00
这个叫什么插件啊。插件应该是不需要修改源程序任何一行代码,而实现额外的功能。

这个只能说是对源代码功能的一些扩展
zhuyuelee - 2008-6-24 18:34:00
哈哈,谢谢指点。
请问:不修改源码,我怎么调用????
上面修改的代码只是调用代码。
第一次类似的事情,如有什么不对的地方,还请多多包涵!
scnubbs - 2008-6-26 21:10:00
希望能够在帖子页面实现这个效果,同时我个人觉得,在首页不太需要。
solotv - 2008-6-26 21:28:00
还不错:D
1
查看完整版本: 左侧导航菜单插件,兼容IE6,IE7,firefox(没人喜欢??)