<!-- #Include File="Skin.asp" -->
<!-- #Include File="Cls_Class.asp" -->
<!-- #Include File="Cls_Public.asp" -->
<!-- #Include File="Inc_Post.asp" -->
<!-- #Include File="../Editor/UBB/Editor.asp" -->
<%
'=======================================================
' 欢迎使用《阿赛大型门户网站系统V3.0》，简称“AsaiMHV3”
' 技术支持、商业版咨询、官方唯一指定联系QQ“4941172”
' 官方网站：http://77ya.com      程序负责人：阿赛
'=======================================================

Dim ViewData			'浏览数据数组
Dim iSpecialID,iCastID
iSpecialID = Cls.Code_ID("ID")
iCastID = Cls.Code_ID("ID")

'//* 载入频道数据分类 *//
Public Sub Channel_Load(LoadType)
    Call Channel_Loader()
	Call Cid_Load()
	Call Class_Load()
	If LoadType = 0 Then
	   Call DoWebHead(0,0)
	ElseIf LoadType = 1 Then
	   Call DoWebHead(2,1)
	End If
End Sub

'//* 释放频道数据分类 *//
Public Sub Channel_End(Endtype)
	If IsArray(ViewData) Then Erase ViewData
	Call Class_End()
	If Endtype=0 Then Call DoWebEnd()
End Sub

'//* 频道数据分类并跳转网页 *//
Public Sub Channel_Redirect(frvar)
	Call Channel_End(0)
	Call Format_Redirect(frvar)
End Sub

Dim v_id,v_username,v_topic,v_remark,v_tim,v_counter,v_comto,v_author,v_power,v_emoney,v_cod,v_keyes,v_tcolor,v_ispic,v_pic,v_IntactTitle,v_Subtitle,v_IncludeInfo,tmp_err,tmp_commend,tmp_topic,v_jt,v_file,v_Period,no_reply
Dim v_name,v_Solves,v_Reward,v_Expired,v_replys,tmp_quick,tmp_Canada,tmp_edit,tmp_Reward,tmp_tims,tmp_pagecute,Isdeal,skin_dir
Dim iSpecialTopic, iSpecialRemark, iSpecialTim,Canada,Pm,Canada_Pm,tmptrue,AsaiMHReward
Dim dim_Ok,integral
dim Reward,Solves
dim AsaiMHtemp1

Public Function ShowChannelIndex(IsHtml)
        Tit=Cls.ChannelName:tit_fir=""
		Tit_Dir = "频道首页"
        HtmlContent = Cls.ReadTemplate(0)
        Call LoadChannelMainList(0)
		Call LoadChannelSort(0,0)
		Call LoadChannelSearch()
		Call LoadChannelSpecial()
		HtmlContent = Html.ReadWebHead(HtmlContent)
		HtmlContent = Html.ReadWebEnd(HtmlContent)
		HtmlContent = Html.ReadUserLogin(HtmlContent)
                HtmlContent = Html.ReadOkList(HtmlContent)
		HtmlContent = Html.ReadFlashPic(HtmlContent)
		HtmlContent = Html.ReadCast(HtmlContent)
		HtmlContent = Html.ReadVote(HtmlContent)
		HtmlContent = Html.ReadChannelMenu(HtmlContent)
		HtmlContent = Cls.ReHtml(HtmlContent,0)
		If IsHtml=True Then
		ShowChannelIndex = HtmlContent
		Else
		Response.Write HtmlContent
		End If
End Function

Public Function ShowChannelLists(IsHtml,ClsID)
		tit=Cls.ChannelTit&"列表"
	    Tit_Dir = Class_Grade(ClsID,Cls.ClassDepth) & Tit
	    tit_fir=Cls.ChannelName
		IndexUrl=Cls.Web_Dir & Cls.ChannelDir
		HtmlContent = Cls.ReadTemplate(2)
        Call LoadChannelMainList(ClsID)
		Call LoadChannelSort(ClsID,0)
		Call LoadChannelSearch()
		Call LoadChannelSpecial()
		Call Html.LoadReplaced()		
 		HtmlContent = Html.ReadWebHead(HtmlContent)
		HtmlContent = Html.ReadWebEnd(HtmlContent)
		HtmlContent = Html.ReadUserLogin(HtmlContent)
    	HtmlContent = Html.ReadOkList(HtmlContent)
		HtmlContent = Html.ReadChannelMenu(HtmlContent)
		HtmlContent = Cls.ReHtml(HtmlContent,0)	
 		If IsHtml=True Then
		ShowChannelLists = HtmlContent
		Else
		Response.Write HtmlContent
		End If	
End Function

