BBSxp修改大全,修改方法经典收藏大集合(1)

BBSxp修改大全,修改方法经典收藏大集合(1)

By admin at 2007-05-26
0人收藏 • 1027人看过

某些修改方法可能过时~不适应新版本,但是有些朋友是用老版本的,我不说大家也明白!叫做经典收藏,只要适合BBSXP的都收藏了~新的或者修正的方法都按时间顺序向后排列!

贴子中点击图片弹出个新窗口(老方法~第二页有适应新版本的方法~请选择适合你的方法!)

在 inc/ybb.js 里,

找到:

if (getCookie('ybbimg')!='0'){ //是否打开[IMG]代码
temp = temp.replace(/(\[IMG\])([^]]*)(\[\/IMG\])/ig,"<img border=0 src='$2' onmousewheel='return yuzi_img(event,this)' onload='javascript:if(this.width>body.clientHeight)this.width=body.clientHeight'> ");
}

<img......>的前后加上<a target=_blank href=$2>和</a>
 
 

========================================
如何防止BBSxp出现同一用户重复在线问题


BBSxp有一个很不应该出现的问题,就是当同一用户在不同的机器上登录时,在线列表中会出现两个或多个该用户,这一点很讨厌。

经过分析,找到了问题的原因所在:。

在Inc/line.asp中有这样几行:

sql="select * from online where ip='"&remoteaddr&"' and username='"&Request.Cookies("username")&"' or sessionid='"&session.sessionid&"' "
rs.Open sql,Conn,1,3
if rs.eof then rs.addnew


这几行的本意为找出也本用户名字、Session相同的在线用户,如果没有,就添加一个新记录。

这本是正确的,但BBSxp画蛇添足地将过滤条件加上了ip='"&remoteaddr&"',这就造成了同一用户会多次出现在在线列表中了。

因为在不同的机器上登录(应该主要是局域网)时,IP是不可能相同的,这就被BBSxp认为是两个不同的用户了。

找到宋侍猓薷木捅涞萌菀琢耍?lt;/P>


sql="select * from online where username='"&Request.Cookies("username")&"'"
rs.Open sql,Conn,1,3
if rs.eof then rs.addnew

If Rs("UserName")<>"" Then
Conn.Execute("Delete From [online] where username='' and sessionid='"&Rs("sessionid")&"'")
End IF

这样,一切就Ok了!快看看你的吧!
=======================================================
论坛菜单分两页显示
找到setup.asp里

sub menu(selec)
sql="Select * From menu where followid="&selec&" order by SortNum"
Set Rs1=Conn.Execute(sql)
do while not rs1.eof
if rs1("followid")=0 then
%> | <a onmouseover="showmenu(event,'<%menu(rs1("id"))%>')" style=cursor:default><%=rs1("name")%></a>
<% else
Response.write "<div class=menuitems><a href="&rs1("url")&">"&rs1("name")&"</a></div>"
end if
rs1.movenext
loop
Set Rs1 = Nothing
end sub

这段代码,然后修改成下面的

sub menu(selec)
sql="Select * From menu where followid="&selec&" order by SortNum"
Set Rs1=Conn.Execute(sql)
i=4
do while not rs1.eof
if rs1("followid")=0 then
%> | <a onmouseover="showmenu(event,'<%menu(rs1("id"))%>')" style=cursor:default><%=rs1("name")%></a><%
else
i=i+1
iii=i mod 2
if iii=1 then
Response.write "<div class=menuitems>"
end if
Response.write "<a href="&rs1("url")&">"&rs1("name")&"</a>"
if iii=1 then
Response.write "|"
end if
if iii=0 then
Response.write "</div>"
end if
end if
rs1.movenext
loop
Set Rs1 = Nothing
end sub


就可以实现让菜单分两排显示了
=============================================================
1.最新发表主题调用<br>

