收藏本页
切换浏览模式

华夏网·艺术论坛站务管理服务大厅 → 查看评论

帖子评论信息
评论主题: 动网论坛7.1SP1 CSS详解
评论对象: 夏雪儿 | 2009/3/29 17:22:47
评论言论: 47 - 主题贴编辑后自动提升
打开savepost.asp,第921行左右可以找到代码:

Dvbbs.Execute("update dv_topic set title='"&topic&"',TopicMode="&MyTopicMode&" "&iExpression&" where topicid="&rootid)

把它改成:

Dvbbs.Execute("update dv_topic set title='"&topic&"',LastPostTime="&SqlNowString&",TopicMode="&MyTopicMode&" "&iExpression&" where topicid="&rootid)
即可实现这个目的。
________________________________________

;

48 - 状态栏显示站长QQ和电子邮件地址
默认模板分页面模板(main_style)中的Dvbbs.mainhtml(2)
在body topmargin="0" leftmargin="0后添加:
onLoad="window.status=' 站长QQ:38843972 Email:xkyz@sina.com'"
________________________________________


49 - 让斑竹不能给自己加精华
文件Admin_posting.asp

topic=rs("topic")
topicusername=rs("username")
topicuserID=rs("postuserID")

前面加一段代码

If Rs("PostUserID")=Dvbbs.UserID and Dvbbs.BoardMaster Then Dvbbs.AddErrCode(28) : Exit Sub
即可。
________________________________________


50 - 上传附件显示详细信息的修改方法
实现如下功能:
1、单贴间多个下载文件单独记录下载次数并显示文件名(这个只是以前那个的Bug修复)
2、显示原来上传时的文件名,而不是变成序号的文件名(不影响保密功能)
3、可以查看下载者的功能(只有发布者和管理员可以看到,别人看不到)
4、文件长度显示,该Byte就Byte,该KByte就KByte,该MByte就MByte(应该不会有那个论坛提供GByte下载吧)
5、无论上传文件后系统加了什么样的后缀序号(其实是用于防盗和防止文件重名的),下载时都会只显示原来的文件名,不会出现后边的一长串序号(这个功能要在系统开启了防盗功能才有效)
一、修改inc/dv_ubbcode.asp:
原来:
re.Pattern="\x01UPLOAD=(.[^\x01]*)\x02(viewFile\.asp.[^\x01]*)\x01\/UPLOAD\x02"
s= re.Replace(s,"<br><IMG SRC=""skins/default/filetype/$1.gif"" border=0> <a href=""$2"" target=_blank>点击浏览该文件</a>")
re.Pattern="viewFile.asp\?"
s= re.Replace(s,"viewFile.asp?Boardid="&Dvbbs.Boardid&"&")
re.Pattern="\x01UPLOAD=(.[^\x01]*)\x02(.[^\x01]*)\x01\/UPLOAD\x02"
s= re.Replace(s,"<br><img src=""skins/default/filetype/$1.gif"" border=""0""> <a href=""$2"" target=""_blank"">点击浏览该文件</a><br><img src=""$2"" border=""0"" >")

