<!-- #include file=../../inc/BBSsetup.asp -->
<!-- #include file=../../inc/Board_Popfun.asp -->
<!--#include file="inc/StarSetup.asp"-->
<%
DEF_BBS_HomeUrl = "../../"
BBS_SiteHead DEF_SiteNameString &" - 社区明星",GBL_board_ID," >> 社区明星"
Dim Master
InitDatabase
If CheckSupervisorUserName = 1 Then
	Master = True
Else
	Master = False
End If
CloseDatabase

If GBL_TableHeadString <> "" Then
	Response.Write "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>"
	Response.Write GBL_TableHeadString
	Response.Write "</td></tr></table>"
End If
%>
<table cellpadding=3 cellspacing=1 align=center width="<%=DEF_BBS_ScreenWidth%>" class=TBone>
<tr class=TBHead height=24>
	<td colSpan=4 align=center><b><font class=HeadFont>＝官方版LeadBBS首页明星插件 社区明星管理中心＝</font><b></td>
</tr>
<%
If GBL_CHK_User="" or Not(Master) Then
	Response.Write "<tr class=TBBG1><td><table cellpadding=3 cellspacing=4><tr><td>产生错误的原因可能是：<li>你不是管理员，无权进入！请别来捣乱！</li><li>如果你是管理员，请以管理员身份<a href='" & DEF_BBS_HomeUrl & "User/Login.asp?Relogin=Yes&u=" & urlencode(Request.Servervariables("SCRIPT_NAME") & "?" & Request.QueryString) & "'><font class=NavColor>重登录</font></a>！</li></td></tr></table></td></tr></table>"
Else
	Call Main()
End If

Sub Main()

	%>
	<tr class=TBBG1>
	<td>
		<table cellpadding=3 cellspacing=1 width=100%>
		<tr>
			<td valign=top>
				<table cellspacing="1" cellpadding="5" align="center">
				<tr>
					<td align="left" valign="middle" width="90%">
						<br> 1. 注意事项： 在下面，您将看到对当前社区明星显示方式的设定，如果想要修改，请
						<br>&nbsp; &nbsp;点击相应的单选按钮对每一行的显示方式进行自定义，自定能力更加强大！<br>
						<br>
						2. 经测算，从对首页显示的速度影响看，范围在：0.00秒——2.0秒间。每一种显示方式对速度
						<br>&nbsp; &nbsp;的影响都不一样，管理员在使用时可自己实验一下！！！<br><br>
						3. <a href=http://www.leadbbs.com/Announce/Announce.asp?BoardID=10&ID=858130 target=_blank><font color=Blue class=BlueFont>官方版LeadBBS首页明星插件最新版最新更新请点击这里</font></a></td>
				</tr>
				<tr> 
					<td>
				<br>
				<form action="admin_HomePageStar.asp" method="post">
					<%
	Dim Temp_1,Temp_2,Temp_3,Temp_4,Temp_5
	If Request.Form("submit") <> " 提交 " Then
		Temp_1 = GBL_PLUG_HPS_LineFirstType
		Temp_2 = GBL_PLUG_HPS_LineSecondType
		Temp_3 = GBL_PLUG_HPS_ShowType
		Temp_4 = GBL_PLUG_HPS_RefreshSpace
		Temp_5 = GBL_PLUG_HPS_TopMax
		%>
					<p>1. <b>第一行明星显示方式：</b><p>
					&nbsp; <input type="radio" name="GBL_PLUG_HPS_LineFirstType" value="1" <%if Temp_1="1" Then Response.Write("checked") End If%> class=fmchkbox>每日发贴量
					<input type="radio" name="GBL_PLUG_HPS_LineFirstType" value="2" <%if Temp_1="2" Then Response.Write("checked") End If%> class=fmchkbox>每周发贴量
					<input type="radio" name="GBL_PLUG_HPS_LineFirstType" value="3" <%if Temp_1="3" Then Response.Write("checked") End If%> class=fmchkbox>每月发贴量
					<input type="radio" name="GBL_PLUG_HPS_LineFirstType" value="4" <%if Temp_1="4" Then Response.Write("checked") End If%> class=fmchkbox>每年发贴量 
					<input type="radio" name="GBL_PLUG_HPS_LineFirstType" value="5" <%if Temp_1="5" Then Response.Write("checked") End If%> class=fmchkbox>发贴总数<!--
					<input type="radio" name="GBL_PLUG_HPS_LineFirstType" value="6" <%if Temp_1="6" Then Response.Write("checked") End If%> class=fmchkbox>
					最佳男明星
					<input type="radio" name="GBL_PLUG_HPS_LineFirstType" value="7" <%if Temp_1="7" Then Response.Write("checked") End If%> class=fmchkbox>
					最佳女明星--></p>
					<p>2. <b>第二行明星显示方式：</b><p>
					&nbsp; <input type="radio" name="GBL_PLUG_HPS_LineSecondType" value="1" <%if Temp_2="1" Then Response.Write("checked") End If%> class=fmchkbox>每日发贴量
					<input type="radio" name="GBL_PLUG_HPS_LineSecondType" value="2" <%if Temp_2="2" Then Response.Write("checked") End If%> class=fmchkbox>每周发贴量
					<input type="radio" name="GBL_PLUG_HPS_LineSecondType" value="3" <%if Temp_2="3" Then Response.Write("checked") End If%> class=fmchkbox>每月发贴量
					<input type="radio" name="GBL_PLUG_HPS_LineSecondType" value="4" <%if Temp_2="4" Then Response.Write("checked") End If%> class=fmchkbox>每年发贴量
					<input type="radio" name="GBL_PLUG_HPS_LineSecondType" value="5" <%if Temp_2="5" Then Response.Write("checked") End If%> class=fmchkbox>发贴总数<!--
					<input type="radio" name="GBL_PLUG_HPS_LineSecondType" value="6" <%if Temp_2="6" Then Response.Write("checked") End If%> class=fmchkbox>
					最佳男明星
					<input type="radio" name="GBL_PLUG_HPS_LineSecondType" value="7" <%if Temp_2="7" Then Response.Write("checked") End If%> class=fmchkbox>
					最佳女明星--></p>
					<p>3. <b>明显插件显示方式：</b><p>
					&nbsp; <input type="radio" name="GBL_PLUG_HPS_ShowType" value="0" <%if Temp_3="0" Then Response.Write("checked") End If%> class=fmchkbox>禁止显示
					<input type="radio" name="GBL_PLUG_HPS_ShowType" value="1" <%if Temp_3="1" Then Response.Write("checked") End If%> class=fmchkbox>正常显示两行
					<input type="radio" name="GBL_PLUG_HPS_ShowType" value="2" <%if Temp_3="2" Then Response.Write("checked") End If%> class=fmchkbox>只显示第一行
					<input type="radio" name="GBL_PLUG_HPS_ShowType" value="3" <%if Temp_3="3" Then Response.Write("checked") End If%> class=fmchkbox>只显示第二行
					<p>4. <b>明显插件刷新间隔：</b><p>
					&nbsp; <input type="text" size=3 maxlength=3 name="GBL_PLUG_HPS_RefreshSpace" value="<%=Temp_4%>" class=fminpt>分钟，为了你的网站更快速及各虚拟主机商利益，要求最少为5分钟，最多50分钟
					<p>5. <b>显示明星记录条数：</b><p>
					&nbsp; <input type="text" size=2 maxlength=2 name="GBL_PLUG_HPS_TopMax" value="<%=Temp_5%>" class=fminpt> 最少为3条，最多只能设置为50条
					<br>
					<br>
					<input type="submit" name="Submit" value=" 提交 " class=fmbtn>
					<input type="reset" name="Submit2" value=" 重置 " class=fmbtn>
					</p><%
	Else
		Temp_1 = Left(Trim(Request.Form("GBL_PLUG_HPS_LineFirstType")),14)
		Temp_2 = Left(Trim(Request.Form("GBL_PLUG_HPS_LineSecondType")),14)
		Temp_3 = Left(Trim(Request.Form("GBL_PLUG_HPS_ShowType")),14)
		Temp_4 = Left(Trim(Request.Form("GBL_PLUG_HPS_RefreshSpace")),14)
		Temp_5 = Left(Trim(Request.Form("GBL_PLUG_HPS_TopMax")),14)
		If isNumeric(Temp_1) = 0 then Temp_1 = 0
		If isNumeric(Temp_2) = 0 then Temp_2 = 0
		If isNumeric(Temp_3) = 0 then Temp_3 = 0
		If isNumeric(Temp_4) = 0 then Temp_4 = 5
		Temp_4 = Fix(cCur(Temp_4))
		If Temp_4 < 5 Then Temp_4 = 5
		If Temp_4 > 50 Then Temp_4 = 50
		
		If isNumeric(Temp_5) = 0 then Temp_5 = 5
		Temp_5 = Fix(cCur(Temp_5))
		If Temp_5 < 3 Then Temp_5 = 3
		If Temp_5 > 50 Then Temp_5 = 50
		
		Dim WriteString
		WriteString = ""
		WriteString = WriteString & "<%" & VbCrLf
		WriteString = WriteString & "const GBL_PLUG_HPS_LineFirstType = " & Temp_1 & VbCrLf
		WriteString = WriteString & "const GBL_PLUG_HPS_LineSecondType = " & Temp_2 & VbCrLf
		WriteString = WriteString & "const GBL_PLUG_HPS_ShowType = " & Temp_3 & VbCrLf
		WriteString = WriteString & "const GBL_PLUG_HPS_RefreshSpace = " & Temp_4 & VbCrLf
		WriteString = WriteString & "const GBL_PLUG_HPS_TopMax = " & Temp_5 & VbCrLf & VbCrLf
        WriteString = WriteString & "'####################################################################" & VbCrLf
		WriteString = WriteString & "'##" & VbCrLf
        WriteString = WriteString & "'##　　社区明星显示方式设置!如你的服务器不支持FSO，请手动修改显示方式!" & VbCrLf
		WriteString = WriteString & "'##　　1为每日发贴量，2为每周发贴量，3为每月发贴量，4为每年发贴量，5为发贴总数，6为最佳男明星，7为最佳女明星" & VbCrLf
		WriteString = WriteString & "'##　　此明星程序由gafc改自由Ivan 编写的动网6.1插件，适合LeadBBS3.14!" & VbCrLf
		WriteString = WriteString & "'##　　此程序最后由管理人员整理更新，时间2004-03-20 16:50 LeadBBS社区明星 for 3.14" & VbCrLf
		WriteString = WriteString & "'##　　切勿随意手工更改上面的位置!" & VbCrLf
		WriteString = WriteString & "'##　　使用前请先看安装说明!" & VbCrLf
		WriteString = WriteString & "'##　　主页：http://gafc.9126.com/" & VbCrLf
		WriteString = WriteString & "'##　　官方主页：http://www.LeadBBS.com/" & VbCrLf
		WriteString = WriteString & "'##　　感谢您使用本插件!" & VbCrLf
		WriteString = WriteString & "'##" & VbCrLf
		WriteString = WriteString & "'####################################################################" & VbCrLf

		WriteString = WriteString & "%" & chr(62) & VbCrLf
		ADODB_SaveToFile WriteString,"Inc/StarSetup.asp"
		
		If GBL_CHK_TempStr = "" Then
			Response.Write "<br><font color=Green class=GreenFont>2.成功完成设置！</font>"
			Response.Write("恭喜您，明星社区显示方式已经设定完毕！！！"&"<br><br><br>")
        	Response.Write("<input type=button value=' 重新设置 ' onclick=window.location.href='admin_HomePageStar.asp' class=fminpt>")
		Else
			%><%=GBL_CHK_TempStr%><br>服务器不支持在线写入文件功能，请使用FTP等功能，将<font color=Red Class=RedFont>Inc/StarSetup.asp</font>文件替换成框中内容(注意备份)<p>
			<textarea name="fileContent" cols="80" rows="30" class=fmtxtra><%=Server.htmlencode(WriteString)%></textarea><%
			GBL_CHK_TempStr = ""
		End If
	End If
	%>
						</td>
					</tr>
					</table>
					</form>
				</td>
			</tr>
			</table>
		</td>
	</tr>
	</table>