Public Function ShowChannelList(IsHtml,ClsID,PgID,ListAction)
	    Select Case ListAction
	    Case "Reward"
	    	tit="高分"&Cls.ChannelTit
	        tit_fir=Cls.ChannelName
			IndexUrl=Cls.Web_Dir & Cls.ChannelDir
			HtmlContent = Cls.ReadTemplate(1)
	    Case "focus"
	    	tit="焦点"&Cls.ChannelTit
    	    tit_fir=Cls.ChannelName
			IndexUrl=Cls.Web_Dir & Cls.ChannelDir
			HtmlContent = Cls.ReadTemplate(1)
        Case "good"
   	    	tit="推荐"&Cls.ChannelTit
   	        tit_fir=Cls.ChannelName
			IndexUrl=Cls.Web_Dir & Cls.ChannelDir
			HtmlContent = Cls.ReadTemplate(1)
	    Case "hot"
	     	tit="热门"&Cls.ChannelTit
	        tit_fir=Cls.ChannelName
			IndexUrl=Cls.Web_Dir & Cls.ChannelDir
			HtmlContent = Cls.ReadTemplate(1)
	    Case "search"
	    	tit=Cls.ChannelTit&"搜索"
	    	tit_fir=Cls.ChannelName
			Tit_Dir = Class_Grade(ClsID,Cls.ClassDepth) & Tit
			IndexUrl=Cls.Web_Dir & Cls.ChannelDir
			HtmlContent = Cls.ReadTemplate(1)
		Case "special"
	    	tit=Cls.ChannelTit&"专题"
	    	tit_fir=Cls.ChannelName	
			IndexUrl=Cls.Web_Dir & Cls.ChannelDir
			HtmlContent = Cls.ReadTemplate(4)
                                HtmlContent = Replace(HtmlContent, "{$SpecialID}", iSpecialID)
			HtmlContent = Replace(HtmlContent, "{$s_name}", iSpecialTopic)
			HtmlContent = Replace(HtmlContent, "{$s_remark}", iSpecialRemark)
			HtmlContent = Replace(HtmlContent, "{$s_tim}", iSpecialTim)
		Case Else
		    tit=Cls.ChannelTit&"列表"
			tit_fir=Cls.ChannelName
	    	Tit_Dir = Class_Grade(ClsID,Cls.ClassDepth) & Tit
			IndexUrl=Cls.Web_Dir & Cls.ChannelDir
			HtmlContent = Cls.ReadTemplate(1)
	    End Select
  Dim ListContent,ListContents,HtmlUrl
  Dim Mhead,obj_search,obj_page
  Dim Tempstr, PageCt
  Dim SQL, i, foundstr, ListStyle
  Dim sDot,sTitle, sTopic, BestCode, BestString
  Dim OkTopic, ClassName, HtmlFileUrl, WriteTime, LinkTarget, HtmlFileName
  Dim tmp_sql,tmp_sql_order,tmp_url
  Mhead="":tmp_url=""
  Select Case ListAction
  Case "hot"
      mhead=tit
      tmp_sql="A.counter>20"
      tmp_sql_order="A.counter desc"
    If Cls.Get_ChannelSetup(Cls.ChannelSetup,6)=1 then
	If Cls.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=hot' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
    Else
    ChannelRss=""
	End if
  Case "good"
      mhead=tit
      tmp_sql="A.isgood=1"
  	If Cls.Get_ChannelSetup(Cls.ChannelSetup,6)=1 then
	If Cls.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=good' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
	Else
    ChannelRss=""
	End if
  Case "focus"
      mhead=tit
      tmp_sql="A.isfocus=1"
  	If Cls.Get_ChannelSetup(Cls.ChannelSetup,6)=1 then
	If Cls.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=focus' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
	Else
    ChannelRss=""
	End if
  Case "Reward"
      mhead=tit
      tmp_sql="A.Reward>30"	 
      If Cls.Get_ChannelSetup(Cls.ChannelSetup,6)=1 then
	If Cls.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=Reward' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
	Else
    ChannelRss=""
	End if	  	  
  Case "search"
  	  if int(ClsID)>0 then
	  tmp_sql="A.ClassID in ("&Class_Cid_Get(Clsid)&")"
	  else
	  tmp_sql=""
	  end if
	  If Cls.Get_ChannelSetup(Cls.ChannelSetup,6)=1 then
	  If Cls.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?c_id="&cid&"' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
	  Else
      ChannelRss=""
	  End if  
      set obj_search=New Cls_Search
      obj_search.inc_url="?c_id="&ClsID&"action=Search&"
      obj_search.inc_sql=tmp_sql
      call obj_search.format_search("A.Name","A.Name,A.keyes,A.username",2,1,0)
      tmp_url=obj_search.inc_url
      tmp_sql=obj_search.inc_sql
      tmp_keyword=obj_search.keyword
      mhead=mhead&"（"&Cls.code_html(obj_search.keyword,1,0)&"）"
      set obj_search=nothing
  Case "special"
	 tmp_url="?ID="&iSpecialID&"&"
	 tmp_sql="A.SpecialID="&iSpecialID
	 mhead=tit
	 If Cls.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=special&id="&iSpecialID&"' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"	
  Case Else
	  if int(ClsID)>0 then 
	  tmp_sql="A.ClassID="&ClsID
	  mhead=tit
      tmp_url=tmp_url&"c_id="&cid&"&"
	   If Cls.Get_ChannelSetup(Cls.ChannelSetup,6)=1 then
	  If Cls.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?c_id="&ClsID&"' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
	  Else
      ChannelRss=""
	  End if
	  End if
  End Select
  if tmp_sql="" then
    tmp_sql="A.hidden=1"
    else
    tmp_sql="A.hidden=1 and "&tmp_sql
  End if
  if tmp_sql_order="" then
    tmp_sql_order="A.istop desc,A.id desc"
  else
    tmp_sql_order=tmp_sql_order&",A.istop desc,A.id desc"
  End if
  set obj_page=New Cls_PageCute
  obj_page.nummer=Cls.ChannelListNum
  obj_page.page_tit=Cls.ChannelTit
  obj_page.page_unit=Cls.ChannelUnit
  obj_page.v_id="A.id"
  if action="hot" then obj_page.v_id="A.counter"
  tmp_sql=tmp_sql&" And A.ChannelIDs="&ChannelIDs
  call obj_page.p_init("","["&Cls.ChannelTable&"] A INNER JOIn [AsaiMHClass] C ON A.ClassID=C.C_ID",tmp_sql,"")
  sql=obj_page.sql_count
  set rs=Cls.exec(sql,1)
  obj_page.rssum=rs(0)
  rs.close
	    If Instr(HtmlContent,"[ShowList]") > 0 Then
	        ListContents=""
            ListContent = Cls.CutFixContent(HtmlContent, "[ShowList]" , "[/ShowList]", 0)
			'检查分页数据
			If PgID<>"" then obj_page.setpage=PgID
			Call obj_page.p_main("A.ID,A.ClassID,A.TColor,A.Name,A.Reward,A.counter,A.username,A.Tim,A.isgood,A.isfocus,A.istop,A.Replys,A.Solves,A.Expired,A.HtmlFileDate,A.UserName,C.ClassName,C.HtmlFileDir","["&Cls.ChannelTable&"] A INNER JOIn [AsaiMHClass] C ON A.ClassID=C.C_ID",tmp_sql,tmp_sql_order)
			'循还读数据
            For i=1 to obj_page.page_num
                If rs.eof Then exit for
				If (i Mod 2) = 0 Then
					ListStyle = "ll" & 1
				Else
					ListStyle = "ll" & 2
				End If
				If Rs("isgood") <> 0 Then
					BestCode = 2
					BestString = "<font color='red'>推荐</font>"
				Else
					BestCode = 1
					BestString = ""
				End If
				'前标
				sDot=Cls.GetDot(rs("istop"),rs("isfocus"),rs("isgood"))
				sDot=""&sDot&""&Cls.GetOkDot(rs("replys"),rs("Solves"),rs("Expired"))&""
				sTitle = Cls.Cuted(Rs("Name"), Cls.ChannelCuteNum)
				sTitle = Cls.GetTcolor(sTitle,rs("tcolor"),False)
				'-------------搜索关键字显亮 
				sTitle = Cls.Channel_Search(sTitle)
				ClassName = Rs("ClassName")
				If CInt(Cls.ChannelIsCreatHtml) <> 0  Then
					HtmlFileName = Cls.ReadFileName(Rs("HtmlFileDate"), Rs("ID"), Cls.ChannelHtmlExtName, Cls.ChannelHtmlPrefix, Cls.ChannelHtmlForm, "")
					HtmlFileUrl = Cls.Web_Dir& Cls.ChannelDir & "/" & Rs("HtmlFileDir") & Cls.ShowDatePath(Rs("HtmlFileDate"), Cls.ChannelHtmlPath) & HtmlFileName
					ClassName = "<a href='" & Cls.ChannelPath & Rs("HtmlFileDir") & "Index_1" & Cls.ChannelHtmlExtName & "'>" & ClassName & "</a>"
				Else
					HtmlFileUrl = Cls.ChannelPath & "View.asp?id=" & Rs("ID")
					ClassName = "<a href='" & Cls.ChannelPath & "List.asp?c_id=" & Rs("ClassID") & "'>" & ClassName & "</a>"
				End If
				WriteTime = Cls.ShowDateTime(Rs("tim"),5)
				If Cls.ChannelIsNewWindow <> 0 Then
					LinkTarget = " target=""_blank"""
				Else
					LinkTarget = ""
				End If
				OkTopic = "<a href='" & HtmlFileUrl & "'" & LinkTarget & " title='" & Cls.ChannelModule & "标题：" & Rs("Name") & "&#13;&#10;发布时间：" & Rs("tim") & "&#13;&#10;阅览次数：" & Rs("counter") & "'>" & sTitle & "</a>"
				AsaiMHReward="<font class=tims>"&rs("Reward")&"</font><img src='/Skin/Skin_1/Small/ico_integral.gIf'>"
				sDot=""&sDot&""&v_jt&""
				Tempstr = ListContent
				Tempstr = Replace(Tempstr, "{$OkTopic}", OkTopic)
				Tempstr = Replace(Tempstr, "{$OkID}", Rs("ID"))
				Tempstr = Replace(Tempstr, "{$OkTitle}", sTitle)
				Tempstr = Replace(Tempstr, "{$Title}", Rs("Name"))
				Tempstr = Replace(Tempstr, "{$Date}", Rs("tim"))
				Tempstr = Replace(Tempstr, "{$Dot}", sDot)
				Tempstr = Replace(Tempstr, "{$BriefTopic}", sTopic)
				Tempstr = Replace(Tempstr, "{$HtmlFileUrl}", HtmlFileUrl)
				Tempstr = Replace(Tempstr, "{$ClassName}", ClassName)
				Tempstr = Replace(Tempstr, "{$AsaiMHReward}", AsaiMHReward)
				Tempstr = Replace(Tempstr, "{$AsaiMHusername}", Rs("UserName"))
				Tempstr = Replace(Tempstr, "[]", "")
				Tempstr = Replace(Tempstr, "{$Target}", LinkTarget)
				Tempstr = Replace(Tempstr, "{$WriteTime}", WriteTime)
				Tempstr = Replace(Tempstr, "{$AticleHits}", Rs("counter"))
				Tempstr = Replace(Tempstr, "{$ListStyle}", ListStyle)
				Tempstr = Replace(Tempstr, "{$BestCode}", BestCode)
				Tempstr = Replace(Tempstr, "{$BestString}", BestString)
				ListContents=ListContents&Tempstr
                rs.movenext
            Next	
  rs.close
  If Cls.ChannelIsCreatHtml = True And ListAction<>"search" then
  obj_page.pageurl="index_"
  obj_page.pagevar=""
  obj_page.pagefirvar="index_1"&Cls.ChannelHtmlExtName
  obj_page.pageext=Cls.ChannelHtmlExtName
  Else
	  if ListAction="search" then
	    obj_page.pageurl = tmp_url
	  elseif  ListAction<>"" and ListAction<>"List" then
        obj_page.pageurl=obj_page.pageurl&"ID="&iSpecialID&"&Action="&ListAction&"&"
	  else
	    obj_page.pageurl="?c_id="&ClsID&"&"
	  end if
  End if
        '内容载入替换，并输出或返回 
		HtmlContent = Replace(HtmlContent,"[ShowList]" & ListContent&"[/ShowList]",ListContents)
		HtmlContent = Replace(HtmlContent,"{$tit}", Tit)
		HtmlContent = Replace(HtmlContent,"{$mhead}", mhead)
		HtmlContent = Replace(HtmlContent,"{$Channel_Xml}", ChannelRss)
		PageCt="<div id='asaipage'>"&obj_page.page_var&"分页："&obj_page.page_cute&""&obj_page.page_shortcut&"</div>"
        HtmlContent = Replace(HtmlContent,"{$PageCute}",PageCt)
		Call LoadChannelSort(ClsID,1)
		Call LoadChannelSearch()
		Call LoadChannelSpecial()
		Call Html.LoadReplaced()	
		HtmlContent=Replace(HtmlContent,"{$ClassID}",ClsID)
 		HtmlContent = Html.ReadWebHead(HtmlContent)
		HtmlContent = Html.ReadWebEnd(HtmlContent)
		HtmlContent = Html.ReadUserLogin(HtmlContent)
    	HtmlContent = Html.ReadOkList(HtmlContent)
		HtmlContent = Html.ReadChannelMenu(HtmlContent)
		HtmlContent = Cls.ReHtml(HtmlContent,0)	
 		If IsHtml=True Then
		    ShowChannelList = HtmlContent
		Else
		    Response.Write HtmlContent
		End If
	    set obj_page=nothing 	
  End If
End Function