<%
sql="select top 10 id,icon,topic from forum where deltopic<>1 order by id Desc"
rs.Open sql,Conn
Do While Not RS.EOF
response.write "<IMG src=images/brow/"&rs("icon")&".gif border=0> <a onclick=min_yuzi() target=message href=ShowPost.asp?id="&rs("id")&">"&left(""&rs("topic")&"",15)&"</a><br>"
RS.MoveNext
loop
RS.Close
%>
<br>
2.我参与的主题调用<br>

<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select top 10 topicid from reforum where username='"&Request.Cookies("username")&"' order by id Desc"
rs.Open sql,Conn
Do While Not RS.EOF
Set rsn = Server.CreateObject("ADODB.Recordset")
sql="select * from forum where id="&rs("topicid")&""
rsn.Open sql,Conn

response.write "<IMG src=images/brow/"&rsn("icon")&".gif border=0> <a onclick=min_yuzi() target=message href=ShowPost.asp?id="&rsn("id")&">"&left(""&rsn("topic")&"",15)&"</a><br>"
RSn.Close
RS.MoveNext
loop
RS.Close
%>
<br>
3.本周最强人气调用<br>

<%
sql="select top 10 id,icon,topic,username,posttime from forum where deltopic<>1 and posttime>"&SqlNowString&"-7 order by Views Desc,id"
rs.Open sql,Conn
Do While Not RS.EOF
response.write "<IMG src=images/brow/"&rs("icon")&".gif border=0> <a onclick=min_yuzi() target=message href=ShowPost.asp?id="&rs("id")&">"&left(""&rs("topic")&"",15)&"</a><br>"
RS.MoveNext
loop
RS.Close
%>
<br>
4.本周最多回复调用<br>

<%
sql="select top 10 id,icon,topic,username,posttime,replies from forum where deltopic<>1 and posttime>"&SqlNowString&"-7 order by replies Desc,id"
rs.Open sql,Conn
Do While Not RS.EOF
response.write "<IMG src=images/brow/"&rs("icon")&".gif border=0> <a onclick=min_yuzi() target=message href=ShowPost.asp?id="&rs("id")&">"&left(""&rs("topic")&"",15)&"</a><br>"
RS.MoveNext
loop
RS.Close
%>

<br>
5.精华帖子调用<br>

<%
sql="select top 10 * from forum where goodtopic=1 and deltopic<>1 order by id Desc"
rs.Open sql,Conn
Do While Not RS.EOF
response.write "<IMG src=images/brow/"&rs("icon")&".gif border=0> <a onclick=min_yuzi() target=message href=ShowPost.asp?id="&rs("id")&">"&left(""&rs("topic")&"",15)&"</a><br>"
RS.MoveNext
loop
RS.Close
%>
<br>
6.投票帖子调用<br>

<%
sql="select top 10 * from forum where polltopic<>'' and deltopic<>1 order by id Desc"
rs.Open sql,Conn
Do While Not RS.EOF
response.write "<IMG src=images/brow/"&rs("icon")&".gif border=0> <a onclick=min_yuzi() target=message href=ShowPost.asp?id="&rs("id")&">"&left(""&rs("topic")&"",15)&"</a><br>"
RS.MoveNext
loop
RS.Close
%>

7、注册会员调用其中的 top 1 是调用最新加入的一人,如果要调用最新注册的十人就将 1 改成 10

新人:
<%
sql="select top 1 username from user order by id Desc"
rs.Open sql,Conn
Do While Not RS.EOF
response.write "<b><a href=Profile.asp?username="&rs("username")&">"&rs("username")&"</a></b>"
RS.MoveNext
loop
RS.Close
%>

=============================================================
BBSXP首页新帖、人气、回复帖子调用(显示彩色标题)
本段代码根据闲聊吧美化版2.0Default.asp中代码修改,特此注明!

使用方法:用记事本打开default.asp找到以下代码

