Board logo

标题: [LeadBBS相关] 【WENSUI】首页显示二级版面新帖链接的修改办法终帖 [打印本页]

作者: shillan    时间: 2005-12-28 04:58     标题: 【WENSUI】首页显示二级版面新帖链接的修改办法终帖

关于模板的问题,如果你使用的不是默认模板,比如第三元素风格使用的是天使之翼模板,一个办法是修改
---------
首页版面列表信息完全显示:
使用js语法
---------
这一部分的js调用,(下面的第一二步).

另一个办法是,把你所有的风格调整为使用默认模板就可以了.(这个比较简单)
第三种办法是:把模板的这一项:首页版面列表信息完全显示,不要选.

八月一日,
对第二三步作了修正,主要是当首页显示的新帖被修改标题时出现首页无法打的情况,这是lb本身的问题,因为当你修改了标题时,首页中的标题并未修改,才导致我们这个修改发生错误,现在的方法是,当发生这种情况时,我们将把链接指向上级版面.
------------------------------
另外,我的修改是在增加区版主显示的基础上修改的,希望大家先安装区版显示,再作这个修改,可能错误的可能性要小些.不好意思,刚刚发现

没办法,man留下这人难题要单独解决确实存在困难,刚刚作了调整,如果装有多个模板,可能需要逐个修改第一和第二步.

针对出现的问题重新作了修改,步骤虽多,但其实仍然简单.
boards.asp,

1、==============================
查找:
---------------
function displayboard(boardid,boardassort,boardname,boardintro,lastwriter,lastwritetime,topicnum,……)
----------------有区版的替换为:
function displayboard(boardid,boardassort,boardname,boardintro,lastwriter,lastwritetime,topicnum,announcenum,forumpass,lastannounceid,lasttopicname,masterlist,boardlimit,assortname,todayannounce,goodnum,boardimgurl,boardimgwidth,boardimgheight,onlineuser,lowerboard,assortmaster,childid,childbid)
------------无区版主的替换为:
function displayboard(boardid,boardassort,boardname,boardintro,lastwriter,lastwritetime,topicnum,announcenum,forumpass,lastannounceid,lasttopicname,masterlist,boardlimit,assortname,todayannounce,goodnum,boardimgurl,boardimgwidth,boardimgheight,onlineuser,lowerboard,childid,childbid)

===================================

2、===============================
查找:
---------------
                  if(parseint(lastannounceid)==0){document.write("主题:" + htmlencode(lasttopicname));}
                 else{document.write("主题:<a href=announce/announce.asp?boardid=" + boardid + "&id=" + lastannounceid + "&aupflag=1&anum=1>" + htmlencode(lasttopicname) + "</a>");}
(原版)
---------或:
                 if(parseint(lastannounceid)==0){document.write("主题:<a href=board/board.asp?boardid=" + boardid + ">" + htmlencode(lasttopicname) + "</a>");}
                 else{document.write("主题:<a href=announce/announce.asp?boardid=" + boardid + "&id=" + lastannounceid + "&aupflag=1&anum=1>" + htmlencode(lasttopicname) + "</a>");}
(做过折衷修改的)
-----------------------------------替换为:

                  if(parseint(lastannounceid)==0){
                  if(childid!=0){document.write("主题:<a href=announce/announce.asp?boardid=" + childbid + "&id=" + childid + "&aupflag=1&anum=1>" + htmlencode(lasttopicname) + "</a>");}  
                  else{document.write("主题:<a href=board/board.asp?boardid=" + boardid + ">" + htmlencode(lasttopicname) + "</a>");}
                  }else{document.write("主题:<a href=announce/announce.asp?boardid=" + boardid + "&id=" + lastannounceid + "&aupflag=1&anum=1>" + htmlencode(lasttopicname) + "</a>");}

=============================================

以上两步可能需要后台同样修改风格或者模板的首页js代码~~~~~~~~~~~

