注意:运用此方法后请隐藏侧边栏中的“User”模块,否则在使用顶部登陆栏登陆时会出现验证码错误!
【步骤一】
在common/Library.asp中查找“用户面板”,将其下面的Function过程替换为以下代码:
Function userPanel()
userPanel = ""
If memName<>Empty Then userPanel = userPanel & stat_title & "<b>" &memName& "</b> | "
If stat_Admin = True Then userPanel = userPanel + "<a href=""control.asp"" class=""sideB"" accesskey=""3"">系统管理</a> | "
If stat_AddAll = True or stat_Add = True Then userPanel = userPanel + "<a href=""blogpost.asp"" class=""sideB"" accesskey=""N"">发表日志</a> | "
If (stat_AddAll = True or stat_Add = True) And (stat_EditAll or stat_Edit) Then
If IsEmpty(session(CookieName&"_draft_"&memName)) Then
session(CookieName&"_draft_"&memName) = conn.Execute("select count(log_ID) from blog_Content where log_Author='"&memName&"' and log_IsDraft=true")(0)
SQLQueryNums = SQLQueryNums + 1
End If
If session(CookieName&"_draft_"&memName)>0 Then
userPanel = userPanel + "<a href=""default.asp?display=draft"" class=""sideB"" accesskey=""D""><strong>编辑草稿 ["&session(CookieName&"_draft_"&memName)&"]</strong></a> | "
Else
userPanel = userPanel + "<a href=""default.asp?display=draft"" class=""sideB"" accesskey=""D"">编辑草稿</a> | "
End If
End If
If memName<>Empty Then
userPanel = userPanel&"<a href=""member.asp?action=edit"" class=""sideB"" accesskey=""M"">修改资料</a> | <a href=""login.asp?action=logout"" class=""sideB"" accesskey=""Q"">退出登陆</a>"
Else
userPanel=userPanel&"<form name=""checkUser"" action=""login.asp"" method=""post""><input name=""action"" type=""hidden"" value=""login""/>用户名<input name=""username"" type=""text"" size=""8"" class=""userpass"" maxlength=""24""/> 密 码<input name=""password"" type=""password"" size=""8"" class=""userpass""/> 验证码<input name=""validate"" type=""text"" size=""4"" class=""userpass"" maxlength=""4""/>"&getcode()&" <input name=""KeepLogin"" type=""checkbox"" value=""1""/>保存登陆 <input type=""submit"" value=""登 陆"" class=""userbutton""/> <input type=""button"" value=""注 册"" class=""userbutton"" onclick=""location.href='register.asp'""/></form>"
End If
End Function
【步骤二】
在header.asp中查找“</head>”,在其后面加上以下代码:
<%
dim FilePathTemp,NowFilePath
FilePathTemp=request.ServerVariables("PATH_INFO")
if instr(FilePathTemp,"/")<>0 then
NowFilePath=replace(FilePathTemp,"/","")
end if
%>
<div style="position:absolute; z-index:1; right:10px; top:3px;<%if NowFilePath="login.asp" or NowFilePath="register.asp" then%>display:none;<%end if%>"><%=userPanel%></div>