文章列表类别

时间:2021-05-18

<%
DimHTML
SetHTML=NewNewaspPublic_Cls
ClassNewaspPublic_Cls

PrivateSubClass_Initialize()
OnErrorResumeNext
Newasp.LoadTemplates0,0,0
EndSub
'================================================
'函数名:LoadArticleList
'作用:装载文章列表
'参数:ClassID----分类ID
'ChannelID----频道ID
'SpecialID----专题ID
'sType----调用文章类型,0=所有最新文章,1=推荐文章,2=热门文章,3=图文文章,4=分类最新文章
'TopNum----显示文章列表数
'strlen----显示标题长度
'ShowClass----是否显示分类
'ShowPic----是否显示图文标题
'ShowDate----是否显示日期
'DateMode----显示日期模式
'newindow----新窗口打开
'================================================
PublicFunctionLoadArticleList(ByValChannelID,ByValClassID,ByValSpecialID,_
ByValstype,ByValTopNum,ByValstrLen,_
ByValshowclass,ByValshowpic,ByValshowdate,_
ByValDateMode,ByValnewindow,ByValstyles)

DimRs,SQL,i,strContent,foundstr
DimsTitle,sTopic,ChildStr,ListStyle,BestCode,BestString
DimArticleTopic,ClassName,HtmlFileUrl,WriteTime,LinkTarget,HtmlFileName

ChannelID=Newasp.ChkNumeric(ChannelID)
ClassID=Newasp.ChkNumeric(ClassID)
SpecialID=Newasp.ChkNumeric(SpecialID)
stype=Newasp.ChkNumeric(stype)

OnErrorResumeNext
Newasp.LoadChannel(ChannelID)

IfCInt(stype)>=4AndCLng(ClassID)<>0Then
SQL="SELECTChildStrFROM[NC_Classify]WHEREChannelID="&ChannelID&"AndClassID="&ClassID
SetRs=Newasp.Execute(SQL)
IfRs.BOFAndRs.EOFThen
SetRs=Nothing
LoadArticleList=""
ExitFunction
Else
ChildStr=Rs("ChildStr")
EndIf
SetRs=Nothing
Else
ChildStr="0"
EndIf

SelectCaseCInt(stype)
Case0:foundstr="OrderByA.WritetimeDesc,A.ArticleidDesc"
Case1:foundstr="AndA.isBest>0OrderByA.WritetimeDesc,A.ArticleidDesc"
Case2:foundstr="OrderByA.AllHitsDesc,A.ArticleidDesc"
Case3:foundstr="And(A.BriefTopic=1OrA.BriefTopic=2)OrderByA.WritetimeDesc,A.ArticleidDesc"
Case4:foundstr="AndA.ClassIDin("&ChildStr&")OrderByA.WritetimeDesc,A.ArticleidDesc"
Case5:foundstr="AndA.ClassIDin("&ChildStr&")AndA.isBest>0OrderByA.WritetimeDesc,A.ArticleidDesc"
Case6:foundstr="AndA.ClassIDin("&ChildStr&")OrderByA.AllHitsDesc,A.ArticleidDesc"
Case7:foundstr="AndA.ClassIDin("&ChildStr&")And(A.BriefTopic=1OrA.BriefTopic=2)OrderByA.WritetimeDesc,A.ArticleidDesc"
CaseElse
foundstr="OrderByA.WritetimeDesc,A.ArticleidDesc"
EndSelect
IfCInt(stype)>=4AndCLng(ClassID)=0Then
foundstr="OrderByA.WritetimeDesc,A.ArticleidDesc"
EndIf
IfCLng(SpecialID)<>0Then
foundstr="AndA.SpecialID="&CLng(SpecialID)&""&foundstr
EndIf
SQL="A.ArticleID,A.ClassID,A.ColorMode,A.FontMode,A.title,A.BriefTopic,A.AllHits,A.WriteTime,A.HtmlFileDate,A.isBest,"
SQL="SELECTTop"&CInt(TopNum)&SQL&"C.ClassName,C.ColorModes,C.FontModes,C.HtmlFileDir,C.UseHtmlFROM[NC_Article]AINNERJOIn[NC_Classify]CONA.ClassID=C.ClassIDWHEREA.isAccept>0AndA.ChannelID="&ChannelID&""&foundstr&""
SetRs=Newasp.Execute(SQL)
i=0
IfRs.BOFAndRs.EOFThen
strContent="该分类还没有添加任何内容!"
Else
strContent="<tablewidth=""100%""border=0cellpadding=2cellspacing=0>"
DoWhileNotRs.EOF
If(iMod2)=0Then
ListStyle=Trim(styles)&1
Else
ListStyle=Trim(styles)&2
EndIf
IfRs("isBest")<>0Then
BestCode=2
BestString="<fontcolor='"&Newasp.MainSetting(3)&"'>推荐</font>"
Else
BestCode=1
BestString=""
EndIf

strContent=strContent&Newasp.MainSetting(13)

