<%
if userfb<>"yes" then
response.write"<SCRIPT language=JavaScript>alert(' 错误提示：\n\n参数非法！非法操作！！\n\n系统设置会员不能发表 ！');"
response.write"JavaScript:window.close()</SCRIPT>"
response.end
end if
if UserLogined<>True then
	response.write"<SCRIPT language=JavaScript>alert(' 请登陆后操作 ，请返回 ！');"
	response.write"javascript:history.go(-1)</SCRIPT>"
	response.end
else
dim action:action=Request.QueryString("action")
if action="news" then start="会员中心 >> 发布新闻"
if action="art" then start="会员中心 >> 发表文章"
if action="dj" then start="会员中心 >> 发布歌曲"
if action="pic" then start="会员中心 >> 上传图片"
if action="down" then start="会员中心 >> 发布软件"
if action="web" then start="会员中心 >> 推荐网站"
if action="shop" then start="会员中心 >> 发布产品"
if action="" then start="会员中心 >> 发表文章"
end if
dim tit_fir
'=================================================
'过程名：main_put
'作  用：显示发表位置导航
'参  数：无
'=================================================
sub main_put()
Response.Write "<table border=0 Cellspacing='10' Cellpadding='1' align='Center'>" & vbCrLf
Response.Write "<tr>" & vbCrLf
if usernews="yes" then
Response.Write "<td><a href='?action=news'>"
if action="news" then response.write "<font color=red>"
Response.Write "发布新闻</font></a></td>"
end if
if userart="yes" then
Response.Write "<td><a href='?action=art'>"
if action="art" or action="" then response.write "<font color=red>"
Response.Write "发表文章</font></a></td>"
end if
if userdj="yes" then
Response.Write "<td><a href='?action=dj'>"
if action="dj" then response.write "<font color=red>"
Response.Write "发布音乐</font></a></td>"
end if
if userdown="yes" then
Response.Write "<td><a href='?action=down'>"
if action="down" then response.write "<font color=red>"
Response.Write "发布软件</font></a></td>"
end if
if userpic="yes" then
Response.Write "<td><a href='?action=pic'>"
if action="pic" then response.write "<font color=red>"
Response.Write "上传贴图</font></a></td>"
end if
if userweb="yes" then
Response.Write "<td><a href='?action=web'>"
if action="web" then response.write "<font color=red>"
Response.Write "推荐网站</font></a></td>"
end if
if usershop="yes" then
Response.Write "<td><a href='?action=shop'>"
if action="shop" then response.write "<font color=red>"
Response.Write "发布产品</font></a></td>"
end if
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
end sub

'=================================================
'过程名：content_put
'作  用：显示发表内容、表单
'参  数：无
'=================================================
sub content_put()
Response.Write "<form name=form2 action='?action="&action&"' method=post onsubmit=""javascript:frm_submitonce(this);"">" & vbCrLf
Response.Write "<input type=hidden name=chk value='yes'>" & vbCrLf
select case action
case "news"
  tit_fir="新闻"
  if usernews="yes" then
    call put_news()
  else
    call put_close("发布")
  end if
case "art"
  tit_fir="文章"
  if userart="yes" then
    call put_art()
  else
    call put_close("发表")
  end if
case "dj"
  tit_fir="音乐"
  if userdj="yes" then
    call put_dj()
  else
    call put_close("发布")
  end if
case "down"
  tit_fir="软件"
  if userdown="yes" then
    call put_down()
  else
    call put_close("发布")
  end if
case "pic"
  tit_fir="图片"
  if userpic="yes" then
    call put_pic()
  else
    call put_close("发布")
  end if
case "web"
  tit_fir="网站"
  if userweb="yes" then
    call put_web()
  else
    call put_close("推荐")
  end if
case "shop"
  tit_fir="产品"
  if usershop="yes" then
    call put_shop()
  else
    call put_close("发布")
  end if
case else
  action="art"
  tit_fir="文章"
  if userart="yes" then
    call put_art()
  else
    call put_close("发表")
  end if
end select
Response.Write "</form>"
end sub


'=================================================
'过程名：put_web
'作  用：显示发表酷站
'参  数：无
'=================================================
sub put_web()
  dim name,url,pic,desc,csid,username,uppic
  if chk() then
    name=CheckStr(code_admin("name",1,50))
    url=CheckStr(code_admin("url",1,100))
    pic=CheckStr(code_admin("pic",1,100))
    desc=CheckStr(code_admin("desc",1,200))
    csid=trim(request.form("c_id"))
    if not isInteger(csid) then
      call admin_error("请选择 "&tit_fir&"类型 ！")
      exit sub
    end if
    if name="" or url="" or pic="" or desc="" then
      call admin_error(tit_fir&"名称、地址、图片和说明 不能为空！")
      exit sub
    end if
    username=code_admin("tjuser",1,20)
    set rs=server.CreateObject("adodb.recordset")
    rs.open "select cs_name,cs_url from coolsites where cs_name='"&name&"' or cs_url='"&url&"'",conn,1,1
    if not rs.eof and not rs.bof then
	   	   response.write"<SCRIPT language=JavaScript>alert('错误提示：\n\n① 此酷站已提交过，正等待审核通过，请不要重复提交!\n\n② 您提交的酷站已经存在，感谢你的支持!');"
	           response.write"this.top.location.href='User_put.asp?action=web';</SCRIPT>"
		   Response.End
    rs.close
    end if
    sql="select * from coolsites"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
    rs.addnew
    rs("tjuser")=username
    rs("cs_name")=name
    rs("cscat_id")=csid
    rs("cs_url")=url
    rs("cs_pic")=pic
    rs("cs_desc")=desc
    if fbpass<>"yes" or (Hx66_Grade=1 and vippass<>"yes") then
    rs("passed")=0
    sql="UPDATE [user] SET points = points + "&fbpoints&" where username='"&username&"'"
    conn.execute (sql)
    else
    rs("passed")=1
    end if
    uppic=right(pic,len(pic)-7)
    conn.execute("update [upload] set webtype='酷站',totable=1,url='"&name&"' where filename='"&uppic&"' and totable=0")
    rs.update
    rs.close
    call user_msg("推荐")
    exit sub
  end if
