admin_createsoft.asp

来自「小游戏网站演示www.4399.io 拥有4万条游戏数据」· ASP 代码 · 共 626 行 · 第 1/3 页

ASP
626
字号
	Response.Write " <td class=tablerow1>"
	Response.Write "<select name='classid' size='2' multiple style='height:260px;width:200px;'>"
	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 "</select>"
	Response.Write "</td>"
	Response.Write " <td class=tablerow1 valign=top>"
	Response.Write "<input class=Button type=submit name=Submit1 value=' 生成分类列表页方法一'><br><br>"
	Response.Write "<input class=Button type=submit name=Submit2 value=' 生成分类列表页方法二' onclick=""document.Createform8.action.value='list2';""><br><br>"
	Response.Write "<input class=Button type=submit name=Submit3 value=' 生成软件信息页 HTML' onclick=""document.Createform8.action.value='cont';""><br><br>"
	Response.Write "请按 CTRL 键多选"
	Response.Write "</td></form>"
	Response.Write " </tr>"
	Response.Write "</table>"
End Sub
Function LinkedStr(str)
	LinkedStr = "Admin_CreateSoft.Asp?action=" & str & "&amp;ChannelID="& ChannelID
End Function
Function ShowInnerHTML(totalnumber,n)
	Response.Write "<script>table2.style.width=" & Fix((n / totalnumber) * 400) & ";"
	Response.Write "txt2.innerHTML=""完成:" & FormatNumber(n / totalnumber * 100, 2, -1) & """;"
	Response.Write "table2.title=""(" & n & ")"";</script>" & vbNewLine
End Function
Sub ShowGuage()
	Response.Write "<br><table width='400' align=center border=0 cellspacing=1 cellpadding=1>" & vbCrLf
	Response.Write "<tr> " & vbCrLf
	Response.Write "<td style=""border: 1px #384780 solid ;background-color: #FFFFFF;"">" & vbCrLf
	Response.Write "<table width=0 id=table2 name=table2 border=0 cellspacing=0 cellpadding=0>" & vbCrLf
	Response.Write "<tr height=12><td bgcolor=#36D91A>" & vbCrLf
	Response.Write "</td></tr></table></td></tr><tr> " & vbCrLf
	Response.Write "<td align=center> <span id=txt2 name=txt2 style=""font-size:9pt"">0</span> <span style=""font-size:9pt"">%</span>   <span id=txt3 name=txt3 style=""font-size:9pt""></span></td></tr>" & vbCrLf
	Response.Write "</table><br>" & vbCrLf
End Sub

Sub CreateSiteIndex()
	Dim HtmlContent,FilePath
	On Error Resume Next
	HtmlContent = HTML.ShowIndex(True)
	FilePath = "../" & Newasp.IndexName
	Newasp.CreatedTextFile FilePath,HtmlContent
	Response.Write "<li>生成首页HTML完成... <a href=" & FilePath & " target=_blank>"
	Response.Write Server.MapPath(FilePath)
	Response.Write "</a></li>"
End Sub
Sub Create_Soft_List()
	Dim totalnumber
	If CInt(Request("field")) = 1 Then
		SQL = " And TurnLink=0  And isUpdate=1"
	ElseIf CInt(Request("field")) = 2 Then
		If Trim(Request("classid")) = "" Then
			ErrMsg = "<li>请选择分类~!</li>"
			FoundErr = True 
			Exit Sub
		End If
		SQL = " And TurnLink=0 And ClassID in(" & Request("classid") & ")"
	Else
		SQL = " And TurnLink=0"
	End If
	totalnumber = Newasp.Execute("SELECT COUNT(ClassID) FROM NC_Classify WHERE ChannelID=" & ChannelID & SQL & "")(0)
	Set Rs = Newasp.Execute("SELECT ClassID FROM [NC_Classify] WHERE ChannelID=" & ChannelID & SQL & " ORDER BY classid ASC")
	If Rs.BOF And Rs.EOF Then
		Response.Write "<meta http-equiv=""refresh"" content=""2;url='Admin_CreateSoft.Asp?ChannelID=" & ChannelID & "&D=" & startime & "&stype=1'"">"
		Set Rs = Nothing
		Exit Sub
	End If
	Call ShowGuage
	SQL=Rs.GetRows(-1)
	NewCloud.ShowFlush = 0
	Response.Write "<ol>"
	For i=0 To Ubound(SQL,2)
		If Not Response.IsClientConnected Then ResponseEnd
		NewCloud.CreateSoftList SQL(0,i),1
		ShowInnerHTML totalnumber,i
		Newasp.Execute ("UPDATE NC_Classify SET isUpdate=0 WHERE Classid="& SQL(0,i))
		Response.Flush
	Next
	Response.Write "</ol>"
	If i=>totalnumber Then
		Response.Write "<script>table2.style.width=400;txt2.innerHTML=""完成:100"";</script>"
	End If
	Rs.Close:Set Rs = Nothing
	
	Response.Write "<meta http-equiv=""refresh"" content=""2;url='Admin_CreateSoft.Asp?ChannelID=" & ChannelID & "&D=" & startime & "&stype=1'"">"
End Sub

Sub Create_Soft_List_Page()
	Dim totalnumber
	dim a(),s,d,p,num,classid
	If Trim(Request("num")) = "" Or (Not IsArray(Session("BuildClassID"))) Then
		If Request("d") <> "" Then
			d = Newasp.CheckNumeric(Request("d"))
		Else
			d = startime
		End If
		num = Newasp.ChkNumeric(Request("num"))
		p = Newasp.ChkNumeric(Request("p"))
		If CInt(Request("field")) = 1 Then
			SQL = " And TurnLink=0  And isUpdate=1"
		ElseIf CInt(Request("field")) = 2 Then
			If Trim(Request("classid")) = "" Then
				ErrMsg = "<li>请选择分类~!</li>"
				FoundErr = True 
				Exit Sub
			End If
			SQL = " And TurnLink=0 And ClassID in(" & Request("classid") & ")"
		Else
			SQL = " And TurnLink=0"
		End If
		totalnumber = Newasp.Execute("SELECT COUNT(ClassID) FROM NC_Classify WHERE ChannelID=" & ChannelID & SQL & "")(0)
		Set Rs = Newasp.Execute("SELECT ClassID FROM [NC_Classify] WHERE ChannelID=" & ChannelID & SQL & " ORDER BY classid ASC")
		If Rs.BOF And Rs.EOF Then
			Session("BuildClassID") = ""
			Response.Write "<meta http-equiv=""refresh"" content=""2;url='Admin_CreateSoft.Asp?ChannelID=" & ChannelID & "&D=" & startime & "&stype=1'"">"
			Set Rs = Nothing
			Exit Sub
		End If
		
		SQL=Rs.GetRows(-1)
		
		For i=0 To Ubound(SQL,2)
			ReDim Preserve a(i)
			a(i)=SQL(0,i)
		Next
		
		Rs.Close:Set Rs = Nothing
		s=Join(a,"|")
		Session("BuildClassID") = Split(s, "|")
		Response.Write "<script language='JavaScript'>" & vbNewLine
		Response.Write "function build(){window.location.href='Admin_CreateSoft.Asp?action=list2&ChannelID=" & ChannelID & "&total=" & totalnumber & "&d=" & d & "&num=" & num & "&p=" & p & "';}" & vbNewLine
		Response.Write "setTimeout('build()',1000);" & vbNewLine
		Response.Write "</script>" & vbNewLine
		Response.Flush
	Else
		totalnumber = Newasp.ChkNumeric(Request("total"))
		num = Newasp.ChkNumeric(Request("num"))
		d = Newasp.CheckNumeric(Request("d"))
		p = Newasp.ChkNumeric(Request("p"))
		If p < 1 Then p = 1

		Response.Write "<br><br>" & vbNewLine
		Response.Write "<table width='400' border='0' align='center' cellpadding='0' cellspacing='0'>" & vbNewLine
		Response.Write "  <tr>" & vbNewLine
		Response.Write "    <td height='50'>总共需要生成 <font color='blue'><b>" & totalnumber & "</b></font> 个分类,正在生成第 <font color='red'><b>" & num+1 & "</b></font>  个分类……</td>" & vbNewLine
		Response.Write "  </tr>" & vbNewLine
		Response.Write "  <tr>" & vbNewLine
		Response.Write "    <td><table width='100%' border='0' cellpadding='1' cellspacing='1'>" & vbNewLine
		Response.Write "      <tr>" & vbNewLine
		Response.Write "        <td style=""border: 1px #384780 solid ;background-color: #FFFFFF;""><table width='" & Fix((num / totalnumber) * 400) & "' height='12' border='0' cellpadding='0' cellspacing='0' bgcolor=#36D91A><tr><td></td></tr></table></td>" & vbNewLine
		Response.Write "      </tr>" & vbNewLine
		Response.Write "    </table></td>" & vbNewLine
		Response.Write "  </tr>" & vbNewLine
		Response.Write "  <tr>" & vbNewLine
		Response.Write "    <td align='center'>" & FormatNumber(num / totalnumber * 100, 2, -1) & " %</td>" & vbNewLine
		Response.Write "  </tr>" & vbNewLine
		Response.Write "</table>" & vbNewLine
		Response.Write "<table width='400' border='0' align='center' cellpadding='0' cellspacing='0'>" & vbNewLine
		Response.Write "   <tr><td height='30' align='center'><input type='button' name='stop' value=' 停止生成HTML ' onclick=""window.location.href='Admin_CreateSoft.asp?ChannelID=" & ChannelID & "&stype=1&D=" & d & "&num=" & num & "';"" class=button></td></tr>" & vbNewLine
		Response.Write "</table>" & vbNewLine
		Response.Flush

		If num >= totalnumber Or num > CLng(UBound(Session("BuildClassID"))) Then
			Session("BuildClassID") = ""
			Response.Write "<meta http-equiv=""refresh"" content=""1;url='Admin_CreateSoft.Asp?ChannelID=" & ChannelID & "&stype=1&d=" & d & "&num=" & num & "'"">"
			Exit Sub
		Else
			NewCloud.MakeHtmlMode = 1
			NewCloud.ShowFlush = 1
			classid = CLng(Session("BuildClassID")(num))
			Response.Write "<ol>"
			NewCloud.CreateSoftList classid,p
			Response.Write "</ol>"
			If NewCloud.MakePageDone = 1 Then
				Newasp.Execute ("UPDATE NC_Classify SET isUpdate=0 WHERE classid="& classid)
			
				Response.Write "<script language='JavaScript'>" & vbNewLine
				Response.Write "function build(){window.location.href='Admin_CreateSoft.Asp?action=list2&ChannelID=" & ChannelID & "&total=" & totalnumber & "&d=" & d & "&num=" & num+1 & "';}" & vbNewLine
				Response.Write "setTimeout('build()',500);" & vbNewLine
				Response.Write "</script>" & vbNewLine
			Else
				
				Response.Write "<script language='JavaScript'>" & vbNewLine
				Response.Write "function build(){window.location.href='Admin_CreateSoft.Asp?action=list2&ChannelID=" & ChannelID & "&total=" & totalnumber & "&d=" & d & "&num=" & num & "&p=" & p+NewCloud.MakeListNum & "';}" & vbNewLine
				Response.Write "setTimeout('build()',500);" & vbNewLine
				Response.Write "</script>" & vbNewLine
			End If
		End If
	End If
End Sub

Sub Create_Soft_Info()
	Dim strDate,d,strLink,j
	Dim CurrentPage,page_count,totalnumber,Pcount,maxperpage
	If Trim(Request("type")) = "date" Then
		strDate = Request("datYear") & "-" & Request("datMonth") & "-" & Request("datDay")
		strLink = "type=date&datYear=" & Request("datYear") & "&datMonth=" & Request("datMonth") & "&datDay=" & Request("datDay")
		If isSqlDataBase = 1 Then
			SQL = "WHERE ChannelID=" & ChannelID & " And isAccept>0 And datediff(d,SoftTime,getdate())=" & DateDiff("d", strDate, Now()) & ""
		Else
			SQL = "WHERE ChannelID=" & ChannelID & " And isAccept>0 And SoftTime like '%" & strDate & "%'"
		End If

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?