sTitle=Newasp.GotTopic(Rs("title"),CInt(strLen))
sTitle=Newasp.ReadFontMode(sTitle,Rs("ColorMode"),Rs("FontMode"))
sTopic=Newasp.ReadPicTopic(Rs("BriefTopic"))

ClassName=Newasp.ReadFontMode(Rs("ClassName"),Rs("ColorModes"),Rs("FontModes"))
HtmlFileName=Newasp.ReadFileName(Rs("HtmlFileDate"),Rs("ArticleID"),Newasp.ChannelHtmlExt,Newasp.ChannelPrefix,Newasp.ChannelHtmlForm,"")
IfCInt(Newasp.ChannelUseHtml)<>0Then
HtmlFileUrl=Newasp.ChannelPath&Rs("HtmlFileDir")&Newasp.ShowDatePath(Rs("HtmlFileDate"),Newasp.ChannelHtmlPath)&HtmlFileName
ClassName="<ahref='"&Newasp.ChannelPath&Rs("HtmlFileDir")&"index"&Newasp.ChannelHtmlExt&"'>"&ClassName&"</a>"
Else
HtmlFileUrl=Newasp.ChannelPath&"show.asp?id="&Rs("ArticleID")
ClassName="<ahref='"&Newasp.ChannelPath&"list.asp?classid="&Rs("ClassID")&"'>"&ClassName&"</a>"
EndIf

IfCInt(showclass)=0ThenClassName=""
IfCInt(showpic)=0ThensTopic=""
IfCInt(showdate)<>0Then
WriteTime=Newasp.ShowDateTime(Rs("WriteTime"),CInt(DateMode))
Else
WriteTime=""
EndIf
IfCInt(newindow)<>0Then
LinkTarget="target=""_blank"""
Else
LinkTarget=""
EndIf
ArticleTopic="<ahref='"&HtmlFileUrl&"'"&LinkTarget&"title='"&Newasp.ChannelModule&"标题:"&Rs("title")&"&#13;&#10;发布时间:"&Rs("WriteTime")&"&#13;&#10;阅览次数:"&Rs("AllHits")&"'class=showlist>"&sTitle&"</a>"
strContent=Replace(strContent,"{$ArticleTopic}",ArticleTopic)
strContent=Replace(strContent,"{$ArticleID}",Rs("ArticleID"))
strContent=Replace(strContent,"{$InstallDir}",Newasp.InstallDir)
strContent=Replace(strContent,"{$ArticleTitle}",sTitle)
strContent=Replace(strContent,"{$Title}",Rs("title"))
strContent=Replace(strContent,"{$DateAndTitle}",Rs("WriteTime"))
strContent=Replace(strContent,"{$BriefTopic}",sTopic)
strContent=Replace(strContent,"{$HtmlFileUrl}",HtmlFileUrl)
strContent=Replace(strContent,"{$ClassName}",ClassName)
strContent=Replace(strContent,"[]","")
strContent=Replace(strContent,"{$Target}",LinkTarget)
strContent=Replace(strContent,"{$WriteTime}",WriteTime)
strContent=Replace(strContent,"{$AticleHits}",Rs("AllHits"))
strContent=Replace(strContent,"{$ListStyle}",ListStyle)
strContent=Replace(strContent,"{$BestCode}",BestCode)
strContent=Replace(strContent,"{$BestString}",BestString)
Rs.MoveNext
i=i+1
Loop
strContent=strContent&"</table>"
EndIf

Rs.Close:SetRs=Nothing
LoadArticleList=strContent
EndFunction
'================================================
'函数名:ReadArticleList
'作用:读取文章列表
'参数:str----原字符串
'================================================
PublicFunctionReadArticleList(ByValstr)
DimstrTemp,i
DimsTempContent,nTempContent
DimarrTempContent,arrTempContents,ArrayList
OnErrorResumeNext
strTemp=str
IfInStr(strTemp,"{$ReadArticleList(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$ReadArticleList(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$ReadArticleList(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")

Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),LoadArticleList(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3),ArrayList(4),ArrayList(5),ArrayList(6),ArrayList(7),ArrayList(8),ArrayList(9),ArrayList(10),ArrayList(11)))
Next
EndIf
ReadArticleList=strTemp
EndFunction
'================================================
'函数名:LoadSoftList
'作用:装载软件列表
'参数:ClassID----分类ID
'ChannelID----频道ID
'sType----调用类型
'TopNum----显示列表数
'strlen----显示标题长度
'ShowClass----是否显示分类
'ShowDate----是否显示日期
'DateMode----显示日期模式
'newindow----新窗口打开
'================================================
PublicFunctionLoadSoftList(ByValChannelID,ByValClassID,ByValSpecialID,_
ByValstype,ByValTopNum,ByValstrLen,ByValshowclass,_
ByValshowdate,ByValDateMode,ByValnewindow,ByValstyles)

DimRs,SQL,i,strContent,foundstr,j
DimstrSoftName,ChildStr,ListStyle
DimHtmlFileName,BestCode,BestString,ChannelPath
DimClassName,HtmlFileUrl,SoftTime,LinkTarget,SoftTopic