call form_first()
%>
<table bgcolor="#ffffff" borderColor="#f0f0f0" Border="1" Cellspacing="0" Cellpadding="5" width="100%" align="Center" style="border-collapse: collapse">
  <tr> 
     <td width="17%">站点名称</td>
     <td><input type="text" name="name" size="65" class="input"></td>
  </tr>
  <tr> 
     <td>所属分类</td>
     <td><select name="c_id" class="input">
<%
sql="select * from cscat"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof%><option value="<%=rs("cscat_id")%>"><%=rs("cscat_name")%></option>
<%
rs.movenext
loop
if rs.eof and rs.bof then%><option value="0">当前没有酷站分类</option>
<%end if%>
</select></td>
  </tr>
  <tr> 
     <td>站点地址</td>
     <td><input type="text" name="url" size="65" class="input"></td>
  </tr>
  <tr> 
     <td>图片地址</td>
     <td><input type="text" name="pic" size="65" class="input"></td>
  </tr>
  <tr> 
     <td>图片上传</td>
     <td><IFRAME name=ad src="user_upload.asp?action=pic" frameBorder=0 width="100%" scrolling=no height=25></IFRAME></td>
  </tr>
  <tr> 
     <td>站点介绍</td>
     <td><textarea name="desc" cols="63" rows="8" class="input"></textarea></td>
  </tr>
  <tr> 
     <td>提交会员</td>
     <td><input type="hidden" name="tjuser" value="<%=Hx66_name%>"><%=Hx66_name%></td>
  </tr>          
  <tr align="center"> 
     <td colspan="2" height="30">
     <input type="submit" name="Submit" value="确定新增" class="input">
     <input type="reset" name="Reset" value="清空重填"  class="input"></td>          
  </tr>
</table>
<%
end sub

'=================================================
'过程名：put_dj
'作  用：显示发表音乐
'参  数：无
'=================================================
sub put_dj()
  dim name,djname,url,csid,types,grades,word,dGrade,dpoints,username,upurl
  if chk() then
    name=CheckStr(code_admin("name",1,50))
    djname=CheckStr(code_admin("djname",1,50))
    csid=trim(request.form("c_id"))
    types=CheckStr(code_admin("types",1,6))
    grades=CheckStr(code_admin("grades",1,5))
    url=CheckStr(code_admin("url",1,250))
    word=CheckStr(code_admin("word",1,1000))
    dGrade=trim(request.form("dGrade"))
    dpoints=trim(request.form("dpoints"))
    if not isInteger(csid) then
      call admin_error("请选择 "&tit_fir&"类型 ！")
      exit sub
    end if
    if name="" or djname="" or url="" or word="" then
      call admin_error(tit_fir&"名称、歌手、地址和歌词 不能为空！")
      exit sub
    end if
    username=code_admin("tjuser",1,20)
    set rs=server.CreateObject("adodb.recordset")
    rs.open "select dj_name,dj_url from dj where dj_name='"&name&"' or dj_url='"&url&"'",conn,1,1
    if not rs.eof and not rs.bof then
	   	   response.write"<SCRIPT language=JavaScript>alert('错误提示：\n\n① 此音乐已提交过，正等待审核通过，请不要重复提交!\n\n② 您提交的音乐已经存在，感谢你的支持!');"
	           response.write"this.top.location.href='User_put.asp?action=dj';</SCRIPT>"
		   Response.End
    rs.close
    end if
    sql="select * from dj"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
    rs.addnew
    rs("tjuser")=username
    rs("dj_name")=name
    rs("dj_user")=djname
    rs("djcat_id")=csid
    rs("dj_url")=url
    rs("dj_pic")=types
    rs("dj_desc")=grades
    rs("dj_word")=word
    rs("Grade")=cint(dGrade)
    if cint(dGrade)=0 then
    rs("points")=0
    else
    rs("points")=cint(dpoints)
    end if
    if fbpass<>"yes" or (Hx66_Grade=1 and vippass<>"yes") then
    rs("passed")=0
    sql="UPDATE [user] SET points = points + "&fbpoints&" where username='"&username&"'"
    conn.execute (sql)
    else
    rs("passed")=1
    end if
    upurl=right(url,len(url)-7)
    conn.execute("update [upload] set webtype='音乐',totable=1,url='"&name&"' where filename='"&upurl&"' and totable=0")
    rs.update
    rs.close
    call user_msg("发布")
    exit sub
  end if
call form_first()
%>
<table bgcolor="#ffffff" borderColor="#f0f0f0" Border="1" Cellspacing="0" Cellpadding="5" width="100%" align="Center" style="border-collapse: collapse">
  <tr> 
     <td width="17%">歌曲名称</td>
     <td><input type="text" name="name" size="65" class="input"></td>
  </tr>
  <tr> 
     <td>歌手名字</td>
     <td><input type="text" name="djname" size="30" value="小俊家园" class="input"></td>
  </tr>
  <tr> 
     <td>歌曲选项</td>
     <td><select name="c_id" class="input">
<%
sql="select * from djcat where sid=0"
set rs1=conn.execute(sql)
do while not rs1.eof
response.write "<optgroup label='"&rs1("djcat_name")&"'>"
sql="select * from djcat where sid="&rs1("djcat_id") 
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
%>
     <option value="<%=rs2("djcat_id")%>">├ <%=rs2("djcat_name")%></option>
