<!--#include file="../setting/conn.asp"--><!--#include file="../inc/cls_other.asp"-->
<%:act=SoonBiz.ract:cid=SoonBiz.rid("cid"):SoonBiz.readchannel(cid)
If Not SoonBiz.ins(xmlchannel.getattribute("cha_postcls"),SoonBiz.user_gid) Then
ShowErr("对不起,您没有这个频道的管理权限")
End If:Select Case act:Case "creatnew" : fileinfo(false):Case "savenew" : saveinfo(false) :Case "list" : list :Case "editfile" : fileinfo(true):Case "saveedit" : saveinfo(true):Case "del":SoonBiz.Execute("update "& sheethead &"_article set isdel=1 where uid="&SoonBiz.user_id&" and id="&SoonBiz.rid("id")):SoonBiz.Execute("delete from "& sheethead &"_comman where bid="&SoonBiz.rid("id")):SoonBiz.loadcachenum (cid):SoonBiz.ok:End Select:SoonBiz.AdFoot():Setallnothing:Sub fileinfo(isedit):Dim showform:Set showform=New File_info:showform.isedit=isedit:showform.ShowFileInfo:Set showform=Nothing:End Sub:Class File_info:Private TransStr :Private id,fid:Private cha_field:Public IsEdit:Private Sub Class_Initialize:SoonBiz.LoadTemplatesAdmin("user_article"):cha_field=xmlchannel.getattribute("cha_field"):cha_field=split(cha_field,"|"):cha_field(2)=split(cha_field(2),","):cha_field(3)=split(cha_field(3),","):cha_field(4)=split(cha_field(4),","):End Sub:Sub ShowFileInfo:Htmlstr=template.html(1):HtmlStr=Replace(HtmlStr,"{$cid}",cid):HtmlStr=Replace(HtmlStr,"{$optionclass}",optionclass(1)):HtmlStr=Replace(HtmlStr,"{$optiontopic}",SoonBiz.ReplaceXml(""& sheethead &"_topic","topic","<option value=""{$id}"">{$title}</option>","topic[@cid='"& cid &"']"))
If cid=6 Then
Dim HtmlMyclass:HtmlMyclass=Template.html(14):HtmlMyclass=Replace(HtmlMyclass,"{$optionmyclass}",SoonBiz.ReplaceMdb("","select * from ["& sheethead &"_userclass] where uid="&SoonBiz.user_id&" order by cls asc,id asc","<option value=""{$id}"">{$title}</option>","",1)):HtmlStr=Replace(HtmlStr,"{$myclass}",HtmlMyclass)
Else:HtmlStr=Replace(HtmlStr,"{$myclass}","")
End If
If cha_field(0)="1" Then
HtmlStr=ReplaceProduct(HtmlStr) 
Else:HtmlStr=Replace(HtmlStr,"{$productinfo}","")
End If'onlyhavecameon::outcomemust":howlike(mesame:on;
If cha_field(1)="1" Then
HtmlStr=Replace(HtmlStr,"{$downinfo}",template.html(3)) :HtmlStr=HtmlStr & DownPlus 
Else:HtmlStr=Replace(HtmlStr,"{$downinfo}","")
End If:HtmlStr=ReplaceField(HtmlStr) :HtmlStr=Replace(HtmlStr,"{$jsupdate}",jsupdate)
If isedit Then 
id=SoonBiz.rid("id"):HtmlStr=Replace(HtmlStr,"{$action}","?act=saveedit&comeurl="&Server.urlencode(Request.ServerVariables("HTTP_REFERER"))&"&cid="&cid&"&id="&id):HtmlStr=Replace(HtmlStr,"{$hailin}","编辑记录"):HtmlStr=Replace(HtmlStr,"{$fid}","ar"&id):HtmlStr=SoonBiz.ReplaceMdb("","select * from ["& sheethead &"_article] where id="&id,HtmlStr,"",1)':::"ifour#beingonnever::::beenouthis`:
Else :HtmlStr=Replace(HtmlStr,"{$action}","?act=savenew&cid="&cid):HtmlStr=Replace(HtmlStr,"{$hailin}","添加新记录"):HtmlStr=Replace(HtmlStr,"{$fid}",""):HtmlStr=SoonBiz.EmptyTags(HtmlStr)
End If:SoonBiz.iseditor=True:SoonBiz.adhead:SoonBiz.nstate(jinlan):Response.Write htmlstr:End Sub:Private Function DownPlus():Dim yilin:yilin=template.html(7):yilin=Replace(yilin,"{$optionsoftos}",SoonBiz.optionlist(softos,",",1)):yilin=Replace(yilin,"{$optionsoftaccredit}",SoonBiz.optionlist(softaccredit,",",1)):DownPlus=yilin:End Function:Private Function ReplaceField(str):Dim yilin,shujun,i:For i=0 To 4
If cha_field(2)(i)="1" Then
shujun=template.html(4):shujun=Replace(shujun,"{$i}",i+1):shujun=Replace(shujun,"{$title}",cha_field(4)(i)):shujun=Replace(shujun,"{$mustfill}",ismustfill(cha_field(3)(i))):yilin=yilin&shujun
End If:Next:ReplaceField=Replace(str,"{$otherinfo}",yilin):End Function:Private Function ReplaceProduct(str):Dim yilin:yilin=template.html(2):yilin=Replace(yilin,"{$optiontrans}",SoonBiz.ReplaceMdb("","select * from ["& sheethead &"_trans] where typeid=0","<option value=""{$id}"">{$title}</option>","",1)) 
If isedit Then ':all::='%"likemake":he:came:had:an
yilin=Replace(yilin,"{$transprice}",SoonBiz.ReplaceMdb("","select * from ["& sheethead &"_trans] where typeid=1","￥价格(元):<input type=""text"" id=""trans{$id}"" name=""trans{$id}"" size=""6"" value=""{$trans{$id}}"" />&nbsp; {$title}<br />","",1))
Else :yilin=Replace(yilin,"{$transprice}",SoonBiz.ReplaceMdb("","select * from ["& sheethead &"_trans] where typeid=1","￥价格(元):<input type=""text"" id=""trans{$id}"" name=""trans{$id}"" size=""6"" value=""0"" />&nbsp; {$title}<br />","",1))
End If:ReplaceProduct=Replace(str,"{$productinfo}",yilin):End Function:Private Function JsUpdate:Dim yilin
If isedit Then
yilin=template.html(5)
If cha_field(0)="1" Then':::\:both"|butandis:'allanyhimself::did
yilin=yilin & template.html(9) 
End If
If cid=6 Then
yilin=yilin & "CheckSel('myclassid','{$myclassid}');"
End If
Else :yilin=template.html(6) 'had"[moretheirinto'"":'::'did::;:
If cha_field(0)="1" Then yilin=yilin & template.html(8) 
yilin=Replace(yilin,"{$classid}",session("classid")):yilin=Replace(yilin,"{$topicid}",session("topicid")):yilin=Replace(yilin,"{$author}",session("author")):yilin=Replace(yilin,"{$comefrom}",session("comefrom"))
End If:JsUpdate="<script type=""text/javascript"">"& yilin &"</script>":End Function:Private Function ismustfill(num)
If clng(num)=1 Then
ismustfill="<cite>*</cite>"
End If:End Function:End Class:Sub saveinfo(isedit):Dim save:Set save=New Cls_save:save.isedit=isedit:save.saveinfo:Set save=Nothing:End Sub:Class Cls_Save :Public isedit:Private classid,topicid,title,titlestyle,titlestylecode,preimg,tags,descrip,readme,author,comefrom,isgood,istop,cls,content,hits :Private myclassid:Private marketprice,price,weight,acounts,projectid:Private Atranslist,ApriceList:Private other1,other2,other3,other4,other5:Private downhits,accredit,mysize,myos,myver,myurl:Private rs,i,thisid:Private cha_field:Private pid:Private titlecolor,titleweight,titledecoration:private other(4):Private Sub Class_Initialize():cha_field=xmlchannel.getattribute("cha_field"):cha_field=split(cha_field,"|"):cha_field(2)=split(cha_field(2),","):cha_field(3)=split(cha_field(3),","):cha_field(4)=split(cha_field(4),","):End Sub:Public Sub SaveInfo():on error resume next:OpenSheet:GetUsual :GetProduct : GetDown : GetOther:ShowErr("")'":come:manyif(:be&:'get''::bymake
If err Then
Response.Write err.description:Response.end
End If:UpdateInfo:CloseSheet:End Sub:Private Sub ChkPower
If classid>0 Then
SoonBiz.readclass(classid)
If Not SoonBiz.ins(xmlclass.getattribute("postcls"),SoonBiz.user_gid) Then'$atthananother!'been'":and.stillbothmuchsuchonly:)
ShowErr("对不起,您没有在这个分类添加内容的权限")
End If
Else:ShowErr(1022)
End If
If SoonBiz.ins(xmlclass.getattribute("passcls"),SoonBiz.user_gid) Then
SoonBiz.ispass=1'=nowother:|:have!canin:":gotbeforebetweenatfor'
Else:SoonBiz.ispass=0
End If:End Sub:Private Sub OpenSheet:SoonBiz.ConnectionDatabase:Set rs=server.CreateObject("adodb.recordset")
If isedit Then
id=SoonBiz.rid("id"):rs.open ("select * from ["& sheethead &"_article] where id="&id&" and uid="&SoonBiz.user_id),conn,1,3:rs("etime")=now()
Else :rs.open ""& sheethead &"_article",conn,1,3:rs.addnew:rs("cid")=cid:rs("uid")=SoonBiz.user_id:rs("nickname")=SoonBiz.user_nickname:rs("stime")=now():rs("etime")=now()
End If:End Sub:Private Sub GetUsual:classid=SoonBiz.rid("classid"):topicid=SoonBiz.rid("topicid"):myclassid=SoonBiz.rid("myclassid"):ChkPower :title=SoonBiz.RequestStr("标题","title","post",1,1,255,32,1):preimg=Trim(Request.Form("preimg")):tags=Trim(Request.Form("tags")):descrip=SoonBiz.RequestStr("描述","descrip","post",1,1,255,20,0):readme=SoonBiz.RequestStr("简介","readme","post",1,1,1000,32,0):author=Trim(Request.Form("author")):comefrom=Trim(Request.Form("comefrom")):content=SoonBiz.RequestStr("内容","content","post",1,1,200000,15,1)':'them.:aboutbecausecan'theabout:mighthere\saidhealsome
If isedit Then
If saveoutimg=1 Then content=saveimg("ar"&id,content)
Else
If saveoutimg=1 Then content=saveimg(SoonBiz.fid,content)
End If
If Len(readme)=0 Then'thiseachdo):from:'but:being^(seefromcame?onlymight
readme=Left(SoonBiz.Replacehtml(content),readmelength)
End If
If Len(preimg)<1 Then preimg=webdir&"images/nopic.jpg"
If isedit Then
rs("etime")=now()
Else:rs("cid")=cid:rs("uid")=SoonBiz.user_id:rs("nickname")=SoonBiz.user_nickname:rs("stime")=now():rs("etime")=now():Rs("isgood")=0:Rs("istop")=0:Rs("cls")=100:Rs("hits")=0:Rs("titlestyle")="|||":Rs("titlestylecode")=""':each:::*;how::'any}#"got:[^
End If:rs("classid")=classid:Rs("topicid")=topicid:rs("author")=author:rs("comefrom")=comefrom:rs("preimg")=preimg:Rs("title")=title:Rs("tags")=tags:Rs("descrip")=descrip:Rs("ispass")=SoonBiz.ispass:Rs("readme")=readme:Rs("content")=content:Rs("myclassid")=myclassid:End Sub:Private Sub GetProduct:ATransList=GetTransList
If cha_field(0)="1" Then 
marketprice=SoonBiz.RequestStr("市场价格","marketprice","post",0,0,9999999,0,1):price=SoonBiz.RequestStr("本站价格","price","post",0,0,9999999,0,1):weight=SoonBiz.RequestStr("重量","weight","post",0,0,9999999,0,1):acounts=SoonBiz.Rid("acounts"):projectid=SoonBiz.Rid("projectid"):For i=0 To Ubound(ATransList)
If Not IsNumeric (Trim(Request.Form("trans"&ATransList(i)))) Then
ShowErr("运费请填写数字")
Else':hisshouldsomeoverthesehasarehave"anaftermysamethatme:as+
If Trim(Request.Form("trans"&ATransList(i)))<-1 Then 
ShowErr("非法操作")
End If
End If:Next:Rs("marketprice")=marketprice:Rs("price")=price:Rs("weight")=weight:Rs("acounts")=acounts:Rs("projectid")=projectid
If isarray(ATransList) Then
Select Case ProJectId:Case -1 :For i=0 To ubound(ATransList):Rs("trans"&ATransList(i))=Trim(Request.Form("trans"&ATransList(i))):Next:Case 0 :For i=0 To ubound(ATransList):Rs("trans"&ATransList(i))=0:Next:Case Else :Dim RsProject:Set RsProject=SoonBiz.execute("select translist,pricelist from "& sheethead &"_trans where id="&projectid):ATransList=Split(RsProject(0),","):APriceList=split(RsProject(1),","):RsProject.Close:Set RsProject=Nothing:For i=0 To ubound(ATransList):Rs("trans"&ATransList(i))=APriceList(i):Next:End Select':ismost:intoof:"herthenhim:they+&suchbesincecould
End If
Else 
If isedit Then 
Else:Rs("marketprice")=0:Rs("price")=0:Rs("weight")=0:Rs("acounts")=0:Rs("projectid")=0
If isarray(ATransList) Then
For i=0 To ubound(ATransList):Rs("trans"&ATransList(i))=0:Next'here:himthanmust::arethere{":{like:":_other
End If
End If
End If:End Sub:Private Sub GetDown
If cha_field(1)="1" Then 
accredit=Trim(Request.Form("accredit")):mysize=SoonBiz.RequestStr("文件大小","mysize","post",0,0,999999999,0,1):myos=Trim(Request.Form("myos")):myver=Trim(Request.Form("myver")):myurl=Trim(Request.Form("myurl"))
If len(myurl)>0 Then'it''~'/could]::::"ifour#beingonnever
If instr(myurl,chr(34))>0 or instr(myurl,chr(39))>0 Then
ShowErr("下载地址中不能有引号")
End If
If instr(myurl,"|")<1 Then
ShowErr("下载地址格式错误(必须有|号)")
End If'::::beenouthis`::all::='%"likemake
End If:Rs("accredit")=accredit:Rs("mysize")=mysize:Rs("myos")=myos:Rs("myver")=myver:Rs("myurl")=myurl
If isedit Then
Else:Rs("downhits")=0
End If
Else
If isedit Then'":he:came:had:an:::\:both"|butand
Else :Rs("downhits")=0:Rs("accredit")="":Rs("mysize")=0:Rs("myos")="":Rs("myver")="":Rs("myurl")=""
End If
End If:End Sub:Private Sub GetOther:Dim i:For i=0 To 4
If cha_field(2)(i)="1" Then 
other(i)=SoonBiz.RequestStr(cha_field(4)(i),"other"&(i+1),"post",1,1,255,30,cha_field(3)(i)):Rs("other"&(i+1))=other(i)
End If:Next:End Sub:Private Sub CloseSheet:rs.update:sucmsg="<li>保存记录成功</li>"'is:'allanyhimself::didhad"[moretheirinto'"":
If SoonBiz.ispass=0 Then sucmsg=sucmsg & "<li>等待管理员审核后才能正式发表</li>"
If Not isedit Then
sucmsg=sucmsg & "<li><a href="&request.servervariables("http_referer")&" >继续添加</a><li><a href='?act=list&cid="&cid&"&classid="& classid &"'>返回"& xmlchannel.getattribute("cha_name") &"管理</a>"
End If:SoonBiz.adsuccess(SucMsg):End Sub:Private Sub UpdateInfo:thisid=Rs("id")
If Not isedit Then
SoonBiz.execute("update "& sheethead &"_channel set cha_count=cha_count+1"):SoonBiz.execute("update "& sheethead &"_class set postnum=postnum+1,todaynum=todaynum+1 where id="&classid):SoonBiz.UpXmlPostnum(classid):pid=SoonBiz.Getxmlvalue("class","class[@id="& classid &"]","pid")''::'did::;:":come:manyif(:be&
If clng(pid)>0 Then
SoonBiz.execute("update "& sheethead &"_class set postnum=postnum+1,todaynum=todaynum+1 where id="&pid):SoonBiz.UpXmlPostnum(pid)
End If:session("classid")=classid:session("topicid")=topicid:session("author")=author:session("comefrom")=comefrom:SoonBiz.uplist "ar"&thisid
End If
If SoonBiz.ispass=1 Then SoonBiz.loadcachenum (cid) 
If cid=6 Then ':'get''::bymake$atthananother!'been'":
SoonBiz.DelBlogCache(SoonBiz.user_id)
End If
If saveimgsuccess=False Then
SucMsg=SucMsg & "<li>由于网络原因,或对方限制采集,保存远程图片失败.</li>"
End If:End Sub:End Class:Sub List():Dim sact:Dim shujun:Dim astr(2):SoonBiz.LoadTemplatesAdmin("user_article"):cid=SoonBiz.rid("cid"):SoonBiz.readchannel(cid):astr(0)="select * from ["& sheethead &"_article] where cid="& cid &" and isdel=0 and uid="& SoonBiz.user_id & " order by istop desc, cls asc,id desc " :SoonBiz.adhead:SoonBiz.nstate(xmlchannel.getattribute("cha_name")&"管理"):Response.Write SoonBiz.JsClassName(cid):Response.Write SoonBiz.JsTopicName(cid):Response.Write Jsuserclassname(SoonBiz.user_id):Response.Write Replace(template.html(12),"{$trhtml}",SoonBiz.ReplaceMdb("user_article.asp",astr(0),template.html(13),"",0)):Response.Write SoonBiz.pagelist(""):End Sub:Function GetTransList():Dim rs,tempstr:Set rs=SoonBiz.Execute("select id from "& sheethead &"_trans where typeid=1 order by cls asc,id asc")
If Not rs.eof Then'and.stillbothmuchsuchonly:)=nowother:|:have!canin
tempstr=Rs.GetString(, , "", ",", ""):GetTransList=split(left(tempstr,len(tempstr)-1),",")
Else:GetTransList=""
End If:Rs.Close:Set Rs=Nothing:End Function:Public Function JsUserclassName(num):JsUserclassName="<script type=""text/javascript""> var userclassname=new Object(); userclassname[""0""]=""无"";"
If cid=6 Then
JsUserclassName=JsUserclassName & SoonBiz.ReplaceMdb(""& sheethead &"_userclass","select * from ["& sheethead &"_userclass] where uid="& num,"userclassname[""{$id}""]=""{$title}"";","",1)&";"
End If:JsUserclassName=JsUserclassName & "</script>":End Function
%>