⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 user_put.asp

📁 后台登陆admin.asp
💻 ASP
📖 第 1 页 / 共 4 页
字号:
      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
'作  用:显示发表产品
'参  数:无
'Web:    www.ynsky.com.cn
'=================================================
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:    www.ynsky.com.cn
'=================================================
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

'****************************************************
%>

⌨️ 快捷键说明

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