<%
rs2.movenext
loop
rs1.movenext
loop
rs1.close
set rs1=nothing
%></select>
<select name="types" class="input">
     <option value="asf">播放类型</option>
     <option value="mtv">MTV影视</option>
     <option value="asf">ASF音乐</option>
     <option value="asfmtv">ASF影视</option>
     <option value="rm">RAM音乐</option>
     <option value="rmmtv">RAM影视</option>
     <option value="flash">FLASH动画</option>
 </select>              
<select name="grades" class="input">
     <option value="☆☆★★★">推荐等级</option>
     <option value="☆☆☆☆★">☆☆☆☆★</option>
     <option value="☆☆☆★★">☆☆☆★★</option>
     <option value="☆☆★★★">☆☆★★★</option>
     <option value="☆★★★★">☆★★★★</option>
     <option value="★★★★★">★★★★★</option>
</select></td>
  </tr>
  <tr> 
     <td>视听地址</td>
     <td><input type="text" name="url" size="65" class="input"></td>
  </tr>
  <tr> 
     <td>音乐上传</td>
     <td><IFRAME name=upload_frame src="user_upload.asp?action=url" frameBorder=0 width="100%" scrolling=no height=25></IFRAME></td>
  </tr>
  <tr> 
     <td>添加歌词</td>
     <td><textarea rows="8" name="Word" cols="63" class="input">暂无歌词</textarea></td>
  </tr>
  <tr>
     <td>下载权限</td>
     <td><select name="dGrade" id="dGrade" class="input">
         <option value="0">游客下载</option>
         <option value="1">普通用户</option>
         <option value="2">VIP 用户</option>
         </select>&nbsp;&nbsp;下载所需会员积分数：<input type="text" name="dpoints" size="5" value="0" class="input"> *正整数数字. </td>
  </tr>
  <tr> 
     <td>提交会员</td>
     <td><input type="hidden" name="tjuser" value="<%=Hx66_name%>"><%=Hx66_name%></td>
  </tr>          
  <tr align="center"> 
     <td colspan="2" height="30">              
         <input type="submit" name="Submit" value="确定新增" class="input">
         <input type="reset" name="Reset" value="清空重填" class="input"></td>
  </tr>
</table>
<table cellspacing="1" border="0" width="530" cellpadding="4" align=center >
  <tr>
      <td>类型说明</td>
  </tr>
  <tr>
      <td>1."<FONT COLOR="#FF0000">.mp3.mid.wma.asf</FONT>"纯音乐文件请选择<FONT COLOR="#0000FF">ASF音乐</FONT>类型<br>
          2."<FONT COLOR="#FF0000">.wmv.asf.mpg.avi</FONT>"影视文件选择<FONT COLOR="#0000FF">ASF影视</FONT>类型.<br>
          3."<FONT COLOR="#FF0000">.ram.rm</FONT>"纯音乐文件请选择<FONT COLOR="#0000FF">RAM音乐</FONT>类型<br>
          4."<FONT COLOR="#FF0000">.ram.rm</FONT>"影视文件请选择<FONT COLOR="#0000FF">RAM影视</FONT>类型<br>
          5."<FONT COLOR="#FF0000">.swf</FONT>"动画文件请选择<FONT COLOR="#0000FF">FLASH动画</FONT>类型 <br>
          6.<span class="style2">MTV影视可以播放大部分影视文件</span></td>
  </tr>
</table>
<%
end sub

'=================================================
'过程名：put_pic
'作  用：显示发表图片
'参  数：无
'=================================================
sub put_pic()
  dim name,pic,desc,csid,username,uppic
  if chk() then
    name=CheckStr(code_admin("name",1,50))
    pic=CheckStr(code_admin("pic",1,100))
    desc=CheckStr(code_admin("desc",1,200))
    csid=trim(request.form("c_id"))
    if not isInteger(csid) then
      call admin_error("请选择 "&tit_fir&"类型 ！")
      exit sub
    end if
    if name="" or pic="" or desc="" then
      call admin_error(tit_fir&"名称、地址和说明 不能为空！")
      exit sub
    end if
    username=code_admin("tjuser",1,20)
    set rs=server.CreateObject("adodb.recordset")
    rs.open "select pic_name,pic_pic from pic where pic_name='"&name&"' or pic_pic='"&pic&"'",conn,1,1
if not rs.eof and not rs.bof then
	   	   response.write"<SCRIPT language=JavaScript>alert('错误提示：\n\n① 此图片已提交过，正等待审核通过，请不要重复提交!\n\n② 您提交的图片已经存在，感谢你的支持!');"
	           response.write"this.top.location.href='User_put.asp?action=pic';</SCRIPT>"
		   Response.End
    rs.close
    end if
    sql="select * from pic"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
    rs.addnew
    rs("tjuser")=username
    rs("pic_name")=name
    rs("piccat_id")=csid
    rs("pic_spic")=pic
    rs("pic_pic")=pic
    rs("pic_desc")=desc
    if fbpass<>"yes" or (Hx66_Grade=1 and vippass<>"yes") then
    rs("passed")=0
    sql="UPDATE [user] SET points = points + "&fbpoints&" where username='"&username&"'"
    conn.execute (sql)
    else
    rs("passed")=1
    end if
    uppic=right(pic,len(pic)-7)
    conn.execute("update [upload] set webtype='图片',totable=1,url='"&name&"' where filename='"&uppic&"' and totable=0")
    rs.update
    rs.close
    call user_msg("上传")
    exit sub
  end if
call form_first()
%>
<table bgcolor="#ffffff" borderColor="#f0f0f0" Border="1" Cellspacing="0" Cellpadding="5" width="100%" align="Center" style="border-collapse: collapse">
  <tr> 
    <td width="17%">图片名称</td>
    <td> <input type="text" name="name" size="65" class="input"></td>
  </tr>
  <tr> 
    <td>所属分类</td>
    <td><select name="c_id" class="input">
<%
sql="select * from piccat where sid=0"
set rs1=conn.execute(sql)
do while not rs1.eof
response.write "<optgroup label='"&rs1("piccat_name")&"'>"
sql="select * from piccat where sid="&rs1("piccat_id") 
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
%>
         <option value="<%=rs2("piccat_id")%>">├ <%=rs2("piccat_name")%></option>
<%
rs2.movenext
loop
rs1.movenext
loop
rs1.close
set rs1=nothing%>
</select></td>
  </tr>
  <tr> 
     <td>图片地址</td>
     <td><input type="text" name="pic" size="65" class="input"></td>
  </tr>
  <tr> 
     <td>图片上传</td>
     <td><IFRAME name=ad src="user_upload.asp?action=pic" frameBorder=0 width="100%" scrolling=no height=25></IFRAME></td>
  </tr>
  <tr> 
     <td>图片介绍</td>
     <td><textarea name="desc" cols="63" rows="6" class="input">图片版权归图片本人所有,未经同意不得转载!</textarea></td>
  </tr>
  <tr> 
     <td>提交会员</td>
     <td><input type="hidden" name="tjuser" value="<%=Hx66_name%>"><%=Hx66_name%></td>
  </tr>          
  <tr align="center"> 
     <td colspan="2" height="30"> 
        <input type="submit" name="Submit" value="确定新增" class="input"> 
        <input type="reset" name="Reset" value="清空重填" class="input"></td>
  </tr>
</table>
<%
end sub

'=================================================
'过程名：put_art
'作  用：显示发表文章
'参  数：无
'=================================================
sub put_art()
  dim name,artname,aahome,csid,akeyword,pic,content,dGrade,dpoints,username,uppic
  if chk() then
    name=CheckStr(code_admin("name",1,50))
    artname=CheckStr(code_admin("artname",1,50))
    aahome=CheckStr(code_admin("aahome",1,50))
    csid=trim(request.form("c_id"))
    akeyword=CheckStr(code_admin("akeyword",1,50))
    pic=CheckStr(code_admin("pic",1,100))
    content=code_admin("content",1,100000)
    dGrade=trim(request.form("dGrade"))
    dpoints=trim(request.form("dpoints"))
    if not isInteger(csid) then
      call admin_error("请选择 "&tit_fir&"类型 ！")
      exit sub
    end if
    if name="" or artname="" or aahome="" or content="" then
      call admin_error(tit_fir&"标题、作者、来源和内容 不能为空！")
      exit sub
    end if
    if strLength(content)>artmax then
      call admin_error(tit_fir&"内容太长 不可以超过"&artmax&"个字符！！")
      exit sub
    end if
    username=code_admin("tjuser",1,20)
    set rs=server.CreateObject("adodb.recordset")
    rs.open "select art_title from art where art_title='"&name&"'",conn,1,1
    if not rs.eof and not rs.bof then
	   	   response.write"<SCRIPT language=JavaScript>alert('错误提示：\n\n① 此文章已提交过，正等待审核通过，请不要重复提交!\n\n② 您提交的文章已经存在，感谢你的支持!');"
	           response.write"this.top.location.href='User_put.asp?action=art';</SCRIPT>"
		   Response.End
    rs.close
    end if
    sql="select * from art"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
    rs.addnew
    rs("tjuser")=username
    rs("art_title")=name
    rs("art_author")=artname
    rs("art_ahome")=aahome
    rs("cat_id")=csid 
    rs("art_keyword")=akeyword  
    rs("art_content")=content
    rs("Grade")=cint(dGrade)
    if cint(dGrade)=0 then
    rs("points")=0
    else
    rs("points")=cint(dpoints)
    end if
    if fbpass<>"yes" or (Hx66_Grade=1 and vippass<>"yes") then
    rs("passed")=0
    sql="UPDATE [user] SET points = points + "&fbpoints&" where username='"&username&"'"
    conn.execute (sql)
    else
    rs("passed")=1
    end if
    if pic<>"" then
    rs("images")=pic
    rs("isimg")=1
    uppic=right(pic,len(pic)-7)
    conn.execute("update [upload] set webtype='文章',totable=1,url='"&name&"' where filename='"&uppic&"' and totable=0")
    end if
    rs.update
    rs.close
    call user_msg("发表")
    exit sub
  end if
call form_first()
%>
<table bgcolor="#ffffff" borderColor="#f0f0f0" Border="1" Cellspacing="0" Cellpadding="5" width="100%" align="Center" style="border-collapse: collapse">
    <tr> 
      <td width="17%">标题名称</td>
      <td><input type="text" name="name" size="65" class="input"> 
      </td>
    </tr>
    <tr> 
      <td>文章作者</td>
      <td><input name="artname" type="text" id="writer" size="20" class="input">&nbsp;<button onClick="writer.value='佚名'" class="input">佚名</button>&nbsp;<button onClick="writer.value='网络'" class="input">网络</button>&nbsp;<button onClick="writer.value='<%=Hx66_name%>'" class="input"><%=Hx66_name%></button>
      </td>
     </tr>
     <tr> 
      <td>文章来源</td>
      <td> <input name="aahome" type="text" id="writer1" size="28" class="input">&nbsp;<button onClick="writer1.value='转摘'" class="input">转摘</button>&nbsp;<button onClick="writer1.value='原创'" class="input">原创</button></button>
     </td>
    </tr>
    <tr> 
      <td>所属分类</td>
      <td><select name="c_id" class="input">
<%
sql="select * from a_cat where sid=0"
set rs1=conn.execute(sql)
do while not rs1.eof
response.write "<optgroup label='"&rs1("cat_name")&"'>"
sql="select * from a_cat where sid="&rs1("cat_id") 
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
%>
      <option value="<%=rs2("cat_id")%>">├ <%=rs2("cat_name")%></option>
<%
rs2.movenext
loop
rs1.movenext
loop
rs1.close
set rs1=nothing%>
</select>&nbsp;&nbsp;关键字 
<input type="text" name="akeyword" size="18" class="input">&nbsp;多个用 | 隔开。</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2" align="center"> <script language="Javascript1.2"><!-- // load htmlarea
_editor_url = "Editor/";                     // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
  document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
  document.write(' language="Javascript1.2"></scr' + 'ipt>');  
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script>
<textarea name="content" style="width:540; height:250" id="content"></textarea>
<script language="javascript1.2">
editor_generate('content');
</script>
      </td>
    </tr>
    <tr>
      <td>阅读等级</td>
      <td><select name="dGrade" id="Grade" class="input">
        <option value="0">游客可读</option>
        <option value="1">普通用户</option>
        <option value="2">VIP 用户</option>
        </select>&nbsp;&nbsp;阅读所需会员积分数：<input type="text" name="dpoints" size="5" value="0" class="input"> *正整数数字</td>
    </tr>
    <tr> 
      <td>提交会员</td>
      <td><input type="hidden" name="tjuser" value="<%=Hx66_name%>"><%=Hx66_name%></td>
    </tr>  
  <tr> 
     <td>文章图片</td>
     <td><input type="text" name="pic" size="65" class="input"></td>
  </tr>
  <tr> 
     <td>图片上传</td>
     <td><IFRAME name=upload_frame src="user_upload.asp?action=pic" frameBorder=0 width="100%" scrolling=no height=25></IFRAME></td>
  </tr>
    <tr align="center"> 
       <td colspan="2" height="30">
        <input type="submit" name="Submit" value="确定新增" class="input"> 
        <input type="reset" name="Reset" value="清空重填" class="input"></td>
    </tr>
</table>
<%
end sub

'=================================================
'过程名：put_down
'作  用：显示发表软件
'参  数：无
'=================================================
sub put_down()
  dim name,size,mode,roof,commend,csid,demo,home,url,desc,pic,dGrade,dpoints,username,uppic,upurl
  if chk() then
    name=CheckStr(code_admin("name",1,50))
    size=CheckStr(code_admin("size",1,10))
    mode=CheckStr(code_admin("mode",1,10))
    roof=CheckStr(code_admin("roof",1,30))
    commend=CheckStr(code_admin("commend",1,50))
    csid=trim(request.form("c_id"))
    demo=CheckStr(code_admin("demo",1,100))
    home=CheckStr(code_admin("home",1,100))
    url=CheckStr(code_admin("url",1,100))
    desc=CheckStr(code_admin("desc",1,5000))
    pic=CheckStr(code_admin("pic",1,100))
    dGrade=trim(request.form("dGrade"))
    dpoints=trim(request.form("dpoints"))
    if not isInteger(csid) then
      call admin_error("请选择 "&tit_fir&"类型 ！")
      exit sub
    end if
    if name="" or url="" or desc="" then
      call admin_error(tit_fir&"名称、简介和地址 不能为空！")
      exit sub
    end if
    username=code_admin("tjuser",1,20)
    set rs=server.CreateObject("adodb.recordset")
    rs.open "select soft_name,soft_url1 from soft where soft_name='"&name&"' or soft_url1='"&url&"'",conn,1,1
    if not rs.eof and not rs.bof then
	   	   response.write"<SCRIPT language=JavaScript>alert('错误提示：\n\n① 此资源已提交过，正等待审核通过，请不要重复提交!\n\n② 您提交的资源已经存在，感谢你的支持!');"
	           response.write"this.top.location.href='User_put.asp?action=down';</SCRIPT>"
		   Response.End
    rs.close
    end if
    sql="select * from soft"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
    rs.addnew
    rs("tjuser")=username
    rs("soft_name")=name
    rs("soft_size")=size
    rs("soft_mode")=mode
    rs("soft_roof")=roof
    rs("soft_commend")=commend
    rs("soft_demo")=demo
    rs("soft_home")=home
    rs("soft_showpic")=pic
    rs("soft_desc")=desc
    rs("soft_url1")=url
    if csid<>"" then
        Set rsclass = Server.CreateObject("ADODB.Recordset")
        sqlclass="SELECT * FROM d_class where class_id="&csid
        rsclass.OPEN sqlclass,Conn,1,1
	rs("soft_classid")=rsclass("class_id")
	rs("soft_classname")=rsclass("class_name")
	rs("soft_catid")=rsclass("cat_id")
	set rscat = Server.CreateObject("ADODB.Recordset")
	sqlcat="select cat_name from d_cat where cat_id="&rsclass("cat_id")
	rscat.open sqlcat,conn,1,1
	rs("soft_catname")=rscat("cat_name")
	rscat.close
	rsclass.close
	set rscat=nothing
	set rsclass=nothing
    end if
    rs("Grade")=cint(dGrade)
    if cint(dGrade)=0 then
    rs("points")=0
    else
    rs("points")=cint(dpoints)
    end if
    if fbpass<>"yes" or (Hx66_Grade=1 and vippass<>"yes") then
    rs("passed")=0
    sql="UPDATE [user] SET points = points + "&fbpoints&" where username='"&username&"'"
    conn.execute (sql)
    else
    rs("passed")=1
    end if
        if pic<>"" then
       uppic=right(pic,len(pic)-7)
    else
       uppic="http://"
    end if
    upurl=right(url,len(url)-7)
    conn.execute("update [upload] set webtype='软件',totable=1,url='"&name&"' where (filename='"&uppic&"' or filename='"&upurl&"') and totable=0")
    rs.update
    rs.close
    call user_msg("发布")
    exit sub
  end if