<font face=Wingdings>v</font> <a href="ShowBBS.asp?menu=2">本周热门帖子</a>
<font face=Wingdings>v</font> <a href="ShowBBS.asp?menu=1">本周人气帖子</a>
<font face=Wingdings>v</font> <a href="ShowBBS.asp">社区新帖</a> 
<font face=Wingdings>v</font> <a href="ShowBBS.asp?menu=3">精华帖子</a> 
<font face=Wingdings>v</font> <a href="ShowBBS.asp?menu=4">投票帖子</a>
<font face=Wingdings>v</font></td>
 

  </tr>
 </table>

<SCRIPT>valignbottom()</SCRIPT>

<br>

下面插入如下代码

<!-------add start------->
<SCRIPT>valigntop()</SCRIPT>
<table cellspacing="1" cellpadding="4" width="97%" border="0" class="a2" align="center">
<tr class="a1">
<td valign="center" align="middle" width="33%">..::最新发表主题::..</td>
<td valign="center" align="middle" width="33%">..::本周最强人气::.. </td>
<td valign="center" align="middle" width="33%">..::本周最多回复::.. </td>
</tr>
<tr class="a4"><td>
<%
sql="select top 5 id,icon,topic from forum where deltopic<>1 order by id Desc"
everyday
response.write "</td><td>"
sql="select top 5 id,icon,topic from forum where deltopic<>1 and posttime>"&SqlNowString&"-7 order by Views Desc,lasttime"
everyday
response.write "</td><td>"
sql="select top 5 id,icon,topic from forum where deltopic<>1 and posttime>"&SqlNowString&"-7 order by replies Desc,lasttime"
everyday

Function everyday
rs.Open sql,Conn
Do While Not RS.EOF
topic=rs("topic")
if Left(topic,5)="<font" then
if Mid(topic,16,1)=">" then
if len(topic)>40 then
topic=left(topic,32)&"..</font>"
end if
else
if Mid(topic,17,1)=">" then
if len(topic)>41 then
topic=left(topic,33)&"..</font>"
end if
else
if Mid(topic,18,1)=">" then
if len(topic)>42 then
topic=left(topic,34)&"..</font>"
end if
else
if Mid(topic,19,1)=">" then
if len(topic)>43 then
topic=left(topic,35)&"..</font>"
end if
else
if Mid(topic,20,1)=">" then
if len(topic)>44 then
topic=left(topic,36)&"..</font>"
end if
end if
end if
end if
end if
end if
else
if len(topic)>17 then
topic=left(topic,16)&".."
end if
end if
response.write "<IMG src=images/brow/"&rs("icon")&".gif border=0> <a target=_blank href=ShowPost.asp?id="&rs("id")&">"&topic&"</a><br>"
RS.MoveNext
loop
RS.Close
end Function

%>
</td></tr></table>
<SCRIPT>valignbottom()</SCRIPT>
<!---------add end------->

==============================================
编辑帖子限制为30分钟
==============================================
打开文件EditTopic.asp

1、找到
sql="Select * From [forum] where ID="&ID&""
rs.Open sql,Conn,1
forumid=rs("forumid")
ReList=rs("ReList")
rs.close

改成
sql="Select * From [forum] where ID="&ID&""
rs.Open sql,Conn,1
forumid=rs("forumid")
ReList=rs("ReList")
stopposttime=DateDiff("n",rs("posttime"),Now())
rs.close
---------------------------------------------------
2、在它下面加入以下代码

if isnumeric(""&Request("retopicid")&"") then
sql="select * from [reforum"&ReList&"] where id="&Request("retopicid")&""
rs.Open sql,Conn,1
stopreposttime=DateDiff("n",rs("posttime"),Now())
if stopreposttime>30 then error("<li>系统编辑帖子时限为30分钟,而从您发表帖子到现在已经有"&stopreposttime&"分钟了。")
else
if stopposttime>30 then error("<li>系统编辑帖子时限为30分钟,而从您发表帖子到现在已经有"&stopposttime&"分钟了。")
end if


登 录


现在注册

QQ  登 录    Weibo  登 录    GitHub  登 录