3、==================================
查找:
---------------
                        response.write vbcrlf & "displayboard(" ....................
                  else
                        response.write vbcrlf & "displayboard("........................
                  end if

----------------------
在它上面,添加:

                        '显示二级版面新帖修改
                              dim childid,childbid,rschild
                                    childid = 0
                                    childbid = 0
                        if getdata(19,0) = 0 then
                              set rschild = con.execute("select top 1 id,boardid from leadbbs_topic where title='" &getdata(20,0) & "'")
                              if not rschild.eof then
                                    childid = rschild(0)
                                    childbid = rschild(1)
                              else
                                    childid = 0
                                    childbid = 0
                              end if
                        end if
                        '显示二级版面新帖修改



=============================

4、==================================
查找到第一个:
                        response.write vbcrlf & "displayboard(" ....................

-------------------没有加区版主显示的替换为:

                        response.write vbcrlf & "displayboard(" & boardid & "," & getdata(1,0) & ",""" & replace(replace(getdata(0,0),"\","\\"),"""","\""") & """,""" & replace(replace(replace(getdata(2,0),"\","\\"),"""","\"""),vbcrlf,"\n") & """,""" & replace(replace(getdata(3,0),"\","\\"),"""","\""") & """,""" & getdata(4,0) & """," & getdata(29,0) & "," & getdata(30,0) & ",""" & forumpass & """," & getdata(19,0) & ",""" & replace(replace(replace(getdata(20,0),"\","\\"),"""","\"""),"<","<") & """,""" & replace(replace(getdata(10,0),"\","\\"),"""","\""") & """," & getdata(9,0) & ",""" & replace(replace(getdata(14,0),"\","\\"),"""","\""") & """," & getdata(31,0) & "," & getdata(32,0) & ",""" & replace(replace(getdata(21,0),"\","\\"),"""","\""") & """,""" & getdata(22,0) & """,""" & getdata(23,0) & """,0,""" & getdata(27,0) & """," & childid & "," & childbid & ");"

------------------------------------加区版主显示的替换为:


                        response.write vbcrlf & "displayboard(" & boardid & "," & getdata(1,0) & ",""" & replace(replace(getdata(0,0),"\","\\"),"""","\""") & """,""" & replace(replace(replace(getdata(2,0),"\","\\"),"""","\"""),vbcrlf,"\n") & """,""" & replace(replace(getdata(3,0),"\","\\"),"""","\""") & """,""" & getdata(4,0) & """," & getdata(29,0) & "," & getdata(30,0) & ",""" & forumpass & """," & getdata(19,0) & ",""" & replace(replace(replace(getdata(20,0),"\","\\"),"""","\"""),"<","<") & """,""" & replace(replace(getdata(10,0),"\","\\"),"""","\""") & """," & getdata(9,0) & ",""" & replace(replace(getdata(14,0),"\","\\"),"""","\""") & """," & getdata(31,0) & "," & getdata(32,0) & ",""" & replace(replace(getdata(21,0),"\","\\"),"""","\""") & """,""" & getdata(22,0) & """,""" & getdata(23,0) & """,0,""" & getdata(27,0) & """,""" & getdata(35,0) & """," & childid & "," & childbid & ");"

=======================================

解决直接进区可能存在的补丁:

将第三步中的下面三行:

                        dim childid,childbid,rschild
                        childid = 0
                        childbid = 0
移到文件开头的:
dim lmt_simplehomepage '是否为简约首页
lmt_simplehomepage = 0

下面,即可解决问题.



即可,请大家测试.

目前无法解决的问题:如果同时有两个名称相同的帖子,有可能会把只是显示新的一个的链接。但不会影响大局。呵呵,这问题实在没法解决。

http://w.leadbbs.com/a/a.asp?b=200&id=2016740




欢迎光临 逐梦论坛 (http://temp2023.zhumeng.org/) Powered by Discuz! 7.2