📄 admin_soft.asp
字号:
strDownAddress = rsAddress("DownloadPath") & Server.HTMLEncode(rsDown("DownFileName"))
sDownAddress = sDownAddress & "<li><a href=""" & strDownAddress & """ target=_blank>" & strDownAddress & "</a></li>" & vbNewLine
rsAddress.movenext
Loop
End If
Set rsAddress = Nothing
Else
strDownAddress = Server.HTMLEncode(rsDown("DownFileName") & "")
sDownAddress = sDownAddress & "<li><a href=""" & strDownAddress & """ target=_blank>" & strDownAddress & "</a></li>" & vbNewLine
End If
rsDown.movenext
Loop
End If
Set rsDown = Nothing
SoftDownAddress = sDownAddress
End Function
Private Sub SoftView()
Call PageTop
If Request("SoftID") = "" Then
FoundErr = True
ErrMsg = ErrMsg + "<li>Sorry!您选择了错误的系统参数。</li>"
Exit Sub
End If
'On Error Resume Next
SQL = "select * from NC_SoftList where ChannelID=" & ChannelID & " And SoftID=" & CLng(Request("SoftID"))
Set Rs = Newasp.Execute(SQL)
If Rs.BOF And Rs.EOF Then
FoundErr = True
ErrMsg = ErrMsg + "<li>Sorry!没有找到任何" & sModuleName & "。或者您选择了错误的系统参数!</li>"
Exit Sub
Else
%>
<table border="0" align="center" cellpadding="3" cellspacing="1" class="TableBorder">
<tr>
<th colspan="2">查看<%=sModuleName%></th>
</tr>
<tr>
<td align="center" class="TableRow2" colspan="2"><a href=?action=edit&ChannelID=<%=ChannelID%>&SoftID=<%=Rs("SoftID")%>><font size=4><%=Rs("SoftName") & " " & Rs("SoftVer")%></font></a></td>
</tr>
<tr>
<td class="TableRow1"><b><%=sModuleName%>运行环境:</b> <%=Rs("RunSystem")%></td>
<td class="TableRow1"><b><%=sModuleName%>类型:</b> <%=Rs("SoftType")%></td>
</tr>
<tr>
<td class="TableRow1"><b><%=sModuleName%>大小:</b> <%=Rs("SoftSize")%> <b>KB</b></td>
<td class="TableRow1"><b><%=sModuleName%>星级:</b>
<%
Response.Write "<font color=red>"
For i = 1 to Rs("star")
Response.Write "★"
Next
Response.Write "</font>"
%>
</td>
</tr>
<tr>
<td class="TableRow1"><b><%=sModuleName%>语言:</b> <%=Rs("Languages")%></td>
<td class="TableRow1"><b>授权方式:</b> <%=Rs("impower")%></td>
</tr>
<tr>
<td class="TableRow1"><b>更新时间:</b> <%=Rs("SoftTime")%></td>
<td class="TableRow1"><b>程序主页:</b> <%=Rs("Homepage")%></td>
</tr>
<tr>
<td class="TableRow1"><b>发 布 人:</b> <font color=blue><%=Rs("username")%></font></td>
<td class="TableRow1"><b>审核状态:</b> <%If Rs("isAccept") > 0 Then%>
<font color=blue>已审核</font>
<%Else%>
<font color=red>未审核</font>
<%End If%>
</td>
</tr>
<tr>
<td colspan="2" class="TableRow1"><b><%=sModuleName%>简介:</b><br><%=UBBCode(Rs("content"))%></td>
</tr>
<tr>
<td colspan="2" class="TableRow1"><b>下载地址:</b><br>
<%
Response.Write SoftDownAddress(Rs("softid"))
%>
</td>
</tr>
<tr>
<td colspan="2" class="TableRow1">上一<%=sModuleName%>:<%=FrontSoft(Rs("SoftID"))%>
<br>下一<%=sModuleName%>:<%=NextSoft(Rs("SoftID"))%></td>
</tr>
<tr>
<td align="center" colspan="2" class="TableRow2"><input type="button" onclick="{if(confirm('您确定要删除此软件吗?')){location.href='?action=del&ChannelID=<%=ChannelID%>&softid=<%=Rs("softid")%>';return true;}return false;}" value="删除软件" name="B2" class=Button>
<input type="button" onclick="javascript:history.go(-1)" value="返回上一页" name="B1" class=Button>
<input type="button" name="Submit1" onclick="javascript:location.href='#'" value="返回顶部" class=button>
<input type="button" name="Submit2" onclick="javascript:location.href='?action=edit&ChannelID=<%=ChannelID%>&SoftID=<%=Rs("SoftID")%>'" value="编辑软件" class=button>
[<a href="?act=批量审核&ChannelID=<%=ChannelID%>&selSoftID=<%=Rs("SoftID")%>" onclick="return confirm('您确定执行审核操作吗?');" ><font color=blue>直接审核</font></a>]</td>
</tr>
</table>
<%
End If
Rs.Close
Set Rs = Nothing
End Sub
Private Function FrontSoft(SoftID)
Dim Rss, SQL
SQL = "select Top 1 SoftID,classid,SoftName from NC_SoftList where ChannelID=" & ChannelID & " And isAccept <> 0 And SoftID < " & SoftID & " order by SoftID desc"
Set Rss = Newasp.Execute(SQL)
If Rss.EOF And Rss.bof Then
FrontSoft = "已经没有了"
Else
FrontSoft = "<a href=admin_Soft.asp?action=view&ChannelID=" & ChannelID & "&SoftID=" & Rss("SoftID") & ">" & Rss("SoftName") & "</a>"
End If
Rss.Close
Set Rss = Nothing
End Function
Private Function NextSoft(SoftID)
Dim Rss, SQL
SQL = "select Top 1 SoftID,classid,SoftName from NC_SoftList where ChannelID=" & ChannelID & " And isAccept <> 0 And SoftID > " & SoftID & " order by SoftID asc"
Set Rss = Newasp.Execute(SQL)
If Rss.EOF And Rss.bof Then
NextSoft = "已经没有了"
Else
NextSoft = "<a href=admin_Soft.asp?action=view&ChannelID=" & ChannelID & "&SoftID=" & Rss("SoftID") & ">" & Rss("SoftName") & "</a>"
End If
Rss.Close
Set Rss = Nothing
End Function
Private Sub BatCreateHtml()
Dim AllSoftID,url
Response.Write "<IE:Download ID=CreationID STYLE=""behavior:url(#default#download)"" />" & vbCrLf
Response.Write "<ol>"
AllSoftID = Split(selSoftID, ",")
For i = 0 To UBound(AllSoftID)
softid = CLng(AllSoftID(i))
url = "admin_makesoft.asp?ChannelID=" & ChannelID & "&softid=" & softid & "&showid=1"
Call ScriptCreation(url,softid)
Next
Response.Write "</ol>"
OutHintScript("开始生成HTML,共有" & i & "个HTML页面需要生成!")
End Sub
Private Function ClassUpdateCount(sortid,stype)
Dim rscount,Parentstr
On Error Resume Next
Set rscount = Newasp.Execute("SELECT ClassID,Parentstr FROM [NC_Classify] WHERE ChannelID = " & ChannelID & " And ClassID=" & CLng(sortid))
If Not (rscount.BOF And rscount.EOF) Then
Parentstr = rscount("Parentstr") &","& rscount("ClassID")
If CInt(stype) = 1 Then
Newasp.Execute ("UPDATE [NC_Classify] SET ShowCount=ShowCount+1,isUpdate=1 WHERE ChannelID = "& ChannelID &" And ClassID in (" & Parentstr & ")")
Else
Newasp.Execute ("UPDATE [NC_Classify] SET ShowCount=ShowCount-1,isUpdate=1 WHERE ChannelID = "& ChannelID &" And ClassID in (" & Parentstr & ")")
End If
End If
Set rscount = Nothing
End Function
Private Sub DelDownAddress()
If Not IsNumeric(Request("id")) Then
FoundErr = True
ErrMsg = ErrMsg + "<li>ID参数错误!</li>"
Exit Sub
End If
Newasp.Execute("Delete From NC_DownAddress Where ChannelID = "& ChannelID &" And id=" & Request("id"))
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Private Sub SoftDel()
softid = Clng(Request("softid"))
If softid = 0 Then
ErrMsg = "<li>请选择正确的系统参数!</li>"
Founderr = True
Exit Sub
End If
On Error Resume Next
Set Rs = Newasp.Execute("SELECT softid,classid,username,HtmlFileDate FROM NC_SoftList WHERE ChannelID="& ChannelID &" And softid= " & softid)
If Not(Rs.BOF And Rs.EOF) Then
ClassUpdateCount Rs("classid"),0
AddUserPointNum Rs("username"),0
DeleteHtmlFile Rs("classid"),Rs("softid"),Rs("HtmlFileDate")
End If
Rs.Close:Set Rs = Nothing
Conn.Execute("DELETE FROM NC_DownAddress WHERE ChannelID="& ChannelID &" And softid=" & softid)
Conn.Execute("DELETE FROM NC_SoftList WHERE ChannelID="& ChannelID &" And softid=" & softid)
Conn.Execute ("DELETE FROM NC_Comment WHERE ChannelID="& ChannelID &" And PostID=" & softid)
Call RemoveCache
'Response.redirect ("admin_soft.asp?ChannelID=" & ChannelID)
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Private Sub batdel()
Set Rs = Newasp.Execute("SELECT softid,classid,username,HtmlFileDate FROM NC_SoftList WHERE ChannelID = "& ChannelID &" And SoftID in (" & selSoftID & ")")
Do While Not Rs.EOF
ClassUpdateCount Rs("classid"),0
AddUserPointNum Rs("username"),0
DeleteHtmlFile Rs("classid"),Rs("softid"),Rs("HtmlFileDate")
Rs.movenext
Loop
Rs.Close:Set Rs = Nothing
Conn.Execute ("delete from NC_SoftList where ChannelID = "& ChannelID &" And SoftID in (" & selSoftID & ")")
Conn.Execute ("delete from NC_DownAddress where ChannelID = "& ChannelID &" And SoftID in (" & selSoftID & ")")
Conn.Execute ("delete from NC_Comment where ChannelID = "& ChannelID &" And PostID in (" & selSoftID & ")")
Call RemoveCache
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Private Sub isCommend()
Newasp.Execute ("update NC_SoftList set isBest=1 where SoftID in (" & selSoftID & ")")
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Private Sub noCommend()
Newasp.Execute ("update NC_SoftList set isBest=0 where SoftID in (" & selSoftID & ")")
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Private Sub isTop()
Newasp.Execute ("update NC_SoftList set isTop=1 where SoftID in (" & selSoftID & ")")
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Private Sub noTop()
Newasp.Execute ("update NC_SoftList set isTop=0 where SoftID in (" & selSoftID & ")")
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
'----批量审核
Private Sub BatAccept()
Set Rs = Newasp.Execute("SELECT username FROM NC_SoftList WHERE isAccept=0 And SoftID in (" & selSoftID & ")")
Do While Not Rs.EOF
AddUserPointNum Rs("username"),1
Rs.movenext
Loop
Rs.Close:Set Rs = Nothing
Newasp.Execute ("update NC_SoftList set isAccept=1 where SoftID in (" & selSoftID & ")")
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Private Sub NotAccept()
Set Rs = Newasp.Execute("SELECT username FROM NC_SoftList WHERE isAccept>0 And SoftID in (" & selSoftID & ")")
Do While Not Rs.EOF
AddUserPointNum Rs("username"),0
Rs.movenext
Loop
Rs.Close:Set Rs = Nothing
Newasp.Execute ("update NC_SoftList set isAccept=0 where SoftID in (" & selSoftID & ")")
Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Private Function AddUserPointNum(username,stype)
On Error Resume Next
Dim rsuser,GroupSetting,userpoint
Set rsuser = Newasp.Execute("SELECT userid,UserGrade,userpoint FROM NC_User WHERE username='"& username &"'")
If Not(rsuser.BOF And rsuser.EOF) Then
GroupSetting = Split(Newasp.UserGroupSetting(rsuser("UserGrade")), "|||")(13)
If CInt(stype) = 1 Then
userpoint = CLng(rsuser("userpoint") + GroupSetting)
Newasp.Execute ("UPDATE NC_User SET userpoint="& userpoint &",experience=experience+2,charm=charm+1 WHERE userid="& rsuser("userid"))
Else
userpoint = CLng(rsuser("userpoint") - GroupSetting)
Newasp.Execute ("UPDATE NC_User SET userpoint="& userpoint &",experience=experience-2,charm=charm-1 WHERE userid="& rsuser("userid"))
End If
End If
Set rsuser = Nothing
End Function
Private Sub BatchSetting()
If Not ChkAdmin("AdminSoft" & ChannelID) Then
Server.Transfer("showerr.asp")
Response.End
End If
Dim Channel_Setting
Channel_Setting = Split(Newasp.Channel_Setting, "|||")
Response.Write "<script src=""include/SoftJuge.Js"" type=""text/javascript""></script>" & vbNewLine
Response.Write "<table cellspacing=1 align=center cellpadding=3 border=0 class=tableborder>"
Response.Write " <tr>"
Response.Write " <th colspan=4>" & sModuleName & "批量设置</th>"
Response.Write " </tr>"
Response.Write " <form name=myform method=post action=?action=saveset>"
Response.Write " <input type=hidden name=ChannelID value='"& ChannelID &"'>"
Response.Write " <tr>"
Response.Write " <td width=""20%"" rowspan=""19"" class=tablerow2 valign=""top"" id=choose2 style=""display:none""><b>请选择" & sModuleName & "分类</b><br>"
Response.Write "<select name=""ClassID"" size='2' multiple style='height:420px;width:180px;'>"
Dim strSelectClass,re
strSelectClass = Newasp.LoadSelectClass(ChannelID)
Set re = New RegExp
re.IgnoreCase = True
re.Global = True
Re.Pattern="(value=)(.*)("" )"
strSelectClass = Re.Replace(strSelectClass,"")
Re.Pattern="({ClassID=)(.*)(}>)"
strSelectClass = Re.Replace(strSelectClass,"value=""$2"">")
Response.Write strSelectClass
Set Re = Nothing
Response.Write "<option value=""-1"">指定所有分类</option>"
Response.Write "</select>"
Response.Write "</td>"
Response.Write " <td class=tablerow1 colspan=2 align=right><b>设置选择:</b></td>"
Response.Write " <td class=tablerow1>"
Response.Write " <input type=radio name=choose value='0' checked onClick=""choose1.style.display='';choose2.style.display='none';""> 按" & sModuleName & "ID "
Response.Write " <input type=radio name=choose value='1' onClick=""choose2.style.display='';choose1.style.display='none';""> 按" & sModuleName & "分类</td>"
Response.Write " </tr>"
Response.Write " <tr id=choose1>"
Response.Write " <td class=tablerow1 colspan=2 align=right><b>" & sModuleName & "ID:</b>多个ID请用“,”分开</td>"
Response.Write " <td class=tablerow1><input type=""text"" name=""SoftID"" size=70 value='"& Request("selSoftID") &"'></td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td class=tablerow1 width=""15%"" align=right><
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -