<!-- #include file="lib.asp" -->
<html>
<head>
<title>资源库用户管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="res/style.css" type=text/css rel=stylesheet>

</head>

<body>
<%
dim ElapsedBloom,obj_union
set ElapsedBloom=new CCAPI
set obj_union=ElapsedBloom.createObject("CCAPI.CCUnion")
Select Case getForm("action","get")
	Case "reg"
		Call regist
	Case "bind"
		Call bind
	Case "edit"
		Call edit
	Case "unbind"
		Call unbind
	Case Else
		Call main
End Select
set obj_union=nothing
set ElapsedBloom=nothing

Sub regist
	If getForm("check","post")= "ok" Then
		with obj_union
			.sitename=getForm("siteName","post")
			.siteurl=getForm("siteUrl","post")
			.sitelogo=getForm("siteLogo","post")
			.sitetype=getForm("siteType","post")
			.sitemail=getForm("siteEmail","post")
			.regist()
		end with
		die()
	End If
	call head
%>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="tableBorder">
<tbody>
<form name="form1" action="?action=reg" method="post" id="form1">
<input type="hidden" name="check" value="ok">
<tr><th colspan=2>注册资源库帐户</th></tr>
<tr><td class="forumrow"><b>网站名称</b><span class="redstar">*</span></td><td class="forumrow"><input type="text" class="wordbox" size="50" name="siteName" value=""></td></tr>
<tr><td class="forumrow"><b>网站域名</b><span class="redstar">*</span></td><td class="forumrow"><input type="text" class="wordbox" size="50" name="siteUrl" value="<%=own_http()%>"  ></td></tr>
<tr><td class="forumrow"><b>联系邮件</b><span class="redstar">*</span></td><td class="forumrow"><input type="text" class="wordbox" size="50" name="siteEmail" value="" title="邮件地址将作为你的登录用户名，请正确填写 "></td></tr>
<tr><td class="forumrow"><b>站点LOGO: </b></td><td class="forumrow"><input type="text" class="wordbox" size="50" name="siteLogo" value=""></td></tr>
<tr><td class="forumrow"><b>站点类型</b><span class="redstar">*</span></td><td class="forumrow"><table width="450px" border="0"><tr><td><input type="radio" name="siteType" value="1" /> 新闻</td><td><input type="radio" name="siteType" value="2" /> 军事</td><td><input type="radio" name="siteType" value="3" /> 音乐</td><td><input type="radio" name="siteType" value="4" / checked> 影视</td><td><input type="radio" name="siteType" value="5" /> 动漫</td><td><input type="radio" name="siteType" value="6" /> 游戏</td></tr><tr><td><input type="radio" name="siteType" value="7" /> 美女</td><td><input type="radio" name="siteType" value="8" /> 娱乐</td><td><input type="radio" name="siteType" value="9" /> 交友</td><td><input type="radio" name="siteType" value="10" /> 教育</td><td><input type="radio" name="siteType" value="11" /> 艺术</td><td><input type="radio" name="siteType" value="12" /> 学术</td></tr><tr><td><input type="radio" name="siteType" value="13" /> 技术</td><td><input type="radio" name="siteType" value="14" /> 动物</td><td><input type="radio" name="siteType" value="15" /> 旅游</td><td><input type="radio" name="siteType" value="16" /> 生活</td><td><input type="radio" name="siteType" value="17" /> 时尚</td><td><input type="radio" name="siteType" value="18" /> 电脑</td></tr><tr><td><input type="radio" name="siteType" value="19" /> 汽车</td><td><input type="radio" name="siteType" value="20" /> 手机</td><td><input type="radio" name="siteType" value="21" /> 摄影</td><td><input type="radio" name="siteType" value="22" /> 戏曲</td><td><input type="radio" name="siteType" value="23" /> 外语</td><td><input type="radio" name="siteType" value="24" /> 公益</td></tr><tr><td><input type="radio" name="siteType" value="25" /> 校园</td><td><input type="radio" name="siteType" value="26" /> 数码</td><td><input type="radio" name="siteType" value="27" /> IT</td><td><input type="radio" name="siteType" value="28" /> 历史</td><td><input type="radio" name="siteType" value="29" /> 天文</td><td><input type="radio" name="siteType" value="30" /> 地理</td></tr><tr><td><input type="radio" name="siteType" value="31" /> 财经</td><td><input type="radio" name="siteType" value="32" /> 地区</td><td><input type="radio" name="siteType" value="33" /> 人物</td><td><input type="radio" name="siteType" value="34" /> 体育</td><td><input type="radio" name="siteType" value="35" /> 健康</td><td><input type="radio" name="siteType" value="36" /> 综合</td></tr><tr></tr></table></td></tr>
<tr ><td class="forumrow"><b>注册协议</b><span class="redstar">*</span></td><td class="forumrow"><input type="checkbox" name="Agreement" value="" checked>我已阅读并同意CC视频CC的<a href="http://union.bokecc.com/protocol.bo" target="_blank">注册和使用协议</a></td></tr>
<tr><td colspan=2 align="center" class="forumrow"><input type="submit" name="step" value=" 注册 " class="submit"></td></tr>
</form>
</tbody>
</table>
<%
End Sub

Sub bind
	If getForm("check","post") = "ok" Then
		with obj_union
			.sitemail=getForm("siteEmail","post")
			.siteurl=getForm("siteUrl","post")
			.ccpwd=getForm("sitePw","post")
			.bind()
		end with
		die()
	End if   	
	call head
%>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="tableBorder">
<form name="form1" action="?action=bind" method="post">
<input type="hidden" name="check" value="ok">
<tr><th colspan=2>绑定资源库帐户 </th></tr>
<tr><td align=left class="forumrow"><b>用户名 </b></td><td class="forumrow"><input type="text" class="wordbox" size="50" name="siteEmail" value="" title="有CC联盟账号可直接输入绑定。">&nbsp;<a href="?action=reg"><font color=#ff0000 size=4><strong>请先点这里注册资源库账号</strong></font></a></td></tr>
<tr><td align=left class="forumrow"><b>帐户密码</b></td><td class="forumrow"><input type="password" size="50" name="sitePw" value="" class="wordbox">&nbsp;<a href="http://union.bokecc.com/sendpassword.bo" target="_blank">忘记密码</a></td></tr>
<tr><td align=left class="forumrow"><b>绑定域名 </b></td><td class="forumrow"><input type="text" class="wordbox" size="50" name="siteUrl" value="<%=own_http()%>"></td></tr>
<tr><td colspan=2 align="center" class="forumrow"><input type="submit" name="bind" value=" 绑定 " class="submit"/></td></tr>
</form>
</table>
<%
End Sub

Function type_html(ckid)
	dim tarray(36),i
	tarray(1) = "新闻":tarray(2) = "军事":tarray(3) = "音乐":tarray(4) = "影视":tarray(5) = "动漫":tarray(6) = "游戏":tarray(7) = "美女":tarray(8) = "娱乐":tarray(9) = "交友":tarray(10) = "教育":tarray(11) = "艺术":tarray(12) = "学术":tarray(13) = "技术":tarray(14) = "动物":tarray(15) = "旅游":tarray(16) = "生活":tarray(17) = "时尚":tarray(18) = "电脑":tarray(19) = "汽车":tarray(20) = "手机":tarray(21) = "摄影":tarray(22) = "戏曲":tarray(23) = "外语":tarray(24) = "公益":tarray(25) = "校园":tarray(26) = "数码"
:tarray(27) = "IT":tarray(28) = "历史":tarray(29) = "天文":tarray(30) = "地理":tarray(31) = "财经":tarray(32) = "地区":tarray(33) = "人物":tarray(34) = "体育":tarray(35) = "健康":tarray(36) = "综合"
%>
<table width="450px" border="0">
<tr>
<%
	for i=1 to 36
%>
<td><input type="radio" name="siteType" value="<%=i%>" <%if i = ckid then echo "checked" end if%> /> <%=tarray(i)%></td>
<%
		if i mod 6 = 0 and i<>36 then
			echo "</tr><tr>"
		end if
	next
%>
</tr>
</table>
<%
end Function

Sub edit
If getForm("check","post") = "ok" Then
  	dim oldpassword,newpassword1,newpassword2
	oldpassword=getForm("oldPassword","post")
	newpassword1=getForm("newPassword1","post")
	newpassword2=getForm("newPassword2","post")
	if obj_union.comparevars(newpassword1,newpassword2)=false then
		echo pwderror1
	else
		with obj_union
			.sitename=getForm("siteName","post")
			.siteurl=getForm("siteUrl","post")
			.sitelogo=getForm("siteLogo","post")
			.sitetype=getForm("siteType","post")
			.ccpwd=newpassword1
		end with
		call obj_union.modify(oldpassword,newpassword1)
	end if
	die()	
End If
call head%>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="tableBorder">
<form name="form1" action="?action=edit" method="post">
<input type="hidden" name="check" value="ok">
<tr><th colspan=2>CC参数设置</th></tr>
<tr><td class="forumrow"><b>CC密码</b></td><td class="forumrow"><input type="password" class="wordbox" size="50" name="oldPassword" value=""> 如不修改请留空</td></tr>
<tr><td class="forumrow"><b>新密码</b></td><td class="forumrow"><input type="password" class="wordbox" size="50" name="newPassword1" value=""> 如不修改请留空</td></tr>
<tr><td class="forumrow"><b>确认密码</b></td><td class="forumrow"><input type="password" class="wordbox" size="50" name="newPassword2" value=""> 如不修改请留空</td></tr>
<tr><td class="forumrow"><b>网站名称</b></td><td class="forumrow"><input type="text" class="wordbox" size="50" name="siteName" value="" > </td></tr>
<tr><td class="forumrow"><b>网站域名</b></b></td><td class="forumrow"><input type="text" class="wordbox" size="50" name="siteUrl" value="<%=own_http()%>" ></br></tr>
<tr><td class="forumrow"><b>站点LOGO: </b></td><td class="forumrow"><input type="text" class="wordbox" size="50" name="siteLogo" value="<%=URLDecode(union_config_array(2))%>"></td></tr>
<tr><td class="forumrow"><b>站点类型</b></td><td class="forumrow">
<%=type_html(union_config_array(3))%></td></tr>
<tr><td colspan=2 align="center" class="forumrow"><input type="submit" name="step" value=" 编辑 " class="submit"></td></tr>
</form>
</table>
<%
End Sub

Sub main
If union_config_array(5) = "" Or IsNull(union_config_array(5)) Then
	response.redirect "?action=bind"
	die()
Else
call head%>
<script>
function copyCode(){
	var isIE=(navigator.userAgent.toLowerCase().indexOf('msie') >= 0 )?true:false;
	if(isIE){
		var o=document.getElementById("ubbstr");
		if(o.value==""){alert("没有地址内容");return false;}
		o.select();
		var js=o.createTextRange();
		js.execCommand("Copy");
		alert("复制成功");
	}else{
		alert("请在IE下使用复制功能！");
	}
}</script>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder">
<form name="myform" action="?action=unbind" method="post">
<tr><th colspan=2>绑定资源库帐户 </th></tr>
<tr><td align=center>你绑定的资源库帐号是:  <%=union_config_array(4)%> </td></tr>
<tr><td align=center>
<input type="submit" name="unbind" value="解除绑定 " onClick="return confirm('提示：解除绑定后将不能正常使用CC的视频功能，直到你重新绑定用户。是否解除绑定？ ')" class="submit"/>
<input type="button" name="rebind" value="修改绑定 "  class="submit"  onClick="document.location.href='?action=edit'"/>
</td></tr>
</form>
</table>
<div style="margin-top:10px" align="center">
<!--<font color="#FF0000">打开DVBBS8.2根目录中inc文件夹中的Dv_ubbcode.asp文件，搜索"Ubb转换",在搜出结果的上一行，复制粘贴下方代码(<b>为防止操作失误，可先备份该文件</b>)</font>-->
<textarea cols="130" rows="10" id="ubbstr">
'CC资源库API
If InStr(Lcase(s),"[/ccapi]")>0 Then
    re.Pattern = "\[ccapi[\s]{1}sid=(\S+)\]\[\/ccapi\]"
    s = re.Replace(s,"<scr"&"ipt src=js/uplayer.js></scr"&"ipt><scr"&"ipt>viewplay($1,'<%=union_config_array(5)%>')</scr"&"ipt>")
End if
</textarea>
<input name="button"  type="button" onClick="copyCode();" value="获取CC资源库接口代码" />
</div>
<%
End If
End Sub

Sub unbind
	obj_union.unBind()
End Sub

  
sub head
%>本功能是由CC视频提供，视频所需的存储空间和带宽等资源由CC视频提供,因而不占用您的空间和带宽。原CC用户可以直接输入您的用户名绑定马克斯资源库。<br />
CC联盟登陆地址： <a href="http://union.bokecc.com" target="_blank">http://union.bokecc.com</a><br />
<%
end sub 
%>

<div  style="margin-top:20px;" align="center">
		<table width="100%"   class="tableBorder">
		<tr><th>官方新闻(官方消息更新，如果想第一时间得到更新，请勿删除！)</th></tr>
			<tr>
				<td><script src='http://www.maxcms.net/ccapi/update.js'></script></td>
			</tr>
		</table>
</div>
</body>
</html>