<%
	Set Application(DEF_MasterCookies & "_PLUG_HPS_DAY") = Nothing
	Application(DEF_MasterCookies & "_PLUG_HPS_DAY") = ""
	Set Application(DEF_MasterCookies & "_PLUG_HPS_OTHER") = Nothing
	Application(DEF_MasterCookies & "_PLUG_HPS_OTHER") = ""
	Application(DEF_MasterCookies & "_PLUG_HPS_M") = ""

End Sub

If GBL_TableBottomString <> "" Then %><table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=0 cellpadding=0 align=center><tr><td><%=GBL_TableBottomString%></td></tr></table><% End If %>
<%
SiteBottom
If GBL_ShowBottomSure = 0 Then GBL_SiteBottomString = ""
If GBL_SiteBottomString <> "" Then Response.Write GBL_SiteBottomString


'存储内容到文件
Sub ADODB_SaveToFile(ByVal strBody,ByVal File)

	On Error Resume Next
	Dim objStream,FSFlag,fs,WriteFile
	FSFlag = 1
	If DEF_FSOString <> "" Then
		Set fs = Server.CreateObject(DEF_FSOString)
		If Err Then
			FSFlag = 0
			Err.Clear
			Set fs = Nothing
		End If
	Else
		FSFlag = 0
	End If
	
	If FSFlag = 1 Then
		Set WriteFile = fs.CreateTextFile(Server.MapPath(File),True)
		WriteFile.Write strBody
		WriteFile.Close
		Set Fs = Nothing
	Else
		Set objStream = Server.CreateObject("ADODB.Stream")
		If Err.Number=-2147221005 Then 
			GBL_CHK_TempStr = "<div align='center'>您的主机不支持ADODB.Stream，无法完成操作，请手工进行</div>"
			Err.Clear
			Set objStream = Noting
			Exit Sub
		End If
		With objStream
			.Type = 2
			.Open
			.Charset = "GB2312"
			.Position = objStream.Size
			.WriteText = strBody
			.SaveToFile Server.MapPath(File),2
			.Close
		End With
		Set objStream = Nothing
	End If
	If Err Then
		GBL_CHK_TempStr = "<br>错误信息：" & err.description & "<br>其它可能：确定是否对此文件有写入权限."
		err.Clear
		Set Fs = Nothing
		Exit Sub
	End If

End Sub
%>