<!-- #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_name,v_tcolor,v_power,v_emoney,v_pic,v_url,v_remark,v_tim,v_counter,v_keyes,v_cod,v_viewtype,tmp_err,tmp_commend,v_file
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.ReadPhotoList(HtmlContent)
		HtmlContent = Html.ReadPhotoPic(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.ReadPhotoList(HtmlContent)
		HtmlContent = Html.ReadPhotoPic(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 "top"
	    	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 ArticleTopic, ClassName, HtmlFileUrl,ImageURL, 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.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 "top"
      mhead=tit
      tmp_sql="A.istop=1"	
	If Cls.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=top' 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.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
	  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
  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.counter,A.username,A.Tim,A.isgood,A.isfocus,A.istop,A.pic,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 = "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"))
				'sTopic = Cls.GetIncInfo(Rs("IncludeInfo"))
				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"),6)
				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
				ImageUrl = "<img src='"&ImageUrl&"' width=" & Cls.ChannelPicWidth & " height=" & Cls.ChannelPicHeight & " class=""ig"">"				
				ArticleTopic = "<a href='" & HtmlFileUrl & "'" & LinkTarget & " title='" & Cls.ChannelModule & "标题：" & Rs("name") & "&#13;&#10;发布时间：" & Rs("tim") & "&#13;&#10;浏览次数：" & Rs("counter") & "'>" & sTitle & "</a>"
				'======================
				Dim PicList
				piclist="<td align=""center"" class=""imagelist"">" & _  
				vbcrlf & "<a href='" & HtmlFileUrl & "' title='" & Rs("name") & "'" & LinkTarget & " target=_blank>" & ImageUrl & "</a>" & _ 
				vbcrlf & "</td><td width=5></td>"
				'=====================
				Tempstr = ListContent
				Tempstr = Replace(Tempstr, "{$PhotoTopic}", ArticleTopic)
				Tempstr = Replace(Tempstr, "{$PhotoPicture}", Cls.GetPic("<a href='" & HtmlFileUrl & "' title='" & Rs("name") & "'" & LinkTarget & " class=""im"">" & ImageUrl & "</a>"))
				Tempstr = Replace(Tempstr, "{$PhotoID}", Rs("ID"))
				Tempstr = Replace(Tempstr, "{$PicList}",PicList)
				Tempstr = Replace(Tempstr, "{$PhotoTitle}", sTitle)
				Tempstr = Replace(Tempstr, "{$Title}", Rs("name"))
				Tempstr = Replace(Tempstr, "{$Date}", Rs("tim"))
				Tempstr = Replace(Tempstr, "{$Dot}", sDot)
				Tempstr = Replace(Tempstr, "{$HtmlFileUrl}", HtmlFileUrl)
				Tempstr = Replace(Tempstr, "{$ClassName}", ClassName)
				Tempstr = Replace(Tempstr, "[]", "")
				Tempstr = Replace(Tempstr, "{$Target}", LinkTarget)
				Tempstr = Replace(Tempstr, "{$Time}", WriteTime)
				Tempstr = Replace(Tempstr, "{$SoftHits}", 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.ReadPhotoList(HtmlContent)
		HtmlContent = Html.ReadPhotoPic(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 LoadViewAbout(va_t)
  dim tmp1,tmp2,tmp_sql
  tmp2="上一组"&Cls.ChannelTit&"：&nbsp;"
  tmp1=tmp2&"没有找到上一组"&Cls.ChannelTit&""
  tmp_sql="Select top 1 id,name,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,name,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 LoadViewAbout0(va_t)
  dim tmp1,tmp2,tmp_sql,tmp,temp
  temp=""
  tmp2="上一组"&Cls.ChannelTit
  tmp=temp&"<font class=Gys>没有"&Cls.ChannelTit&"啦</font>"
  tmp_sql="Select top 1 id,name,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
  tmp=temp&"<font class=Gys>没有"&Cls.ChannelTit&"啦</font>"
    tmp_sql="Select top 1 id,name,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)&"'>"&tmp2&"</a>"
     Else
        tmp="<a href='View.asp?id="&rs(0)&"' title='"&Cls.code_html(rs(1),1,0)&"'>"&tmp2&"</a>"
	 End if
  End if
  rs.close
  LoadViewAbout=tmp
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_name=rs("name")
	v_tcolor=rs("tcolor")
	v_power=rs("power")
	v_emoney=rs("emoney")
	v_viewtype=rs("viewtype")
	v_url=rs("url")
	v_pic=rs("pic")
	v_remark=rs("remark")
	v_tim=rs("tim")
	v_cod=rs("cod")
	v_counter=rs("counter")
	v_keyes=rs("keyes")
	v_file=Rs("HtmlFileDate")
	Rs.Close
	'头部信息
	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 v_viewtype = 0 then v_viewtype = Cint(Cls.ChannelOption)
	'权限
   Dim chkpower,chkemoney,ChkMsg
   	   chkpower=true
	   chkemoney=true
   If IsHtml = False then
   	   chkpower=chk_power(v_power,ChannelIDs)
	   chkemoney=chk_emoney(v_emoney,"Photo",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 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_name="<font color="&v_tcolor&">"&v_name&"</font>"
  If Cls.ErrTrue Then tmp_err=commend_error(ChannelIDs,v_name,v_id,Cls.ChannelName)
  tmp_commend=format_commend(Cls.ChannelName,v_name,Cls.Web_Dir&Cls.ChannelDir&"/View.asp?id="&v_id)
  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=Cls.ReadTemplate(3)
  HtmlContent=Replace(HtmlContent,"{$id}",v_id)  
  HtmlContent=Replace(HtmlContent,"{$name}",v_name) 
  HtmlContent=Replace(HtmlContent,"{$emoney}",v_emoney)
  HtmlContent=Replace(HtmlContent,"{$power}",v_power)
  HtmlContent=Replace(HtmlContent,"{$emony_power}",format_emoney_power(v_emoney,v_power,1))
  HtmlContent=Replace(HtmlContent,"{$tit_fir}",Cls.ChannelTit)
  if v_tcolor<>"" then HtmlContent=Replace(HtmlContent,"{$tcolor}",v_tcolor)
  HtmlContent=Replace(HtmlContent,"{$tim}",Cls.time_type(v_tim,4))
  HtmlContent=Replace(HtmlContent,"{$tit}",tit)
  HtmlContent=Replace(HtmlContent,"{$tit_fir}",Cls.ChannelTit)
  HtmlContent=Replace(HtmlContent,"{$pic}",v_pic)
  HtmlContent=Replace(HtmlContent,"{$remark}",v_remark)
  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"))
  If not Cls.ReviewTrue Then HtmlContent=Replace(HtmlContent,"{$review}","")
  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.ReadPhotoList(HtmlContent)
  HtmlContent = Html.ReadPhotoPic(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 v_script,dim_url,num_url,now_url,pic_url,pfile,HtmlUrl,FilePath,vClassPath,ilepaths,Filepaths,Filepathes,HtmlFileName,pp,pi
  Dim v_picurl,v_picname,pagecute_url,v_picurls,pageup,pagedown
  dim_url=split(v_url,"@@@")
  num_url=ubound(dim_url)
  now_url=0
  For pp=0 to num_url
    If not(chkpower and chkemoney) Then 
       v_picurl = ChkMsg
	   v_picname = ""
	   pagecute_url = ""
	   pp=num_url
    Else
       If v_viewtype = 1 then
          If Cls.ChannelIsCreatHtml = True then
              obj_page.pageurl=Cls.ReadFileName(v_file, v_id, "_", Cls.ChannelPrefix, Cls.ChannelHtmlForm, "")
              obj_page.pagefirvar=Cls.ReadFileName(v_file, v_id, "", Cls.ChannelPrefix, Cls.ChannelHtmlForm, "")
              obj_page.pageext=Cls.ChannelHtmlExt
			  obj_page.pagevar=""
			  obj_page.setpage=pp+1
          Else
              obj_page.pageurl="View.asp?id="&v_id&"&"
			  pp=num_url '只运行一次
          End if
          obj_page.nummer=1
          obj_page.rssum=num_url+1
          obj_page.page_unit=Cls.ChannelUnit
          obj_page.page_tit=Cls.ChannelTit
          call obj_page.p_info()
		  pagecute_url="<table border=0 cellspacing=0 cellpadding=1><tr><td>"&obj_page.page_var&"</td><td width=5></td><td>分页：</td><td>"&obj_page.page_cute&"</td><td width=5></td>"&obj_page.page_shortcut&"</tr></table>"
		  now_url=obj_page.viewpage-1
		  v_url=dim_url(now_url)  	  
          v_url=Split(v_url,"|")
          v_PicName=v_url(0)
          v_PicUrl=v_url(1)
          v_picurls=v_url(1)
          If isHtml = True Then
               if obj_page.viewpage=2 then
                    pagedown=obj_page.pagefirvar
               else
                    pagedown=obj_page.pageurl&obj_page.viewpage-1&".html"
               end if
               pageup=obj_page.pageurl&obj_page.viewpage+1&".html"
          else
               pagedown=obj_page.pageurl&"page="&obj_page.viewpage-1
               pageup=obj_page.pageurl&"page="&obj_page.viewpage+1
          end if
          v_script = v_script & vbcrlf & "<script language=""javascript"" type=""text/javascript"">"
          v_script = v_script & vbcrlf & "//图片处理"
          v_script = v_script & vbcrlf & "var nowpage = "&now_url&";"
          v_script = v_script & vbcrlf & "var numpage = "&num_url&";"
          v_script = v_script & vbcrlf & "function click_pic(o) {"
          v_script = v_script & vbcrlf & "	if(event.offsetX <= o.clientWidth/2){"
          v_script = v_script & vbcrlf & "	  if (nowpage==0){"
          v_script = v_script & vbcrlf & "	    alert(""已经是第一张图片了!"");"
          v_script = v_script & vbcrlf & "	  }else{"
          If isHtml = True Then		  
             v_script = v_script & vbcrlf & "	    window.location.href="""&v_id&"_"&obj_page.viewpage-1&".Html"";"
		  Else
             v_script = v_script & vbcrlf & "	    window.location.href="""&obj_page.pageurl&"page="&obj_page.viewpage-1&""";"
		  End If
          v_script = v_script & vbcrlf & "	  }"	  
          v_script = v_script & vbcrlf & "	}else{"
          v_script = v_script & vbcrlf & "	  if (nowpage==numpage){"
          v_script = v_script & vbcrlf & "	    alert(""已经是最后一张图片了!"");"
          v_script = v_script & vbcrlf & "	  }else{"
          If isHtml = True Then		  
             v_script = v_script & vbcrlf & "	    window.location.href="""&v_id&"_"&obj_page.viewpage+1&".Html"";"
		  Else
             v_script = v_script & vbcrlf & "	    window.location.href="""&obj_page.pageurl&"page="&obj_page.viewpage+1&""";"
		  End If
          v_script = v_script & vbcrlf & "	  }"	
          v_script = v_script & vbcrlf & "  }"			  	   
          v_script = v_script & vbcrlf & "}"
          v_script = v_script & vbcrlf & "function change_style(o) {"
          v_script = v_script & vbcrlf & "	if(event.offsetX <= o.clientWidth/2 ) {"
          v_script = v_script & vbcrlf & "		if( !o.style.cursor.match(""pre"") )"
          v_script = v_script & vbcrlf & "			o.style.cursor = ""url(""+"""&Cls.Web_Dir&"Images/Cursor/pre.ani""+"")"";"
          v_script = v_script & vbcrlf & "		if( o.alt != ""点击跳到上一张"" )"
          v_script = v_script & vbcrlf & "			o.alt = ""点击跳到上一张"";"
          v_script = v_script & vbcrlf & "	}"
          v_script = v_script & vbcrlf & "	else if( !o.style.cursor.match(""next"") ){	"
          v_script = v_script & vbcrlf & "		o.style.cursor=""url(""+"""&Cls.Web_Dir&"Images/Cursor/next.ani""+"")"";"
          v_script = v_script & vbcrlf & "		if( o.alt != ""点击跳到下一张"" )"
          v_script = v_script & vbcrlf & "			o.alt = ""点击跳到下一张"";"
          v_script = v_script & vbcrlf & "	}"
          v_script = v_script & vbcrlf & "	return;"
          v_script = v_script & vbcrlf & "}"	
          v_script = v_script & vbcrlf & "</script>"		    
          If Lcase(Right(v_picurl,4))=".swf" then
               v_picurl=vbcrlf&"<div id=photo_img align=center class=bw><object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0""  width='500' height='500'>" & _
               vbcrlf&"<param name=movie value='"&v_PicUrl&"'>" & _
               vbcrlf&"<param name=quality value=high>" & _
               vbcrlf&"<embed src='"&v_PicUrl&"' quality=high pluginspage=""http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"" type=""application/x-shockwave-flash"" width='500' height='500'></embed> " & _
               vbcrlf&"</object></div>"
          Else
               v_picurl="<div id=photo_div align=center class=bw><img id=photo_img src='"&v_PicUrl&"' border=0  onload=""javascript:if(this.width>788)this.width=788;"" onmousemove=""change_style(this);javascript:if(this.width>788)this.width=788;"" onclick=""click_pic(this);""></div>"
          v_picurl = v_picurl & vbcrlf & "<script language=""javascript"" type=""text/javascript"">"
          v_picurl = v_picurl & vbcrlf & "//图片处理"
          v_picurl = v_picurl & vbcrlf & "var nowpage = "&now_url&";"
          v_picurl = v_picurl & vbcrlf & "var numpage = "&num_url&";"
          v_picurl = v_picurl & vbcrlf & "function click_pic(o) {"
          v_picurl = v_picurl & vbcrlf & "	if(event.offsetX <= o.clientWidth/2){"
          v_picurl = v_picurl & vbcrlf & "	  if (nowpage==0){"
          v_picurl = v_picurl & vbcrlf & "	    alert(""已经是第一张图片了!"");"
          v_picurl = v_picurl & vbcrlf & "	  }else{"
          v_picurl = v_picurl & vbcrlf & "	    window.location.href="""&pagedown&""";"
          v_picurl = v_picurl & vbcrlf & "	  }"	  
          v_picurl = v_picurl & vbcrlf & "	}else{"
          v_picurl = v_picurl & vbcrlf & "	  if (nowpage==numpage){"
          v_picurl = v_picurl & vbcrlf & "	    alert(""已经是最后一张图片了!"");"
          v_picurl = v_picurl & vbcrlf & "	  }else{"
          v_picurl = v_picurl & vbcrlf & "	    window.location.href="""&pageup&""";"
          v_picurl = v_picurl & vbcrlf & "	  }"	
          v_picurl = v_picurl & vbcrlf & "  }"			  	   
          v_picurl = v_picurl & vbcrlf & "}"
          v_picurl = v_picurl & vbcrlf & "function change_style(o) {"
          v_picurl = v_picurl & vbcrlf & "	if(event.offsetX <= o.clientWidth/2 ) {"
          v_picurl = v_picurl & vbcrlf & "		if( !o.style.cursor.match(""pre"") )"
          v_picurl = v_picurl & vbcrlf & "			o.style.cursor = ""url(""+"""&Cls.Web_Dir&"Images/Cursor/pre.ani""+"")"";"
          v_picurl = v_picurl & vbcrlf & "		if( o.alt != ""点击跳到上一张"" )"
          v_picurl = v_picurl & vbcrlf & "			o.alt = ""点击跳到上一张"";"
          v_picurl = v_picurl & vbcrlf & "	}"
          v_picurl = v_picurl & vbcrlf & "	else if( !o.style.cursor.match(""next"") ){	"
          v_picurl = v_picurl & vbcrlf & "		o.style.cursor=""url(""+"""&Cls.Web_Dir&"Images/Cursor/next.ani""+"")"";"
          v_picurl = v_picurl & vbcrlf & "		if( o.alt != ""点击跳到下一张"" )"
          v_picurl = v_picurl & vbcrlf & "			o.alt = ""点击跳到下一张"";"
          v_picurl = v_picurl & vbcrlf & "	}"
          v_picurl = v_picurl & vbcrlf & "	return;"
          v_picurl = v_picurl & vbcrlf & "}"	
          v_picurl = v_picurl & vbcrlf & "</script>"	
          End if 
		 v_picurl = v_script & vbcrlf & v_picurl	
       Else
	      pp=num_url '只运行一次
		  If v_viewtype = 2 Then
		     v_picurl ="<div class=bw>"
		  	 v_PicName = ""
			 pagecute_url =""
		     For pi = 0 to num_url
			     v_url=Split(dim_url(pi),"|")
                 If Lcase(Right(v_picurl,4))=".swf" then
                     v_picurl=v_picurl&vbcrlf&"<Div id=photo_"&pi&"><object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0""  width='500' height='500'>" & _
                     vbcrlf&"<param name=movie value='"&v_url(1)&"'>" & _
                     vbcrlf&"<param name=quality value=high>" & _
                     vbcrlf&"<embed src='"&v_url(1)&"' quality=high pluginspage=""http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"" type=""application/x-shockwave-flash"" width='500' height='500'></embed> " & _
                     vbcrlf&"</object><br /><b>"&v_url(0)&"</b></Div><br />"
                 Else
                     v_picurl=v_picurl&vbcrlf&"<Div id=photo_"&pi&"><img id=photo_img_"&pi&" src='"&v_url(1)&"' border=0 style='margin-right: 1em; float: middle'  onload=""javascript:if(this.width>788)this.width=788;"" align=center><br /><br /><b>"&v_url(0)&"</b></Div><br /><br />"
				 End if
			 Next
             v_picurl=v_picurl&vbcrlf&"</div>"			 
		  Else
                v_script = v_script & vbcrlf & "<script language=""javascript"" type=""text/javascript"">"
                v_script = v_script & vbcrlf & "//图片处理"
                v_script = v_script & vbcrlf & "var nowpage = 0;"
                v_script = v_script & vbcrlf & "var numpage = "&num_url&";"
                v_script = v_script & vbcrlf & "var picurl = new Array();"
     		    for pi = 0 to num_url
                v_script = v_script & vbcrlf & "picurl["&pi&"] = """&replace(replace(dim_url(pi),"'","\'"),"""","\""")&""";"
	     	    next
                v_script = v_script & vbcrlf & "function click_pic(o) {"
                v_script = v_script & vbcrlf & "	if(event.offsetX <= o.clientWidth/2)"
                v_script = v_script & vbcrlf & "		goPage(""pre"");"
                v_script = v_script & vbcrlf & "	else"
                v_script = v_script & vbcrlf & "		goPage(""next"");"
                v_script = v_script & vbcrlf & "}"
                v_script = v_script & vbcrlf & "function change_style(o) {"
                v_script = v_script & vbcrlf & "	if(event.offsetX <= o.clientWidth/2 ) {"
                v_script = v_script & vbcrlf & "		if( !o.style.cursor.match(""pre"") )"
                v_script = v_script & vbcrlf & "			o.style.cursor = ""url(""+"""&Cls.Web_Dir&"Images/Cursor/pre.ani""+"")"";"
                v_script = v_script & vbcrlf & "		if( o.alt != ""点击跳到上一张"" )"
                v_script = v_script & vbcrlf & "			o.alt = ""点击跳到上一张"";"
                v_script = v_script & vbcrlf & "	}"
                v_script = v_script & vbcrlf & "	else if( !o.style.cursor.match(""next"") ){	"
                v_script = v_script & vbcrlf & "		o.style.cursor=""url(""+"""&Cls.Web_Dir&"Images/Cursor/next.ani""+"")"";"
                v_script = v_script & vbcrlf & "		if( o.alt != ""点击跳到下一张"" )"
                v_script = v_script & vbcrlf & "			o.alt = ""点击跳到下一张"";"
                v_script = v_script & vbcrlf & "	}"
                v_script = v_script & vbcrlf & "	return;"
                v_script = v_script & vbcrlf & "}"
                v_script = v_script & vbcrlf & "function goPage (page) {"
                v_script = v_script & vbcrlf & "	switch(page) {"
                v_script = v_script & vbcrlf & "	case ""pre"":"
                v_script = v_script & vbcrlf & "	if (nowpage==0){"
                v_script = v_script & vbcrlf & "	alert(""已经是第一张图片了!"");"
                v_script = v_script & vbcrlf & "	}else{"
                v_script = v_script & vbcrlf & "	nowpage = nowpage - 1;"
                v_script = v_script & vbcrlf & "	doImgView(picurl[nowpage]);"
                v_script = v_script & vbcrlf & "	}"
                v_script = v_script & vbcrlf & "	break;"
                v_script = v_script & vbcrlf & "	case ""next"":"
                v_script = v_script & vbcrlf & "	if (nowpage==numpage){"
                v_script = v_script & vbcrlf & "	alert(""已经是最后一张图片了!"");"
                v_script = v_script & vbcrlf & "	}else{"
                v_script = v_script & vbcrlf & "	nowpage = nowpage + 1;"
                v_script = v_script & vbcrlf & "	doImgView(picurl[nowpage]);"
                v_script = v_script & vbcrlf & "	}"		   
                v_script = v_script & vbcrlf & "	break;"
                v_script = v_script & vbcrlf & "	default:page=parseInt(page);"
                v_script = v_script & vbcrlf & "	if (page>=0 && page<=numpage){;"
                v_script = v_script & vbcrlf & "	 nowpage = page;"
                v_script = v_script & vbcrlf & "	 doImgView(picurl[nowpage]);"
		        v_script = v_script & vbcrlf & "	 break;"	
                v_script = v_script & vbcrlf & "  }"
                v_script = v_script & vbcrlf & " }"
                v_script = v_script & vbcrlf & "}"
                v_script = v_script & vbcrlf & "function doImgView(picsrc) {"
                v_script = v_script & vbcrlf & "	var src = picsrc.split(""|"");"
                v_script = v_script & vbcrlf & "	if (src.length>0) {"
                v_script = v_script & vbcrlf & "	$(""photo_url"").innerHTML = ""<img id=\""photo_img\"" src=\""""+ src[1]+ ""\""  border=\""0\"" style=\""float: middle\"" onload=\""javascript:if(this.width>788)this.width=788;\"" onmousemove=\""change_style(this);\"" onclick=\""click_pic(this);\"" />"";"
                v_script = v_script & vbcrlf & "	$(""photo_name"").innerHTML = ""<b>""+ src[0]+ ""</b>"";"
                v_script = v_script & vbcrlf & "	$(""photo_cut"").innerHTML = PageCute();"
		        v_script = v_script & vbcrlf & " }"
                v_script = v_script & vbcrlf & "}"
                v_script = v_script & vbcrlf & "function PageCute(){"
                v_script = v_script & vbcrlf & " var p = 1; //开始页"
                v_script = v_script & vbcrlf & " var e = numpage+1; //结束页"
                v_script = v_script & vbcrlf & " var shownum = 10; //显示页码数"
                v_script = v_script & vbcrlf & " var pstr = """";"
                v_script = v_script & vbcrlf & " if (e <= shownum || nowpage==0){"
                v_script = v_script & vbcrlf & "   p=1;"
                v_script = v_script & vbcrlf & "	e=shownum;"
                v_script = v_script & vbcrlf & "	if (numpage<e) e=numpage+1;"
                v_script = v_script & vbcrlf & " }else{"
                v_script = v_script & vbcrlf & "   p=nowpage+1;"
                v_script = v_script & vbcrlf & "	e=nowpage+shownum;"
                v_script = v_script & vbcrlf & "	if (numpage<e) e=numpage+1;"
                v_script = v_script & vbcrlf & "	if (e-p<shownum) p=e-shownum+1;"
                v_script = v_script & vbcrlf & " }"
                v_script = v_script & vbcrlf & " pstr += ""<a href=\""javascript:void(0)\"" onclick=\""goPage(0);\"" title=\""第一张\""><b>&lt;&lt;</b></a> "";"
                v_script = v_script & vbcrlf & " pstr += ""<a href=\""javascript:void(0)\"" onclick=\""goPage(""+(nowpage-1)+"");\"" title=\""上一张\""><b>&lt;</b></a> "";"
                v_script = v_script & vbcrlf & " while (p <= e){"
                v_script = v_script & vbcrlf & "     pstr += ""<a href=\""javascript:void(0)\"" onclick=\""goPage(""+(p-1)+"");\"" title=\""第""+p+""张\"">"";"
                v_script = v_script & vbcrlf & "     if (p==nowpage+1){"
                v_script = v_script & vbcrlf & "	       pstr += ""<b>""+p+""</b></a> "";"
                v_script = v_script & vbcrlf & "	  }else{"
                v_script = v_script & vbcrlf & "	       pstr += p+""</a> "";"
                v_script = v_script & vbcrlf & "	  }"
                v_script = v_script & vbcrlf & "	  p++;"
                v_script = v_script & vbcrlf & " }"
                v_script = v_script & vbcrlf & " pstr += ""<a href=\""javascript:void(0)\"" onclick=\""goPage(""+(nowpage+1)+"");\"" title=\""下一张\""><b>&gt;</b></a> "";"
                v_script = v_script & vbcrlf & "pstr += ""<a href=\""javascript:void(0)\"" onclick=\""goPage(""+numpage+"");\"" title=\""最后一张\""><b>&gt;&gt;</b></a> "";"
                v_script = v_script & vbcrlf & "return(pstr);"
                v_script = v_script & vbcrlf & "}"	   	
                v_script = v_script & vbcrlf & "</script>"
		        Dim v_page
		        v_page = Cls.Code_ID("page") '通过&page=num来浏览分页图片 
		        If v_page > 0 Then 	v_page = v_page - 1
		        v_picurl = v_script & "<div align=center id=photo_url><img src='"&cls.web_dir&"Images/Viewpic/Loading.gif' /> 图片载入中...</div> "
		        v_picname = "<div align=center id=photo_name></div>"
		        pagecute_url = "<div align=center id=photo_cut></div><script type='text/javascript'>setTimeout('goPage("&v_page&")', 1);</script>"
		   End if			
 	    End if   
	End If
    NewHtmlContent=HtmlContent
  	NewHtmlContent=Replace(NewHtmlContent,"{$picurl}",v_picurl)
  	NewHtmlContent=Replace(NewHtmlContent,"{$picurls}",v_picurls)
    NewHtmlContent=Replace(NewHtmlContent,"{$picname}",v_picname)
    NewHtmlContent=Replace(NewHtmlContent,"{$pagecute}",pagecute_url)
	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, pp+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_url
End Function

'//* 列表初始 *//
Public Sub LoadListFirst()
	Select Case action
	Case "top"
		Call ShowChannelList(False,Cid,"","top")
	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,rssfeed
    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
			rssfeed="<a href=RssFeed.asp?c_id="&ncid&" target=_blank><img src='"&Cls.Web_Dir&"Images/Pic/Rss.png' title='订阅最新信息' border=0></a>"
			
			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 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="top" then TmpImg="sort_c2"
	    If Cls.ChannelIsCreatHtml = True then
    	      Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/TopPhoto/Index_1"&Cls.ChannelHtmlExtName
    	Else
	          Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/List.asp?Action=top"
	    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&"/FocusPhoto/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&"/GoodPhoto/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&"/HotPhoto/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 Name,Power,Emoney,keyes,username,tim,Remark,counter,Urls,Isfocus,hidden,pic,oSpecialID,oIncludeInfo,Istop,isgood,tcolor,Found_Err
    pic=Cls.code_admin("pic",1,100)
    Urls=Cls.Code_Remark("Urls")  'Cls.code_admin("url",1,200)
    Name=Cls.Code_Admin("Name",1,150)
    Remark=Cls.Code_Remark("Remark")
    csid=Cls.Code_Form("ClassID")
    If Cls.Code_Form("readme")<>"yes" Then
    Found_Err=Found_Err&"+<font class=blue>请您先阅读并同意有关信息发布的相关声明！</font><br />"
    End If
    If name="" or remark="" or Pic="" or Urls="" 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 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
    keyes=Cls.code_admin("keyes",1,20)
    oSpecialID=Cls.Code_Int("SpecialID",0)
    tcolor=Cls.Code_Form("tcolor")
    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("Name")=Name
    rs("emoney")=0
    rs("power")=""
    rs("Url")=Urls
    rs("username")=login_username
    rs("tim")=Cls.now_time
    rs("counter")=0
    rs("Isfocus")=0
    If chkputpower=True Then
  	Rs("hidden")=1
    Else
  	Rs("hidden")=0
    End If
    rs("keyes")=keyes
    rs("pic")=pic
    rs("Remark")=Remark
    rs("isgood")=0
    rs("Istop")=0
    rs("cod")=1
    rs("tcolor")=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 ="<tr><td>"&tit_fir&"标题：</td><td><input type=text name=name size=60 maxlength=100>"&redx&"&nbsp;&nbsp;"&ShowColor("tcolor","")&"</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 & showcomefrom(cls.web_name,preset(1),"佚名",preset(2)) 
  n_put = n_put & "<input type=hidden name=PhotoSize value='' size=10 maxlength=10>"
  n_put = n_put & ShowsPicUpload(ChannelIDs,"","pic")
  n_put = n_put & "<tr valign=top><td>图片地址：</td><td><input type=hidden name=Urls value=''>"
  n_put = n_put & "<select name=Url style=""width:80%;height:100"" size=2 onclick=""doPreviews('Url','"&Cls.Web_Dir&"','"&Cls.Web_Dir&"Upload');"" ondblclick=""ModifyUrl('图片地址','Url');""></select>"& redx&"<br />"
  n_put = n_put & "<input type=button name=addurl value='添加图片地址' onclick=""AddUrl('图片地址','Url');"" class=btn>"
  n_put = n_put & "<input type=button name=addurl value='修改当前地址' onclick=""ModifyUrl('图片地址','Url');"" class=btn>"
  n_put = n_put & "<input type=button name=addurl value='删除当前地址' onclick=""DelUrl('图片地址','Url');"" class=btn>"
  n_put = n_put & "<input type=button name=upurl value='↑' onclick=""UpUrl('图片地址','Url');"" class=btn>"
  n_put = n_put & "<input type=button name=Downurl value='↓' onclick=""DownUrl('图片地址','Url');"" class=btn>"
  n_put = n_put & "<input type=button name=SelectFile value='已上传中选择' onclick=""SelectFiles('"&ChannelIDs&"','2','Url','');"" class=btn>"
  n_put = n_put & "</tr><tr><td>上传"& tit_fir&"：</td><td><table border=0 width='100%'><tr><td><iframe frameborder=0 name=upload_frame width='100%' height=30 scrolling=no src='"&Cls.Web_Dir&"Include/Upload.asp?ID="&ChannelIDs&"&Type=4&Obj=Url&TObj=TempUploadFiles'></iframe></td><td></td></tr></table></td></tr>"
  n_put = n_put & ShowUploadList()
  n_put = n_put & ShowMoreItem(0,"s")
  n_put = n_put & ShowEditor(ChannelIDs,5,"add_frm","Remark","内容","TempUploadFiles","")
        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.ReadUserLogin(HtmlContent)
	HtmlContent = Html.ReadPhotoList(HtmlContent)
	HtmlContent = Html.ReadPhotoPic(HtmlContent)
	HtmlContent = Html.ReadChannelMenu(HtmlContent)
	HtmlContent = Cls.ReHtml(HtmlContent,0)	
	Response.Write HtmlContent
End Sub
%>