ChannelID=Newasp.ChkNumeric(ChannelID)
ClassID=Newasp.ChkNumeric(ClassID)
SpecialID=Newasp.ChkNumeric(SpecialID)
stype=Newasp.ChkNumeric(stype)

OnErrorResumeNext
Newasp.LoadChannel(ChannelID)

IfCInt(stype)>=3AndCLng(ClassID)<>0Then
SQL="SELECTChildStrFROM[NC_Classify]WHEREChannelID="&ChannelID&"AndClassID="&ClassID
SetRs=Newasp.Execute(SQL)
IfRs.BOFAndRs.EOFThen
SetRs=Nothing
LoadSoftList=""
ExitFunction
Else
ChildStr=Rs("ChildStr")
EndIf
Rs.Close
Else
ChildStr=0
EndIf
SelectCaseCInt(stype)
Case0:foundstr="OrderByA.SoftTimeDesc,A.SoftIDDesc"
Case1:foundstr="AndA.isBest>0OrderByA.SoftTimeDesc,A.SoftIDDesc"
Case2:foundstr="OrderByA.AllHitsDesc,A.SoftIDDesc"
Case3:foundstr="AndA.ClassIDin("&ChildStr&")OrderByA.SoftTimeDesc,A.SoftIDDesc"
Case4:foundstr="AndA.ClassIDin("&ChildStr&")AndA.isBest>0OrderByA.SoftTimeDesc,A.SoftIDDesc"
Case5:foundstr="AndA.ClassIDin("&ChildStr&")OrderByA.AllHitsDesc,A.SoftIDDesc"
CaseElse
foundstr="OrderByA.SoftTimeDesc,A.SoftIDDesc"
EndSelect
IfCInt(stype)>=3AndCLng(ClassID)=0Then
foundstr="OrderByA.SoftTimeDesc,A.SoftIDDesc"
EndIf
IfCLng(SpecialID)<>0Then
foundstr="AndA.SpecialID="&CLng(SpecialID)&""&foundstr
EndIf
SQL="A.SoftID,A.ClassID,A.ColorMode,A.FontMode,A.SoftName,A.SoftVer,A.AllHits,A.SoftTime,A.HtmlFileDate,A.isBest,"
SQL="SELECTTOP"&CInt(TopNum)&SQL&"C.ClassName,C.ColorModes,C.FontModes,C.HtmlFileDir,C.UseHtmlFROM[NC_SoftList]AINNERJOIN[NC_Classify]COnA.ClassID=C.ClassIDWHEREA.isAccept>0AndA.ChannelID="&ChannelID&""&foundstr&""
SetRs=Newasp.Execute(SQL)
j=0

