<%
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")&" "&Rs("WriteTime")&" "&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))&" "&SQL(7,i)&" "&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)&" "&SQL(7,i)&" "&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&""&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.BOFAndRs.EOFThen
strContent="<imgsrc='"&Newasp.InstallDir&"images/no_pic.gif'width="&width&"height="&height&"border=0>"
Else
strContent="<tablewidth=""100%""border=""0""cellpadding=""1""cellspacing=""3"">"&vbCrLf
DoWhileNotRs.EOF
strContent=strContent&"<tr>"&vbCrLf
Fori=1ToCInt(PerRowNum)
strContent=strContent&"<tdalign=""center""class=""imagelist"">"
IfNotRs.EOFThen
strSoftName=Newasp.GotTopic(Rs("SoftName")&""&Rs("SoftVer"),CInt(strLen))
SoftImage=Newasp.GetImageUrl(Rs("SoftImage"),Newasp.ChannelData(1))
SoftImage=Newasp.GetFlashAndPic(SoftImage,height,width)
HtmlFileName=Newasp.ReadFileName(Rs("HtmlFileDate"),Rs("SoftID"),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("SoftID")
EndIf
IfCInt(newindow)<>0Then
LinkTarget="target=""_blank"""
Else
LinkTarget=""
EndIf
strContent=strContent&Newasp.MainSetting(19)
strContent=Replace(strContent,"{$SoftPicture}","<ahref='"&HtmlFileUrl&"'title='"&Rs("SoftName")&"'"&LinkTarget&">"&SoftImage&"</a>")
IfCInt(showtopic)=1Then
strContent=Replace(strContent,"{$SoftTopic}","<ahref='"&HtmlFileUrl&"'title='"&Rs("SoftName")&"'"&LinkTarget&">"&strSoftName&"</a>")
Else
strContent=Replace(strContent,"{$SoftTopic}",vbNullString)
EndIf
strContent=strContent&"</td>"&vbCrLf
Rs.MoveNext
EndIf
Next
strContent=strContent&"</tr>"&vbCrLf
Loop
strContent=strContent&"</table>"&vbCrLf
EndIf
Rs.Close:SetRs=Nothing
LoadSoftPic=strContent
EndFunction
'================================================
'函数名:ReadSoftPic
'作用:读取软件图片列表
'参数:str----原字符串
'================================================
PublicFunctionReadSoftPic(ByValstr)
DimstrTemp,i
DimsTempContent,nTempContent,ArrayList
DimarrTempContent,arrTempContents
OnErrorResumeNext
strTemp=str
IfInStr(strTemp,"{$ReadSoftPic(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$ReadSoftPic(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$ReadSoftPic(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),LoadSoftPic(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3),ArrayList(4),ArrayList(5),ArrayList(6),ArrayList(7),ArrayList(8),ArrayList(9),ArrayList(10)))
Next
EndIf
ReadSoftPic=strTemp
EndFunction
'================================================
'函数名:LoadFlashPic
'作用:装载动画图片列表
'参数:ClassID----分类ID
'ChannelID----频道ID
'sType----调用动画类型,0=所有最新动画,1=推荐动画,2=热门动画
'TopNum----显示动画列表数
'strlen----显示标题长度
'newindow----新窗口打开
'================================================
PublicFunctionLoadFlashPic(ByValChannelID,ByValClassID,ByValSpecialID,_
ByValstype,ByValTopNum,ByValPerRowNum,ByValstrLen,ByValnewindow,_
ByValwidth,ByValheight,ByValshowtopic)
DimRs,SQL,i,strContent,foundstr
Dimstrtitle,ChildStr,miniature,HtmlFileName
DimHtmlFileUrl,addTime,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
LoadFlashPic=""
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.title,A.AllHits,A.addTime,A.HtmlFileDate,A.isBest,A.miniature,"
SQL="SELECTTOP"&CInt(TopNum)&SQL&"C.ClassName,C.HtmlFileDir,C.UseHtmlFROM[NC_FlashList]AINNERJOIN[NC_Classify]COnA.ClassID=C.ClassIDWHEREA.isAccept>0AndA.miniature<>''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=""0""cellpadding=""0""cellspacing=""3"">"&vbCrLf
DoWhileNotRs.EOF
strContent=strContent&"<tr>"&vbCrLf
Fori=1ToCInt(PerRowNum)
strContent=strContent&"<tdalign=""center""class=""imagelist"">"
IfNotRs.EOFThen
strtitle=Newasp.GotTopic(Rs("title"),CInt(strLen))
miniature=Newasp.GetImageUrl(Rs("miniature"),Newasp.ChannelData(1))
miniature=Newasp.GetFlashAndPic(miniature,height,width)
HtmlFileName=Newasp.ReadFileName(Rs("HtmlFileDate"),Rs("flashid"),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("flashid")
EndIf
IfCInt(newindow)<>0Then
LinkTarget="target=""_blank"""
Else
LinkTarget=""
EndIf
strContent=strContent&Newasp.MainSetting(21)
strContent=Replace(strContent,"{$Miniature}","<ahref='"&HtmlFileUrl&"'title='"&Rs("title")&"'"&LinkTarget&">"&miniature&"</a>")
IfCInt(showtopic)=1Then
strContent=Replace(strContent,"{$FlashTopic}","<ahref='"&HtmlFileUrl&"'title='"&Rs("title")&"'"&LinkTarget&">"&strtitle&"</a>")
Else
strContent=Replace(strContent,"{$FlashTopic}",vbNullString)
EndIf
strContent=strContent&"</td>"&vbCrLf
Rs.MoveNext
EndIf
Next
strContent=strContent&"</tr>"&vbCrLf
Loop
strContent=strContent&"</table>"&vbCrLf
EndIf
Rs.Close:SetRs=Nothing
LoadFlashPic=strContent
EndFunction
'================================================
'函数名:ReadFlashPic
'作用:读取动画图片列表
'参数:str----原字符串
'================================================
PublicFunctionReadFlashPic(ByValstr)
DimstrTemp,i
DimsTempContent,nTempContent,ArrayList
DimarrTempContent,arrTempContents
OnErrorResumeNext
strTemp=str
IfInStr(strTemp,"{$ReadFlashPic(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$ReadFlashPic(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$ReadFlashPic(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),LoadFlashPic(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3),ArrayList(4),ArrayList(5),ArrayList(6),ArrayList(7),ArrayList(8),ArrayList(9),ArrayList(10)))
Next
EndIf
ReadFlashPic=strTemp
EndFunction
'================================================
'函数名:LoadFriendLink
'作用:装载友情连接
'参数:str----原字符串
'================================================
PublicFunctionLoadFriendLink(ByValTopNum,ByValPerRowNum,ByValisLogo,ByValorders)
DimRs,SQL,i,strContent
DimstrOrder,LinkAddress
strContent=""
IfNotIsNumeric(TopNum)ThenExitFunction
IfNotIsNumeric(PerRowNum)ThenExitFunction
IfNotIsNumeric(isLogo)ThenExitFunction
IfNotIsNumeric(orders)ThenExitFunction
OnErrorResumeNext
IfCInt(orders)=1Then
'--首页显示按时间升序排列
strOrder="AndisIndex>0OrderByLinkTimeDesc,LinkIDDesc"
ElseIfCInt(orders)=2Then
'--首页显示按点击数升序排列
strOrder="AndisIndex>0OrderByLinkHistDesc,LinkIDDesc"
ElseIfCInt(orders)=3Then
'--首页显示按点击数降序排列
strOrder="AndisIndex>0OrderByLinkHistDesc,LinkIDAsc"
ElseIfCInt(orders)=4Then
'--所有按升序排列
strOrder="OrderByLinkIDDesc"
ElseIfCInt(orders)=5Then
'--所有按降序排列
strOrder="OrderByLinkIDAsc"
ElseIfCInt(orders)=6Then
'--所有按点击数升序排列
strOrder="OrderByLinkHistDesc,LinkIDDesc"
ElseIfCInt(orders)=7Then
'--所有按点击数降序排列
strOrder="OrderByLinkHistDesc,LinkIDAsc"
ElseIfCInt(orders)=8Then
'--首页显示按名称排列
strOrder="AndisIndex>0OrderByLinkNameDesc,LinkIDDesc"
ElseIfCInt(orders)=9Then
'--所有按名称排列
strOrder="OrderByLinkNameDesc,LinkIDDesc"
Else
'--首页显示按时间降序排列
strOrder="AndisIndex>0OrderByLinkTimeAsc,LinkIDAsc"
EndIf
IfCInt(isLogo)=1OrCInt(isLogo)=3Then
SQL="SelectTop"&CInt(TopNum)&"LinkID,LinkName,LinkUrl,LogoUrl,Readme,LinkHist,isLogofrom[NC_Link]whereisLock=0AndisLogo>0"&strOrder&""
Else
SQL="SelectTop"&CInt(TopNum)&"LinkID,LinkName,LinkUrl,LogoUrl,Readme,LinkHist,isLogofrom[NC_Link]whereisLock=0AndisLogo=0"&strOrder&""
EndIf
SetRs=Newasp.Execute(SQL)
IfNot(Rs.BOFAndRs.EOF)Then
strContent="<tablewidth=""100%""border=0cellpadding=1cellspacing=3class=FriendLink1>"&vbCrLf
DoWhileNotRs.EOF
strContent=strContent&"<tr>"&vbCrLf
Fori=1ToCInt(PerRowNum)
strContent=strContent&"<tdalign=centerclass=FriendLink2>"
IfNotRs.EOFThen
IfCInt(isLogo)<2Then
LinkAddress=Newasp.InstallDir&"link/link.asp?id="&Rs("LinkID")&"&url="&Trim(Rs("LinkUrl"))
Else
LinkAddress=Trim(Rs("LinkUrl"))
EndIf
IfRs("isLogo")=1OrCInt(isLogo)=3Then
strContent=strContent&"<ahref='"&LinkAddress&"'target=_blanktitle='主页名称:"&Rs("LinkName")&" "&Rs("LinkHist")&"'><imgsrc='"&Newasp.ReadFileUrl(Rs("LogoUrl"))&"'width=88height=31border=0></a>"
Else
strContent=strContent&"<ahref='"&LinkAddress&"'target=_blanktitle='主页名称:"&Rs("LinkName")&" "&Rs("LinkHist")&"'>"&Rs("LinkName")&"</a>"
EndIf
strContent=strContent&"</td>"&vbCrLf
Rs.MoveNext
Else
IfCInt(isLogo)=1OrCInt(isLogo)=3Then
strContent=strContent&"<ahref='"&Newasp.InstallDir&"link/addlink.asp'target=_blank><imgsrc='"&Newasp.InstallDir&"images/link.gif'width=88height=31border=0></a>"
Else
strContent=strContent&"<ahref='"&Newasp.InstallDir&"link/'target=_blank>更多连接</a>"
EndIf
strContent=strContent&"</td>"&vbCrLf
EndIf
Next
strContent=strContent&"</tr>"&vbCrLf
Loop
strContent=strContent&"</table>"&vbCrLf
EndIf
LoadFriendLink=strContent
EndFunction
'================================================
'函数名:ReadFriendLink
'作用:读取友情连接
'参数:str----原字符串
'================================================
PublicFunctionReadFriendLink(ByValstr)
DimstrTemp,i
DimsTempContent,nTempContent,ArrayList
DimarrTempContent,arrTempContents
OnErrorResumeNext
strTemp=str
IfInStr(strTemp,"{$ReadFriendLink(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$ReadFriendLink(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$ReadFriendLink(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),LoadFriendLink(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3)))
Next
EndIf
ReadFriendLink=strTemp
EndFunction
'================================================
'函数名:PageRunTime
'作用:页面执行时间
'================================================
PublicFunctionExecutionTime()
DimEndtime
ExecutionTime=""
IfCInt(Newasp.IsRunTime)=1Then
Endtime=Timer()
ExecutionTime="页面执行时间:"&FormatNumber((((Endtime-startime)*5000)+0.5)/10,3,-1)&"毫秒"
Else
ExecutionTime=""
EndIf
EndFunction
'================================================
'函数名:CurrentStation
'作用:当前位置
'参数:...
'================================================
PublicFunctionCurrentStation(ByValChannelID,ByValClassID,ByValClassName,_
ByValParentID,ByValstrParent,ByValHtmlFileDir,ByValCompart)
DimrsCurrent,SQL,strContent,ChannelDir
CurrentStation=""
ChannelID=Newasp.ChkNumeric(ChannelID)
ClassID=Newasp.ChkNumeric(ClassID)
ParentID=Newasp.ChkNumeric(ParentID)
OnErrorResumeNext
Newasp.LoadChannel(ChannelID)
ChannelDir=Newasp.ChannelPath
strContent="<ahref='"&ChannelDir&"'>"&Newasp.ChannelName&"</a>"&Compart&""
IfParentID<>0AndLen(strParent)<>0Then
SQL="SELECTClassID,ClassName,HtmlFileDir,UseHtmlFROM[NC_Classify]WHEREChannelID="&ChannelID&"AndClassIDin("&strParent&")"
SetrsCurrent=Newasp.Execute(SQL)
IfNot(rsCurrent.EOFAndrsCurrent.BOF)Then
DoWhileNotrsCurrent.EOF
IfCInt(Newasp.IsCreateHtml)<>0Then
strContent=strContent&"<ahref='"&ChannelDir&rsCurrent("HtmlFileDir")&"'>"&rsCurrent("ClassName")&"</a>"&Compart&""
Else
strContent=strContent&"<ahref='"&ChannelDir&"list.asp?classid="&rsCurrent("ClassID")&"'>"&rsCurrent("ClassName")&"</a>"&Compart&""
EndIf
rsCurrent.MoveNext
Loop
EndIf
rsCurrent.Close
SetrsCurrent=Nothing
EndIf
IfCInt(Newasp.IsCreateHtml)<>0Then
strContent=strContent&"<ahref='"&ChannelDir&HtmlFileDir&"'>"&ClassName&"</a>"
Else
strContent=strContent&"<ahref='"&ChannelDir&"list.asp?classid="&ClassID&"'>"&ClassName&"</a>"
EndIf
CurrentStation=strContent
EndFunction
'================================================
'函数名:ReadCurrentStation
'作用:读取当前位置
'参数:str----原字符串
'================================================
PublicFunctionReadCurrentStation(ByValstr,ByValChannelID,ByValClassID,_
ByValClassName,ByValParentID,ByValstrParent,ByValHtmlFileDir)
DimstrTemp,i
DimsTempContent,nTempContent
DimarrTempContent,arrTempContents
OnErrorResumeNext
strTemp=str
IfInStr(strTemp,"{$CurrentStation(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$CurrentStation(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$CurrentStation(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
strTemp=Replace(strTemp,arrTempContents(i),CurrentStation(ChannelID,ClassID,ClassName,ParentID,strParent,HtmlFileDir,arrTempContent(i)))
Next
EndIf
ReadCurrentStation=strTemp
EndFunction
'================================================
'函数名:NewsPictureAndText
'作用:图文混排列表
'================================================
PublicFunctionNewsPictureAndText(ByValchanid,ByValClassID,ByValspecid,_
ByValstype,ByValheight,ByValwidth,ByValmaxlen,_
ByValmaxline,ByValhspace,ByValvspace,ByValalign,_
ByValdivcss,ByValtarget,ByValstart,ByValshowpic,_
ByValshowclass,ByValshowdate,ByValdateformat)
DimRs,SQL,i,strContent,foundstr
DimChildStr,HtmlFileUrl,HtmlFileName,strPicture
DimPicTopic,NewsTitle,ClassName,ArticleTitle,WriteTime
chanid=Newasp.ChkNumeric(chanid)
ClassID=Newasp.ChkNumeric(ClassID)
specid=Newasp.ChkNumeric(specid)
stype=Newasp.ChkNumeric(stype)
OnErrorResumeNext
Newasp.LoadChannel(chanid)
IfCInt(stype)>=3AndCLng(ClassID)<>0Then
SQL="SELECTChildStrFROM[NC_Classify]WHEREChannelID="&chanid&"AndClassID="&ClassID
SetRs=Newasp.Execute(SQL)
IfRs.BOFAndRs.EOFThen
SetRs=Nothing
NewsPictureAndText=""
ExitFunction
Else
ChildStr=Rs("ChildStr")
EndIf
Rs.Close
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&")AndA.AllHits>B.LeastHotHistORDERBYA.AllHitsDESC,A.ArticleidDESC"
Case6:foundstr="AndA.ClassIDin("&ChildStr&")ORDERBYA.WritetimeDESC,A.ArticleidDESC"
CaseElse
foundstr="ORDERBYA.WritetimeDESC,A.ArticleidDESC"
EndSelect
IfCInt(stype)>=3AndCLng(ClassID)=0Then
foundstr="ORDERBYA.WritetimeDESC,A.ArticleidDESC"
EndIf
IfCLng(specid)<>0Then
foundstr="AndA.SpecialID="&CLng(specid)&""&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(maxline)&SQL&"C.ClassName,C.ColorModes,C.FontModes,C.HtmlFileDirFROM[NC_Article]AINNERJOIN[NC_Classify]CONA.ClassID=C.ClassIDWHEREA.isAccept>0AndA.ChannelID="&chanid&""&foundstr&""
SetRs=Newasp.Execute(SQL)
i=0
strContent=""
IfRs.BOFAndRs.EOFThen
strContent="还没有添加任何内容!"
Else
DoWhileNotRs.EOF
NewsTitle=Newasp.ReadTopic(Rs("title"),CInt(maxlen))
NewsTitle=Newasp.ReadFontMode(NewsTitle,Rs("ColorMode"),Rs("FontMode"))
PicTopic=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)=1Then
ClassName=ClassName
Else
ClassName=""
EndIf
IfCInt(showdate)=1Then
WriteTime=Newasp.ShowDateTime(Rs("WriteTime"),CInt(dateformat))
Else
WriteTime=""
EndIf
ArticleTitle="<div"&divcss&">"&start&ClassName&"<ahref="""&HtmlFileUrl&"""target="""&target&"""title="""&Newasp.ChannelModule&"标题:"&Rs("title")&" "&Rs("WriteTime")&" "&Rs("AllHits")&"""class=showlist>"&NewsTitle&"</a>"&WriteTime&"</div>"
strContent=strContent&ArticleTitle
Rs.MoveNext
i=i+1
Loop
EndIf
Rs.Close:SetRs=Nothing
DimsExtName,ExtName,ImageUrl
IfCInt(showpic)=1Then
SQL="A.ArticleID,A.ClassID,A.title,A.AllHits,A.WriteTime,A.HtmlFileDate,A.ImageUrl,"
SQL="SELECT"&SQL&"C.HtmlFileDir,B.ChannelDir,B.StopChannel,B.ModuleName,B.BindDomain,B.DomainName,B.IsCreateHtml,B.HtmlExtName,B.HtmlPath,B.HtmlForm,B.HtmlPrefix,B.LeastHotHistFROM([NC_Article]AINNERJOIN[NC_Classify]CONA.ClassID=C.ClassID)INNERJOIN[NC_Channel]BOnA.ChannelID=B.ChannelIDWHEREA.isAccept>0AndA.ChannelID="&CInt(chanid)&"AndA.ImageUrl<>''"&foundstr&""
SetRs=Newasp.Execute(SQL)
IfRs.BOFAndRs.EOFThen
strPicture="<imgsrc='"&Newasp.SiteUrl&Newasp.InstallDir&"images/no_pic.gif'width="""&width&"""height="""&height&"""hspace="""&hspace&"""vspace="""&vspace&"""align="""&align&"""border=""0"">"
Else
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
ImageUrl=Newasp.GetImageUrl(Rs("ImageUrl"),Newasp.ChannelData(1))
sExtName=Split(Rs("ImageUrl"),".")
ExtName=sExtName(UBound(sExtName))
SelectCaseLCase(ExtName)
Case"swf","swi"
strPicture="<objectclassid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000""codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0""width="""&width&"""height="""&height&"""hspace="""&hspace&"""vspace="""&vspace&"""align="""&align&""">"&vbNewLine
strPicture=strPicture&"<paramname=""movie""value="""&ImageUrl&""">"&vbNewLine
strPicture=strPicture&"<paramname=""quality""value=""high"">"&vbNewLine
strPicture=strPicture&"<embedsrc="""&ImageUrl&"""width="""&width&"""height="""&height&"""hspace="""&hspace&"""vspace="""&vspace&"""align="""&align&"""quality=""high""pluginspage=""http://www.macromedia.com/go/getflashplayer""type=""application/x-shockwave-flash""></embed>"&vbNewLine
strPicture=strPicture&"</object>"&vbNewLine
CaseElse
strPicture="<ahref="""&HtmlFileUrl&"""target="""&target&"""title="""&Newasp.ChannelModule&"标题:"&Rs("title")&" "&Rs("WriteTime")&" "&Rs("AllHits")&"""><imgsrc="""&ImageUrl&"""width="""&width&"""height="""&height&"""hspace="""&hspace&"""vspace="""&vspace&"""align="""&align&"""border=""0""></a>"
EndSelect
EndIf
Rs.Close:SetRs=Nothing
Else
strPicture=""
EndIf
NewsPictureAndText=strPicture&strContent
EndFunction
'================================================
'函数名:ReadNewsPicAndText
'作用:读取图文混排列表
'参数:str----原字符串
'================================================
PublicFunctionReadNewsPicAndText(ByValstr)
DimstrTemp,i,sTempContent
DimnTempContent,ArrayList
DimarrTempContent,arrTempContents
OnErrorResumeNext
strTemp=str
IfInStr(strTemp,"{$NewsPictureAndText(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$NewsPictureAndText(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$NewsPictureAndText(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),NewsPictureAndText(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3),ArrayList(4),ArrayList(5),ArrayList(6),ArrayList(7),ArrayList(8),ArrayList(9),ArrayList(10),ArrayList(11),ArrayList(12),ArrayList(13),ArrayList(14),ArrayList(15),ArrayList(16),ArrayList(17)))
Next
EndIf
ReadNewsPicAndText=strTemp
EndFunction
'================================================
'函数名:SoftPictureAndText
'作用:软件图文混排列表
'================================================
PublicFunctionSoftPictureAndText(ByValchanid,ByValClassID,ByValspecid,_
ByValstype,ByValheight,ByValwidth,ByValmaxlen,_
ByValmaxline,ByValhspace,ByValvspace,ByValalign,_
ByValdivcss,ByValtarget,ByValstart,ByValshowpic,_
ByValshowclass,ByValshowdate,ByValdateformat)
DimRs,SQL,i,strContent,foundstr
DimChildStr,HtmlFileUrl,HtmlFileName,strPicture
DimSoftTopic,ClassName,softname,SoftTime
chanid=Newasp.ChkNumeric(chanid)
ClassID=Newasp.ChkNumeric(ClassID)
specid=Newasp.ChkNumeric(specid)
stype=Newasp.ChkNumeric(stype)
OnErrorResumeNext
Newasp.LoadChannel(chanid)
IfCInt(stype)>=3AndCLng(ClassID)<>0Then
SQL="SELECTChildStrFROM[NC_Classify]WHEREChannelID="&chanid&"AndClassID="&ClassID
SetRs=Newasp.Execute(SQL)
IfRs.BOFAndRs.EOFThen
SetRs=Nothing
SoftPictureAndText=""
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(specid)>0Then
foundstr="AndA.SpecialID="&CLng(specid)&""&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(maxline)&SQL&"C.ClassName,C.ColorModes,C.FontModes,C.HtmlFileDirFROM[NC_SoftList]AINNERJOIN[NC_Classify]CONA.ClassID=C.ClassIDWHEREA.isAccept>0AndA.ChannelID="&chanid&""&foundstr&""
SetRs=Newasp.Execute(SQL)
i=0
strContent=""
IfRs.BOFAndRs.EOFThen
strContent="还没有添加任何软件!"
Else
DoWhileNotRs.EOF
SoftTopic=Newasp.ReadTopic(Trim(Rs("SoftName")&""&Rs("SoftVer")),CInt(maxlen))
SoftTopic=Newasp.ReadFontMode(SoftTopic,Rs("ColorMode"),Rs("FontMode"))
ClassName=Newasp.ReadFontMode(Rs("ClassName"),Rs("ColorModes"),Rs("FontModes"))
HtmlFileName=Newasp.ReadFileName(Rs("HtmlFileDate"),Rs("softid"),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("softid")
ClassName="[<ahref='"&Newasp.ChannelPath&"list.asp?classid="&Rs("ClassID")&"'>"&ClassName&"</a>]"
EndIf
IfCInt(showclass)=1Then
ClassName=ClassName
Else
ClassName=""
EndIf
IfCInt(showdate)=1Then
SoftTime=Newasp.ShowDateTime(Rs("SoftTime"),CInt(dateformat))
Else
SoftTime=""
EndIf
softname="<div"&divcss&">"&start&ClassName&"<ahref="""&HtmlFileUrl&"""target="""&target&"""title="""&Newasp.ChannelModule&"标题:"&Rs("SoftName")&""&Rs("SoftVer")&" "&Rs("SoftTime")&" "&Rs("AllHits")&"""class=showlist>"&SoftTopic&"</a>"&SoftTime&"</div>"
strContent=strContent&softname
Rs.MoveNext
i=i+1
Loop
EndIf
Rs.Close:SetRs=Nothing
DimsExtName,ExtName,SoftImage
IfCInt(showpic)=1Then
SQL="A.softid,A.ClassID,A.SoftName,A.SoftVer,A.AllHits,A.SoftTime,A.HtmlFileDate,A.SoftImage,"
SQL="SELECT"&SQL&"C.HtmlFileDir,B.ChannelDir,B.ModuleName,B.BindDomain,B.DomainName,B.IsCreateHtml,B.HtmlExtName,B.HtmlPath,B.HtmlForm,B.HtmlPrefix,B.LeastHotHistFROM([NC_SoftList]AINNERJOIN[NC_Classify]CONA.ClassID=C.ClassID)INNERJOIN[NC_Channel]BOnA.ChannelID=B.ChannelIDWHEREA.isAccept>0AndA.ChannelID="&CInt(chanid)&"AndA.SoftImage<>''"&foundstr&""
SetRs=Newasp.Execute(SQL)
IfRs.BOFAndRs.EOFThen
strPicture="<imgsrc='"&Newasp.SiteUrl&Newasp.InstallDir&"images/no_pic.gif'width="""&width&"""height="""&height&"""hspace="""&hspace&"""vspace="""&vspace&"""align="""&align&"""border=""0"">"
Else
HtmlFileName=Newasp.ReadFileName(Rs("HtmlFileDate"),Rs("softid"),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("softid")
EndIf
SoftImage=Newasp.GetImageUrl(Rs("SoftImage"),Newasp.ChannelData(1))
sExtName=Split(Rs("SoftImage"),".")
ExtName=sExtName(UBound(sExtName))
SelectCaseLCase(ExtName)
Case"swf","swi"
strPicture="<objectclassid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000""codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0""width="""&width&"""height="""&height&"""hspace="""&hspace&"""vspace="""&vspace&"""align="""&align&""">"&vbNewLine
strPicture=strPicture&"<paramname=""movie""value="""&SoftImage&""">"&vbNewLine
strPicture=strPicture&"<paramname=""quality""value=""high"">"&vbNewLine
strPicture=strPicture&"<embedsrc="""&SoftImage&"""width="""&width&"""height="""&height&"""hspace="""&hspace&"""vspace="""&vspace&"""align="""&align&"""quality=""high""pluginspage=""http://www.macromedia.com/go/getflashplayer""type=""application/x-shockwave-flash""></embed>"&vbNewLine
strPicture=strPicture&"</object>"&vbNewLine
CaseElse
strPicture="<ahref="""&HtmlFileUrl&"""target="""&target&"""title="""&Newasp.ChannelModule&"标题:"&Rs("SoftName")&""&Rs("SoftVer")&" "&Rs("SoftTime")&" "&Rs("AllHits")&"""><imgsrc="""&SoftImage&"""width="""&width&"""height="""&height&"""hspace="""&hspace&"""vspace="""&vspace&"""align="""&align&"""border=""0""></a>"
EndSelect
EndIf
Rs.Close:SetRs=Nothing
Else
strPicture=""
EndIf
SoftPictureAndText=strPicture&strContent
EndFunction
'================================================
'函数名:ReadSoftPicAndText
'作用:读取软件图文混排列表
'参数:str----原字符串
'================================================
PublicFunctionReadSoftPicAndText(ByValstr)
OnErrorResumeNext
DimstrTemp,i,sTempContent
DimnTempContent,ArrayList
DimarrTempContent,arrTempContents
strTemp=str
IfInStr(strTemp,"{$SoftPictureAndText(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$SoftPictureAndText(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$SoftPictureAndText(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),SoftPictureAndText(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3),ArrayList(4),ArrayList(5),ArrayList(6),ArrayList(7),ArrayList(8),ArrayList(9),ArrayList(10),ArrayList(11),ArrayList(12),ArrayList(13),ArrayList(14),ArrayList(15),ArrayList(16),ArrayList(17)))
Next
EndIf
ReadSoftPicAndText=strTemp
EndFunction
'================================================
'函数名:LoadGuestList
'作用:装载留言列表
'参数:maxnum----最多留言数
'maxlen----字符长度
'newindow----是否新窗口打开1=是,0=否
'showdate----是否显示时间1=是,0=否
'DateMode----时间模式
'styles----风格名称
'================================================
PublicFunctionLoadGuestList(ByValmaxnum,ByValmaxlen,ByValnewindow,_
ByValshowdate,ByValDateMode,ByValstyles)
DimRs,SQL,strContent
Dimi,ListStyle,GuestTopic,LinkTarget
DimWriteTime,lastime,GuestTitle,strChannelDir
OnErrorResumeNext
SetRs=Newasp.Execute("SELECTTOP"&CInt(maxnum)&"guestid,Topicformat,title,username,WriteTime,lastime,ReplyNumFROMNC_GuestBookWHEREisAccept>0ORDERBYisTopDESC,lastimeDESC,guestidDESC")
IfRs.BOFAndRs.EOFThen
LoadGuestList="没有任何留言!"
SetRs=Nothing
ExitFunction
Else
i=0
strContent="<tablewidth=""100%""border=0cellpadding=2cellspacing=0>"
strChannelDir=Newasp.GetChannelDir(4)
DoWhileNotRs.EOF
If(iMod2)=0Then
ListStyle=Trim(styles)&1
Else
ListStyle=Trim(styles)&2
EndIf
IfCInt(newindow)<>0Then
LinkTarget="target=""_blank"""
Else
LinkTarget=""
EndIf
IfCInt(showdate)<>0Then
WriteTime=Newasp.ShowDateTime(Rs("WriteTime"),CInt(DateMode))
lastime=Newasp.ShowDateTime(Rs("lastime"),CInt(DateMode))
Else
WriteTime=""
lastime=""
EndIf
GuestTitle=Newasp.HTMLEncode(Rs("title"))
GuestTopic="<span"&Rs("Topicformat")&">"&Newasp.GotTopic(GuestTitle,CInt(maxlen))&"</span>"
GuestTopic="<ahref="""&strChannelDir&"showreply.asp?guestid="&Rs("guestid")&"""title=""主题:"&GuestTitle&""&Rs("WriteTime")&""&Newasp.HTMLEncode(Rs("username"))&""""&LinkTarget&">"&GuestTopic&"</a>"
strContent=strContent&Newasp.MainSetting(16)
strContent=Replace(strContent,"{$GuestID}",Rs("guestid"))
strContent=Replace(strContent,"{$UserName}",Newasp.HTMLEncode(Rs("username")))
strContent=Replace(strContent,"{$GuestTopic}",GuestTopic)
strContent=Replace(strContent,"{$ListStyle}",ListStyle)
strContent=Replace(strContent,"{$Number}",i)
strContent=Replace(strContent,"{$WriteTime}",WriteTime)
strContent=Replace(strContent,"{$lastime}",lastime)
Rs.MoveNext
i=i+1
Loop
strContent=strContent&"</table>"
EndIf
LoadGuestList=strContent
EndFunction
'================================================
'函数名:ReadGuestList
'作用:读取留言列表
'参数:str----原字符串
'================================================
PublicFunctionReadGuestList(ByValstr)
DimstrTemp,i,sTempContent
DimnTempContent,ArrayList
DimarrTempContent,arrTempContents
strTemp=str
IfInStr(strTemp,"{$ReadGuestList(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$ReadGuestList(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$ReadGuestList(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),LoadGuestList(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3),ArrayList(4),ArrayList(5)))
Next
EndIf
ReadGuestList=strTemp
EndFunction
'================================================
'函数名:LoadPopularSoft
'作用:装载排行软件列表
'参数:ClassID----分类ID
'chanid----频道ID
'stype----调用类型
'maxline----显示列表数
'maxlen----显示标题长度
'showhits----是否显示下载数
'target----连接目标
'start----标题头标记
'styles----样式名称
'================================================
PublicFunctionLoadPopularSoft(ByValchanid,ByValClassID,ByValstype,_
ByValmaxlen,ByValmaxline,ByValshowhits,_
ByValtarget,ByValstart,ByValstyles)
DimSQL,Rs,foundsql,strHits
DimChildStr,i,strContent
DimHtmlFileName,HtmlFileUrl
DimNewsTitle,AllHits,strSoftName
Dimdivstyle
chanid=Newasp.ChkNumeric(chanid)
ClassID=Newasp.ChkNumeric(ClassID)
stype=Newasp.ChkNumeric(stype)
Ifchanid=0Thenchanid=1
OnErrorResumeNext
Newasp.LoadChannel(chanid)
IfCLng(ClassID)>0AndTrim(ClassID)<>""Then
SQL="SELECTChildStrFROM[NC_Classify]WHEREChannelID="&chanid&"Andclassid="&ClassID
SetRs=Newasp.Execute(SQL)
IfRs.BOFAndRs.EOFThen
SetRs=Nothing
LoadPopularSoft=""
ExitFunction
Else
ChildStr=Rs("ChildStr")
foundsql="AndA.ClassIDin("&ChildStr&")"
EndIf
Rs.Close
Else
ChildStr="0"
foundsql=""
EndIf
SelectCaseCInt(stype)
Case1
foundsql=foundsql&"ORDERBYA.DayHitsDESC,A.softidDESC"
strHits="DayHits"
Case2
foundsql=foundsql&"ORDERBYA.WeekHitsDESC,A.softidDESC"
strHits="WeekHits"
Case3
foundsql=foundsql&"ORDERBYA.MonthHitsDESC,A.softidDESC"
strHits="MonthHits"
Case4
foundsql=foundsql&"AndA.isBest>0ORDERBYA.AllHitsDESC,A.softidDESC"
strHits="AllHits"
CaseElse
foundsql=foundsql&"ORDERBYA.AllHitsDESC,A.softidDESC"
strHits="AllHits"
EndSelect
SQL="A.softid,A.ClassID,A.ColorMode,A.FontMode,A.SoftName,A.SoftVer,A.AllHits,A.SoftTime,A.HtmlFileDate,A.isBest,A.DayHits,A.WeekHits,A.MonthHits,"
SQL="SELECTTOP"&CInt(maxline)&SQL&"C.ClassName,C.ColorModes,C.FontModes,C.HtmlFileDirFROM[NC_SoftList]AINNERJOIN[NC_Classify]CONA.ClassID=C.ClassIDWHEREA.isAccept>0AndA.ChannelID="&chanid&""&foundsql
SetRs=Newasp.Execute(SQL)
i=0
strContent=""
IfRs.BOFAndRs.EOFThen
strContent="还没有找到任何内容!"
Else
DoWhileNotRs.EOF
IfTrim(styles)<>""AndTrim(styles)<>"0"Then
If(iMod2)=0Then
divstyle="class="""&Trim(styles)&"1"""
Else
divstyle="class="""&Trim(styles)&"2"""
EndIf
EndIf
NewsTitle=Newasp.GotTopic(Rs("SoftName")&""&Rs("SoftVer"),CInt(maxlen))
NewsTitle=Newasp.ReadFontMode(NewsTitle,Rs("ColorMode"),Rs("FontMode"))
HtmlFileName=Newasp.ReadFileName(Rs("HtmlFileDate"),Rs("SoftID"),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("softid")
EndIf
IfCInt(showhits)>0Then
AllHits=Rs(strHits)
Else
AllHits=""
EndIf
strSoftName="<div"&divstyle&">"&start&"<ahref="""&HtmlFileUrl&"""target="""&target&"""title="""&Newasp.ChannelModule&"名称:"&Rs("SoftName")&""&Rs("SoftVer")&" "&Rs("SoftTime")&" "&Rs("AllHits")&"""class=popular>"&NewsTitle&"</a>"&AllHits&"</div>"
strContent=strContent&strSoftName
Rs.MoveNext
i=i+1
Loop
EndIf
Rs.Close:SetRs=Nothing
LoadPopularSoft=strContent
EndFunction
'================================================
'函数名:ReadPopularSoft
'作用:读取软件排行列表
'参数:str----原字符串
'================================================
PublicFunctionReadPopularSoft(ByValstr)
OnErrorResumeNext
DimstrTemp,i,sTempContent
DimnTempContent,ArrayList
DimarrTempContent,arrTempContents
strTemp=str
IfInStr(strTemp,"{$ReadPopularSoft(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$ReadPopularSoft(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$ReadPopularSoft(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),LoadPopularSoft(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3),ArrayList(4),ArrayList(5),ArrayList(6),ArrayList(7),ArrayList(8)))
Next
EndIf
ReadPopularSoft=strTemp
EndFunction
'================================================
'函数名:LoadPopularArticle
'作用:装载排行文章列表
'参数:ClassID----分类ID
'chanid----频道ID
'stype----调用类型
'maxline----显示列表数
'maxlen----显示标题长度
'showhits----是否显示下载数
'target----连接目标
'start----标题头标记
'styles----样式名称
'================================================
PublicFunctionLoadPopularArticle(ByValchanid,ByValClassID,ByValstype,_
ByValmaxlen,ByValmaxline,ByValshowhits,ByValtarget,_
ByValstart,ByValstyles)
DimSQL,Rs,foundsql,strHits
DimChildStr,i,strContent
DimHtmlFileName,HtmlFileUrl
DimNewsTitle,AllHits,ArticleTitle
Dimdivstyle
chanid=Newasp.ChkNumeric(chanid)
ClassID=Newasp.ChkNumeric(ClassID)
stype=Newasp.ChkNumeric(stype)
Ifchanid=0Thenchanid=2
OnErrorResumeNext
Newasp.LoadChannel(chanid)
IfCLng(ClassID)>0AndTrim(ClassID)<>""Then
SQL="SELECTChildStrFROM[NC_Classify]WHEREChannelID="&chanid&"Andclassid="&CLng(ClassID)
SetRs=Newasp.Execute(SQL)
IfRs.BOFAndRs.EOFThen
SetRs=Nothing
LoadPopularArticle=""
ExitFunction
Else
ChildStr=Rs("ChildStr")
foundsql="AndA.ClassIDin("&ChildStr&")"
EndIf
Rs.Close
Else
ChildStr="0"
foundsql=""
EndIf
SelectCaseCInt(stype)
Case1
foundsql=foundsql&"ORDERBYA.DayHitsDESC,A.ArticleidDESC"
strHits="DayHits"
Case2
foundsql=foundsql&"ORDERBYA.WeekHitsDESC,A.ArticleidDESC"
strHits="WeekHits"
Case3
foundsql=foundsql&"ORDERBYA.MonthHitsDESC,A.ArticleidDESC"
strHits="MonthHits"
Case4
foundsql=foundsql&"AndA.isBest>0ORDERBYA.AllHitsDESC,A.ArticleidDESC"
strHits="AllHits"
CaseElse
foundsql=foundsql&"ORDERBYA.AllHitsDESC,A.ArticleidDESC"
strHits="AllHits"
EndSelect
SQL="A.ArticleID,A.ClassID,A.ColorMode,A.FontMode,A.title,A.BriefTopic,A.AllHits,A.WriteTime,A.HtmlFileDate,A.isBest,A.DayHits,A.WeekHits,A.MonthHits,"
SQL="SELECTTOP"&CInt(maxline)&SQL&"C.ClassName,C.ColorModes,C.FontModes,C.HtmlFileDirFROM[NC_Article]AINNERJOIN[NC_Classify]CONA.ClassID=C.ClassIDWHEREA.isAccept>0AndA.ChannelID="&chanid&""&foundsql
SetRs=Newasp.Execute(SQL)
i=0
strContent=""
IfRs.BOFAndRs.EOFThen
strContent="还没有找到任何软件!"
Else
DoWhileNotRs.EOF
IfTrim(styles)<>""AndTrim(styles)<>"0"Then
If(iMod2)=0Then
divstyle="class="""&Trim(styles)&"1"""
Else
divstyle="class="""&Trim(styles)&"2"""
EndIf
EndIf
NewsTitle=Newasp.GotTopic(Rs("title"),CInt(maxlen))
NewsTitle=Newasp.ReadFontMode(NewsTitle,Rs("ColorMode"),Rs("FontMode"))
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(showhits)>0Then
AllHits=Rs(strHits)
Else
AllHits=""
EndIf
ArticleTitle="<div"&divstyle&">"&start&"<ahref="""&HtmlFileUrl&"""target="""&target&"""title="""&Newasp.ChannelModule&"标题:"&Rs("title")&" "&Rs("WriteTime")&" "&Rs("AllHits")&"""class=popular>"&NewsTitle&"</a>"&AllHits&"</div>"
strContent=strContent&ArticleTitle
Rs.MoveNext
i=i+1
Loop
EndIf
Rs.Close:SetRs=Nothing
LoadPopularArticle=strContent
EndFunction
'================================================
'函数名:ReadPopularSoft
'作用:读取软件排行列表
'参数:str----原字符串
'================================================
PublicFunctionReadPopularArticle(ByValstr)
OnErrorResumeNext
DimstrTemp,i,sTempContent
DimnTempContent,ArrayList
DimarrTempContent,arrTempContents
strTemp=str
IfInStr(strTemp,"{$ReadPopularArticle(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$ReadPopularArticle(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$ReadPopularArticle(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),LoadPopularArticle(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3),ArrayList(4),ArrayList(5),ArrayList(6),ArrayList(7),ArrayList(8)))
Next
EndIf
ReadPopularArticle=strTemp
EndFunction
'================================================
'函数名:LoadPopularFlash
'作用:装载排行动画列表
'参数:ClassID----分类ID
'chanid----频道ID
'stype----调用类型
'maxline----显示列表数
'maxlen----显示标题长度
'showhits----是否显示下载数
'target----连接目标
'start----标题头标记
'styles----样式名称
'================================================
PublicFunctionLoadPopularFlash(ByValchanid,ByValClassID,ByValstype,_
ByValmaxlen,ByValmaxline,ByValshowhits,_
ByValtarget,ByValstart,ByValstyles)
DimSQL,Rs,foundsql,strHits
DimChildStr,i,strContent
DimHtmlFileName,HtmlFileUrl
DimNewsTitle,AllHits,strtitle
Dimdivstyle
chanid=Newasp.ChkNumeric(chanid)
ClassID=Newasp.ChkNumeric(ClassID)
stype=Newasp.ChkNumeric(stype)
Ifchanid=0Thenchanid=1
OnErrorResumeNext
Newasp.LoadChannel(chanid)
IfCLng(ClassID)>0AndTrim(ClassID)<>""Then
SQL="SELECTChildStrFROM[NC_Classify]WHEREChannelID="&chanid&"Andclassid="&ClassID
SetRs=Newasp.Execute(SQL)
IfRs.BOFAndRs.EOFThen
SetRs=Nothing
LoadPopularFlash=""
ExitFunction
Else
ChildStr=Rs("ChildStr")
foundsql="AndA.ClassIDin("&ChildStr&")"
EndIf
Rs.Close
Else
ChildStr="0"
foundsql=""
EndIf
SelectCaseCInt(stype)
Case1
foundsql=foundsql&"ORDERBYA.DayHitsDESC,A.flashidDESC"
strHits="DayHits"
Case2
foundsql=foundsql&"ORDERBYA.WeekHitsDESC,A.flashidDESC"
strHits="WeekHits"
Case3
foundsql=foundsql&"ORDERBYA.MonthHitsDESC,A.flashidDESC"
strHits="MonthHits"
Case4
foundsql=foundsql&"AndA.isBest>0ORDERBYA.AllHitsDESC,A.flashidDESC"
strHits="AllHits"
CaseElse
foundsql=foundsql&"ORDERBYA.AllHitsDESC,A.flashidDESC"
strHits="AllHits"
EndSelect
SQL="A.flashid,A.ClassID,A.ColorMode,A.FontMode,A.title,A.AllHits,A.addTime,A.HtmlFileDate,A.isBest,A.DayHits,A.WeekHits,A.MonthHits,"
SQL="SELECTTOP"&CInt(maxline)&SQL&"C.ClassName,C.ColorModes,C.FontModes,C.HtmlFileDirFROM[NC_FlashList]AINNERJOIN[NC_Classify]CONA.ClassID=C.ClassIDWHEREA.isAccept>0AndA.ChannelID="&chanid&""&foundsql
SetRs=Newasp.Execute(SQL)
i=0
strContent=""
IfRs.BOFAndRs.EOFThen
strContent="还没有找到任何内容!"
Else
DoWhileNotRs.EOF
IfTrim(styles)<>""AndTrim(styles)<>"0"Then
If(iMod2)=0Then
divstyle="class="""&Trim(styles)&"1"""
Else
divstyle="class="""&Trim(styles)&"2"""
EndIf
EndIf
NewsTitle=Newasp.GotTopic(Rs("title"),CInt(maxlen))
NewsTitle=Newasp.ReadFontMode(NewsTitle,Rs("ColorMode"),Rs("FontMode"))
HtmlFileName=Newasp.ReadFileName(Rs("HtmlFileDate"),Rs("flashid"),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("flashid")
EndIf
IfCInt(showhits)>0Then
AllHits=Rs(strHits)
Else
AllHits=""
EndIf
strtitle="<div"&divstyle&">"&start&"<ahref="""&HtmlFileUrl&"""target="""&target&"""title="""&Newasp.ChannelModule&"名称:"&Rs("title")&" "&Rs("addTime")&" "&Rs("AllHits")&"""class=popular>"&NewsTitle&"</a>"&AllHits&"</div>"
strContent=strContent&strtitle
Rs.MoveNext
i=i+1
Loop
EndIf
Rs.Close:SetRs=Nothing
LoadPopularFlash=strContent
EndFunction
'================================================
'函数名:ReadPopularFlash
'作用:读取动画排行列表
'参数:str----原字符串
'================================================
PublicFunctionReadPopularFlash(ByValstr)
OnErrorResumeNext
DimstrTemp,i,sTempContent
DimnTempContent,ArrayList
DimarrTempContent,arrTempContents
strTemp=str
IfInStr(strTemp,"{$ReadPopularFlash(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$ReadPopularFlash(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$ReadPopularFlash(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),LoadPopularFlash(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3),ArrayList(4),ArrayList(5),ArrayList(6),ArrayList(7),ArrayList(8)))
Next
EndIf
ReadPopularFlash=strTemp
EndFunction
'================================================
'函数名:LoadSoftType
'作用:装载软件类型列表
'参数:chanid----频道ID
'SoftType----软件类型
'maxline----显示列表数
'maxlen----显示标题长度
'showclass----是否显示分类
'showdate----是否显示日期
'DateMode----显示日期模式
'newindow----是否新窗口打开连接
'styles----样式名称
'================================================
PublicFunctionLoadSoftType(ByValchanid,ByValSoftType,ByValmaxlen,_
ByValmaxline,ByValshowclass,ByValshowdate,_
ByValDateMode,ByValnewindow,ByValstyles)
DimSQL,Rs,foundsql,strContent,i
DimstrSoftName,ChildStr,ListStyle,HtmlFileName,BestCode,BestString
DimClassName,HtmlFileUrl,SoftTime,LinkTarget,SoftTopic
SoftType=Newasp.CheckStr(SoftType)
chanid=Newasp.ChkNumeric(chanid)
maxline=Newasp.ChkNumeric(maxline)
Ifchanid=0Thenchanid=2
Ifmaxline=0Thenmaxline=10
OnErrorResumeNext
Newasp.LoadChannel(chanid)
IfTrim(SoftType)<>""Then
foundsql="AndA.SoftType='"&SoftType&"'OrderByA.SoftTimeDesc,A.SoftIDDesc"
Else
foundsql="OrderByA.SoftTimeDesc,A.SoftIDDesc"
EndIf
SQL="A.SoftID,A.ClassID,A.ColorMode,A.FontMode,A.SoftName,A.SoftVer,A.SoftType,A.AllHits,A.SoftTime,A.HtmlFileDate,A.isBest,"
SQL="SELECTTOP"&maxline&SQL&"C.ClassName,C.ColorModes,C.FontModes,C.HtmlFileDir,C.UseHtmlFROM[NC_SoftList]AINNERJOIN[NC_Classify]CONA.ClassID=C.ClassIDWHEREA.isAccept>0AndA.ChannelID="&chanid&""&foundsql
SetRs=Newasp.Execute(SQL)
i=0
strContent=""
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(14)
strSoftName=Newasp.GotTopic(Rs("SoftName")&""&Rs("SoftVer"),CInt(maxlen))
strSoftName=Newasp.ReadFontMode(strSoftName,Rs("ColorMode"),Rs("FontMode"))
ClassName=Newasp.ReadFontMode(Rs("ClassName"),Rs("ColorModes"),Rs("FontModes"))
HtmlFileName=Newasp.ReadFileName(Rs("HtmlFileDate"),Rs("SoftID"),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("SoftID")
ClassName="<ahref='"&Newasp.ChannelPath&"list.asp?classid="&Rs("ClassID")&"'>"&ClassName&"</a>"
EndIf
IfCInt(showclass)=0ThenClassName=""
IfCInt(showdate)<>0Then
SoftTime=Newasp.ShowDateTime(Rs("SoftTime"),CInt(DateMode))
Else
SoftTime=""
EndIf
IfCInt(newindow)<>0Then
LinkTarget="target=""_blank"""
Else
LinkTarget=""
EndIf
SoftTopic="<ahref='"&HtmlFileUrl&"'"&LinkTarget&"title='"&Newasp.ChannelModule&"名称:"&Rs("SoftName")&" "&Rs("SoftTime")&" "&Rs("AllHits")&"'class=showlist>"&strSoftName&"</a>"
strContent=Replace(strContent,"{$SoftTopic}",SoftTopic)
strContent=Replace(strContent,"{$InstallDir}",Newasp.InstallDir)
strContent=Replace(strContent,"{$SoftName}",strSoftName)
strContent=Replace(strContent,"{$Title}",Rs("SoftName"))
strContent=Replace(strContent,"{$DateAndTitle}",Rs("SoftTime"))
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}",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
SetRs=Nothing
LoadSoftType=strContent
EndFunction
'================================================
'函数名:ReadSoftType
'作用:读取软件类型列表
'参数:str----原字符串
'================================================
PublicFunctionReadSoftType(ByValstr)
OnErrorResumeNext
DimstrTemp,i,sTempContent
DimnTempContent,ArrayList
DimarrTempContent,arrTempContents
strTemp=str
IfInStr(strTemp,"{$ReadSoftType(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$ReadSoftType(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$ReadSoftType(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),LoadSoftType(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3),ArrayList(4),ArrayList(5),ArrayList(6),ArrayList(7),ArrayList(8)))
Next
EndIf
ReadSoftType=strTemp
EndFunction
'================================================
'函数名:LoadUserRank
'作用:装用户排行列表
'================================================
PublicFunctionLoadUserRank(ByValstype,ByValgrade,ByValmaxline,ByValstyles)
DimSQL,Rs,foundsql,strContent,i
DimListStyle,username
stype=Newasp.CheckNumeric(stype)
grade=Newasp.CheckNumeric(grade)
maxline=Newasp.CheckNumeric(maxline)
Ifmaxline=0Thenmaxline=10
Ifstype=1Then
foundsql="ORDERBYJoinTimeDESC,useridDESC"
ElseIfstype=2Then
foundsql="ORDERBYLastTimeDESC,useridDESC"
ElseIfstype=3Then
foundsql="ORDERBYuserpointDESC,useridDESC"
Else
foundsql="ORDERBYuserloginDESC,useridDESC"
EndIf
Ifgrade>0Then
SQL="SELECTTOP"&maxline&"userid,username,userpoint,userloginFROM[NC_User]WHEREUserGrade="&grade&""&foundsql
Else
SQL="SELECTTOP"&maxline&"userid,username,userpoint,userloginFROM[NC_User]"&foundsql
EndIf
SetRs=Newasp.Execute(SQL)
i=0
strContent=""
IfNot(Rs.BOFAndRs.EOF)Then
strContent="<tablewidth=""100%""border=0cellpadding=2cellspacing=0>"
DoWhileNotRs.EOF
If(iMod2)=0Then
ListStyle=Trim(styles)&1
Else
ListStyle=Trim(styles)&2
EndIf
username="<ahref="""&Newasp.InstallDir&"user/userlist.asp?userid="&Rs("userid")&"""target=""_blank"">"&Rs("username")&"</a>"
strContent=strContent&Newasp.MainSetting(23)
strContent=Replace(strContent,"{$ListStyle}",ListStyle)
strContent=Replace(strContent,"{$InstallDir}",Newasp.InstallDir)
strContent=Replace(strContent,"{$UserName}",username)
strContent=Replace(strContent,"{$username}",Rs("username"))
strContent=Replace(strContent,"{$UserID}",Rs("userid"))
strContent=Replace(strContent,"{$UserLogin}",Rs("userlogin"))
strContent=Replace(strContent,"{$UserPoint}",Rs("userpoint"))
Rs.MoveNext
i=i+1
strContent=Replace(strContent,"{$OrderID}",i)
Loop
strContent=strContent&"</table>"
EndIf
Rs.Close:SetRs=Nothing
LoadUserRank=strContent
EndFunction
'================================================
'函数名:ReadUserRank
'作用:读取用户排行列表
'参数:str----原字符串
'================================================
PublicFunctionReadUserRank(ByValstr)
OnErrorResumeNext
DimstrTemp,i,sTempContent
DimnTempContent,ArrayList
DimarrTempContent,arrTempContents
strTemp=str
IfInStr(strTemp,"{$ReadUserRank(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$ReadUserRank(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$ReadUserRank(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),LoadUserRank(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3)))
Next
EndIf
ReadUserRank=strTemp
EndFunction
'================================================
'函数名:LoadStatistic
'作用:装载频道统计
'参数:moduleid----所属模块
'ChannelID----频道ID
'strClass----所调用的分类ID或者软件类型
'stype----统计类型,0=全部统计,1=今日更新统计,2=点击数统计,3=软件容量统计
'================================================
PublicFunctionLoadStatistic(ByValmoduleid,ByValChannelID,ByValstrClass,ByValstype)
moduleid=Newasp.CheckNumeric(moduleid)
ChannelID=Newasp.CheckNumeric(ChannelID)
stype=Newasp.CheckNumeric(stype)
DimRs,SQL,StatCount
Dimfoundsql,ClassID,ChildStr
ClassID=Newasp.CheckNumeric(strClass)
OnErrorResumeNext
LoadStatistic=0
IfClassID>0Then
SQL="SELECTChildStrFROM[NC_Classify]WHEREChannelID="&ChannelID&"AndClassID="&ClassID
SetRs=Newasp.Execute(SQL)
IfRs.BOFAndRs.EOFThen
ChildStr=0
Else
ChildStr=Rs("ChildStr")
EndIf
Rs.Close:SetRs=Nothing
foundsql="AndChannelID="&ChannelID&"AndClassIDin("&ChildStr&")"
Else
foundsql="AndChannelID="&ChannelID
EndIf
SelectCasemoduleid
Case1
Ifstype=1Then
IfisSqlDataBase=1Then
SQL="SELECTCOUNT(ArticleID)FROMNC_ArticleWHEREisAccept>0"&foundsql&"AndDatediff(d,WriteTime,GetDate())=0"
Else
SQL="SELECTCOUNT(ArticleID)FROMNC_ArticleWHEREisAccept>0"&foundsql&"AndWriteTime>=Date()"
EndIf
ElseIfstype=2Then
SQL="SELECTSUM(AllHits)FROMNC_ArticleWHEREisAccept>0"&foundsql
ElseIfstype=4Then
SQL="SELECTSUM(DayHits)FROMNC_ArticleWHEREisAccept>0"&foundsql
Else
SQL="SELECTCOUNT(ArticleID)FROMNC_ArticleWHEREisAccept>0"&foundsql
EndIf
Case2
IfNotIsNumeric(strClass)Then
foundsql=foundsql&"AndSoftType='"&Newasp.CheckStr(strClass)&"'"
EndIf
Ifstype=1Then
IfisSqlDataBase=1Then
SQL="SELECTCOUNT(softid)FROMNC_SoftListWHEREisAccept>0"&foundsql&"AndDatediff(d,SoftTime,GetDate())=0"
Else
SQL="SELECTCOUNT(softid)FROMNC_SoftListWHEREisAccept>0"&foundsql&"AndSoftTime>=Date()"
EndIf
ElseIfstype=2Then
SQL="SELECTSUM(AllHits)FROMNC_SoftListWHEREisAccept>0"&foundsql
ElseIfstype=3Then
SQL="SELECTSUM(SoftSize)FROMNC_SoftListWHEREisAccept>0"&foundsql
ElseIfstype=4Then
SQL="SELECTSUM(DayHits)FROMNC_SoftListWHEREisAccept>0"&foundsql
Else
SQL="SELECTCOUNT(softid)FROMNC_SoftListWHEREisAccept>0"&foundsql
EndIf
Case4
Ifstype=1Then
IfisSqlDataBase=1Then
SQL="SELECTCOUNT(GuestID)FROMNC_GuestBookWHEREisAccept>0AndDatediff(d,WriteTime,GetDate())=0"
Else
SQL="SELECTCOUNT(GuestID)FROMNC_GuestBookWHEREisAccept>0AndWriteTime>=Date()"
EndIf
Else
SQL="SELECTCOUNT(GuestID)FROMNC_GuestBookWHEREisAccept>0"
EndIf
Case5
Ifstype=1Then
IfisSqlDataBase=1Then
SQL="SELECTCOUNT(flashid)FROMNC_FlashListWHEREisAccept>0"&foundsql&"AndDatediff(d,addTime,GetDate())=0"
Else
SQL="SELECTCOUNT(flashid)FROMNC_FlashListWHEREisAccept>0"&foundsql&"AndaddTime>=Date()"
EndIf
ElseIfstype=2Then
SQL="SELECTSUM(AllHits)FROMNC_FlashListWHEREisAccept>0"&foundsql
ElseIfstype=3Then
SQL="SELECTSUM(filesize)FROMNC_FlashListWHEREisAccept>0"&foundsql
ElseIfstype=4Then
SQL="SELECTSUM(DayHits)FROMNC_FlashListWHEREisAccept>0"&foundsql
Else
SQL="SELECTCOUNT(flashid)FROMNC_FlashListWHEREisAccept>0"&foundsql
EndIf
CaseElse
Ifstype=1Then
IfisSqlDataBase=1Then
SQL="SELECTCOUNT(userid)FROMNC_UserWHEREDatediff(d,JoinTime,GetDate())=0"
Else
SQL="SELECTCOUNT(userid)FROMNC_UserWHEREJoinTime>=Date()"
EndIf
Else
SQL="SELECTCOUNT(userid)FROMNC_User"
EndIf
EndSelect
SetRs=Newasp.Execute(SQL)
IfRs.BOFAndRs.EOFThen
StatCount=0
Else
StatCount=CCur(Rs(0))
If(moduleid=2Andstype=3)Or(moduleid=5Andstype=3)Then
StatCount=Round(StatCount/1024/1024,3)
StatCount=FormatNumber(StatCount,3,-1)
EndIf
EndIf
Rs.Close:SetRs=Nothing
LoadStatistic=StatCount
EndFunction
'================================================
'函数名:ReadStatistic
'作用:读取频道统计
'参数:str----原字符串
'================================================
PublicFunctionReadStatistic(ByValstr)
OnErrorResumeNext
DimstrTemp,i,sTempContent
DimnTempContent,ArrayList
DimarrTempContent,arrTempContents
strTemp=str
OnErrorResumeNext
IfInStr(strTemp,"{$ReadStatistic(")>0Then
sTempContent=Newasp.CutMatchContent(strTemp,"{$ReadStatistic(",")}",1)
nTempContent=Newasp.CutMatchContent(strTemp,"{$ReadStatistic(",")}",0)
arrTempContents=Split(sTempContent,"|||")
arrTempContent=Split(nTempContent,"|||")
Fori=0ToUBound(arrTempContents)
ArrayList=Split(arrTempContent(i),",")
strTemp=Replace(strTemp,arrTempContents(i),LoadStatistic(ArrayList(0),ArrayList(1),ArrayList(2),ArrayList(3)))
Next
EndIf
ReadStatistic=strTemp
EndFunction
PublicFunctionShowIndex(ByValisHtml)
DimHtmlContent
Newasp.LoadTemplates0,1,0
HtmlContent=Newasp.HtmlContent
HtmlContent=Replace(HtmlContent,"{$ChannelRootDir}",Newasp.InstallDir)
HtmlContent=Replace(HtmlContent,"{$InstallDir}",Newasp.InstallDir)
IfLen(Newasp.HtmlSetting(1))<2Then
HtmlContent=Replace(HtmlContent,"{$PageTitle}","首页")
Else
HtmlContent=Replace(HtmlContent,"{$PageTitle}",Newasp.HtmlSetting(1))
EndIf
HtmlContent=Replace(HtmlContent,"{$ChannelID}",0)
HtmlContent=ReadAnnounceContent(HtmlContent,0)
HtmlContent=ReadClassMenu(HtmlContent)
HtmlContent=ReadClassMenubar(HtmlContent)
HtmlContent=ReadArticlePic(HtmlContent)
HtmlContent=ReadSoftPic(HtmlContent)
HtmlContent=ReadArticleList(HtmlContent)
HtmlContent=ReadSoftList(HtmlContent)
HtmlContent=ReadFlashList(HtmlContent)
HtmlContent=ReadFlashPic(HtmlContent)
HtmlContent=ReadFriendLink(HtmlContent)
HtmlContent=ReadNewsPicAndText(HtmlContent)
HtmlContent=ReadSoftPicAndText(HtmlContent)
HtmlContent=ReadGuestList(HtmlContent)
HtmlContent=ReadAnnounceList(HtmlContent)
HtmlContent=ReadPopularArticle(HtmlContent)
HtmlContent=ReadPopularSoft(HtmlContent)
HtmlContent=ReadPopularFlash(HtmlContent)
HtmlContent=ReadSoftType(HtmlContent)
HtmlContent=ReadStatistic(HtmlContent)
HtmlContent=ReadUserRank(HtmlContent)
HtmlContent=Replace(HtmlContent,"{$SkinPath}",Newasp.SkinPath)
HtmlContent=Replace(HtmlContent,"{$InstallDir}",Newasp.InstallDir)
IfisHtmlThen
ShowIndex=HtmlContent
Else
Response.WriteHtmlContent
EndIf
EndFunction
EndClass
%>
【文章列表类别】相关文章:
★ 捌度空间 缓存类