<!--#include file="../../connshop.asp"-->
<!--#include file="../config.Inc"-->
<!--#include file="../Lebi_db_cls.asp"-->
<!--#include file="../Lebi_cache_cls.asp"-->
<!--#include file="../Lebi_cache.asp"-->
<!--#include file="../Lebi_LangInfo.asp"-->
<!--#include file="../Lebi_main.asp"-->
<!--#include file="../Lebi_function.asp"-->
<!--#include file="../Lebi_Word.asp"-->
<%
'**************************************
'* 最后更新 2011-02-06 by 56770.Kingdge
'* Copyright www.56770.com     
'**************************************
connopen()
Dim strFile,RLoadStyle(7),topnum,cutcharnum,d_type,datetype,sql,tmpstr,i,page,url,Temp_SiteMesage,LoadSiteMessage,TmpLoadSiteMessage,DataCount,App_SiteMessage,LangPath,LangTxt
topnum = request("topnum")
If Not IsNumeric(topnum) Or isempty(topnum) Then topnum = 5
cutcharnum = request("cutcharnum")
d_type = request("type")
datetype = request("datetype")
LangTxt = safereplace(request("LangTxt"))
LangPath = safereplace(request("LangPath"))
cache.name="SiteMessage"&d_type&LangTxt
cache.reloadtime= 5000
If cache.objisempty() Then
		sql = "select top "&topnum&" subject"& LangTxt &",id,message"& LangTxt &""
		If datetype <> 0 Then sql = sql &",idate"
		sql = sql &" from [Lebi_help] where syxs=1 order by id DESC"
		Set rs = conn.execute(sql)
		If rs.eof Then      
				cache.value = ""
				cache.DataCount = 0
		Else 
				cache.value = rs.getrows()
				cache.DataCount = 1
		End If 
		rs.close : Set rs = Nothing 
End If 
App_SiteMessage = cache.value
DataCount = cache.DataCount
strFile = Eshop_url& Style_Folder &"Lebi.SiteMessage."
If d_type = 0 Then 
		RLoadStyle(0) = LoadStyle(strFile&"0.style")
		Temp_SiteMesage = RLoadStyle(0)
		If DataCount = 1 Then 
				RLoadStyle(2) = splits(LoadStyle(strFile&"2.style"))
				For i = 0 To UBound(App_SiteMessage,2)
						LoadSiteMessage = RLoadStyle(2)
						If ((i+1)/top25) = 1 Then 
								page = 1
						Else
								page = Split(formatnumber2(((i+1)/top25)),".")(0) + 1
						End If 
						Select Case show_html 
							   Case "0" : url = "help/class/?news_type=0&page="& page &"#"& App_SiteMessage(1,i)
							   Case "1" : url = Folder(6) &"news."& page &"."& Sys_Ext &"#"& App_SiteMessage(1,i)
						End Select 
						If datetype <> 0 Then
								ReplaceStyle "time",Formatdate(App_SiteMessage(3,i),datetype) &" ",LoadSiteMessage
						Else
								ReplaceStyle "time","",LoadSiteMessage
						End If
						ReplaceStyle "url",LangPath & url,LoadSiteMessage
						ReplaceStyle "title",App_SiteMessage(0,i),LoadSiteMessage
						ReplaceStyle "content",App_SiteMessage(2,i),LoadSiteMessage
						ReplaceStyle "cut_title",Cutchar(App_SiteMessage(0,i),cutcharnum),LoadSiteMessage
						ReplaceStyle "loop_num",i+1,LoadSiteMessage
						TmpLoadSiteMessage = TmpLoadSiteMessage & LoadSiteMessage
				Next 
		Else
				RLoadStyle(1) = splits(LoadStyle(strFile&"1.style"))
				Temp_SiteMesage = Temp_SiteMesage & RLoadStyle(1)
		End If 
		RLoadStyle(3) = LoadStyle(strFile&"3.style")
		Temp_SiteMesage = Temp_SiteMesage & TmpLoadSiteMessage & RLoadStyle(3)
Else 
		RLoadStyle(4) = LoadStyle(strFile&"4.style")
		Temp_SiteMesage = RLoadStyle(4)
		If DataCount = 1 Then 
				RLoadStyle(6) = splits(LoadStyle(strFile&"6.style"))
				For i = 0 To UBound(App_SiteMessage,2)
						LoadSiteMessage = RLoadStyle(6)
						If ((i+1)/top25) = 1 Then 
								page = 1
						Else
								page = Split(formatnumber2(((i+1)/top25)),".")(0) + 1
						End If 
						Select Case show_html 
							   Case "0" : url = "help/class/?news_type=0&page="& page &"#"& App_SiteMessage(1,i)
							   Case "1" : url = Folder(6) &"news."& page &"."& Sys_Ext &"#"& App_SiteMessage(1,i)
						End Select 
						If datetype <> 0 Then
								ReplaceStyle "time",Formatdate(App_SiteMessage(3,i),datetype) &" ",LoadSiteMessage
						Else
								ReplaceStyle "time","",LoadSiteMessage
						End If
						ReplaceStyle "url",LangPath & url,LoadSiteMessage
						ReplaceStyle "title",App_SiteMessage(0,i),LoadSiteMessage
						ReplaceStyle "content",App_SiteMessage(2,i),LoadSiteMessage
						ReplaceStyle "cut_title",Cutchar(App_SiteMessage(0,i),cutcharnum),LoadSiteMessage
						ReplaceStyle "loop_num",i+1,LoadSiteMessage
						TmpLoadSiteMessage = TmpLoadSiteMessage & LoadSiteMessage
				Next 
		Else
				RLoadStyle(5) = splits(LoadStyle(strFile&"5.style"))
				Temp_SiteMesage = Temp_SiteMesage & RLoadStyle(5)
		End If 
		RLoadStyle(7) = LoadStyle(strFile&"7.style")
		Temp_SiteMesage = Temp_SiteMesage & TmpLoadSiteMessage & RLoadStyle(7)
End If 
response.write htmltojs(Temp_SiteMesage)
connclose()
%>