Public Function ShowMyList(IsHtml,ClsID,PgID,ListAction)
	    Select Case ListAction
	    Case "reply"
	    	tit="我的回答"
	    	tit_fir=Cls.ChannelName
			Tit_Dir = Class_Grade(ClsID,Cls.ClassDepth) & Tit
			IndexUrl=Cls.Web_Dir & Cls.ChannelDir
			HtmlContent = Cls.ReadTemplate(10)
		Case Else
		    tit="我的问题"
			tit_fir=Cls.ChannelName
	    	Tit_Dir = Class_Grade(ClsID,Cls.ClassDepth) & Tit
			IndexUrl=Cls.Web_Dir & Cls.ChannelDir
			HtmlContent = Cls.ReadTemplate(10)
	    End Select
  Dim dbTable
  Dim ListContent,ListContents,HtmlUrl
  Dim Mhead,obj_search,obj_page
  Dim Tempstr, PageCt
  Dim SQL, i, foundstr, ListStyle
  Dim sDot,sTitle, sTopic, BestCode, BestString
  Dim OkTopic, ClassName, HtmlFileUrl, WriteTime, LinkTarget, HtmlFileName
  Dim tmp_sql,tmp_sql_order,tmp_url,tmp_keyword
  Mhead="":tmp_url=""
  Select Case ListAction
  Case "reply"
      dbTable="AsaiMHOk_reply"
      tmp_sql="A.UserName='"&login_username&"'"
	  tmp_sql_order="A.id desc"
	  mhead=tit
  set obj_page=New Cls_PageCute
  obj_page.nummer=Cls.ChannelListNum
  obj_page.page_tit=Cls.ChannelTit
  obj_page.page_unit=Cls.ChannelUnit
  obj_page.v_id="A.id"
  tmp_sql=tmp_sql&" And A.ChannelIDs="&ChannelIDs
  call obj_page.p_init("","["&dbTable&"]  A INNER JOIn [AsaiMHOk] B ON A.R_ID=B.ID",tmp_sql,"")
  sql=obj_page.sql_count
  set rs=Cls.exec(sql,1)
  obj_page.rssum=rs(0)
  rs.close
	    If Instr(HtmlContent,"[ShowList]") > 0 Then
	        ListContents=""
            ListContent = Cls.CutFixContent(HtmlContent, "[ShowList]" , "[/ShowList]", 0)
			'检查分页数据
			If PgID<>"" then obj_page.setpage=PgID
			Call obj_page.p_main("A.ID,A.r_id,A.username,A.Tim,B.name,B.istop,B.isfocus,B.isgood,B.replys,B.Solves,B.Expired","["&dbTable&"]  A INNER JOIn [AsaiMHOk] B ON A.R_ID=B.ID",tmp_sql,tmp_sql_order)
			'循还读数据
            For i=1 to obj_page.page_num
                If rs.eof Then exit for
				If (i Mod 2) = 0 Then
					ListStyle = "ll" & 1
				Else
					ListStyle = "ll" & 2
				End If
				'前标
				
				sDot=Cls.GetDot(rs("istop"),rs("isfocus"),rs("isgood"))
				sDot=""&sDot&""&Cls.GetOkDot(rs("replys"),rs("Solves"),rs("Expired"))&""
				sTopic = ""
				sTitle = Cls.Cuted(Rs("Name"), Cls.ChannelCuteNum)
				WriteTime = Cls.ShowDateTime(Rs("tim"),5)
				If Cls.ChannelIsNewWindow <> 0 Then
					LinkTarget = " target=""_blank"""
				Else
					LinkTarget = ""
				End If
				ClassName=""
				HtmlFileUrl = Cls.ChannelPath & "View.asp?id=" & Rs("R_ID")
				OkTopic = "<a href='" & HtmlFileUrl & "'" & LinkTarget & " title='" & Cls.ChannelModule & "内容：" & rs("name") & "&#13;&#10;发布时间：" & Rs("tim") & "'>" & sTitle & "</a>"
				Tempstr = ListContent
				Tempstr = Replace(Tempstr, "{$OkTopic}", OkTopic)
				Tempstr = Replace(Tempstr, "{$OkID}", Rs("ID"))
				Tempstr = Replace(Tempstr, "{$OkTitle}", sTitle)
				Tempstr = Replace(Tempstr, "{$Title}", sTitle)
				Tempstr = Replace(Tempstr, "{$Date}", Rs("tim"))
				Tempstr = Replace(Tempstr, "{$Dot}", sDot)
				Tempstr = Replace(Tempstr, "{$BriefTopic}", sTopic)
				Tempstr = Replace(Tempstr, "{$HtmlFileUrl}", HtmlFileUrl)
				Tempstr = Replace(Tempstr, "{$ClassName}", ClassName)
				Tempstr = Replace(Tempstr, "{$AsaiMHReward}", AsaiMHReward)
				Tempstr = Replace(Tempstr, "{$AsaiMHusername}", Rs("UserName"))
				Tempstr = Replace(Tempstr, "[]", "")
				Tempstr = Replace(Tempstr, "{$Target}", LinkTarget)
				Tempstr = Replace(Tempstr, "{$WriteTime}", WriteTime)
				Tempstr = Replace(Tempstr, "{$ListStyle}", ListStyle)
				Tempstr = Replace(Tempstr, "{$BestCode}", BestCode)
				Tempstr = Replace(Tempstr, "{$BestString}", BestString)
				ListContents=ListContents&Tempstr
                rs.movenext
            Next	
  rs.close
 	    obj_page.pageurl = tmp_url
        obj_page.pageurl=obj_page.pageurl&"ID="&iSpecialID&"&Action="&ListAction&"&"
        '内容载入替换，并输出或返回 
		HtmlContent = Replace(HtmlContent,"[ShowList]" & ListContent&"[/ShowList]",ListContents)
		HtmlContent = Replace(HtmlContent,"{$tit}", Tit)
		HtmlContent = Replace(HtmlContent,"{$mhead}", mhead)
		HtmlContent = Replace(HtmlContent,"{$Channel_Xml}", ChannelRss)
		PageCt="<div id='asaipage'>"&obj_page.page_var&"分页："&obj_page.page_cute&""&obj_page.page_shortcut&"</div>"
        HtmlContent = Replace(HtmlContent,"{$PageCute}",PageCt)
		Call LoadChannelSort(ClsID,1)
		Call LoadChannelSearch()
		Call LoadChannelSpecial()
		Call Html.LoadReplaced()	
		HtmlContent=Replace(HtmlContent,"{$ClassID}",ClsID)
 		HtmlContent = Html.ReadWebHead(HtmlContent)
		HtmlContent = Html.ReadWebEnd(HtmlContent)
		HtmlContent = Html.ReadUserLogin(HtmlContent)
    	HtmlContent = Html.ReadOkList(HtmlContent)
		HtmlContent = Html.ReadChannelMenu(HtmlContent)
		HtmlContent = Cls.ReHtml(HtmlContent,0)	
 		If IsHtml=True Then
		    ShowChannelList = HtmlContent
		Else
		    Response.Write HtmlContent
		End If
	    set obj_page=nothing  
  End If
  Case Else
	  dbTable="AsaiMHOk" 
	  tmp_sql="UserName='"&login_username&"'"
	  tmp_sql_order="istop desc,id desc"
	  mhead=tit
      tmp_sql="hidden=1 and "&tmp_sql
  set obj_page=New Cls_PageCute
  obj_page.nummer=Cls.ChannelListNum
  obj_page.page_tit=Cls.ChannelTit
  obj_page.page_unit=Cls.ChannelUnit
  obj_page.v_id="id"
  tmp_sql=tmp_sql&" And ChannelIDs="&ChannelIDs
  call obj_page.p_init("","["&dbTable&"]",tmp_sql,"")
  sql=obj_page.sql_count
  set rs=Cls.exec(sql,1)
  obj_page.rssum=rs(0)
  rs.close
	    If Instr(HtmlContent,"[ShowList]") > 0 Then
	        ListContents=""
            ListContent = Cls.CutFixContent(HtmlContent, "[ShowList]" , "[/ShowList]", 0)
			'检查分页数据
			If PgID<>"" then obj_page.setpage=PgID
			Call obj_page.p_main("ID,ClassID,TColor,Name,Reward,counter,username,Tim,isgood,isfocus,istop,Replys,Solves,Expired,HtmlFileDate,UserName","["&dbTable&"]",tmp_sql,tmp_sql_order)
			'循还读数据
            For i=1 to obj_page.page_num
                If rs.eof Then exit for
				If (i Mod 2) = 0 Then
					ListStyle = "ll" & 1
				Else
					ListStyle = "ll" & 2
				End If
				If Rs("isgood") <> 0 Then
					BestCode = 2
					BestString = "<font color='red'>推荐</font>"
				Else
					BestCode = 1
					BestString = ""
				End If
				'前标
				sDot=Cls.GetDot(rs("istop"),rs("isfocus"),rs("isgood"))
				sDot=""&sDot&""&Cls.GetOkDot(rs("replys"),rs("Solves"),rs("Expired"))&""
				'sTopic = Cls.GetIncInfo(Rs("IncludeInfo"))
				sTitle = Cls.Cuted(Rs("Name"), Cls.ChannelCuteNum)
				sTitle = Cls.GetTcolor(sTitle,rs("tcolor"),False)
				'-------------搜索关键字显亮 
				sTitle = Cls.Channel_Search(sTitle)
				WriteTime = Cls.ShowDateTime(Rs("tim"),5)
				If Cls.ChannelIsNewWindow <> 0 Then
					LinkTarget = " target=""_blank"""
				Else
					LinkTarget = ""
				End If
				ClassName=""
				HtmlFileUrl = Cls.ChannelPath & "View.asp?id=" & Rs("ID")
				OkTopic = "<a href='" & HtmlFileUrl & "'" & LinkTarget & " title='" & Cls.ChannelModule & "标题：" & Rs("Name") & "&#13;&#10;发布时间：" & Rs("tim") & "&#13;&#10;阅览次数：" & Rs("counter") & "'>" & sTitle & "</a>"
				AsaiMHReward="<font class=tims>"&rs("Reward")&"</font><img src='/Skin/Skin_1/Small/ico_integral.gIf'>"
				sDot=""&sDot&""&v_jt&""
				Tempstr = ListContent
				Tempstr = Replace(Tempstr, "{$OkTopic}", OkTopic)
				Tempstr = Replace(Tempstr, "{$OkID}", Rs("ID"))
				Tempstr = Replace(Tempstr, "{$OkTitle}", sTitle)
				Tempstr = Replace(Tempstr, "{$Title}", Rs("Name"))
				Tempstr = Replace(Tempstr, "{$Date}", Rs("tim"))
				Tempstr = Replace(Tempstr, "{$Dot}", sDot)
				Tempstr = Replace(Tempstr, "{$BriefTopic}", sTopic)
				Tempstr = Replace(Tempstr, "{$HtmlFileUrl}", HtmlFileUrl)
				Tempstr = Replace(Tempstr, "{$ClassName}", ClassName)
				Tempstr = Replace(Tempstr, "{$AsaiMHReward}", AsaiMHReward)
				Tempstr = Replace(Tempstr, "{$AsaiMHusername}", Rs("UserName"))
				Tempstr = Replace(Tempstr, "[]", "")
				Tempstr = Replace(Tempstr, "{$Target}", LinkTarget)
				Tempstr = Replace(Tempstr, "{$WriteTime}", WriteTime)
				Tempstr = Replace(Tempstr, "{$AticleHits}", Rs("counter"))
				Tempstr = Replace(Tempstr, "{$ListStyle}", ListStyle)
				Tempstr = Replace(Tempstr, "{$BestCode}", BestCode)
				Tempstr = Replace(Tempstr, "{$BestString}", BestString)
				ListContents=ListContents&Tempstr
                rs.movenext
            Next	
  rs.close
	    obj_page.pageurl = tmp_url
        obj_page.pageurl=obj_page.pageurl&"ID="&iSpecialID&"&Action="&ListAction&"&"
        '内容载入替换，并输出或返回 
		HtmlContent = Replace(HtmlContent,"[ShowList]" & ListContent&"[/ShowList]",ListContents)
		HtmlContent = Replace(HtmlContent,"{$tit}", Tit)
		HtmlContent = Replace(HtmlContent,"{$mhead}", mhead)
		HtmlContent = Replace(HtmlContent,"{$Channel_Xml}", ChannelRss)
		PageCt="<div id='asaipage'>"&obj_page.page_var&"分页："&obj_page.page_cute&""&obj_page.page_shortcut&"</div>"
        HtmlContent = Replace(HtmlContent,"{$PageCute}",PageCt)
		Call LoadChannelSort(ClsID,1)
		Call LoadChannelSearch()
		Call LoadChannelSpecial()
		Call Html.LoadReplaced()	
		HtmlContent=Replace(HtmlContent,"{$ClassID}",ClsID)
 		HtmlContent = Html.ReadWebHead(HtmlContent)
		HtmlContent = Html.ReadWebEnd(HtmlContent)
		HtmlContent = Html.ReadUserLogin(HtmlContent)
    	HtmlContent = Html.ReadOkList(HtmlContent)
		HtmlContent = Html.ReadChannelMenu(HtmlContent)
		HtmlContent = Cls.ReHtml(HtmlContent,0)	
 		If IsHtml=True Then
		    ShowChannelList = HtmlContent
		Else
		    Response.Write HtmlContent
		End If
	    set obj_page=nothing 	
  End if
  End Select	
End Function