call form_first()
%>
<table bgcolor="#ffffff" borderColor="#f0f0f0" Border="1" Cellspacing="0" Cellpadding="5" width="100%" align="Center" style="border-collapse: collapse">
  <tr> 
     <td width="17%">软件名称</td>
     <td><input type="text" name="name" size="65" class="input"></td>
  </tr>
  <tr> 
     <td>软件大小</td>
     <td><input type="text" name="size" size="20" class="input"></td>
  </tr>
  <tr> 
     <td>授权方式</td>
     <td><select name="mode" class="input">
	<option value="免费软件" selected>免费软件</option>
        <option value="共享软件">共享软件</option>
        <option value="汉化软件">汉化软件</option>
        <option value="破解软件">破解软件</option>
         </select></td>
  </tr>
  <tr> 
     <td>应用平台</td>
     <td><select name="roof" class="input">
	<option value="Win9x/Me">Win9x/Me</option>
	<option value="IIS环境" selected>IIS环境</option>
        <option value="WinNT/2000/XP">WinNT/2000/XP</option>
        <option value="Win9x/Me/NT/2000/XP">Win9x/Me/NT/2000/XP</option>
        </select> </td>
  </tr>
  <tr> 
     <td>推荐程度</td>
     <td><select name="commend" class="input">
	<option value="5">5stars</option>
        <option value="4">4stars</option>
        <option value="3" selected>3stars</option>
        <option value="2">2stars</option>
        <option value="1">1stars</option>
        <option value="0">0stars</option>
        </select></td>
  </tr>
  <tr> 
     <td>所属分类</td>
     <td><select name="c_id" class="input">
<%dim catname,classname,catid,classid
Set rs = Server.CreateObject("ADODB.Recordset")
sql="SELECT * FROM d_cat"
rs.OPEN sql,Conn,1,1
if not (rs.eof and rs.bof) then
rs.movefirst
do while not rs.eof
sql="select * from d_class where cat_id="&rs("cat_id")
Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.OPEN sql,Conn,1,1
if not (rs2.eof and rs2.bof) then
do while not rs2.eof
catid=rs("cat_id")
classid=rs2("class_id")
catname=rs("cat_name")
classname=rs2("class_name")
%>
        <option value='<%=rs2("class_id")%>'><%=rs2("class_name")%>（<%=rs("cat_name")%>）</option>
<%
rs2.movenext
loop
end if
rs.movenext
rs2.close
set rs2=nothing
loop
end if
%></select></td>
   </tr>
   <tr> 
      <td>演示地址</td>
      <td><input type="text" name="demo" size="65" class="input"></td>
   </tr>
   <tr> 
      <td>主页地址</td>
      <td><input type="text" name="home" size="65" value="<%=weburl%>" class="input"></td>
   </tr>
   <tr> 
      <td>程序简介</td>
      <td><textarea name="desc" cols="63" rows="6" class="input">没有</textarea></td>
   </tr>
   <tr> 
      <td>下载地址</td>
      <td><input type="text" name="url" size="65" class="input"></td>
   </tr>
   <tr>
      <td>下载权限</td>
      <td><select name="dGrade" id="dGrade" class="input">
          <option value="0">游客下载</option>
          <option value="1">普通用户</option>
          <option value="2">VIP 用户</option>
          </select>&nbsp;&nbsp;下载所需会员积分数：<input type="text" name="dpoints" size="5" value="0" class="input"> *正整数数字. </td>
   </tr>
   <tr> 
      <td>提交会员</td>
      <td><input type="hidden" name="tjuser" value="<%=Hx66_name%>"><%=Hx66_name%></td>
   </tr>
   <tr> 
      <td>软件图片</td>
      <td><input type="text" name="pic" size="40" value="img/nopic.gif" class="input">&nbsp;&nbsp;<a href='user_upload.asp?action=pic' target=upload_frame>上传图片</a>&nbsp;&nbsp;<a href='user_upload.asp?action=url' target=upload_frame>上传软件</a></td>
   </tr>
  <tr> 
     <td>文件上传</td>
     <td><IFRAME name=upload_frame src="user_upload.asp?action=pic" frameBorder=0 width="100%" scrolling=no height=25></IFRAME></td>
  </tr>
   <tr> 
      <td colspan="2" align="center" height="30">
       <input type="submit" name="Submit" value="确定新增" class="input">
       <input type="reset" name="Reset" value="清空重填" class="input"></td>
   </tr>
</table>
<%
end sub

'=================================================
'过程名：put_news
'作  用：显示发表新闻
'参  数：无
'=================================================
sub put_news()
  dim name,artname,aahome,csid,akeyword,pic,content,username,uppic
  if chk() then
    name=CheckStr(code_admin("name",1,50))
    artname=CheckStr(code_admin("artname",1,50))
    aahome=CheckStr(code_admin("aahome",1,50))
    csid=trim(request.form("c_id"))
    akeyword=CheckStr(code_admin("akeyword",1,50))
    pic=CheckStr(code_admin("pic",1,100))
    content=code_admin("content",1,100000)
    if not isInteger(csid) then
      call admin_error("请选择 "&tit_fir&"类型 ！")
      exit sub
    end if
    if name="" or artname="" or aahome="" or content="" then
      call admin_error(tit_fir&"标题、作者、来源和内容 不能为空！")
      exit sub
    end if
    if strLength(content)>artmax then
      call admin_error(tit_fir&"内容太长 不可以超过"&artmax&"个字符！！")
      exit sub
    end if
    username=code_admin("tjuser",1,20)
    set rs=server.CreateObject("adodb.recordset")
    rs.open "select news_title from news where news_title='"&name&"'",conn,1,1
    if not rs.eof and not rs.bof then
	   	   response.write"<SCRIPT language=JavaScript>alert('错误提示：\n\n① 此新闻已提交过，正等待审核通过，请不要重复提交!\n\n② 您提交的新闻已经存在，感谢你的支持!');"
	           response.write"this.top.location.href='User_put.asp?action=news';</SCRIPT>"
		   Response.End
    rs.close
    end if
    sql="select * from news"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
    rs.addnew
    rs("tjuser")=username
    rs("news_title")=name
    rs("news_author")=artname
    rs("news_ahome")=aahome
    rs("cat_id")=csid 
    rs("news_keyword")=akeyword  
    rs("news_content")=content
    if fbpass<>"yes" or (Hx66_Grade=1 and vippass<>"yes") then
    rs("passed")=0
    sql="UPDATE [user] SET points = points + "&fbpoints&" where username='"&username&"'"
    conn.execute (sql)
    else
    rs("passed")=1
    end if
    if pic<>"" then
    rs("images")=pic
    rs("isimg")=1
    uppic=right(pic,len(pic)-7)
    conn.execute("update [upload] set webtype='新闻',totable=1,url='"&name&"' where filename='"&uppic&"' and totable=0")
    end if
    rs.update
    rs.close
    call user_msg("发布")
    exit sub
  end if