这个是标准DV的代码,不含以前修改的代码(如果你已经修改过,请恢复为DV7标准代码)
改为:
Dim Test
Dim LoopCount
LoopCount=0
re.Pattern="(^.*)\x01UPLOAD=(.[^\x01]*)\x02viewFile\.asp\?id=*([0-9]*)\x01\/UPLOAD\x02(.*)"
Test=re.Test(s)
if Test then
dim upsql,uprs
dim uploadid
dim TrueFileName
dim TruePos
dim FileLen
dim iDownUser
dim SplitDownUser
dim iii
Set uprs = Server.CreateObject("ADODB.Recordset")
do while Test
uploadid=re.Replace(s,"$3")
if IsNumeric(uploadid) then
upsql="select F_Filename,F_FileType,F_FileSize,F_DownNum,F_DownUser from DV_Upfile where F_ID="&trim(uploadid)
uprs.Open upsql,conn,1,1
TruePos=instrrev(uprs("F_Filename"),"___")
if TruePos>0 then
TrueFileName=left(uprs("F_Filename"),TruePos-1)
else
TrueFileName=uprs("F_Filename")
end if
TruePos=instrrev(TrueFileName,"/")
if TruePos>0 then
TrueFileName=right(TrueFileName,len(TrueFileName)-TruePos)
end if
FileLen=uprs("F_FileSize")
if FileLen>1024 then
FileLen=Round(FileLen / 1024,2)
if FileLen > 1024 then
FileLen=Round(FileLen / 1024,2)
FileLen="<B>" & FileLen & "</B> MByte"
else
FileLen="<B>" & FileLen & "</b> KByte"
end if
else
FileLen="<B>" & FileLen & "</B> Byte"
end if
if dvbbs.membername<>"" and (dvbbs.membername=username or dvbbs.master) then
if (not isnull(uprs("F_DownUser"))) and uprs("F_DownUser")<>"" then
SplitDownUser=split(uprs("F_DownUser"),"|")
iDownUser="<select size=1><option value=0>以下用户</option>"
for iii=0 to ubound(SplitDownUser)
iDownUser=iDownUser & "<option value="&iii&">"&SplitDownUser(iii)&"</option>"
next
iDownUser=iDownUser&"</select>"
else
iDownUser=""
end if
s= re.Replace(s,"$1<BR><FIELDSET><LEGEND>本帖包含附件</LEGEND><TABLE cellSpacing=3 border=0 cellpadding=0><tr height=25 valign=middle><td><IMG src=""skins/default/filetype/"&uprs("F_FileType")&".gif"" border=0></td><TD><A href=""viewFile.asp?Boardid=8&ID="&trim(uploadid)&""" target=_blank>"&TrueFileName&"</A>&nbsp; (&nbsp;"&FileLen&",已被"&iDownUser&"下载 <FONT color=red><b>"&uprs("F_DownNum")&"</b></FONT>&nbsp;次&nbsp;)</TD></TR></TABLE></FIELDSET><BR>$4")
else
s= re.Replace(s,"$1<BR><FIELDSET><LEGEND>本帖包含附件</LEGEND><TABLE cellSpacing=3 border=0 cellpadding=0><tr height=25 valign=middle><td><IMG src=""skins/default/filetype/"&uprs("F_FileType")&".gif"" border=0></td><TD><A href=""viewFile.asp?Boardid=8&ID="&trim(uploadid)&""" target=_blank>"&TrueFileName&"</A>&nbsp; (&nbsp;"&FileLen&",已被下载 <FONT color=red><b>"&uprs("F_DownNum")&"</b></FONT>&nbsp;次&nbsp;)</TD></TR></TABLE></FIELDSET><BR>$4")
end if
uprs.close
end if
re.Pattern="(^.*)\<\/FONT\>\&nbsp\;次\&nbsp\;\)\<\/TD\>\<\/TR\>\<\/TABLE\>\<\/FIELDSET\>(\<BR\>){0,}\<FIELDSET\>\<LEGEND\>本帖包含附件\<\/LEGEND\>\<TABLE cellSpacing=3 border=0 cellpadding=0\>(.*)"
s=re.Replace(s,"$1</FONT>&nbsp;次&nbsp;)</TD></TR>$3")
re.Pattern="(^.*)\x01UPLOAD=(.[^\x01]*)\x02viewFile\.asp\?id=*([0-9]*)\x01\/UPLOAD\x02(.*)"
Test=re.Test(s)
LoopCount=LoopCount+1
If LoopCount>MaxLoopCount Then Exit Do
loop
end if

二、修改viewfile.asp:
1、原来:
If Dvbbs.Forum_Setting(75)="0" Then
Dvbbs.Execute("Update dv_upfile Set F_DownNum=F_DownNum+1 Where F_ID="&DownID)
Response.Redirect uploadpath&rs("F_filename")
Else
filename=Replace(rs("F_filename"),"..","")&""
If Request.ServerVariables("HTTP_REFERER")="" Or InStr(Request.ServerVariables("HTTP_REFERER"),Request.ServerVariables("SERVER_NAME"))=0 Or filename="" Then
Response.Redirect "index.asp"
Else
Call downloadFile(Server.MapPath(Dvbbs.Forum_Setting(76)&filename))
End If
End If
现在:
If Dvbbs.Forum_Setting(75)="0" Then
if dvbbs.membername<>"" then
if not instr(1,"|"&rs("f_downuser")&"|","|"&dvbbs.membername&"|")>0 then
if isnull(rs("F_DownUser")) or rs("F_DownUser")="" then
conn.execute("update dv_upfile set F_DownNum=F_DownNum+1,F_DownUser='"&dvbbs.membername&"' where F_ID="&DownID)
else
conn.execute("update dv_upfile set F_DownNum=F_DownNum+1,F_DownUser=F_DownUser+'|"&dvbbs.membername&"' where F_ID="&DownID)
end if
end if
else
Dvbbs.Execute("Update dv_upfile Set F_DownNum=F_DownNum+1 Where F_ID="&DownID)
end if
Response.Redirect uploadpath&rs("F_filename")
Else
filename=Replace(rs("F_filename"),"..","")&""
If Request.ServerVariables("HTTP_REFERER")="" Or InStr(Request.ServerVariables("HTTP_REFERER"),Request.ServerVariables("SERVER_NAME"))=0 Or filename="" Then
Response.Redirect "index.asp"
Else
if dvbbs.membername<>"" then
if not instr(1,"|"&rs("f_downuser")&"|","|"&dvbbs.membername&"|")>0 then
if isnull(rs("F_DownUser")) or rs("F_DownUser")="" then
conn.execute("update dv_upfile set F_DownNum=F_DownNum+1,F_DownUser='"&dvbbs.membername&"' where F_ID="&DownID)
else
conn.execute("update dv_upfile set F_DownNum=F_DownNum+1,F_DownUser=F_DownUser+'|"&dvbbs.membername&"' where F_ID="&DownID)
end if
end if
else
Dvbbs.Execute("Update dv_upfile Set F_DownNum=F_DownNum+1 Where F_ID="&DownID)
end if
Call downloadFile(Server.MapPath(Dvbbs.Forum_Setting(76)&filename))
End If
End If

2、原来:
If Response.IsClientConnected Then
Response.AddHeader "Content-Disposition", "attachment; filename=" & f.name
现在:
If Response.IsClientConnected Then
dim TruePos
dim TrueFileName
TruePos=instrrev(f.name,"___")
if TruePos>0 then
TrueFileName=left(f.name,TruePos-1)
else
TrueFileName=f.name
end if
TruePos=instrrev(TrueFileName,"/")
if TruePos>0 then
TrueFileName=right(TrueFileName,len(TrueFileName)-TruePos)
end if
Response.AddHeader "Content-Disposition", "attachment; filename=" & TrueFileName
全部完成!
________________________________________


51 - 在线列表中方便查询客人和会员IP来源
找到后台风格样式模板总管理--Page_online temp(0)的
if ((username!=''&&(str[i][4])!=0&&str[i][3]=='2')||(master==1&&(str[i][4])!=0))
{
showstring+='<a href=dispuser.asp?name='+str[i][1]+' target=_blank >查看资料</a>&nbsp;&nbsp;<a href=messanger.asp?action=new&touser='+str[i][1]+' target=_blank >给他留言</a>'
}
改为:
if ((username!=''&&(str[i][4])!=0&&str[i][3]=='2')||(master==1&&(str[i][4])!=0))
{
showstring+='<a href=dispuser.asp?name='+str[i][1]+' target=_blank >查看资料</a>&nbsp;&nbsp;<a href=messanger.asp?action=new&touser='+str[i][1]+' target=_blank >给他留言</a>&nbsp;&nbsp;<a href=TopicOther.asp?t=1&action=lookip&ip='+str[i][tmpcount[4]]+' >查看IP来源</a>'
} else {
if(master==1) showstring+='I P来 源:<a href=TopicOther.asp?t=1&action=lookip&ip='+str[i][tmpcount[4]]+' >查看IP来源</a>'
________________________________________


52 - 公告和短消息中开启URL自动识别的修改
在inc/dv_ubbcode.asp中找到(一共两处都要改):
Board_Setting(5)=0:Board_Setting(7)=1
改为:
Board_Setting(5)=1:Board_Setting(7)=1
________________________________________


53 - 论坛同等级版主不能相互编辑的修改
post.asp

If Cint(Dvbbs.UserGroupID) < 4 And Cint(Dvbbs.UserGroupID) = rs("UserGroupID") Then
Dvbbs.AddErrCode(75)
改為:
If Cint(Dvbbs.UserGroupID) < 4 And Cint(Dvbbs.UserGroupID) = rs("UserGroupID") Then
'Dvbbs.AddErrCode(75)

savepost.asp

If Cint(Dvbbs.UserGroupID) < 4 And Cint(Dvbbs.UserGroupID) = rs("UserGroupID") Then
Dvbbs.AddErrCode(75)
改為:
If Cint(Dvbbs.UserGroupID) < 4 And Cint(Dvbbs.UserGroupID) = rs("UserGroupID") then
'Dvbbs.AddErrCode(75)

反对方

支持方

反对方人数(0
支持方人数(0

中立方

中立方人数(0
Copyright ©2004 - 2020 cnrr.cn
Powered By Dvbbs Version 8.0.0
页面执行时间 0.08594 秒, 9 次数据查询