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

Dim ViewData			'浏览数据数组
Dim iSpecialID
iSpecialID = 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_pic,v_IntactTitle,tmp_err,tmp_commend,tmp_topic,v_jt,v_file, v_types,v_price,v_otime,v_oname,v_phone,v_email,v_url,v_address, oDay
Dim iSpecialTopic, iSpecialRemark, iSpecialTim

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.ReadFleaList(HtmlContent)
                HtmlContent = Html.ReadFleaPic(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.ReadFleaList(HtmlContent)
		HtmlContent = Html.ReadFleaPic(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 "pic"
	    	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 FleaTopic, ClassName, HtmlFileUrl, ImageUrl, WriteTime, LinkTarget, HtmlFileName
  Dim tmp_sql,tmp_sql_order,tmp_url,fType
  Mhead="":tmp_url=""
  Select Case ListAction
  Case "hot"
      mhead=tit
      tmp_sql="A.counter>20"
      tmp_sql_order="A.counter desc"
	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>"
  Case "good"
      mhead=tit
      tmp_sql="A.isgood=1"
	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>"
  Case "focus"
      mhead=tit
      tmp_sql="A.isfocus=1"
	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>"
  Case "pic"
      mhead=tit
      tmp_sql="A.pic<>''"	
	If Cls.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=pic' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
  Case "search"
  	  if int(ClsID)>0 then
	  tmp_sql="A.ClassID in ("&Class_Cid_Get(Clsid)&")"
	  else
	  tmp_sql=""
	  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.topic","A.topic,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
	  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>"	  
  End Select
  if tmp_sql="" then
    tmp_sql="A.hidden=1"
  else
    tmp_sql="A.hidden=1 and "&tmp_sql
  End if
  fType = Trim(Request.QueryString("Type"))
  If fType = "0" Then tmp_sql="A.Types=0 and "&tmp_sql
  If fType = "1" Then tmp_sql="A.Types=1 and "&tmp_sql
  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.Topic,A.Types,A.Pic,A.counter,A.username,A.oName,A.price,A.Tim,A.oTim,A.isgood,A.isfocus,A.istop,A.HtmlFileDate,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 = "Showflea" & 1
				Else
					ListStyle = "Showflea" & 2
				End If
				If Rs("isgood") <> 0 Then
					BestCode = 2
					BestString = "<font color='red'>推荐</font>"
				Else
					BestCode = 1
					BestString = ""
				End If
				'前标
				If rs("types")=1 then
				sTopic = "<font color=blue>求</font>"
				Else
				sTopic = "<font color=orange>[供]</font>"
				End If
				sDot=Cls.GetDot(rs("istop"),rs("isfocus"),rs("isgood"))
				'sTopic = Cls.GetIncInfo(Rs("IncludeInfo"))
				sTitle = Cls.Cuted(Rs("topic"), 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
				If rs("Pic")="" then
					   ImageUrl = Cls.Web_Dir&"Skin/no_pic.gif"
				else
					   ImageUrl = rs("Pic")
				end if
				oDay = DateDiff("d",cls.now_time,DateAdd("d",Rs("oTim"),Rs("Tim")))
				If oDay < 0 then
					oDay = "<font color=red>该"&Cls.ChannelTit&"已经过期</font>"
				else
					oDay = "还有 <font color=red>"&oDay&"</font> 天"
				end if
				ImageUrl = "<img src='"&ImageUrl&"' width=" & Cls.ChannelPicWidth & " height=" & Cls.ChannelPicHeight & " class=""ig"">"		
				FleaTopic = "<a href='" & HtmlFileUrl & "'" & LinkTarget & " title='" & Cls.ChannelModule & "标题：" & Rs("topic") & "&#13;&#10;发布时间：" & Rs("tim") & "&#13;&#10;阅览次数：" & Rs("counter") & "'>" & sTitle & "</a>"
				Tempstr = ListContent
				Tempstr = Replace(Tempstr, "{$tit_fir}", Cls.ChannelTit)
				Tempstr = Replace(Tempstr, "{$FleaTopic}", FleaTopic)
                Tempstr = Replace(Tempstr, "{$FleaPicture}", Cls.GetPic("<a href='" & HtmlFileUrl & "' title='" & Rs("topic") & "'" & LinkTarget & ">" & ImageUrl & "</a>"))
				Tempstr = Replace(Tempstr, "{$FleaID}", Rs("ID"))
				Tempstr = Replace(Tempstr, "{$FleaTitle}", sTitle)
				Tempstr = Replace(Tempstr, "{$Title}", Rs("topic"))
				Tempstr = Replace(Tempstr, "{$Date}", Rs("tim"))
				Tempstr = Replace(Tempstr, "{$Dot}", sDot)
				Tempstr = Replace(Tempstr, "{$Type}", sTopic)
				Tempstr = Replace(Tempstr, "{$oName}", Rs("oName"))
				Tempstr = Replace(Tempstr, "{$Price}", Rs("Price"))
				Tempstr = Replace(Tempstr, "{$oTim}",DateAdd("d",Rs("oTim"),Rs("Tim")))
'				Tempstr = Replace(Tempstr, "{$oTim}",Cls.ShowDateTime(DateAdd("d",Rs("oTim"),Rs("Tim")),5))
				Tempstr = Replace(Tempstr, "{$oDay}", oDay)
				Tempstr = Replace(Tempstr, "{$HtmlFileUrl}", HtmlFileUrl)
				Tempstr = Replace(Tempstr, "{$ClassName}", ClassName)
				Tempstr = Replace(Tempstr, "[]", "")
				Tempstr = Replace(Tempstr, "{$Target}", LinkTarget)
				Tempstr = Replace(Tempstr, "{$Tim}", WriteTime)
				Tempstr = Replace(Tempstr, "{$Hits}", 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&"&Type="&fType&"&"
	  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.ReadFleaList(HtmlContent)
		HtmlContent = Html.ReadFleaPic(HtmlContent)
		'HtmlContent = Html.ReadRssList(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 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 "&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_topic=rs("Topic")
	v_remark=rs("Word")
	v_tim=rs("Tim")
	v_counter=rs("Counter")
	v_types=rs("types")
	v_price=Rs("price")
	v_otime=Rs("otim")
	v_oname=Rs("oname")
	v_phone=Rs("phone")
	v_email=Rs("email")
	v_url=Rs("url")
	v_address=Rs("address")
	v_pic=rs("Pic")
	v_cod=rs("Cod")
	v_power=rs("Power")
	v_emoney=rs("Emoney")
	v_keyes=rs("Keyes")
	v_tcolor=rs("tColor")
	v_file=Rs("HtmlFileDate")
	Rs.Close
	'头部信息
	If Int(Web_Dim(15)) = 0 Then
	   tit=tit&"--"&v_topic
        Else
	   tit=v_topic&"--"&tit
	End if
	Tit_Dir = Class_Grade(Cid,Cls.ClassDepth) & Cls.ChannelTit&"浏览" &":"& Tit
	tit_fir=Cls.ChannelName
	IndexUrl=Cls.Web_Dir & Cls.ChannelDir
	'权限
   '信息处理
  if v_pic<>"" then
     v_pic=pic_show(v_pic,2,v_pic)
	 else
	 v_pic=pic_show(Cls.Web_Dir&"Images/no_pic_show.gif",2,Cls.Web_Dir&"Images/no_pic_show.gif")
  End if
  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_topic
  Else
    tmp_topic=v_IntactTitle
  End If
  If v_types=0 then
     v_types="<font color=blue>[供应]</font>"
  else
     v_types="<font color=orange>[求购]</font>"
  end if
  if v_phone="" then v_phone="<font class=Gys>暂无电话</font>"
  if v_email="" then v_email="<font class=Gys>暂无邮件</font>"
  if v_url="" then v_url="<font class=Gys>暂无链接</font>"
  if v_address="" then v_address="<font class=Gys>暂无地址</font>"
  if not is_logintrue then
     v_oname="<font class=Gys>请登陆后再查看</font>"  
     v_phone="<font class=Gys>请登陆后再查看</font>"
     v_email="<font class=Gys>请登陆后再查看</font>"
     v_url="<font class=Gys>请登陆后再查看</font>"
     v_address="<font class=Gys>请登陆后再查看</font>"
  end if
  oDay = DateDiff("d",cls.now_time,DateAdd("d",v_otime,v_tim))
  If oDay < 0 then
	oDay = "<font color=red>该"&Cls.ChannelTit&"以经过期</font>"
  else
	oDay = "还有 <font color=red>"&oDay&"</font> 天"
  end if
  HtmlContent=Cls.ReadTemplate(3)
  HtmlContent=Replace(HtmlContent,"{$tit_fir}",Cls.ChannelTit)
  HtmlContent=Replace(HtmlContent,"{$topic}",tmp_topic)
  HtmlContent=Replace(HtmlContent,"{$tcolor}",v_tcolor)
  HtmlContent=Replace(HtmlContent,"{$tim}",Cls.time_type(v_tim,4))
  HtmlContent=Replace(HtmlContent,"{$tit}",tit)
  HtmlContent=Replace(HtmlContent,"{$pic}",v_pic)
  HtmlContent=Replace(HtmlContent,"{$types}",v_types)
  HtmlContent=Replace(HtmlContent,"{$price}",v_price)
  HtmlContent=Replace(HtmlContent,"{$otim}",Cls.time_type(DateAdd("d",v_otime,v_tim),4))
  HtmlContent=Replace(HtmlContent,"{$oday}",oDay)
  HtmlContent=Replace(HtmlContent,"{$oname}",v_oname)
  HtmlContent=Replace(HtmlContent,"{$phone}",v_phone)
  HtmlContent=Replace(HtmlContent,"{$email}",v_email)
  HtmlContent=Replace(HtmlContent,"{$url}",v_url)
  HtmlContent=Replace(HtmlContent,"{$address}",v_address)
  HtmlContent=Replace(HtmlContent,"{$username}",format_user_view(v_username,1,0))
  HtmlContent=Replace(HtmlContent,"{$commend_friend}",tmp_commend)
  HtmlContent=Replace(HtmlContent,"{$commend_err}",tmp_err)
  HtmlContent=Replace(HtmlContent,"{$about_up}",LoadViewAbout("up"))
  HtmlContent=Replace(HtmlContent,"{$about_Down}",LoadViewAbout("Down"))
  HtmlContent=Replace(HtmlContent,"{$about_print}","【<a href='"&Cls.Web_Dir&Cls.ChannelDir&"/Print.asp?id="&v_id&"' target='_blank'>打印本页</a>】")
  HtmlContent=Replace(HtmlContent,"{$user_defined}","")
  If IsHtml = True then
        If Cls.ReviewTrue Then HtmlContent=Replace(HtmlContent,"{$review}","<script language=""JavaScript"" src="""&Cls.Web_Dir&"Include/Review.asp?c_id="&ChannelIDs&"&id="&v_id&"""></script>")
	    HtmlContent=Replace(HtmlContent,"{$counter}","<script language=""JavaScript"" src="""&Cls.Web_Dir&"Include/GetHits.asp?c_id="&ChannelIDs&"&id="&v_id&"""></script>")
  Else
        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,""))
	    HtmlContent=Replace(HtmlContent,"{$counter}",v_counter)
	    Call Cls.Exec("update "&Cls.ChannelTable&" set counter=counter+1 where id="&v_id,0)
  End If
  '载入模板函数
  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.ReadFleaList(HtmlContent)
  HtmlContent = Html.ReadFleaPic(HtmlContent)
  HtmlContent = Html.ReadRelateList(HtmlContent,ChannelIDs,v_id,v_keyes,Cls.ChannelIsCreatHtml)  
  HtmlContent = Html.ReadChannelMenu(HtmlContent)
  '判断输出
  Dim CFS,obj_page
  Dim tmp_err,tmp_commend,tmp_topic,v_jt,HtmlUrl,FilePath,vClassPath,ilepaths,Filepaths,Filepathes,ii,j,HtmlFileName
        If int(v_cod)=0 then
        v_remark=Ubb.Ubbcode(v_remark)
        Else
        v_remark=Ubb.HtmlCode(v_remark)
        End if
        v_remark = KeyWord_Url(v_remark) '关键字显亮＋链接
        HtmlContent = Replace(HtmlContent,"{$remark}",v_remark)
		HtmlContent = Cls.ReHtml(HtmlContent,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, 0)
		   CfS.CreateHtmlFile Cls.Web_Dir&Cls.ChannelDir,FilePath,HtmlFileName,HtmlContent
		   set Cfs=nothing
		Else
		    If IsHtml=True Then
			    ShowChannelView = HtmlContent
	        Else
		        Response.Write HtmlContent
		   End If	
		End If
End Function

Public Sub ShowChannelPrint()
   Call Channel_Load(0)
   'If Cls.Is_Null(vid)="" Then 
    v_id=Cls.Code_ID("id")
	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_topic=rs("Topic")
	v_remark=rs("Word")
	v_tim=rs("Tim")
	v_counter=rs("Counter")
	v_IncludeInfo=rs("IncludeInfo")
	v_ispic=rs("Ispic")
	v_comto=rs("Comto")
    v_author=rs("author")
	v_pic=rs("Pic")
	v_cod=rs("Cod")
	v_power=rs("Power")
	v_emoney=rs("Emoney")
	v_keyes=rs("Keyes")
	v_tcolor=rs("tColor")
	v_Subtitle=rs("Subtitle")
	v_file=Rs("HtmlFileDate")
	Rs.Close
	'头部信息
	tit=v_topic
	Tit_Dir = Class_Grade(Cid,Cls.ClassDepth) & Cls.ChannelTit&"浏览" &":"& Tit
	tit_fir=Cls.ChannelName
	'权限
	Dim chkpower,chkemoney,ChkMsg
   	   chkpower=true
	   chkemoney=true
   If Cls.ChannelIsCreatHtml = False then
   	   chkpower=chk_power(v_power,ChannelIDs)
	   chkemoney=chk_emoney(v_emoney,"Flea",v_id,ChannelIDs)
   If login_mode<>"" Then
      if not chkemoney then 
	      If int(login_emoney) >= int(v_emoney) then
	           ChkMsg="<p align=center><br /><br />阅读本"&Cls.ChannelTit&"需要扣除<b><font color=red>"&v_emoney&"</font></b>"&Cls.Web_Unit&",你目前尚有<b><font class=blue>"&login_emoney&"</font></b>"&Cls.Web_Unit&"可用<br /><br />你确实愿意支付<b><font color=red>"&v_emoney&"</font></b>"&Cls.Web_Unit&"来阅读此"&Cls.ChannelTit&"吗？<br /><br /><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/View.asp?id="&v_id&"&pay=yes'>我愿意</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='"&Cls.Web_Dir&Cls.ChannelDir&"'>我不愿意</a></p>"
          else
	           ChkMsg="<p align=center><br /><br />对不起，阅读本"&Cls.ChannelTit&"需要扣除<b><font color=red>"&v_emoney&"</font></b>"&Cls.Web_Unit&",你目前只有<b><font class=blue>"&login_emoney&"</font></b>"&Cls.Web_Unit&"可用<br /><br />你的"&Cls.Web_Unit&"不足，无法阅读此"&Cls.ChannelTit&"，请联系管理员进行充值！</p>"
		  end if
	  end if
	  if not chkpower then ChkMsg="<p align=center><br /><br />对不起，你没有查看此"&Cls.ChannelTit&"的权限！</p>"
   else
	  if not(chkpower and chkemoney) then ChkMsg="<br />&nbsp;&nbsp;&nbsp;&nbsp;你还没注册？或者没有登录？这篇"&Cls.ChannelTit&"要求至少是本站的注册用户才能阅读！<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;如果你还没注册，请赶紧<a href=''"&Cls.Web_Dir&"/User/Register.asp'><font color=red>点此注册</font></a>吧！<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;如果你已经注册但还没登录，请赶紧<a href='"&Cls.Web_Dir&"/User/Login.asp?old_url=back'><font color=red>点此登录</font></a>吧！<br /><br />"
   end if
   End IF
   '信息处理
  if not(chkpower and chkemoney) then
  v_remark=ChkMsg
  else
  Dim tmp_topic
  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
  if v_ispic=true then
    v_pic=pic_fk(v_pic,2,"")
  End if
  if Cls.Is_Null(v_tcolor)<>"" then v_topic="<font color="&v_tcolor&">"&v_topic&"</font>"
  If v_IntactTitle="" Then
    tmp_topic=v_topic
  Else
    tmp_topic=v_IntactTitle
  End If
If Cls.Is_null(v_Subtitle)<>"" Then  v_Subtitle="——"&v_Subtitle
  Cls.ReadPage  "print_view"
  Cls.HtmlRcod "web_urls",Cls.web_urls
  Cls.HtmlRcod "tit_fir",Cls.ChannelName
  Cls.HtmlRcod "tit_dir",Tit_Dir
  Cls.HtmlRcod "tit",tit
  Cls.HtmlRcod "topic",tmp_topic
  Cls.HtmlRcod "tcolor",v_tcolor
  Cls.HtmlRcod "subtitle",v_Subtitle
  Cls.HtmlRcod "tim",Cls.time_type(v_tim,4)
  Cls.HtmlRcod "comto",v_comto
  Cls.HtmlRcod "author",v_author
  Cls.HtmlRcod "pic",v_pic
  Cls.HtmlRcod "remark",v_remark
  Cls.HtmlRcod "counter",v_counter
  Cls.HtmlRcod "username",format_user_view(v_username,1,0)
  Cls.HtmlRcod "user_defined",""
  Cls.OutPage
End Sub

'//* 列表初始 *//
Public Sub LoadListFirst()
	Select Case action
	Case "pic"
		Call ShowChannelList(False,Cid,"","pic")
	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 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)
    		
    		
			
			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 LoadViewAbout(va_t)
  dim tmp1,tmp2,tmp_sql
  tmp2="上一篇"&Cls.ChannelTit&"：&nbsp;"
  tmp1=tmp2&"没有找到上篇"&Cls.ChannelTit&""
  tmp_sql="Select top 1 id,topic,ClassID,HtmlFileDate from "&Cls.ChannelTable&" where ChannelIDs="&ChannelIDs&" And hidden=1 and id<"&v_id&" order by id desc"
  if va_t="Down" then
  tmp2="下一篇"&Cls.ChannelTit&"：&nbsp;"
  tmp1=tmp2&"没有找到下篇"&Cls.ChannelTit&""
    tmp_sql="Select top 1 id,topic,ClassID,HtmlFileDate from "&Cls.ChannelTable&" where ChannelIDs="&ChannelIDs&" And hidden=1 and id>"&v_id&" order by id"
  End if
  set rs=Cls.exec(tmp_sql,1)
  if not rs.eof then
     If Cls.ChannelIsCreatHtml = True then
        tmp1=tmp2&"<a href='"&Cls.Web_Dir& Cls.ChannelDir & "/" & Class_Path_Get(rs(2)) & Cls.ShowDatePath(Rs("HtmlFileDate"), Cls.ChannelHtmlPath) &  Cls.ReadFileName(Rs("HtmlFileDate"), Rs("ID"), Cls.ChannelHtmlExtName, Cls.ChannelHtmlPrefix, Cls.ChannelHtmlForm, "")&"' title='"&Cls.code_html(rs(1),1,0)&"'>"&Cls.code_html(rs(1),1,0)&"</a>"
     Else
        tmp1=tmp2&"<a href='View.asp?id="&rs(0)&"' title='"&Cls.code_html(rs(1),1,0)&"'>"&Cls.code_html(rs(1),1,0)&"</a>"
	 End if
  End if
  rs.close
  LoadViewAbout=tmp1
End Function

'//* 频道搜索 *//
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
	    TmpStr=VbCrlf&"<li>"
		If action="pic" or action="focus" or action="good" or action="hot" or tCid > 0 Then
	    TmpImg="sort_c1"
	    if Request.QueryString("Type")="0" then TmpImg="sort_c3"
	    Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/List.asp?Action="&action&"&c_id="&tCid&"&Type=0"
    	TmpStr=TmpStr&"<div class=slis>"&img_skin(TmpImg)&"<a href='"&Tmpurl&"'>供方"&Cls.ChannelTit&"</a></div>" & _
		       VbCrlf&""
	    TmpImg="sort_c1"
    	if Request.QueryString("Type")="1" then TmpImg="sort_c3"
	    Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/List.asp?Action="&action&"&c_id="&tCid&"&Type=1"
	    TmpStr=TmpStr&"<div class=slis>"&img_skin(TmpImg)&"<a href='"&Tmpurl&"'>求方"&Cls.ChannelTit&"</a></div></li>" & _
		       VbCrlf&"<li>"
	    End If
	    TmpImg="sort_c1"
	    if action="pic" then TmpImg="sort_c2"
	    If Cls.ChannelIsCreatHtml = True then
    	      Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/PicInfo/Index_1"&Cls.ChannelHtmlExtName
    	Else
	          Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/List.asp?Action=pic"
	    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&"/FocusInfo/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&"/GoodInfo/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&"/HotInfo/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("Topic"),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_Chk()
  Dim num_integral,chkputpower  '发布信息得分
  num_integral=UserGroup_Config(15)
  chkputpower=chk_putpower(ChannelIDs)
  Dim ToPic,ClassID,username,pic,ispic,word,tcolor,oSpecialID,tim,Found_Err
  Dim types,price,otime,oname,phone,email,url,address
    topic=Cls.Code_Admin("topic",1,40)
    word=Cls.Code_Remark("word")
    csid=Cls.Code_Form("ClassID")
    pic=Cls.Code_Admin("pic",1,100)
	tim=Cls.now_time
    oSpecialID=Cls.Code_Int("SpecialID",0)
	types=Cls.Code_Int("types",0)
	price=Cls.Code_Int("price",0)
	otime=Cls.Code_Int("otime",7)
	oname=Cls.Code_Admin("oname",1,20)
	phone=Cls.Code_Admin("phone",1,20)
	email=Cls.Code_Admin("email",1,30)
	url=Cls.Code_Admin("url",1,50)
	address=Cls.Code_Admin("address",1,60)
	Found_Err=""
	  If Cls.Code_Form("readme")<>"yes" Then
    Found_Err=Found_Err&"+<font class=blue>请您先阅读并同意有关信息发布的相关声明！</font><br />"
  End If
  If ToPic="" 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 otime<=0  Then
    Found_Err=Found_Err&"+发布信息的 <font color=red>过期天数</font> 不能为0或更小！<br />"
  End If
  If price<0  Then
    Found_Err=Found_Err&"+发布信息的 <font color=red>交易价格</font> 不能小于0！<br />"
  End If  
  If oname="" or email="" 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")=oSpecialID
  Rs("ClassID")=cid
  Rs("cod")=0
  Rs("topic")=topic
  Rs("username")=login_username
  Rs("tim")=tim
  Rs("types")=types
  Rs("price")=price
  Rs("otim")=otime
  Rs("oname")=oname
  Rs("phone")=phone
  Rs("email")=email
  Rs("url")=url
  Rs("address")=address
  Rs("emoney")=0
  Rs("counter")=0
  Rs("isgood")=0
  If chkputpower=True Then
  	Rs("hidden")=1
  Else
  	Rs("hidden")=0
  End If
  Rs("keyes")=""
  Rs("pic")=pic
  Rs("Istop")=0
  Rs("power")=""
  Rs("Isfocus")=0
  Rs("word")=word
  Rs("tcolor")=""
  Rs("HtmlFileDate")=Cls.HtmlRndFileName()
  Rs("isUpdate")=True  
  Rs.update
  Rs.close
  If int(num_integral)>0 Then
    '发表此类信息不得分
    'SQL="update AsaiMHUserData set integral=integral+"&int(num_integral)&" where username='"&login_username&"'"
    Call Cls.exec(SQL,0)
  End If
  Call Cls.Channel_Count(ChannelIDs)
  If chkputpower=True Then
  	'Response.write Cls.js_put("alert(""您已成功发布了一篇"&Cls.ChannelTit&"！\n\n点击返回……"");location.href='./';",1)
  	Response.write Cls.js_put("alert(""您已成功发布了一篇"&Cls.ChannelTit&"！\n\n点击返回……"");location.href='"&Cls.Web_Dir&"User/Put.asp';",1)
  Else
  	'Response.write Cls.js_put("alert(""您已成功发布了一篇"&Cls.ChannelTit&"！请等待管理审核通过！\n\n点击返回……"");location.href='./';",1)
  	Response.write Cls.js_put("alert(""您已成功发布了一篇"&Cls.ChannelTit&"！请等待管理审核通过！\n\n点击返回……"");location.href='"&Cls.Web_Dir&"User/Put.asp';",1)
  End If
End Sub

'//* 发布列表 *//
Public Sub Channel_Put()
  if Cls.Get_ChannelSetup(Cls.ChannelSetup,0)=0 then
    call put_close("发表")
    exit sub
  end if
  dim n_put,preset
  tit_fir = Cls.ChannelTit
  preset=split(Cls.ChannelPreset,"|||")
  n_put =""
  n_put ="<tr><td width=70>"&tit_fir&"标题：</td><td width='*'><input type=text name=topic size=50 maxlength=40>"&redx&"</td></tr>"  
  n_put = n_put & ShowClassSel(ChannelIDs,ClassID,Cls.ClassDepth)
  'n_put = n_put & ShowSpecialSel(ChannelIDs,0)
  'n_put = n_put & ShowKeyWord("",preset(0))
  n_put = n_put & ShowFleaType(0)
  n_put = n_put & "<tr><td>交易价格：</td><td><input type=text name=price size=6 maxlength=5> 元"&redx&"&nbsp;&nbsp;过期时间:<input type=text name=otime size=6 maxlength=2> 天"&redx&"</td></tr>"  
   n_put = n_put & "<tr><td>联系人：</td><td><input type=text name=oname size=20 maxlength=20> "&redx&"&nbsp;&nbsp;电话：<input type=text name=phone size=20 maxlength=20> </td></tr>"  
    n_put = n_put & "<tr><td>电子邮件：</td><td><input type=text name=email size=20 maxlength=50> "&redx&"&nbsp;&nbsp;网址：<input type=text name=url size=30 maxlength=30> </td></tr>"  
    n_put = n_put & "<tr><td>联系住址：</td><td><input type=text name=address size=40 maxlength=60> <font color=red>最好加上邮编，以方便联系</font></td></tr>"  
  n_put = n_put & ShowUBBEditor("7","add_frm","word","说明","","Simple",480,150)  
  n_put = n_put & "<tr height=30 class=tr><td>"&Cls.ChannelTit&"图片：</td><td><input type=text name=pic value='' size=60></td></tr>"
  n_put = n_put & "<tr height=30 class=tr><td>上传图片： </td><td><iframe id=UploadFiles1 width='98%' height=30 frameborder=0 scrolling=no src='"&Cls.Web_Dir&"Include/Upload.asp?ID="&ChannelIDs&"&Type=0&Obj=pic'></iframe></td></tr>"

       HtmlContent = Cls.ReadTemplate("mod_put")
		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.ReadFleaList(HtmlContent)
		HtmlContent = Html.ReadFleaPic(HtmlContent)
		HtmlContent = Html.ReadUserLogin(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
%>