call form_first()
%>
<table bgcolor="#ffffff" borderColor="#f0f0f0" Border="1" Cellspacing="0" Cellpadding="5" width="100%" align="Center" style="border-collapse: collapse">
    <tr> 
      <td width="17%">标题名称</td>
      <td><input type="text" name="name" size="65" class="input"> 
      </td>
    </tr>
    <tr> 
      <td>新闻作者</td>
      <td><input name="artname" type="text" id="writer" size="20" class="input">&nbsp;<button onClick="writer.value='佚名'" class="input">佚名</button>&nbsp;<button onClick="writer.value='网络'" class="input">网络</button>&nbsp;<button onClick="writer.value='<%=Hx66_name%>'" class="input"><%=Hx66_name%></button>
      </td>
     </tr>
     <tr> 
      <td>新闻来源</td>
      <td> <input name="aahome" type="text" id="writer1" size="28" class="input">&nbsp;<button onClick="writer1.value='转摘'" class="input">转摘</button>&nbsp;<button onClick="writer1.value='原创'" class="input">原创</button></button>
     </td>
    </tr>
    <tr> 
      <td>所属分类</td>
      <td><select name="c_id" class="input">
<%
sql="select * from newcat where sid=0"
set rs1=conn.execute(sql)
do while not rs1.eof
response.write "<optgroup label='"&rs1("cat_name")&"'>"
sql="select * from newcat where sid="&rs1("cat_id") 
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
%>
      <option value="<%=rs2("cat_id")%>">├ <%=rs2("cat_name")%></option>
<%
rs2.movenext
loop
rs1.movenext
loop
rs1.close
set rs1=nothing%>
</select>&nbsp;&nbsp;关键字 
<input type="text" name="akeyword" size="18" class="input">&nbsp;多个用 | 隔开。</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2" align="center"> <script language="Javascript1.2"><!-- // load htmlarea
_editor_url = "Editor/";                     // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
  document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
  document.write(' language="Javascript1.2"></scr' + 'ipt>');  
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script>
<textarea name="content" style="width:540; height:250" id="content"></textarea>
<script language="javascript1.2">
editor_generate('content');
</script>
      </td>
    </tr>
    <tr> 
      <td>提交会员</td>
      <td><input type="hidden" name="tjuser" value="<%=Hx66_name%>"><%=Hx66_name%></td>
    </tr>  
  <tr> 
     <td>新闻图片</td>
     <td><input type="text" name="pic" size="65" class="input"></td>
  </tr>
  <tr> 
     <td>图片上传</td>
     <td><IFRAME name=upload_frame src="user_upload.asp?action=pic" frameBorder=0 width="100%" scrolling=no height=25></IFRAME></td>
  </tr>
    <tr align="center"> 
       <td colspan="2" height="30">
        <input type="submit" name="Submit" value="确定新增" class="input"> 
        <input type="reset" name="Reset" value="清空重填" class="input"></td>
    </tr>
</table>
<%
end sub

'=================================================
'过程名：put_shop
'作  用：显示发表产品
'参  数：无
'=================================================
sub put_shop()
  dim name,djname,csid,types,grades,word1,word,dGrade,dpoints,username,d_unit,pic,uppic
  if chk() then
    name=CheckStr(code_admin("name",1,50))
    d_unit=CheckStr(code_admin("d_unit",1,10))
    csid=trim(request.form("c_id"))
    grades=CheckStr(code_admin("grades",1,5))
    s_user=CheckStr(code_admin("s_user",1,30))
    stock=CheckStr(code_admin("stock",1,10))
    pic=CheckStr(code_admin("pic",1,100))
    price_1=CheckStr(code_admin("price_1",1,10))
    price_2=CheckStr(code_admin("price_2",1,10))
    price_3=CheckStr(code_admin("price_3",1,10))
    'word1=CheckStr(code_admin("word1",1,50))
    word=code_admin("word",1,10000)
    if not isInteger(csid) then
      call admin_error("请选择 "&tit_fir&"类型 ！")
      exit sub
    end if
    if name="" or pic="" or word="" or price_1="" or price_2="" or price_3="" then
      call admin_error(tit_fir&"名称、图片、介绍和价格 不能为空！")
      exit sub
    end if
    if isnumeric(price_1)=false or isnumeric(price_2)=false or isnumeric(price_3)=false then
      call admin_error("价格必需输入数字 ！")
      exit sub
    end if
    username=code_admin("tjuser",1,20)
    set rs=server.CreateObject("adodb.recordset")
    rs.open "select s_name from shop where tjuser='"&username&"' and s_pic='"&pic&"'",conn,1,1
    if not rs.eof and not rs.bof then
	   	   response.write"<SCRIPT language=JavaScript>alert('错误提示：\n\n① 此产品你已提交过，正等待审核通过，请不要重复提交!\n\n② 您提交的产品已经存在，感谢你的支持!');"
	           response.write"this.top.location.href='User_put.asp?action=shop';</SCRIPT>"
		   Response.End
    rs.close
    end if
    sql="select * from shop"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
    rs.addnew
    rs("tjuser")=username
    rs("s_name")=name
    rs("s_user")=s_user
    rs("scat_id")=csid
    rs("stock")=stock
    rs("s_pic")=pic
    'rs("ss_desc")=word1
    rs("s_desc")=word
    rs("price_1")=price_1
    rs("price_2")=price_2
    rs("price_3")=price_3
    rs("commend")=grades
    rs("d_unit")=d_unit
    if fbpass<>"yes" or (Hx66_Grade=1 and vippass<>"yes") then
    rs("passed")=0
    sql="UPDATE [user] SET points = points + "&fbpoints&" where username='"&username&"'"
    conn.execute (sql)
    else
    rs("passed")=1
    end if
    uppic=right(pic,len(pic)-7)
    conn.execute("update [upload] set webtype='产品',totable=1,url='"&name&"' where filename='"&uppic&"' and totable=0")
    rs.update
    rs.close
    call user_msg("发布")
    exit sub
  end if