'//* 爱问浏览 *//
Public Function ShowChannelView(Vid,IsHtml)
    '初始载入
	tit=Cls.ChannelTit&"浏览"
   If Cls.Is_Null(vid)="" Then vid=Cls.Code_ID("id")
   v_id=vid
   	SQL="Select Top 1 * From AsaiMHUserData Where username='"&login_username&"'"
   		Set Rs=Cls.Exec(SQL,1)
   		If not Rs.Eof Then
      integral=rs("integral")
	   Rs.Close
	   end if
	SQL="Select Top 1 * From "&Cls.ChannelTable&" Where hidden=1 And ChannelIDs="&ChannelIDs&" And id="&v_id
	Set Rs=Cls.Exec(SQL,1)
	If Rs.Eof Then
	   Rs.Close
		Call Channel_Redirect(Cls.Web_Dir&Cls.ChannelDir)
	End If
	cid=rs("ClassID")
	v_username=rs("Username")
	v_name=rs("Name")
	v_remark=rs("Word")
	v_tim=rs("Tim")
	v_counter=rs("Counter")
	v_cod=rs("Cod")
	v_tcolor=rs("tColor")
	v_Solves=rs("Solves")
	v_Reward=rs("Reward")
	v_Expired=rs("Expired")
	v_replys=rs("replys")
	v_file=Rs("HtmlFileDate")
	Rs.Close
	'头部信息
	no_reply=false
	if login_username = v_username then no_reply=true
	If Int(Web_Dim(15)) = 0 Then
	   tit=tit&"--"&v_name
        Else
	   tit=v_name&"--"&tit
	End if
	Tit_Dir = Class_Grade(Cid,Cls.ClassDepth) & Cls.ChannelTit&"浏览" &":"& Tit
	tit_fir=Cls.ChannelName
	IndexUrl=Cls.Web_Dir & Cls.ChannelDir
   '信息处理
  if Cls.Is_Null(v_tcolor)<>"" then v_topic="<font color="&v_tcolor&">"&v_topic&"</font>"
  If Cls.ErrTrue Then tmp_err=commend_error(ChannelIDs,v_topic,v_id,Cls.ChannelName)
  tmp_commend=format_commend(Cls.ChannelName,v_topic,Cls.Web_Dir&Cls.ChannelDir&"/View.asp?id="&v_id)
  If v_IntactTitle="" Then
    tmp_topic=v_name
  Else
    tmp_topic=v_IntactTitle
  End If
        v_remark=Ubb.Ubbcode(v_remark)
        v_remark = KeyWord_Url(v_remark) '关键字显亮＋链接
  tmp_quick=""
  tmp_edit=""
  if v_Solves<>1 and v_username<>login_username and v_Expired>now()  then
  tmp_quick="&nbsp;<input type=button value='我来回答' class=btn  onClick=""location.href='#Channel_Reply';"">"
  end if
  if v_Solves<>1 and v_username=login_username and v_Expired>now() then
  tmp_edit="&nbsp;<input type=button onClick=""location.href='Edit.asp?Action=Ok_edit&id="&v_id&"';"" value='编辑问题' class=btn>"
  end if
  if v_Solves<>1 and v_username=login_username and v_Expired<now() then
  tmp_edit="<form method=post action=View.asp?id="&v_id&"><td>&nbsp;<input name='closer' type='submit' value='关闭问题' size='10' class=btn></td></form>"
  end if
  if request("closer")="关闭问题" then
  call Cls.exec("update "&Cls.ChannelTable&" set hidden=false where id="&v_id,0)
  'call Cls.exec("update AsaiMHUserData set integral=integral+"&v_Reward&" where username='"&v_username&"'",0)
  response.write"<script>alert('此问题已关闭,为保障回答者利益,提问时扣除您的"&v_Reward&"积分将不给予返还,敬请理解！');window.navigate('Index.asp');</script>"
  end if
  if v_Solves<>1 and v_username=login_username then
  Canada=trim(request.form("Sfen"))
  tmp_Canada=tmp_Canada&"<table cellspacing=1 cellpadding=0 border=0><form method=post action=View.asp?id="&v_id&">" & _
  vbcrlf&"<tr><td><select name='Sfen'><option value="&Pm+5&">5分</option><option value="&Pm+10&">10分</option><option value="&Pm+15&">15分</option><option value="&Pm+20&">20分</option><option value="&Pm+25&">25分</option><option value="&Pm+30&">30分</option></select> </td><td> <input name='Tours' type='submit' value='追加赏分' size='10' class=btn></td><td>"& tmp_quick &"</td><td>"& tmp_edit&"</td></tr></form></table>"
  if request("Tours")="追加赏分" then
  Canada_Pm=int(Canada)-Pm
  tmptrue=false
  if int(integral)>=int(Canada_Pm) then tmptrue=true
  if not tmptrue then
  response.write"<script>alert('您的积分不足!');history.back();</script>"
      exit Function
    end if
  call Cls.exec("update AsaiMHOk set Reward=Reward+"&Canada_Pm&" where id="&v_id,0)
  call Cls.exec("update AsaiMHOk set Expired=Expired+"&Canada_Pm&" where id="&v_id,0)
  call Cls.exec("update AsaiMHUserData set integral=integral-"&Canada_Pm&" where username='"&v_username&"'",0)
  response.write"<script>alert('成功追加悬赏分（"&Canada_Pm&"分），问题过期时间将延期（"&Canada_Pm&"天）！');window.navigate('View.asp?id="&v_id&"');</script>"
  exit Function
  end if
  else
  	tmp_Canada= tmp_quick & tmp_edit
  end if
    v_jt=Cls.GetOkDot(v_replys,v_Solves,v_Expired)
    tmp_Reward=Img_Alt("ico_integral","积分")&" <font color=red>"&v_Reward&" 分</font>"
if v_Solves<>1 then
if now()<v_Expired then
tmp_tims="<font class=Gys>离问题结束还有 "&DateDiff("d",now(),v_Expired)&" 天</font>"
end if
if now()>v_Expired and v_replys<>0 then
tmp_tims="<font class=Gys>离问题结束还有 "&DateDiff("d",now(),v_Expired)&" 天</font>"
end if
else 
tmp_tims="&nbsp;"
end if
dim R
  If Cls.Is_null(v_Subtitle)<>"" Then  v_Subtitle="——"&v_Subtitle
  R="问题浏览"
  '//===========================================
  HtmlContent=Cls.ReadTemplate(3)  
  HtmlContent=Replace(HtmlContent,"{$tit_fir}",Cls.ChannelTit)  
  HtmlContent=Replace(HtmlContent,"{$topic}",v_name) 
  HtmlContent=Replace(HtmlContent,"{$tcolor}",v_tcolor)
  HtmlContent=Replace(HtmlContent,"{$tim}",Cls.time_type(v_tim,4))
  HtmlContent=Replace(HtmlContent,"{$tit}",R)
  HtmlContent=Replace(HtmlContent,"{$username}",format_user_view(v_username,1,0))
  HtmlContent=Replace(HtmlContent,"{$v_jt}",v_jt)
  HtmlContent=Replace(HtmlContent,"{$editbar}",tmp_Canada)
  HtmlContent=Replace(HtmlContent,"{$Grade}",Ok_Grade(v_username))
  HtmlContent=Replace(HtmlContent,"{$Reward}",tmp_Reward)
  HtmlContent=Replace(HtmlContent,"{$ChannelTit}",Cls.ChannelTit)
  HtmlContent=Replace(HtmlContent,"{$tims}",tmp_tims)
  HtmlContent=Replace(HtmlContent,"{$replys}",v_replys)
  HtmlContent=Replace(HtmlContent,"{$answer}",LoadChannelReply())
  HtmlContent=Replace(HtmlContent,"{$remark}",v_remark)
  HtmlContent=Replace(HtmlContent,"{$pagecute}",tmp_pagecute)
  HtmlContent=Replace(HtmlContent,"{$Reply}",Channel_Reply())
  HtmlContent=Replace(HtmlContent,"{$counter}",v_counter)
       '不要评论
       ' If Cls.ReviewTrue Then 
       ' HtmlContent=Replace(HtmlContent,"{$review}",review_type(ChannelIDs,v_id,Cls.Web_Dir&Cls.ChannelDir&"/View.asp?id="&v_id,1,v_username,""))
	   ' else
       ' HtmlContent=Replace(HtmlContent,"{$review}","评论已经关闭，请联系管理员")
	  ' end if
	    HtmlContent=Replace(HtmlContent,"{$counter}",v_counter)
	    Call Cls.Exec("update "&Cls.ChannelTable&" set counter=counter+1 where id="&v_id,0)
  '载入模板函数
  Call LoadChannelSort(Cid,1)
  Call LoadChannelSearch()
  Call LoadChannelSpecial()
  Call Html.LoadReplaced()
  HtmlContent = Replace(HtmlContent,"{$ClassID}",cid)
  HtmlContent = Html.ReadWebHead(HtmlContent)
  HtmlContent = Html.ReadWebEnd(HtmlContent)
  HtmlContent = Html.ReadUserLogin(HtmlContent)
  HtmlContent = Html.ReadOkList(HtmlContent)
  'HtmlContent = Html.ReadRelateList(HtmlContent,ChannelIDs,v_id,v_keyes,Cls.ChannelIsCreatHtml)  
  HtmlContent = Html.ReadChannelMenu(HtmlContent)
  '判断输出
  Dim CFS,obj_page,NewHtmlContent
  set obj_page=New Cls_PageCute
  Dim dim_remark,num_remark,pfile,pagecute_remark,now_remark,HtmlUrl,FilePath,vClassPath,ilepaths,Filepaths,Filepathes,ii,j,HtmlFileName
  dim_remark=split(v_remark,"[PageCute]")
  num_remark=ubound(dim_remark)
  now_remark=0
  For i=0 to num_remark
      If num_remark>0 then
          If Cls.ChannelIsCreatHtml = True then
              obj_page.pageurl=Cls.ReadFileName(v_file, v_id, "_", Cls.ChannelHtmlPrefix, Cls.ChannelHtmlForm, "")
              obj_page.pagefirvar=Cls.ReadFileName(v_file, v_id, "", Cls.ChannelHtmlPrefix, Cls.ChannelHtmlForm, "")
              obj_page.pageext=Cls.ChannelHtmlExt&Cls.ChannelHtmlExtName
			  obj_page.pagevar=""
			  obj_page.setpage=i+1
          Else
              obj_page.pageurl="View.asp?id="&v_id&"&"
			  i=num_remark '只运行一次
          obj_page.nummer=1
          obj_page.rssum=num_remark+1
          obj_page.page_unit="页"
          obj_page.page_tit=""
          call obj_page.p_info()
		  pagecute_remark="<div id='asaipage'>"&obj_page.page_var&" "&obj_page.page_cute&" "&obj_page.page_shortcut&"</div>"
		  now_remark=obj_page.viewpage-1
		  v_remark=dim_remark(now_remark)
       end if
        If int(v_cod)=0 then
        v_remark=Ubb.Ubbcode(v_remark)
        Else
        v_remark=Ubb.HtmlCode(v_remark)
        End if
        v_remark=replace(v_remark,"[PageCute]","")
        v_remark = KeyWord_Url(v_remark) '关键字显亮＋链接
	 end if
		NewHtmlContent=HtmlContent
  		NewHtmlContent=Replace(NewHtmlContent,"{$remark}",v_remark )
        NewHtmlContent=Replace(NewHtmlContent,"{$pagecute}",pagecute_remark)
		NewHtmlContent = Cls.ReHtml(NewHtmlContent,0)	
		If Cls.ChannelIsCreatHtml = True  and IsHtml=True then
		  Set Cfs=New Cls_FileSystem
		   '开始生成文件所在目录
		   vClassPath = Class_Path_Get(cid)
		   FilePath =  vClassPath & Cls.ShowDatePath(v_file, Cls.ChannelHtmlPath)
		   HtmlFileName = Cls.ReadFileName(v_file, v_id, Cls.ChannelHtmlExtName, Cls.ChannelHtmlPrefix, Cls.ChannelHtmlForm, i+1)
		   CfS.CreateHtmlFile Cls.Web_Dir&Cls.ChannelDir,FilePath,HtmlFileName,NewHtmlContent
		   set Cfs=nothing
		Else
		    If IsHtml=True Then
			    ShowChannelView = NewHtmlContent
	        Else
		        Response.Write NewHtmlContent
		        		   End If	
		End If
  Next
