<!--#include file="../setting/conn.asp"--><%:cid=0:act=SoonBiz.ract:Select Case act:Case "" : myask :Case "creatnew" : fileinfo :Case "savenew" : saveinfo(false):Case "readmyask" : readmyask:Case "savereask" : savereask :Case Else : Response.end:End Select:setallnothing:Sub myask():Dim tr,sql:Dim display:display="none":tr="<tr onmouseover=""this.style.backgroundColor='#e2e8f4'"" onmouseout=""this.style.backgroundColor=''"" ><td align='center'>{$id}</td><td><a href=?act=readmyask&id={$id}>{$title}</a></td><td align='center'><script type=""text/javascript"">document.write(classname[{$classid}]);</script></td><td align='center'><script type=""text/javascript"">isover({$isover});</script></td><td align='center'>{$reps}</td><td align='center'>{$stime_short}</td></tr>":SoonBiz.adhead:SoonBiz.nstate("我的问题"):Response.Write SoonBiz.JsClassName(0):Response.Write "<table cellspacing=1 class=tableborder1>":Response.Write "<tr>":Response.Write "<th width=40>ID</th>":Response.Write "<th width=*>问题</th>":Response.Write "<th width=180>所属分类</th>":Response.Write "<th width=60>状态</th>":Response.Write "<th width=40>回复</th>":Response.Write "<th width=80>时间</th>":Response.Write "</tr>":sql="select * from ["& sheethead &"_ask] where askid=0 and uid="&SoonBiz.user_id :sql=sql & " order by isover asc,id desc":Response.write SoonBiz.ReplaceMdb("user_ask",sql,tr,"",0):Response.write "</table>":Response.write SoonBiz.pagelist(""):SoonBiz.adfoot:End Sub:Sub fileinfo():SoonBiz.iseditor=true:SoonBiz.title="发表新问题":SoonBiz.adhead:SoonBiz.nstate("发表新部题"):SoonBiz.LoadTemplatesAdmin("user_ask"):HtmlStr=template.html(1):HtmlStr=Replace(HtmlStr,"{$optionclass}",SoonBiz.ReplaceClass("admin_ask.asp",0,0,"<option value='{$id}'>{$title}</option>","all")) :HtmlStr=Replace(HtmlStr,"{$codestr}",SoonBiz.codestr) :HtmlStr=Replace(HtmlStr,"{$cid}",cid):Response.Write HtmlStr:End Sub:Sub saveinfo(isedit):SoonBiz.codeistrue:Dim title,content:Dim rs:Dim id:classid=SoonBiz.rid("classid"):title=SoonBiz.requeststr("问题","title","post",1,2,255,10,1):content=SoonBiz.requeststr("问题描述","content","post",1,2,500000,10,1):ShowErr(""):SoonBiz.ConnectionDatabase:Set rs=server.CreateObject("adodb.recordset")
If isedit Then
Else:rs.open ""& sheethead &"_ask",conn,1,3:rs.addnew:Rs("uid")=SoonBiz.user_id:Rs("nickname")=SoonBiz.user_nickname:Rs("stime")=now():Rs("cls")=100:Rs("reps")=0:Rs("isgood")=0
End if:Rs("classid")=classid:Rs("retime")=now():Rs("title")=title:Rs("content")=content:Rs("askid")=0 :Rs("isover")=0:rs.update:id=rs("id"):SoonBiz.uplist("ask"&id):session("codestr")="":SoonBiz.adsuccess("发表成功!"):End Sub:Sub savereask() :Dim id,content:Dim sql,rs:id=SoonBiz.rid("id") :content=SoonBiz.RequestStr("问题描述","content","post",1,2,500000,10,1):ShowErr(""):sql="insert into "& sheethead &"_ask (uid,nickname,stime,content,isover,askid) values (":sql=sql & SoonBiz.user_id:sql=sql & ",'"& SoonBiz.user_nickname &"'":sql=sql & ","&soonbizcom:sql=sql & ",'"& SoonBiz.Checkstr(content) &"'" :sql=sql & ",0":sql=sql & ","&id:sql=sql & ")":SoonBiz.Execute(sql):SoonBiz.execute("update "& sheethead &"_ask set isover=0,reps=reps+1 where id="&id):SucMsg=SucMsg & "<li>提交成功!</li>":SucMsg=SucMsg & "<li><a href='?'>返回我的问题!</a></li>":SoonBiz.adsuccess(SucMsg):End Sub:Sub listfilter():Dim tr:Dim trhtml:tr="<option value=""{$id}"">{$title}</option>":Response.Write "<div class=""listfilter"">":Response.Write "<form method=post action=""?act=usual"">":Response.Write " <input type=""text"" name=""keyword"" id=""keyword"" class=""inputsearch"">":Response.Write " <select name=""classid"" id=""classid"">":Response.Write " <option value="""">全部分类</option>":Response.Write soonbiz.replaceclass("",cid,0,"{$trhtml}",tr,"all"):Response.Write " </select>":Response.Write " &nbsp;&nbsp;<input type='submit' name=""submit"" id=""submit"" value='显示'>":Response.Write " </form>":Response.Write "</div>":End Sub:Sub readmyask() :Dim tr:Dim sql:id=SoonBiz.rid("id"):jinlan="<a href='?'>我的问题</a>":SoonBiz.iseditor=true:SoonBiz.adhead:SoonBiz.nstate(jinlan):tr="<div><div class=askstate><script type=""text/javascript"">isover({$isover});</script></div><div class='asktitle'>问题</div></div> <div class=ask> <h1>{$title}</h1> {$content} </div>":sql="select * from ["& sheethead &"_ask] where uid="& SoonBiz.user_id &" and id="&id:Response.write SoonBiz.ReplaceMdb("user_ask",sql,tr,"",1):sql="select * from ["& sheethead &"_ask] where askid="& id &" order by id asc":tr=" <div><div class='answertitle'>回复</div></div> <div class=answer> {$content} </div>":Response.write SoonBiz.ReplaceMdb("user_ask",sql,tr,"",0):Response.Write "<br /><br />":Response.Write "<form method=""post"" action=""?act=savereask&id="& id &""">":Response.Write "<table cellspacing=1 class=tableborder1>":Response.Write "<tr>":Response.Write "<th colspan=2>继续提问</th>":Response.Write "</tr>":Response.Write "<tr>":Response.Write "<td colspan=2><script type=""text/javascript"">wedonetedit('content')</script></td>":Response.Write "</tr>":Response.Write "</table>":Response.Write "<div class=""operate""><input type=""submit"" value=""提交"" /></div>":Response.Write "</form>":Response.Write "<iframe id=""upfile"" src=""user_img.asp?act=nolist&amp;obj=content&amp;cid="& cid &"&amp;fid=ask" &id &""" frameborder=""0"" scrolling=""no"" width=""100%"" height=""280""></iframe>":SoonBiz.adfoot:End Sub
%>