call form_first()
%>
<table bgcolor="#ffffff" borderColor="#f0f0f0" Border="1" Cellspacing="0" Cellpadding="5" width="100%" align="Center" style="border-collapse: collapse">
  <tr> 
     <td width="17%">产品名称</td>
     <td><input type="text" name="name" size="65" class="input"></td>
  </tr>
  <tr> 
     <td>厂商或品牌</td>
     <td><input type="text" name="s_user" size="30" class="input"></td>
  </tr>
  <tr> 
     <td>产品分类</td>
     <td><select name="c_id" class="input">
<%
sql="select * from scat where sid=0"
set rs1=conn.execute(sql)
do while not rs1.eof
response.write "<optgroup label='"&rs1("scat_name")&"'>"
sql="select * from scat where sid="&rs1("scat_id") 
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
%>
<option value="<%=rs2("scat_id")%>">├ <%=rs2("scat_name")%></option>
<%
rs2.movenext
loop
rs1.movenext
loop
rs1.close
set rs1=nothing%>
</select>
<select name="grades" class="input">
     <option value="★★★">推荐等级</option>
     <option value="★">☆☆☆☆★</option>
     <option value="★★">☆☆☆★★</option>
     <option value="★★★">☆☆★★★</option>
     <option value="★★★★">☆★★★★</option>
     <option value="★★★★★">★★★★★</option>
</select>&nbsp;&nbsp;供货数量：<input type="text" name="stock" class="input" size="10"></td>
  </tr>
  <tr> 
     <td>产品图片</td>
     <td><input type="text" name="pic" size="65" class="input"></td>
  </tr>
  <tr> 
     <td>图片上传</td>
     <td><IFRAME name=upload_frame src="user_upload.asp?action=pic" frameBorder=0 width="100%" scrolling=no height=25></IFRAME></td>
  </tr>
  <tr> 
     <td>计量单位</td>
     <td><input name='d_unit' type='text' size='12' class="input"></td>
  </tr>
  <tr> 
     <td>产品价格</td>
     <td>市场价：<input type="text" name="price_1" class="input" size="10">元&nbsp;&nbsp;会员价：<input type="text" name="price_2" class="input" size="10">元&nbsp;&nbsp;VIP 价：<input type="text" name="price_3" class="input" size="10">元</td>
  </tr>
  <tr> 
     <td colspan="2">产品介绍</td>
  </tr>
  <tr> 
     <td colspan="2" align="center"> <script language="Javascript1.2"><!-- // load htmlarea
_editor_url = "Editor/";                     // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
  document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
  document.write(' language="Javascript1.2"></scr' + 'ipt>');  
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script>
<textarea name="Word" style="width:540; height:200" id="Word"></textarea>
<script language="javascript1.2">
editor_generate('Word');
</script></td>
  </tr>
  <tr> 
     <td>提交会员</td>
     <td><input type="hidden" name="tjuser" value="<%=Hx66_name%>"><%=Hx66_name%></td>
  </tr>          
  <tr align="center"> 
     <td colspan="2" height="30">              
         <input type="submit" name="Submit" value="确定新增" class="input">
         <input type="reset" name="Reset" value="清空重填" class="input"></td>
  </tr>
</table><BR>
<%
end sub

'=================================================
'过程名：put_close,admin_error,form_first,user_msg
'作  用：显示发表状态信息
'参  数：无
'Web:    http://www.vip138.com
'=================================================
sub put_close(tvar)
  response.write "<table align=Center><tr><td colspan=2 height=200 align=center><font color=red>对不起！本站暂时关闭 <font color=blue>"&tvar&tit_fir&"</font> 的功能。</font><br><br>如有需要，请与管理员联系。谢谢！</td></tr></table>"
end sub

sub admin_error(tvar)
  response.write vbcrlf&"<table align=Center><tr><td colspan=2 align=center><br>"&tvar&"<br><br><input type=button name=go_back value='返回上一页' onclick=""javascript:history.back(1);"" class=input><br><br></td></tr></table>"
end sub

sub form_first()
  session("Hx_cms")=true
end sub

sub user_msg(tvar)
  session("Hx_cms")=false
  Response.Write "<table align=Center><tr><td colspan=2 align=center height=200>" & vbCrLf
if fbpass<>"yes" or (Hx66_Grade=1 and vippass<>"yes") then
  Response.Write "已成功"&tvar&"了一个"&tit_fir&"！</font><br><br>本站已直接显示你提交的内容，请到版块列表处查看。<br><br>同时你的个人积分已增加"&fbpoints&"会员币，谢谢您的支持！！" & vbCrLf
else
  Response.Write "<font color=red>已成功"&tvar&"了一个"&tit_fir&"！</font><br><br>请等待管理审核通过……" & vbCrLf
end if
  Response.Write "</tr></table>" & vbCrLf
end sub
%>