set obj_page=nothing
erase dim_remark
End Function

Public Sub LoadOkHelp()
        HtmlContent = Cls.ReadTemplate(11)
		Call LoadChannelSort(0,0)
		Call LoadChannelSearch()
		Call LoadChannelSpecial()
		Call Html.LoadReplaced()		
 		HtmlContent = Html.ReadWebHead(HtmlContent)
		HtmlContent = Html.ReadWebEnd(HtmlContent)
		HtmlContent = Html.ReadUserLogin(HtmlContent)
    	HtmlContent = Html.ReadOkList(HtmlContent)
		HtmlContent = Html.ReadChannelMenu(HtmlContent)
		HtmlContent = Cls.ReHtml(HtmlContent,0)			
		Response.Write HtmlContent
End Sub

'//* 列表初始 *//
Public Sub LoadListFirst()
	Select Case action
	Case "Reward"
		Call ShowChannelList(False,Cid,"","Reward")
	Case "focus"
		Call ShowChannelList(False,Cid,"","focus")		
	Case "good"
		Call ShowChannelList(False,Cid,"","good")
	Case "hot"
		Call ShowChannelList(False,Cid,"","hot")
	Case "search"
		Call ShowChannelList(False,Cid,"","search")
	Case "ask"
		Call ShowMyList(False,0,"","ask")
	Case "reply"
		Call ShowMyList(False,0,"","reply")
	Case "help"
	    Call LoadOkHelp()
	Case Else
		if int(cid)<1 then Call Channel_Redirect(Cls.Web_Dir&Cls.ChannelDir)
		If Class_Child_Get(Cid)=0 Then
		Call ShowChannelList(False,Cid,"","List")
		Else
		Call ShowChannelLists(False,Cid)
		End If
	End Select
End Sub

Sub LoadChannelMainList(ListCid)
    Dim ListContent,ListContents
    Dim tmp1,ncid,ncname,mores
    Dim isdb,lablez,si,ji
	ListContents=""
	If Instr(HtmlContent,"[Repeat=1]") > 0 Then
	   isdb = False
	   lablez = "[Repeat=1]"
	ElseIf Instr(HtmlContent,"[Repeat=2]") > 0 Then
	   isdb =True
	   lablez = "[Repeat=2]"
	Else
	   Call Html.LoadReplaced()
	   Exit Sub
	End If
    ListContent = Cls.CutFixContent(HtmlContent, lablez , "[/Repeat]", 0)
	If ClassTrue Then
	ji=2
	
	for si=0 to ClassNum
		if int(ClassArr(2,si))=ListCid then
			ncid=Int(ClassArr(0,si))
			ncname=ClassArr(1,si)
			tmp1=""
			If Cls.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?c_id="&ncid&"' target=_blank class=dvaam><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
			If Cls.ChannelIsCreatHtml = True then
			mores=Cls.Web_Dir & Cls.ChannelDir & "/"&ClassArr(8,si)&"index_1"&Cls.ChannelHtmlExtName
			Else
			mores="List.asp?c_id="&ncid
			End If
			
            ListContents=ListContents&ListContent 
			ListContents=Replace(ListContents,"{$ClassID}",ncid)
			ListContents=Replace(ListContents,"{$ClassName}",ncname)
			ListContents=Replace(ListContents,"{$more}",mores)
			ListContents=Replace(ListContents,"{$Channel_Xml}",ChannelRss)
			ListContents=Replace(ListContents,"{$Channel_Xml}",ChannelRss)
    		
    		
			
			ji=ji+1
		End If
    next
	
	Else
	ListContents="请先添加分类"
	End If
	HtmlContent=Replace(HtmlContent,lablez & ListContent&"[/Repeat]",ListContents)
	HtmlContent=Replace(HtmlContent,"{$ClassID}",ListCid)
    Call Html.LoadReplaced()
End Sub

'//* 爱问搜索 *//
Public Function LoadChannelSearch()
   If Instr(HtmlContent,"{$Search}")>0 then
   HtmlContent=Replace(HtmlContent,"{$Search}",format_nsort_sea(ChannelSort,img_skin("search"),Class_Select_Type(Cls.ChannelTit,Cls.ClassDepth,0),Cls.ChannelTit))
   End If
End Function

'//* 爱问导航 *//
Public Sub LoadChannelSort(tCid,tCtype)
	Dim TmpStr, TmpImg ,Tmpur1,tmpurl
	If Instr(HtmlContent,"{$SortList}")>0 then
		TmpImg="sort_c1"
		TmpStr="<li>"&VbCrlf
	    if action="Reward" then TmpImg="sort_c2"
	    If Cls.ChannelIsCreatHtml = True then
    	      Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/RewardOk/Index_1"&Cls.ChannelHtmlExtName
    	Else
	          Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/List.asp?Action=Reward"
	    End if	
    	TmpStr=TmpStr&"<div class=slis>"&img_skin(TmpImg)&"<a href='"&Tmpurl&"'>高分"&Cls.ChannelTit&"</a></div>" & _
		       VbCrlf&""
	    TmpImg="sort_c1"
    	if action="focus" then TmpImg="sort_c2"
	    If Cls.ChannelIsCreatHtml = True then
    	      Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/FocusOk/Index_1"&Cls.ChannelHtmlExtName
	    Else
	          Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/List.asp?Action=focus"
        End if	
		TmpStr=TmpStr&"<div class=slis>"&img_skin(TmpImg)&"<a href='"&Tmpurl&"'>焦点"&Cls.ChannelTit&"</a></div>"&VbCrlf&"</li>" & _
		VbCrlf&"<li>"&VbCrlf
    	TmpImg="sort_c1"
	    if action="good" then TmpImg="sort_c2"
	    If Cls.ChannelIsCreatHtml = True then
	          Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/GoodOk/Index_1"&Cls.ChannelHtmlExtName
	    Else
	          Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/List.asp?Action=good"
	    End if	
		TmpStr=TmpStr&"<div class=slis>"&img_skin(TmpImg)&"<a href='"&Tmpurl&"'>推荐"&Cls.ChannelTit&"</a></div>" & _
		VbCrlf&""
	    TmpImg="sort_c1"
	    if action="hot" then TmpImg="sort_c2"
	    If Cls.ChannelIsCreatHtml = True then
	          Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/HotOk/Index_1"&Cls.ChannelHtmlExtName
        Else
    	      Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/List.asp?Action=hot"
    	End if	
	    TmpStr=TmpStr&"<div class=slis>"&img_skin(TmpImg)&"<a href='"&Tmpurl&"'>热门"&Cls.ChannelTit&"</a></div>"&VbCrlf&"</li>"
		TmpStr=TmpStr&vbcrlf&LoadClass(tCid,tCtype,Cls.ChannelIsCreatHtml)
    	HtmlContent=Replace(HtmlContent,"{$SortList}","<ul>"&VbCrlf&Tmpstr&VbCrlf&"</ul>")
   End If
End Sub

'//* 频道专题列表 *//
Public Sub LoadChannelSpecial()
   If Instr(HtmlContent,"{$SpecialList}")>0 then
   	If Not Cls.SpecialTrue Then 
	HtmlContent=Replace(HtmlContent,"{$SpecialList}","没有专题")
	Exit Sub
	End If
	Dim Tmpstr, Sii
	Tmpstr = "<ul>"
	For Sii = 0 To Ubound(Cls.ChannelSpecial,2)
		Tmpstr = Tmpstr & "<li>"&img_skin("sort_c2")&"<a href='Special.asp?ID="&Cls.ChannelSpecial(0,Sii)&"'"
		If iSpecialID = Cls.ChannelSpecial(0,Sii) Then Tmpstr = Tmpstr & " class=red"
		Tmpstr = Tmpstr & ">"&Cls.ChannelSpecial(1,Sii)&"</a></li>"
	Next
	Tmpstr = Tmpstr & "</ul>"
   HtmlContent=Replace(HtmlContent,"{$SpecialList}",Tmpstr)
   End If
End Sub

'//* 专题初始 *//
Public Sub LoadSpecialFirst()
   SQL = "Select Top 1 * From [AsaiMHSpecial] Where ID="&iSpecialID
   Set Rs=Cls.Exec(SQL,1)
   If Rs.Eof Then
	  Rs.Close
	  Call Channel_Redirect(Cls.Web_Dir&Cls.ChannelDir)
   End If
   iSpecialTopic = Cls.Code_Html(Rs("Name"),1,0)
   iSpecialRemark = Rs("Remark")
   iSpecialTim = Cls.Time_Type(Rs("Tim"),1)
   Rs.Close
   Call ShowChannelList(False,Cid,"","special")
End Sub