IfRs.BOFAndRs.EOFThen
strContent="没有添加任何软件!"
Else
SQL=Rs.GetRows(-1)
strContent="<tablewidth=""100%""border=0cellpadding=2cellspacing=0>"
Fori=0ToUbound(SQL,2)
If(jMod2)=0Then
ListStyle=Trim(styles)&1
Else
ListStyle=Trim(styles)&2
EndIf
IfCInt(SQL(9,i))<>0Then
BestCode=2
BestString="<fontcolor='"&Newasp.MainSetting(3)&"'>推荐</font>"
Else
BestCode=1
BestString=""
EndIf
strContent=strContent&Newasp.MainSetting(14)
strSoftName=Newasp.GotTopic(SQL(4,i)&""&SQL(5,i),CInt(strLen))
strSoftName=Newasp.ReadFontMode(strSoftName,SQL(2,i),SQL(3,i))
ClassName=Newasp.ReadFontMode(SQL(10,i),SQL(11,i),SQL(12,i))
HtmlFileName=Newasp.ReadFileName(SQL(8,i),SQL(0,i),Newasp.ChannelHtmlExt,Newasp.ChannelPrefix,Newasp.ChannelHtmlForm,"")
IfCInt(Newasp.ChannelUseHtml)<>0Then
HtmlFileUrl=Newasp.ChannelPath&SQL(13,i)&Newasp.ShowDatePath(SQL(8,i),Newasp.ChannelHtmlPath)&HtmlFileName
ClassName="<ahref='"&Newasp.ChannelPath&SQL(13,i)&"index"&Newasp.ChannelHtmlExt&"'>"&ClassName&"</a>"
Else
HtmlFileUrl=Newasp.ChannelPath&"show.asp?id="&SQL(0,i)
ClassName="<ahref='"&Newasp.ChannelPath&"list.asp?classid="&SQL(1,i)&"'>"&ClassName&"</a>"
EndIf
IfCInt(showclass)=0ThenClassName=""
IfCInt(showdate)<>0Then
SoftTime=Newasp.ShowDateTime(SQL(7,i),CInt(DateMode))
Else
SoftTime=""
EndIf
IfCInt(newindow)<>0Then
LinkTarget="target=""_blank"""
Else
LinkTarget=""
EndIf
SoftTopic="<ahref='"&HtmlFileUrl&"'"&LinkTarget&"title='"&Newasp.ChannelModule&"名称:"&Trim(SQL(4,i)&""&SQL(5,i))&"&#13;&#10;发布时间:"&SQL(7,i)&"&#13;&#10;下载次数:"&SQL(6,i)&"'class=showlist>"&strSoftName&"</a>"
strContent=Replace(strContent,"{$SoftTopic}",SoftTopic)
strContent=Replace(strContent,"{$SoftID}",Rs("softid"))
strContent=Replace(strContent,"{$InstallDir}",Newasp.InstallDir)
strContent=Replace(strContent,"{$SoftName}",strSoftName)
strContent=Replace(strContent,"{$Title}",SQL(4,i))
strContent=Replace(strContent,"{$DateAndTitle}",SQL(7,i))
strContent=Replace(strContent,"{$HtmlFileUrl}",HtmlFileUrl)
strContent=Replace(strContent,"{$ClassName}",ClassName)
strContent=Replace(strContent,"[]","")
strContent=Replace(strContent,"{$Target}",LinkTarget)
strContent=Replace(strContent,"{$SoftTime}",SoftTime)
strContent=Replace(strContent,"{$SoftHits}",SQL(6,i))
strContent=Replace(strContent,"{$ListStyle}",ListStyle)
strContent=Replace(strContent,"{$BestCode}",BestCode)
strContent=Replace(strContent,"{$BestString}",BestString)
j=j+1
Next
SQL=Null
strContent=strContent&"</table>"
EndIf
Rs.Close:SetRs=Nothing
LoadSoftList=strContent
EndFunction
'================================================
'函数名:ReadSoftList
'作用:读取软件列表
'参数:str----原字符串
'================================================
PublicFunctionReadSoftList(ByValstr)
DimstrTemp,i
DimsTempContent,nTempContent
DimarrTempContent,arrTempContents,ArrayList
OnErrorResumeNext
strTemp=str
IfInStr(strTemp,"{$ReadSoftList(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$ReadSoftList(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$ReadSoftList(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),LoadSoftList(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3),ArrayList(4),ArrayList(5),ArrayList(6),ArrayList(7),ArrayList(8),ArrayList(9),ArrayList(10)))
Next
EndIf
ReadSoftList=strTemp
EndFunction

'================================================
'函数名:LoadFlashList
'作用:装载动画列表
'参数:ClassID----分类ID
'ChannelID----频道ID
'sType----调用类型
'TopNum----显示列表数
'strlen----显示标题长度
'ShowClass----是否显示分类
'ShowDate----是否显示日期
'DateMode----显示日期模式
'newindow----新窗口打开
'================================================
PublicFunctionLoadFlashList(ByValChannelID,ByValClassID,ByValSpecialID,_
ByValstype,ByValTopNum,ByValstrLen,ByValshowclass,_
ByValshowdate,ByValDateMode,ByValnewindow,ByValstyles)

DimRs,SQL,i,strContent,foundstr,j
DimstrTitle,ChildStr,ListStyle
DimHtmlFileName,BestCode,BestString,ChannelPath
DimClassName,HtmlFileUrl,addTime,LinkTarget,FlashTopic

ChannelID=Newasp.ChkNumeric(ChannelID)
ClassID=Newasp.ChkNumeric(ClassID)
SpecialID=Newasp.ChkNumeric(SpecialID)
stype=Newasp.ChkNumeric(stype)

OnErrorResumeNext
Newasp.LoadChannel(ChannelID)

IfCInt(stype)>=3AndCLng(ClassID)<>0Then
SQL="SELECTChildStrFROM[NC_Classify]WHEREChannelID="&ChannelID&"AndClassID="&ClassID
SetRs=Newasp.Execute(SQL)
IfRs.BOFAndRs.EOFThen
SetRs=Nothing
LoadFlashList=""
ExitFunction
Else
ChildStr=Rs("ChildStr")
EndIf
Rs.Close
Else
ChildStr=0
EndIf
SelectCaseCInt(stype)
Case0:foundstr="OrderByA.addTimeDesc,A.flashidDesc"
Case1:foundstr="AndA.isBest>0OrderByA.addTimeDesc,A.flashidDesc"
Case2:foundstr="OrderByA.AllHitsDesc,A.flashidDesc"
Case3:foundstr="AndA.ClassIDin("&ChildStr&")OrderByA.addTimeDesc,A.flashidDesc"
Case4:foundstr="AndA.ClassIDin("&ChildStr&")AndA.isBest>0OrderByA.addTimeDesc,A.flashidDesc"
Case5:foundstr="AndA.ClassIDin("&ChildStr&")OrderByA.AllHitsDesc,A.flashidDesc"
CaseElse
foundstr="OrderByA.addTimeDesc,A.flashidDesc"
EndSelect
IfCInt(stype)>=3AndCLng(ClassID)=0Then
foundstr="OrderByA.addTimeDesc,A.flashidDesc"
EndIf
IfCLng(SpecialID)<>0Then
foundstr="AndA.SpecialID="&CLng(SpecialID)&""&foundstr
EndIf
SQL="A.flashid,A.ClassID,A.ColorMode,A.FontMode,A.title,A.Author,A.AllHits,A.addTime,A.HtmlFileDate,A.isBest,"
SQL="SELECTTOP"&CInt(TopNum)&SQL&"C.ClassName,C.ColorModes,C.FontModes,C.HtmlFileDir,C.UseHtmlFROM[NC_FlashList]AINNERJOIN[NC_Classify]COnA.ClassID=C.ClassIDWHEREA.isAccept>0AndA.ChannelID="&ChannelID&""&foundstr&""
SetRs=Newasp.Execute(SQL)
j=0

IfRs.BOFAndRs.EOFThen
strContent="没有添加任何信息!"
Else
SQL=Rs.GetRows(-1)
strContent="<tablewidth=""100%""border=0cellpadding=2cellspacing=0>"
Fori=0ToUbound(SQL,2)
If(jMod2)=0Then
ListStyle=Trim(styles)&1
Else
ListStyle=Trim(styles)&2
EndIf
IfCInt(SQL(9,i))<>0Then
BestCode=2
BestString="<fontcolor='"&Newasp.MainSetting(3)&"'>推荐</font>"
Else
BestCode=1
BestString=""
EndIf
strContent=strContent&Newasp.MainSetting(22)
strTitle=Newasp.GotTopic(SQL(4,i),CInt(strLen))
strTitle=Newasp.ReadFontMode(strTitle,SQL(2,i),SQL(3,i))
ClassName=Newasp.ReadFontMode(SQL(10,i),SQL(11,i),SQL(12,i))
HtmlFileName=Newasp.ReadFileName(SQL(8,i),SQL(0,i),Newasp.ChannelHtmlExt,Newasp.ChannelPrefix,Newasp.ChannelHtmlForm,"")
IfCInt(Newasp.ChannelUseHtml)<>0Then
HtmlFileUrl=Newasp.ChannelPath&SQL(13,i)&Newasp.ShowDatePath(SQL(8,i),Newasp.ChannelHtmlPath)&HtmlFileName
ClassName="<ahref='"&Newasp.ChannelPath&SQL(13,i)&"index"&Newasp.ChannelHtmlExt&"'>"&ClassName&"</a>"
Else
HtmlFileUrl=Newasp.ChannelPath&"show.asp?id="&SQL(0,i)
ClassName="<ahref='"&Newasp.ChannelPath&"list.asp?classid="&SQL(1,i)&"'>"&ClassName&"</a>"
EndIf
IfCInt(showclass)=0ThenClassName=""
IfCInt(showdate)<>0Then
addTime=Newasp.ShowDateTime(SQL(7,i),CInt(DateMode))
Else
addTime=""
EndIf
IfCInt(newindow)<>0Then
LinkTarget="target=""_blank"""
Else
LinkTarget=""
EndIf
FlashTopic="<ahref='"&HtmlFileUrl&"'"&LinkTarget&"title='"&Newasp.ChannelModule&"名称:"&SQL(4,i)&"&#13;&#10;发布时间:"&SQL(7,i)&"&#13;&#10;下载次数:"&SQL(6,i)&"'class=showlist>"&strTitle&"</a>"
strContent=Replace(strContent,"{$FlashTopic}",FlashTopic)
strContent=Replace(strContent,"{$FlashID}",Rs("flashid"))
strContent=Replace(strContent,"{$InstallDir}",Newasp.InstallDir)
strContent=Replace(strContent,"{$FlashTopic}",strTitle)
strContent=Replace(strContent,"{$Title}",SQL(4,i))
strContent=Replace(strContent,"{$DateAndTime}",SQL(7,i))
strContent=Replace(strContent,"{$HtmlFileUrl}",HtmlFileUrl)
strContent=Replace(strContent,"{$ClassName}",ClassName)
strContent=Replace(strContent,"[]","")
strContent=Replace(strContent,"{$Target}",LinkTarget)
strContent=Replace(strContent,"{$addTime}",addTime)
strContent=Replace(strContent,"{$FlashHits}",SQL(6,i))
strContent=Replace(strContent,"{$ListStyle}",ListStyle)
strContent=Replace(strContent,"{$BestCode}",BestCode)
strContent=Replace(strContent,"{$BestString}",BestString)
j=j+1
Next
SQL=Null
strContent=strContent&"</table>"
EndIf
Rs.Close:SetRs=Nothing
LoadFlashList=strContent
EndFunction
'================================================
'函数名:ReadFlashList
'作用:读取动画列表
'参数:str----原字符串
'================================================
PublicFunctionReadFlashList(ByValstr)
DimstrTemp,i
DimsTempContent,nTempContent
DimarrTempContent,arrTempContents,ArrayList
OnErrorResumeNext
strTemp=str
IfInStr(strTemp,"{$ReadFlashList(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$ReadFlashList(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$ReadFlashList(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),LoadFlashList(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3),ArrayList(4),ArrayList(5),ArrayList(6),ArrayList(7),ArrayList(8),ArrayList(9),ArrayList(10)))
Next
EndIf
ReadFlashList=strTemp
EndFunction
'================================================
'函数名:LoadAnnounceContent
'作用:装载内容公告
'参数:str----原字符串
'================================================
PublicFunctionLoadAnnounceContent(ByValsTopic,ByValChannelID)
DimSQL,Rs,strTemp
strTemp=""
sTopic=Newasp.CheckStr(sTopic)
IfsTopic<>""AndsTopic<>"0"Then
SQL="SelectAnnounceID,Content,PostTime,writerFromNC_AnnouncewhereAnnounceType=1Andtitle='"&sTopic&"'OrderByPostTimeDesc,AnnounceIDDesc"
Else
SQL="SelectAnnounceID,ContentFromNC_AnnouncewhereAnnounceType=1AndChannelIDin("&ChannelID&",999)OrderByPostTimeDesc,AnnounceIDDesc"
EndIf
SetRs=Newasp.Execute(SQL)
IfNot(Rs.BOFAndRs.EOF)Then
strTemp=Rs("Content")
EndIf
Rs.Close:SetRs=Nothing
LoadAnnounceContent=strTemp
EndFunction
'================================================
'函数名:ReadAnnounceContent
'作用:读取内容公告
'参数:str----原字符串
'================================================
PublicFunctionReadAnnounceContent(ByValstr,ByValChannelID)
DimstrTemp,i,sTempContent,nTempContent,strValue
DimarrTempContent,arrTempContents
OnErrorResumeNext
strTemp=str
IfInStr(strTemp,"{$AnnounceContent(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$AnnounceContent(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$AnnounceContent(",")}",0)
IfnTempContent=""ThennTempContent="0"
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
strValue=arrTempContent(i)
strTemp=Replace(strTemp,arrTempContents(i),LoadAnnounceContent(strValue,ChannelID))
Next
EndIf
ReadAnnounceContent=strTemp
EndFunction
'================================================
'函数名:LoadAnnounceList
'作用:装载公告列表
'参数:maxnum----最多公告数
'maxlen----字符长度
'newindow----是否新窗口打开1=是,0=否
'showdate----是否显示时间1=是,0=否
'DateMode----时间模式
'showtree----树型显示
'================================================
PublicFunctionLoadAnnounceList(ByValChannelID,ByValmaxnum,ByValmaxlen,_
ByValnewindow,ByValshowdate,ByValDateMode,ByValshowtree)

DimRs,SQL,strContent
DimAnnounceTopic,LinkTarget
DimPostTime

ChannelID=Newasp.ChkNumeric(ChannelID)
maxnum=Newasp.ChkNumeric(maxnum)
Ifmaxnum=0Thenmaxnum=10

OnErrorResumeNext
SetRs=Newasp.Execute("SELECTTOP"&CInt(maxnum)&"AnnounceID,title,Content,PostTime,writer,hitsFROMNC_AnnounceWHERE(ChannelID="&ChannelID&"OrChannelID=999)AndAnnounceType<>1ORDERBYPostTimeDESC,AnnounceIDDESC")
IfRs.BOFAndRs.EOFThen
LoadAnnounceList=""
SetRs=Nothing
ExitFunction
Else
DoWhileNotRs.EOF
IfCInt(newindow)<>0Then
LinkTarget="target=""_blank"""
Else
LinkTarget=""
EndIf
IfCInt(showdate)<>0Then
PostTime=Newasp.ShowDateTime(Rs("PostTime"),CInt(DateMode))
Else
PostTime=""
EndIf
AnnounceTopic=Newasp.GotTopic(Rs("title"),CInt(maxlen))
AnnounceTopic="<ahref="""&Newasp.InstallDir&"Announce.Asp?AnnounceID="&Rs("AnnounceID")&"""title="""&Rs("title")&""""&LinkTarget&">"&AnnounceTopic&"</a>"
IfCInt(showtree)=1Then
strContent=strContent&"<div>·"&AnnounceTopic&"</div><divalign=""right""class=""dottedline"">"&PostTime&"</div>"&vbNewLine
Else
strContent=strContent&"·"&AnnounceTopic&"&nbsp;&nbsp;"&PostTime&vbNewLine
EndIf
Rs.MoveNext
Loop
EndIf
LoadAnnounceList=strContent
EndFunction
'================================================
'函数名:ReadAnnounceList
'作用:读取公告列表
'参数:str----原字符串
'================================================
PublicFunctionReadAnnounceList(ByValstr)
DimstrTemp,i
DimsTempContent,nTempContent,ArrayList
DimarrTempContent,arrTempContents
OnErrorResumeNext
strTemp=str
IfInStr(strTemp,"{$ReadAnnounceList(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$ReadAnnounceList(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$ReadAnnounceList(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),LoadAnnounceList(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3),ArrayList(4),ArrayList(5),ArrayList(6)))
Next
EndIf
ReadAnnounceList=strTemp
EndFunction
'================================================
'函数名:LoadArticlePic
'作用:装载文章图片列表
'参数:ClassID----分类ID
'ChannelID----频道ID
'sType----调用文章类型,0=所有最新文章,1=推荐文章,2=热门文章,3=图文文章,4=分类最新文章
'TopNum----显示文章列表数
'strlen----显示标题长度
'ShowClass----是否显示分类
'ShowPic----是否显示图文标题
'ShowDate----是否显示日期
'DateMode----显示日期模式
'newindow----新窗口打开
'================================================
PublicFunctionLoadArticlePic(ChannelID,ClassID,SpecialID,stype,TopNum,PerRowNum,strLen,newindow,width,height,showtopic)
DimRs,SQL,i,strContent,foundstr
DimsTitle,ChildStr,ImageUrl,HtmlFileName
DimHtmlFileUrl,WriteTime,LinkTarget

ChannelID=Newasp.ChkNumeric(ChannelID)
ClassID=Newasp.ChkNumeric(ClassID)
SpecialID=Newasp.ChkNumeric(SpecialID)
stype=Newasp.ChkNumeric(stype)

OnErrorResumeNext
Newasp.LoadChannel(ChannelID)

IfCInt(stype)>=3AndCLng(ClassID)<>0Then
SQL="SELECTChildStrFROM[NC_Classify]WHEREChannelID="&ChannelID&"AndClassID="&ClassID
SetRs=Newasp.Execute(SQL)
IfRs.BOFAndRs.EOFThen
SetRs=Nothing
LoadArticlePic=""
ExitFunction
Else
ChildStr=Rs("ChildStr")
EndIf
SetRs=Nothing
Else
ChildStr=0
EndIf
SelectCaseCInt(stype)
Case0:foundstr="OrderByA.WritetimeDesc,A.ArticleidDesc"
Case1:foundstr="AndA.isBest>0OrderByA.WritetimeDesc,A.ArticleidDesc"
Case2:foundstr="OrderByA.AllHitsDesc,A.ArticleidDesc"
Case3:foundstr="AndA.ClassIDin("&ChildStr&")OrderByA.WritetimeDesc,A.ArticleidDesc"
Case4:foundstr="AndA.ClassIDin("&ChildStr&")AndA.isBest>0OrderByA.WritetimeDesc,A.ArticleidDesc"
Case5:foundstr="AndA.ClassIDin("&ChildStr&")OrderByA.AllHitsDesc,A.ArticleidDesc"
CaseElse
foundstr="OrderByA.WritetimeDesc,A.ArticleidDesc"
EndSelect
IfCInt(stype)>=4AndCLng(ClassID)=0Then
foundstr="OrderByA.WritetimeDesc,A.ArticleidDesc"
EndIf
IfCLng(SpecialID)<>0Then
foundstr="AndA.SpecialID="&CLng(SpecialID)&""&foundstr
EndIf
SQL="A.ArticleID,A.ClassID,A.title,A.AllHits,A.WriteTime,A.HtmlFileDate,A.isBest,A.ImageUrl,"
SQL="selectTop"&CInt(TopNum)&SQL&"C.ClassName,C.HtmlFileDir,C.UseHtmlfrom[NC_Article]Ainnerjoin[NC_Classify]COnA.ClassID=C.ClassIDwhereA.isAccept>0AndA.ImageUrl<>''AndA.ChannelID="&ChannelID&""&foundstr&""
SetRs=Newasp.Execute(SQL)
IfRs.BOFAndRs.EOFThen
strContent="<imgsrc='"&Newasp.InstallDir&"images/no_pic.gif'width="&width&"height="&height&"border=0>"
Else
strContent="<tablewidth=""100%""border=0cellpadding=1cellspacing=5>"&vbCrLf
DoWhileNotRs.EOF

strContent=strContent&"<tr>"&vbCrLf
Fori=1ToCInt(PerRowNum)
strContent=strContent&"<tdalign=""center""class=""imagelist"">"
IfNotRs.EOFThen
sTitle=Newasp.GotTopic(Rs("title"),CInt(strLen))
ImageUrl=Newasp.GetImageUrl(Rs("ImageUrl"),Newasp.ChannelData(1))
ImageUrl=Newasp.GetFlashAndPic(ImageUrl,height,width)

HtmlFileName=Newasp.ReadFileName(Rs("HtmlFileDate"),Rs("ArticleID"),Newasp.ChannelHtmlExt,Newasp.ChannelPrefix,Newasp.ChannelHtmlForm,"")
IfCInt(Newasp.ChannelUseHtml)<>0Then
HtmlFileUrl=Newasp.ChannelPath&Rs("HtmlFileDir")&Newasp.ShowDatePath(Rs("HtmlFileDate"),Newasp.ChannelHtmlPath)&HtmlFileName
Else
HtmlFileUrl=Newasp.ChannelPath&"show.asp?id="&Rs("ArticleID")
EndIf

IfCInt(newindow)<>0Then
LinkTarget="target=""_blank"""
Else
LinkTarget=""
EndIf
strContent=strContent&Newasp.MainSetting(18)
strContent=Replace(strContent,"{$ArticlePicture}","<ahref='"&HtmlFileUrl&"'title='"&Rs("title")&"'"&LinkTarget&">"&ImageUrl&"</a>")
IfCInt(showtopic)=1Then
strContent=Replace(strContent,"{$ArticleTopic}","<ahref='"&HtmlFileUrl&"'title='"&Rs("title")&"'"&LinkTarget&">"&sTitle&"</a>")
Else
strContent=Replace(strContent,"{$ArticleTopic}",vbNullString)
EndIf
strContent=strContent&"</td>"&vbCrLf
Rs.MoveNext
EndIf
Next
strContent=strContent&"</tr>"&vbCrLf
Loop
strContent=strContent&"</table>"&vbCrLf
EndIf
Rs.Close:SetRs=Nothing
LoadArticlePic=strContent
EndFunction
'================================================
'函数名:ReadArticlePic
'作用:读取文章图片列表
'参数:str----原字符串
'================================================
PublicFunctionReadArticlePic(ByValstr)
DimstrTemp,i
DimsTempContent,nTempContent,ArrayList
DimarrTempContent,arrTempContents
OnErrorResumeNext
strTemp=str
IfInStr(strTemp,"{$ReadArticlePic(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$ReadArticlePic(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$ReadArticlePic(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),LoadArticlePic(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3),ArrayList(4),ArrayList(5),ArrayList(6),ArrayList(7),ArrayList(8),ArrayList(9),ArrayList(10)))
Next
EndIf
ReadArticlePic=strTemp
EndFunction
'================================================
'函数名:LoadSoftPic
'作用:装载软件图片列表
'参数:ClassID----分类ID
'ChannelID----频道ID
'sType----调用软件类型,0=所有最新软件,1=推荐软件,2=热门软件
'TopNum----显示软件列表数
'strlen----显示标题长度
'newindow----新窗口打开
'================================================
PublicFunctionLoadSoftPic(ChannelID,ClassID,SpecialID,stype,TopNum,PerRowNum,strLen,newindow,width,height,showtopic)
DimRs,SQL,i,strContent,foundstr
DimstrSoftName,ChildStr,SoftImage,HtmlFileName
DimHtmlFileUrl,SoftTime,LinkTarget

ChannelID=Newasp.ChkNumeric(ChannelID)
ClassID=Newasp.ChkNumeric(ClassID)
SpecialID=Newasp.ChkNumeric(SpecialID)
stype=Newasp.ChkNumeric(stype)

OnErrorResumeNext
Newasp.LoadChannel(ChannelID)

IfCInt(stype)>=3AndCLng(ClassID)<>0Then
SQL="selectChildStrfrom[NC_Classify]whereChannelID="&ChannelID&"AndClassID="&ClassID
SetRs=Newasp.Execute(SQL)
IfRs.BOFAndRs.EOFThen
SetRs=Nothing
LoadSoftPic=""
ExitFunction
Else
ChildStr=Rs("ChildStr")
EndIf
Rs.Close
Else
ChildStr=0
EndIf
SelectCaseCInt(stype)
Case0:foundstr="OrderByA.SoftTimeDesc,A.SoftIDDesc"
Case1:foundstr="AndA.isBest>0OrderByA.SoftTimeDesc,A.SoftIDDesc"
Case2:foundstr="OrderByA.AllHitsDesc,A.SoftIDDesc"
Case3:foundstr="AndA.ClassIDin("&ChildStr&")OrderByA.SoftTimeDesc,A.SoftIDDesc"
Case4:foundstr="AndA.ClassIDin("&ChildStr&")AndA.isBest>0OrderByA.SoftTimeDesc,A.SoftIDDesc"
Case5:foundstr="AndA.ClassIDin("&ChildStr&")OrderByA.AllHitsDesc,A.SoftIDDesc"
CaseElse
foundstr="OrderByA.SoftTimeDesc,A.SoftIDDesc"
EndSelect
IfCInt(stype)>=3AndCLng(ClassID)=0Then
foundstr="OrderByA.SoftTimeDesc,A.SoftIDDesc"
EndIf
IfCLng(SpecialID)<>0Then
foundstr="AndA.SpecialID="&CLng(SpecialID)&""&foundstr
EndIf
SQL="A.SoftID,A.ClassID,A.SoftName,A.SoftVer,A.AllHits,A.SoftTime,A.HtmlFileDate,A.isBest,A.SoftImage,"
SQL="selectTop"&CInt(TopNum)&SQL&"C.ClassName,C.HtmlFileDir,C.UseHtmlfrom[NC_SoftList]Ainnerjoin[NC_Classify]COnA.ClassID=C.ClassIDwhereA.isAccept>0AndA.SoftImage<>''AndA.ChannelID="&ChannelID&""&foundstr&""
SetRs=Newasp.Execute(SQL)
IfRs.BOFAnd

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章