Public Sub Channel_Put()
 Dim Name,ClassID,username,word,Found_Err,Reward,tmptrue,chkputpower
 dim AsaiMHOk,AsaiMHReward,AsaiMHDates
 dim_Ok=split(Cls.ChannelOption,"|")
 chkputpower=chk_putpower(ChannelIDs)
 if Cls.chk() then
    Name=Cls.Code_Admin("Name",1,40)
    word=Cls.Code_Remark("word")
    csid=Cls.Code_Form("ClassID")
	Reward=Cls.Code_Int("Reward",0)
  If Name="" or word="" Then
    Found_Err=Found_Err&"+发布信息的 <font color=red>标题、内容</font> 不能为空！<br />"
  End If
  If cs_nd(csid)=false Then
    Found_Err=Found_Err&"+请选择"&tit_fir&"分类！如有下级分类，请如实选择所属下级分类<br />"
  End If
  If Reward>login_integral Then
    Found_Err=Found_Err&"+你的 <font color=red>积分</font> 不足,请改小积分 ！<br />"
  End If
  if Not Cls.CodeIsTrue() then
	Found_Err=Found_Err&"+您输入的 <font color=red>验 证 码</font> 为空或有错误，请勿非法提交！<br />"
  End If
	If Found_Err<>"" Then
	     ChannelIDs = 0
         Cls.ReadPage "common"
	     Cls.HtmlRcod "msg",Found_Error(Found_Err,460)
	     Cls.HtmlRcod "tit",tit
	     Cls.OutPage
    exit Sub
     End If
    Call Chk_Cid()
  SQL="Select * From "&Cls.ChannelTable&" Where (ID is Null)"
  Call Cls.exe_conn(Rs,SQL,3)
  Rs.addnew
  Rs("ChannelIDs")=ChannelIDs
  Rs("SpecialID")=0
  Rs("ClassID")=cid
  Rs("cod")=1
  Rs("Name")=Name
  Rs("username")=login_username
  Rs("tim")=Cls.now_time
  Rs("Expired")=DateAdd("d",15,Cls.now_time)
  Rs("counter")=0
  Rs("isgood")=0
  If chkputpower=True Then
  	Rs("hidden")=1
  Else
  	Rs("hidden")=0
  End If
  Rs("Reward")=Reward
  Rs("Istop")=0
  Rs("Isfocus")=0
  Rs("word")=word
  Rs("tcolor")=""
  Rs.update
  Rs.close
   Call Cls.Exec("update AsaiMHUserData set ok_counter=ok_counter+1 where username='"&login_username&"'",0)
   Call Cls.exec(sql,0)
   Call Cls.exec("update AsaiMHUserData set integral=integral-"&int(Reward)&" where username='"&login_username&"'",0)
  Call Cls.Channel_Count(ChannelIDs)
  If chkputpower=True Then
  	Response.write Cls.js_put("alert(""您已成功发布一个问题,请等待别人为你解答吧！\n\n点击返回……"");location.href='./';",1)
  Else
  	Response.write Cls.js_put("alert(""您已成功发布一个问题,请等待别人为你解答吧！\n\n请等待管理审核通过！\n\n点击返回……"");location.href='./';",1)
  End If
end if 
  if Cls.Get_ChannelSetup(Cls.ChannelSetup,0)=0 then
    call put_close("发表")
    exit sub
  end if
  dim n_put
  tit_fir = Cls.ChannelTit
  n_put =""
  n_put = n_put &"<tr><td>"&tit_fir&"标题：</td><td><input type=text name=Name size=50 maxlength=100></td></tr>"
  n_put = n_put & ShowClassSel(ChannelIDs,ClassID,Cls.ClassDepth)
  n_put = n_put & ShowSpecialSel(ChannelIDs,0) 
  n_put = n_put & "<tr><td>悬赏分：</td><td><input type=text size=5 name=Reward value='0'>  你目前有<font color=red>"&login_integral&"</font>分可用</td></tr>"
  n_put = n_put & ShowUBBEditor("9","add_frm","word","内容","","Simple",480,250)  
  n_put = n_put & "<tr><td>上传图片：</td><td><iframe id=UploadFiles width='98%' height=30 frameborder=0 scrolling=no src='"&Cls.Web_Dir&"Include/Upload.asp?ID="&ChannelIDs&"&Type=0&Obj=word'></iframe></td></tr>"
        HtmlContent = Cls.ReadTemplate(9)
		HtmlContent = Replace(HtmlContent, "{$n_redx}",redx)
		HtmlContent = Replace(HtmlContent, "{$n_put}",n_put)
		HtmlContent = Replace(HtmlContent, "{$n_GetCode}",Cls.GetCode)
		Call LoadChannelSort(0,0)
		Call LoadChannelSearch()
		Call LoadChannelSpecial()
		Call Html.LoadReplaced()		
 		HtmlContent = Html.ReadWebHead(HtmlContent)
		HtmlContent = Html.ReadWebEnd(HtmlContent)
		HtmlContent = Html.ReadUserLogin(HtmlContent)
    	HtmlContent = Html.ReadOkList(HtmlContent)
		HtmlContent = Html.ReadChannelMenu(HtmlContent)
		HtmlContent = Cls.ReHtml(HtmlContent,0)		
		Response.Write HtmlContent
End Sub

Public Function InterceptString(txt,length) 
Dim x,y,ii,c,ischines,isascii,tempStr 
txt=trim(txt) 
x = len(txt) 
y = 0 
if x >= 1 then 
for ii = 1 to x 
c=asc(mid(txt,ii,1)) 
if c< 0 or c >255 then 
'说明是一个中文字符 
y = y + 2 
ischines=1 
isascii=0 
else 
'说明是一个ascii码 
y = y + 1 
ischines=0 
isascii=1 
end if 
'如果长度已经大于定义子字符串长度，就判断是否包含敏感字符串是否分开 
if y >= length then 
if ischines=1 and StrCount(left(trim(txt),ii),"<a")=StrCount(left(trim(txt),ii),"</a>") then 
txt = left(trim(txt),ii) '"字符串限长 
exit for 
else 
if isascii=1 then x=x+1 
end if 
end if 
next 
InterceptString = txt 
else 
InterceptString = "" 
end if 
End Function 
'判断字符串出现的次数 
Function StrCount(Str,SubStr) 
Dim iStrCount 
Dim iStrStart 
Dim iTemp 
iStrCount = 0 
iStrStart = 1 
iTemp = 0 
Str=LCase(Str) 
SubStr=LCase(SubStr) 
Do While iStrStart < Len(Str) 
iTemp = Instr(iStrStart,Str,SubStr,vbTextCompare) 
If iTemp <=0 Then 
iStrStart = Len(Str) 
Else 
iStrStart = iTemp + Len(SubStr) 
iStrCount = iStrCount + 1 
End If 
Loop 
StrCount = iStrCount 
End Function

Function Ok_Grade(Ok_UserName)
dim_Ok=Split(Cls.ChannelOption,"|")
  Dim UserPut,UserLevelName,Powern,Pg_Star,Pg_Power,Pg_Grade_Name,gi,ok_helpnum
  Dim  SQLs,Rss
  SQLs="Select * From AsaiMHUserData Where Username='"&Ok_UserName&"'"
	Set Rss=Cls.Exec(SQLs,1)
	If Rss.Eof Then
		Rss.Close
		Call Channel_Redirect(Cls.Web_Dir&Cls.ChannelDir)
	End If
    ok_helpnum=rss("ok_helpnum")
	Rss.Close
  UserPut = Split(dim_Ok(5),":")
  UserLevelName = Split(dim_Ok(6),":")
  For gi = 0 To Ubound(UserPut)-1
      If int(ok_helpnum)>=int(UserPut(gi)) Then
      Pg_Star=gi
	  Pg_Grade_Name=UserLevelName(gi)
	  End If
  Next
  Erase UserPut
  Erase UserLevelName
  Ok_Grade=Pg_Grade_Name
End Function

'//* 回答问题初始 *//
Public Sub Channel_Reply_Chk()
Dim Word,Uls,ok_reply,Reply_expression,UserName,Tim,R_id,Found_Err
  if Not Cls.CodeIsTrue() then
    Response.Write Cls.js_put("alert(""您输入的 验证码 为空或有错误，\n请勿非法提交！"");location.href='View.asp?id="&v_id&"';",1)
    exit Sub	
  End If
  If Cls.chk() then
  Word=Cls.Code_Remark("Word")
  UserName=Cls.Code_Admin("UserName",1,20)
  Tim=Cls.Code_Admin("Tim",1,20)
  Uls=Cls.Code_Admin("Uls",1,100)
  R_id=Cls.Code_Int("R_id",0)
  If Cls.Is_Null(Uls)="" or Uls="http://" Then Uls=""
  SQL="Select * From AsaiMHOk_reply Where (ID is Null)"
  Call Cls.exe_conn(Rs,SQL,3)
  Rs.addnew
  Rs("ChannelIDs")=ChannelIDs
  Rs("Word")=Word
  Rs("UserName")=Login_username
  Rs("Uls")=Uls
  Rs("R_id")=v_id
  Rs("Tim")=Cls.Now_time
  Rs.update
  Rs.close 
    SQL="update "&Cls.ChannelTable&" set Replys=Replys+1 where id="&v_id&""
    Call Cls.exec(SQL,0)
    SQL="update AsaiMHUserData set ok_reply=ok_reply+1 where username='"&login_username&"'"
    Call Cls.exec(SQL,0)
    If v_Solves=0 Then
    SQL="update AsaiMHUserData set expression=expression+"&int(Reply_expression)&" where username='"&login_username&"'"
    Call Cls.exec(SQL,0)
  End If
  Call Cls.Channel_Count(ChannelIDs)
  Response.Write Cls.js_put("alert(""回答成功,感谢您的参与!\n\n点击返回……"");location.href='View.asp?id="&v_id&"';",1)
  end if
  End Sub

'//* 回答问题列表 *//
Function Channel_Reply()
Dim tmp1,Word,Uls,ok_reply,Reply_expression,UserName,Tim,R_id,Found_Err,AsaiMHtmp1
  If no_reply then exit function
  dim_Ok=split(Cls.ChannelOption,"|")
  Reply_expression=dim_Ok(0)
  if Cls.Is_Null(login_username)="" then
  tmp1=web_nologin
  AsaiMHtmp1=AsaiMHtmp1&"<div class=ats>"&tmp1&""&_
                 vbcrlf&"</div>"
    ElseIf v_Expired<now() and v_Solves=0 then 
  tmp1="此问题已过期，不能对问题进行回答，请追加悬赏积分后继续！"
  ElseIf v_Solves=1 then
  tmp1="此问题已经解决，不能再回答！"
    AsaiMHtmp1=AsaiMHtmp1&"<div class=ats>"&tmp1&""&_
                 vbcrlf&"</div>"
  ElseIf Cls.Chk() Then
  Call Channel_Reply_Chk()
  Else
  Dim n_GetCode,n_word,n_Uls,n_submit,n_FORM
    n_GetCode=Cls.GetCode()
	tit_fir = Cls.ChannelTit
    n_word=ShowUBBEditor("9","add_frm","word","回答","","simple",480,150)
	n_Uls="<input name='Uls' type='text' size='50' value='http://'>"
	n_submit="<INPUT class=btn type=submit  value='提交回答'>　　<input type=reset class=btn value='重新填写'>"
		n_FORM="<FORM name=add_frm onsubmit=javascript:frm_Submitonce(this); action='View.asp?id="&v_id&"' method=post>"
		   AsaiMHtmp1=AsaiMHtmp1&"<div class=dvak><div class=dvat><div class=dvati><li class=dvatid><a class=dvaat name=Channel_Reply>"&_
			vbcrlf&"我来回答"&_ 
		vbcrlf&"</a></li><li class=dvatii></li></div></div><div class=dvac><div class=dvaco><FORM name=add_frm action='View.asp?Action=add&id="&v_id&"' method=post><input type=hidden name=chk value='yes'>"&_ 
			vbcrlf&""&_ 
			vbcrlf&"您的姓名：<input type=text class=txt name=rusername value='"&login_username&"' size=20 maxlength=20><br />"&_
			vbcrlf&""&n_word&"<br />"&_ 
			vbcrlf&"参考资料："&n_Uls&"<br />"&_ 
			vbcrlf&"验 证 码："&Cls.GetCode()&"<br />"&_ 
			vbcrlf&""&n_submit&"<br />"&_ 
			vbcrlf&"</form></div></div></div>"	
  End if
Channel_Reply=AsaiMHtmp1
end function 

'//* 浏览回答初始 *//
Public Function LoadChannelReply()
Dim obj_page,tmp1,R_username,tmp_more
AsaiMHtemp1 = ""
If v_Expired<now() and v_Solves=0 then
  tmp1=tmp1&"此问题已过期，相关回答不能查看，请加悬赏积分后查看！"
  AsaiMHtemp1=AsaiMHtemp1&"<div class=ats>"&tmp1&"</div>"
else
 If v_replys>0 then
	Set obj_page=new Cls_PageCute 
	obj_page.pageurl="View.asp?id="&v_id&"&"			'链接
	obj_page.nummer=4					'调用个数
	obj_page.page_t=1									'两种样式
	obj_page.page_p=5									'翻页显示的个数
	obj_page.page_unit="个"
	obj_page.page_tit="回答"
	obj_page.v_id="id"
	Call obj_page.p_init("id,UserName,Word,Tim,Uls,Isdeal,Vote,Cod","AsaiMHOk_reply","ChannelIDS="&ChannelIDS&" And R_id="&v_id&"","Isdeal desc,id")
	SQL = obj_page.sql_count
	Set rs=Cls.Exec(SQL,1)
	obj_page.rssum=rs(0)
	Rs.Close
	Call obj_page.p_main("id,UserName,Word,Tim,Uls,Isdeal,Vote","AsaiMHOk_reply","ChannelIDS="&ChannelIDS&" And R_id="&v_id&"","Isdeal desc,id")
	For i=1 To obj_page.page_num
	 tmp1=tmp1&Channel_Reply_Load(Rs("id"),Rs("Username"),Rs("Word"),Cls.time_type(Rs("Tim"),4),Rs("Uls"),Rs("Isdeal"),Rs("Vote"))
		Rs.Movenext
	Next
	Rs.Close
  tmp_more="<div id='asaipage'>"&obj_page.page_var&" "&obj_page.page_cute&" "&obj_page.page_shortcut&"</div>"
		   AsaiMHtemp1=AsaiMHtemp1&"<div class=""conh""><b>"&_
			vbcrlf&"其他相关回答"&_ 
			vbcrlf&"</b></div>"&_ 
			vbcrlf&""&tmp1&""&_ 
			vbcrlf&""&tmp_more&""&_ 
			vbcrlf&""
  set obj_page=nothing
  end If
  end If
  LoadChannelReply=AsaiMHtemp1&ukong
End Function

'//* 问题浏览列表 *//
Public Function Channel_Reply_Load(u_id,u_UserName,u_Word,u_Tim,u_Uls,u_Isdeal,u_Vote)
Dim tmp_edit,tmp_Uls,tmp_Accepts,tmp_Isdeal,tmp_Vote,tmpl_Vote,tmp_Vote_tim,tmp_Word,AsaiMHTable
If u_UserName=login_username then no_reply=true
dim_Ok=split(Cls.ChannelOption,"|")
  dim tmp_editbar:tmp_editbar=""
  tmp_Isdeal=""
  If u_UserName=login_username and v_Solves<>1 then
  tmp_edit="<input type=button class=btn onClick=""location.href='Edit.asp?Action=reply_edit&id="&u_id&"';"" value='编辑回答'>"
  end If
  tmp_Uls=""
  If u_Uls<>"" Then tmp_Uls="<p>参考资料：<a href="&u_Uls&" target=_blank>"&u_Uls&"</a></p>"
   If request("deal")="采纳答案" then
   Call Cls.exec("update AsaiMHOk_reply set isdeal=1 where ChannelIDs="&ChannelIDs&" and R_id="&v_id&" and id="&request("rid"),0)
   Call Cls.exec("update AsaiMHOk set Solves=1 where ChannelIDs="&ChannelIDs&" and id="&v_id,0)
   Call Cls.exec("update AsaiMHOk set Jieuser='"&u_UserName&"' where ChannelIDs="&ChannelIDs&" and id="&v_id&" and "&u_id&"="&request("rid"),0)
   Call Cls.exec("update AsaiMHUserData set integral=integral+"&int(v_Reward)&" where username='"&u_UserName&"' and "&u_id&"="&request("rid"),0)
   Call Cls.exec("update AsaiMHUserData set ok_helpnum=ok_helpnum+1 where username='"&u_UserName&"' and "&u_id&"="&request("rid"),0)
	 Response.Write Cls.js_put("alert(""您已经成功采纳答案！您的问题已经解决！\n\n点击返回……"");location.href='View.asp?id="&v_id&"';",1)
  end If
   If request("t_Vote")="投票" then
   Call Cls.exec("update AsaiMHOk_reply set Vote=Vote+1 where ChannelIDs="&ChannelIDs&" and R_id="&v_id&" and id="&request("rid")&" and "&u_id&"="&request("rid"),0)
   tmpl_Vote=u_Vote+1
   If  tmpl_Vote>=int(dim_Ok(3)) then
   Call Cls.exec("update AsaiMHOk_reply set isdeal=1 where ChannelIDs="&ChannelIDs&" and R_id="&v_id&" and id="&request("rid"),0)
   Call Cls.exec("update AsaiMHOk set Solves=1 where ChannelIDs="&ChannelIDs&" and id="&v_id,0)
   Call Cls.exec("update AsaiMHOk set Jieuser='"&u_UserName&"' where ChannelIDs="&ChannelIDs&" and id="&v_id&" and "&u_id&"="&request("rid"),0)
   Call Cls.exec("update AsaiMHUserData set integral=integral+"&int(v_Reward)&" where username='"&u_UserName&"' and "&u_id&"="&request("rid"),0)
   Call Cls.exec("update AsaiMHUserData set ok_helpnum=ok_helpnum+1 where username='"&u_UserName&"' and "&u_id&"="&request("rid"),0)
	 Response.Write Cls.js_put("alert(""您投票的答案已等于或大于答案投票限制数:"&dim_Ok(3)&"票！系统自动采纳此答案！该问题已经解决！\n\n点击返回……"");location.href='View.asp?id="&v_id&"';",1)
   else
   Response.Write Cls.js_put("alert(""您已经成功对此答案投票,共投"&tmpl_Vote&"票,,谢谢支持！\n\n点击返回……"");location.href='View.asp?id="&v_id&"';",1)
  end If
  end If
  If v_UserName=login_username and v_Solves<>1  then 
  if u_Isdeal<>1 and now()<v_Expired then
  tmp_Accepts="<td><input type=submit class=btn value='采纳答案' disabled></td>"
  'tmp_Vote="<td>&nbsp;<input type=submit class=btn value='投票' disabled></td>"
  else
  tmp_Accepts="<form method=post action=View.asp?id="&v_id&"&rid="&u_id&"><td><input id='deal' name=deal type=submit class=btn value='采纳答案'></td></form>"
  tmp_Vote="<form method=post action=View.asp?id="&v_id&"&rid="&u_id&"><td>&nbsp;<input id='t_Vote' name=t_Vote type=submit class=btn value='投票'></td></form>"
  end If
  end If
  If v_UserName=login_username and v_Solves<>1  then
  If u_UserName=login_username and v_Solves<>1 then
  tmp_Accepts=""
  tmp_Vote=""
  else
  tmp_Accepts="<form method=post action=View.asp?id="&v_id&"&rid="&u_id&"><td><input id='deal' name=deal type=submit class=btn value='采纳答案'></td></form>"
  If v_Expired-now<int(dim_Ok(2)) then 
  tmp_Vote="<form method=post action=View.asp?id="&v_id&"&rid="&u_id&"><td><input id='t_Vote' name=t_Vote type=submit class=btn value='投票'></td></form>"
  tmp_Vote_tim="<td>投票数量："&u_Vote&"</td>"
  end If
  end If
  end If
  if tmp_edit <>"" or tmp_Accepts <>"" or tmp_Vote <>"" then
  tmp_editbar = vbcrlf&"<tr><td align=right><table  border=0 cellspacing=0 cellpadding=0><tr>"&tmp_edit&""&tmp_Accepts&""&tmp_Vote&"</tr></table></td></tr>"

  end if
  
  if u_Isdeal=1 and v_Solves=1 then
	  tmp_Isdeal=Img_Alt("ico_Solves3","最佳回答")
			AsaiMHtemp1=AsaiMHtemp1&"<div class=""ahzj"">"&_
			vbcrlf&"<div class=""ahzjt"">"&_ 
			vbcrlf&""&tmp_Isdeal&" 最佳回答"&_ 
			vbcrlf&"</div>"&_ 
			vbcrlf&""&Ubb.Ubbcode(u_Word)&""&tmp_Uls&"<br>"&_ 
			vbcrlf&"<p align=right>回答者："&format_user_name(u_UserName,0,"")&" - "&Ok_Grade(u_UserName)&" - "&u_tim&"</p>"&_ 
			vbcrlf&""&tmp_editbar&""&tmp_Vote_tim&""&_
			vbcrlf&"</div>"
   else
  'Period=split(Cls.time_type(dateadd("s",-dim_Ok(2),v_Expired),4),"-")
   AsaiMHTable=AsaiMHTable&"<div class=""ahpt"">"&Ubb.Ubbcode(u_Word)&"<br>"&_
                    vbcrlf&""&tmp_Uls&"<br>"&_
                    vbcrlf&"<p align=right>回答者："&format_user_name(u_UserName,0,"")&" - "&Ok_Grade(u_UserName)&" - "&u_tim&"</p>"&_
					vbcrlf & tmp_editbar &_
					vbcrlf & tmp_Vote_tim &_
                    vbcrlf&"</div>"	
Channel_Reply_Load=AsaiMHTable
  end if
End Function

'=======================================================
'//* 编辑回答问题初始 *//
'=======================================================
Public Sub Channel_Reply_Edit_Chk()
  dim UserName,Tim,Word,Uls,Found_Err,R_id
  Word=Cls.Code_Remark("Word")
  UserName=Cls.Code_Admin("UserName",1,20)
  Tim=Cls.Code_Admin("Tim",1,20)
  Uls=Cls.Code_Admin("Uls",1,100)
    Found_Err=""
    If word="" Then
	Found_Err=Found_Err&"+回答问题的 <font color=red>内容</font> 不能为空！<br />"
	End If
	If Found_Err<>"" Then
    response.write Found_Error(Found_Err,300)
    exit Sub
    End If
    if Not Cls.CodeIsTrue() then
	Found_Err=Found_Err&"+您输入的 <font color=red>验 证 码</font> 为空或有错误，请勿非法提交！<br />"
	End If
	If Found_Err<>"" Then
    response.write Found_Error(Found_Err,300)
    exit Sub
    End If
  Rs("Word")=Word
  Rs("UserName")=Login_username
  Rs("Uls")=Uls
  Rs("Tim")=Cls.Now_time
  Rs.update
  Call Cls.Channel_Count(ChannelIDs)
   Response.Write Cls.js_put("alert(""已成功编辑了一个回答,感谢您的参与!\n\n关闭窗口……"");location.href='javascript:self.close()';opener.location.reload();",1)	
End Sub

'//* 编辑回答问题列表 *//
Public sub Channel_Reply_Edit()
dim UserName,Tim,Word,Uls,n_submit,n_Uls,n_FORM
Dim n_GetCode,n_word,id
if Cls.Is_Null(login_username)="" then
Dim tmp1
  tmp1=web_nologin
  Cls.ReadPage "mod_center"
  Cls.HtmlRcod "tit","编辑回答"
  Cls.HtmlRcod "body",tmp1
  Cls.HtmlRcod "more",""
  Cls.HtmlRcod "ends",""
  Cls.OutPage
  Else
id=Cls.Code_ID("id")
    n_GetCode=Cls.GetCode()
	n_word=ShowUBBEditor("9","Edit_Frm","word","编辑",Cls.Code_Html(rs("word"),0,0),"Default",560,150)
	n_submit="<INPUT class=btn type=submit  value='提交修改'>"
	n_Uls="<input name='Uls' type='text' size='50' value='"&Rs("Uls")&"'>"
	n_FORM="<FORM name=Edit_Frm onsubmit=javascript:frm_Submitonce(this); action='Edit.asp?Action=reply_edit&id="&id&"' method=post>"
  Cls.ReadPage "Channel_Reply"
  Cls.HtmlRcod "n_tit","编辑回答"
  Cls.HtmlRcod "n_redx",redx
  Cls.HtmlRcod "n_id",v_id
  Cls.HtmlRcod "n_word",n_word
  Cls.HtmlRcod "n_GetCode",n_GetCode
  Cls.HtmlRcod "n_submit",n_submit
  Cls.HtmlRcod "n_Uls",n_Uls
  Cls.HtmlRcod "n_FORM",n_FORM
  Cls.OutPage
   end if
  Call Cls.Channel_Count(ChannelIDs)
End Sub

'===============================================================
'//* 编辑爱问初始 *//
'===============================================================
Public Sub Channel_Put_Edit()
  Dim name,username,pic,ispic,word,tcolor,Found_Err
    name=Cls.Code_Admin("Name",1,40)
    word=Cls.Code_Remark("word")
    tcolor=Cls.Code_Form("tcolor")
    if len(tcolor)<>6 then tcolor=""
    username=Cls.Code_Admin("username",1,20)
    if ChkName(username)=false then username=login_username
	Found_Err=""
    'If name="" or word="" Then
    'Found_Err=Found_Err&"+发布信息的 <font color=red>标题、内容</font> 不能为空！<br />"
    'End If
    if Not Cls.CodeIsTrue() then
	Found_Err=Found_Err&"+您输入的 <font color=red>验 证 码</font> 为空或有错误，请勿非法提交！<br />"
	End If
	If Found_Err<>"" Then
    response.write Found_Error(Found_Err,300)
    exit Sub
     End If
    Call Chk_Cid()
  Rs("ChannelIDs")=ChannelIDs
  Rs("cod")=1
  Rs("Name")=name
  Rs("word")=word
  Rs("tcolor")=tcolor
  Rs.update
  ispic=Cls.Rand_File(Index_Url)
  Call Cls.Channel_Count(ChannelIDs)
  Response.Write Cls.js_put("alert(""您已成功修改了一个"&Cls.ChannelTit&"！\n\n点击返回……"");location.href='javascript:self.close()';opener.location.reload();",1)
End Sub

'//* 编辑爱问列表 *//
Public Sub Channel_Edit()
  dim n_class,n_topic,n_Special,n_keyes,n_Derivation,n_word,n_frmupload,pic,mlpic,n_Power,n_GetCode,n_Reward,n_put,id
  if Cls.Is_Null(login_username)="" then
  Dim tmp1
  tmp1=web_nologin
  Cls.ReadPage "mod_center"
  Cls.HtmlRcod "tit","编辑回答"
  Cls.HtmlRcod "body",tmp1
  Cls.HtmlRcod "more",""
  Cls.HtmlRcod "ends",""
  Cls.OutPage
  Else
  id=Cls.Code_ID("id")
  n_topic="<tr class=tr><td>"&tit_fir&"标题：</td><td><input type=text name=Name size=40 maxlength=100 value='"&Rs("Name")&"'>"&redx&"&nbsp;&nbsp;"&ShowColor("tcolor",rs("tcolor"))&"</td></tr>"
  n_word=ShowUBBEditor("9","Edit_Frm","word","编辑回答",Cls.Code_Html(rs("word"),0,0),"Default",560,150)
  n_GetCode=Cls.GetCode()
  n_put="<FORM name=Edit_Frm onsubmit=javascript:frm_Submitonce(this); action='Edit.asp?Action=Ok_Edit&id="&id&"' method=post><INPUT type=hidden value=yes name=chk> <INPUT type=hidden name=upid>"
  Cls.ReadPage "Edit_put"
  Cls.HtmlRcod "n_tit",Cls.ChannelTit&"修改"
  Cls.HtmlRcod "n_redx",redx
  Cls.HtmlRcod "n_topic",n_topic
  Cls.HtmlRcod "n_Power",""
  Cls.HtmlRcod "n_class",""
  Cls.HtmlRcod "n_Reward" ,""
  Cls.HtmlRcod "n_Special",""
  Cls.HtmlRcod "n_keyes",""
  Cls.HtmlRcod "n_Derivation",""
  Cls.HtmlRcod "n_word",n_word
  Cls.HtmlRcod "n_GetCode",n_GetCode
  Cls.HtmlRcod "n_frmupload",""
  Cls.HtmlRcod "n_put",n_put
  Cls.HtmlRcod "n_readme",""
  Cls.HtmlRcod "n_UploadList",""
  Cls.HtmlRcod "n_zhuy",""
  Cls.OutPage
End If
End Sub

'//* 列表初始 *//
Public Sub Channel_List_First()
dim ClsTit
	Call Channel_Load(0)
	Select Case action
	Case "good"
		tit="推荐"&Cls.ChannelTit
	Case "hot"
		tit="热门"&Cls.ChannelTit
    Case "Reward"
		tit="高分"&Cls.ChannelTit
    Case "My_Ok"
		tit="我的"&Cls.ChannelTit
	Case "search"
		tit=Cls.ChannelTit&"搜索"
	Case Else
		if int(cid)<1 then
			Call Channel_Redirect(Cls.Web_Dir&Cls.ChannelDir)
		End if
		if action<>"more" then action=""
		tit=Cls.ChannelTit
		'If Cid>0 Then tit=tit&"("&Class_Name_Get(Cid)&")"
	End Select
	ClsTit = Class_Grade(Cid,Cls.ClassDepth) & Tit
	tit_fir=Cls.ChannelName
End Sub

'//* 爱问已过期的问题处理帮助 *//
Function Channel_Help(nums)
dim AsaiMHHelp,tit,AsaiMHmod,more
dim Solves0,Solves1,Solves2,Solves3
dim replys0,replys1
    tit=""&Cls.ChannelTit&"帮助"
  	Solves0=Img_Alt("ico_Solves0","未解决的"&Cls.ChannelTit)
	Solves1=Img_Alt("ico_Solves1","未解决的"&Cls.ChannelTit)
	Solves2=Img_Alt("ico_Solves2","未解决的"&Cls.ChannelTit)
	Solves3=Img_Alt("ico_Expired","已过期的"&Cls.ChannelTit)
	replys0=Img_Alt("ico_replys_0","此答案已被采纳")
	replys1=Img_Alt("ico_replys_1","此答案未被采纳")
  if nums=1 then
    AsaiMHHelp=AsaiMHHelp&"<TR class=tr><TD>问题列表的标题前显示 "&Solves0&" "&Solves1&" "&Solves2&" "&Solves3&" 代表的意思:</TD></TR>"&_
                   vbcrlf&"<TR class=tr><TD>"&Solves0&" :表示您的问题还没有用户回答,请浏览此问题后加悬赏积分、过期天数或编辑回答的内容描述的清楚些.</TD></TR>"&_
                   vbcrlf&"<TR class=tr><TD>"&Solves1&" :表示您的问题已有用户回答.请浏览此问题后继续相关的操作.</TD></TR>"&_
                   vbcrlf&"<TR class=tr><TD>"&Solves2&" :表示您的问题已经解决.请浏览此问题后继续相关的操作.</TD></TR>"&_
                   vbcrlf&"<TR class=tr><TD>"&Solves3&" :表示您的问题已经过期,请浏览此问题加悬赏积分、过期天数或关闭问题.当您加悬赏积分、过期天数后,此问题会正常显示.同时相关回答也可正常浏览.当您关闭问题后,系统会自动把提出此问题时扣除的悬赏积分返还到您的帐户中.</TD></TR>"&_
                   vbcrlf&"<TR class=tr><TD>追加悬赏积分:追加1积分时,过期天数也加1天.</TD></TR>"
  Else 
    AsaiMHHelp=AsaiMHHelp&"<TR class=tr><TD>回答列表中显示 "&replys0&" "&replys1&"  代表的意思:</TD></TR>"&_
                   vbcrlf&"<TR class=tr><TD>"&replys0&" :表示您的回答已被发问用户采纳,并获得了发问用户的积分悬赏,同时您的回答被采纳的次数越多,您的爱问等级也越高.</TD></TR>"&_
                   vbcrlf&"<TR class=tr><TD>"&replys1&" :表示您的回答未被采纳,请浏览此问题,编辑您的回答,等待发问用户的采纳.</TD></TR>"
  End If
       AsaiMHmod=AsaiMHmod&"<table cellspacing=1 cellpadding=1 class=table>"&_
                    vbcrlf&"<tr class=tr><td align=center>"&AsaiMHHelp&"</td></tr>"&_
                    vbcrlf&"</table>"
Channel_Help=AsaiMHmod
End Function
%>
