<% dim html set html = new newasppublic_cls class newasppublic_cls
private sub class_initialize() on error resume next newasp.loadtemplates 0, 0, 0 end sub '================================================ '函数名:loadarticlelist '作 用:装载文章列表 '参 数:classid ----分类id ' channelid ----频道id ' specialid ----专题id ' stype ----调用文章类型,0=所有最新文章,1=推荐文章,2=热门文章,3=图文文章,4=分类最新文章 ' topnum ----显示文章列表数 ' strlen ----显示标题长度 ' showclass ----是否显示分类 ' showpic ----是否显示图文标题 ' showdate ----是否显示日期 ' datemode ----显示日期模式 ' newindow ----新窗口打开 '================================================ public function loadarticlelist(byval channelid, byval classid, byval specialid, _ byval stype, byval topnum, byval strlen, _ byval showclass, byval showpic, byval showdate, _ byval datemode, byval newindow, byval styles)
dim rs, sql, i, strcontent, foundstr dim stitle, stopic, childstr, liststyle, bestcode, beststring dim articletopic, classname, htmlfileurl, writetime, linktarget, htmlfilename
channelid = newasp.chknumeric(channelid) classid = newasp.chknumeric(classid) specialid = newasp.chknumeric(specialid) stype = newasp.chknumeric(stype)
on error resume next newasp.loadchannel(channelid)
if cint(stype) >= 4 and clng(classid) <> 0 then sql = "select childstr from [nc_classify] where channelid=" & channelid & " and classid=" & classid set rs = newasp.execute(sql) if rs.bof and rs.eof then set rs = nothing loadarticlelist = "" exit function else childstr = rs("childstr") end if set rs = nothing else childstr = "0" end if
select case cint(stype) case 0: foundstr = "order by a.writetime desc ,a.articleid desc" case 1: foundstr = "and a.isbest > 0 order by a.writetime desc ,a.articleid desc" case 2: foundstr = "order by a.allhits desc ,a.articleid desc" case 3: foundstr = "and (a.brieftopic = 1 or a.brieftopic = 2) order by a.writetime desc ,a.articleid desc" case 4: foundstr = "and a.classid in (" & childstr & ") order by a.writetime desc ,a.articleid desc" case 5: foundstr = "and a.classid in (" & childstr & ") and a.isbest > 0 order by a.writetime desc ,a.articleid desc" case 6: foundstr = "and a.classid in (" & childstr & ") order by a.allhits desc ,a.articleid desc" case 7: foundstr = "and a.classid in (" & childstr & ") and (a.brieftopic = 1 or a.brieftopic = 2) order by a.writetime desc ,a.articleid desc" case else foundstr = "order by a.writetime desc ,a.articleid desc" end select if cint(stype) >= 4 and clng(classid) = 0 then foundstr = "order by a.writetime desc ,a.articleid desc" end if if clng(specialid) <> 0 then foundstr = "and a.specialid =" & clng(specialid) & " " & foundstr end if sql = " a.articleid,a.classid,a.colormode,a.fontmode,a.title,a.brieftopic,a.allhits,a.writetime,a.htmlfiledate,a.isbest," sql = "select top " & cint(topnum) & sql & " c.classname,c.colormodes,c.fontmodes,c.htmlfiledir,c.usehtml from [nc_article] a inner join [nc_classify] c on a.classid=c.classid where a.isaccept>0 and a.channelid=" & channelid & " " & foundstr & "" set rs = newasp.execute(sql) i = 0 if rs.bof and rs.eof then strcontent = "该分类还没有添加任何内容!" else strcontent = "<table width=""100%"" border=0 cellpadding=2 cellspacing=0>" do while not rs.eof if (i mod 2) = 0 then liststyle = trim(styles) & 1 else liststyle = trim(styles) & 2 end if if rs("isbest") <> 0 then bestcode = 2 beststring = "<font color='" & newasp.mainsetting(3) & "'>推荐</font>" else bestcode = 1 beststring = "" end if
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, "") if cint(newasp.channelusehtml) <> 0 then htmlfileurl = newasp.channelpath & rs("htmlfiledir") & newasp.showdatepath(rs("htmlfiledate"), newasp.channelhtmlpath) & htmlfilename classname = "<a href='" & newasp.channelpath & rs("htmlfiledir") & "index" & newasp.channelhtmlext & "'>" & classname & "</a>" else htmlfileurl = newasp.channelpath & "show.asp?id=" & rs("articleid") classname = "<a href='" & newasp.channelpath & "list.asp?classid=" & rs("classid") & "'>" & classname & "</a>" end if
if cint(showclass) = 0 then classname = "" if cint(showpic) = 0 then stopic = "" if cint(showdate) <> 0 then writetime = newasp.showdatetime(rs("writetime"), cint(datemode)) else writetime = "" end if if cint(newindow) <> 0 then linktarget = " target=""_blank""" else linktarget = "" end if articletopic = "<a href='" & 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>" end if
rs.close: set rs = nothing loadarticlelist = strcontent end function '================================================ '函数名:readarticlelist '作 用:读取文章列表 '参 数:str ----原字符串 '================================================ public function readarticlelist(byval str) dim strtemp, i dim stempcontent, ntempcontent dim arrtempcontent, arrtempcontents, arraylist on error resume next strtemp = str if instr(strtemp, "{$readarticlelist(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$readarticlelist(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$readarticlelist(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||")
for i = 0 to ubound(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 end if readarticlelist = strtemp end function '================================================ '函数名:loadsoftlist '作 用:装载软件列表 '参 数:classid ----分类id ' channelid ----频道id ' stype ----调用类型 ' topnum ----显示列表数 ' strlen ----显示标题长度 ' showclass ----是否显示分类 ' showdate ----是否显示日期 ' datemode ----显示日期模式 ' newindow ----新窗口打开 '================================================ public function loadsoftlist(byval channelid, byval classid, byval specialid, _ byval stype, byval topnum, byval strlen, byval showclass, _ byval showdate, byval datemode, byval newindow, byval styles)
dim rs, sql, i, strcontent, foundstr,j dim strsoftname, childstr, liststyle dim htmlfilename, bestcode, beststring,channelpath dim classname, htmlfileurl, softtime, linktarget, softtopic
channelid = newasp.chknumeric(channelid) classid = newasp.chknumeric(classid) specialid = newasp.chknumeric(specialid) stype = newasp.chknumeric(stype)
on error resume next newasp.loadchannel(channelid)
if cint(stype) >= 3 and clng(classid) <> 0 then sql = "select childstr from [nc_classify] where channelid=" & channelid & " and classid = " & classid set rs = newasp.execute(sql) if rs.bof and rs.eof then set rs = nothing loadsoftlist = "" exit function else childstr = rs("childstr") end if rs.close else childstr = 0 end if select case cint(stype) case 0: foundstr = "order by a.softtime desc ,a.softid desc" case 1: foundstr = "and a.isbest > 0 order by a.softtime desc ,a.softid desc" case 2: foundstr = "order by a.allhits desc ,a.softid desc" case 3: foundstr = "and a.classid in (" & childstr & ") order by a.softtime desc ,a.softid desc" case 4: foundstr = "and a.classid in (" & childstr & ") and a.isbest > 0 order by a.softtime desc ,a.softid desc" case 5: foundstr = "and a.classid in (" & childstr & ") order by a.allhits desc ,a.softid desc" case else foundstr = "order by a.softtime desc ,a.softid desc" end select if cint(stype) >= 3 and clng(classid) = 0 then foundstr = "order by a.softtime desc ,a.softid desc" end if if clng(specialid) <> 0 then foundstr = "and a.specialid =" & clng(specialid) & " " & foundstr end if sql = " a.softid,a.classid,a.colormode,a.fontmode,a.softname,a.softver,a.allhits,a.softtime,a.htmlfiledate,a.isbest," sql = "select top " & cint(topnum) & sql & " c.classname,c.colormodes,c.fontmodes,c.htmlfiledir,c.usehtml from [nc_softlist] a inner join [nc_classify] c on a.classid=c.classid where a.isaccept>0 and a.channelid=" & channelid & " " & foundstr & "" set rs = newasp.execute(sql) j = 0
if rs.bof and rs.eof then strcontent = "没有添加任何软件!" else sql=rs.getrows(-1) strcontent = "<table width=""100%"" border=0 cellpadding=2 cellspacing=0>" for i=0 to ubound(sql,2) if (j mod 2) = 0 then liststyle = trim(styles) & 1 else liststyle = trim(styles) & 2 end if if cint(sql(9,i)) <> 0 then bestcode = 2 beststring = "<font color='" & newasp.mainsetting(3) & "'>推荐</font>" else bestcode = 1 beststring = "" end if 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, "") if cint(newasp.channelusehtml) <> 0 then htmlfileurl = newasp.channelpath & sql(13,i) & newasp.showdatepath(sql(8,i), newasp.channelhtmlpath) & htmlfilename classname = "<a href='" & newasp.channelpath & sql(13,i) & "index" & newasp.channelhtmlext & "'>" & classname & "</a>" else htmlfileurl = newasp.channelpath & "show.asp?id=" & sql(0,i) classname = "<a href='" & newasp.channelpath & "list.asp?classid=" & sql(1,i) & "'>" & classname & "</a>" end if if cint(showclass) = 0 then classname = "" if cint(showdate) <> 0 then softtime = newasp.showdatetime(sql(7,i), cint(datemode)) else softtime = "" end if if cint(newindow) <> 0 then linktarget = " target=""_blank""" else linktarget = "" end if softtopic = "<a href='" & 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>" end if rs.close: set rs = nothing loadsoftlist = strcontent end function '================================================ '函数名:readsoftlist '作 用:读取软件列表 '参 数:str ----原字符串 '================================================ public function readsoftlist(byval str) dim strtemp, i dim stempcontent, ntempcontent dim arrtempcontent, arrtempcontents, arraylist on error resume next strtemp = str if instr(strtemp, "{$readsoftlist(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$readsoftlist(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$readsoftlist(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(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 end if readsoftlist = strtemp end function
'================================================ '函数名:loadflashlist '作 用:装载动画列表 '参 数:classid ----分类id ' channelid ----频道id ' stype ----调用类型 ' topnum ----显示列表数 ' strlen ----显示标题长度 ' showclass ----是否显示分类 ' showdate ----是否显示日期 ' datemode ----显示日期模式 ' newindow ----新窗口打开 '================================================ public function loadflashlist(byval channelid, byval classid, byval specialid, _ byval stype, byval topnum, byval strlen, byval showclass, _ byval showdate, byval datemode, byval newindow, byval styles)
dim rs, sql, i, strcontent, foundstr,j dim strtitle, childstr, liststyle dim htmlfilename, bestcode, beststring,channelpath dim classname, htmlfileurl, addtime, linktarget, flashtopic
channelid = newasp.chknumeric(channelid) classid = newasp.chknumeric(classid) specialid = newasp.chknumeric(specialid) stype = newasp.chknumeric(stype)
on error resume next newasp.loadchannel(channelid)
if cint(stype) >= 3 and clng(classid) <> 0 then sql = "select childstr from [nc_classify] where channelid=" & channelid & " and classid = " & classid set rs = newasp.execute(sql) if rs.bof and rs.eof then set rs = nothing loadflashlist = "" exit function else childstr = rs("childstr") end if rs.close else childstr = 0 end if select case cint(stype) case 0: foundstr = "order by a.addtime desc ,a.flashid desc" case 1: foundstr = "and a.isbest > 0 order by a.addtime desc ,a.flashid desc" case 2: foundstr = "order by a.allhits desc ,a.flashid desc" case 3: foundstr = "and a.classid in (" & childstr & ") order by a.addtime desc ,a.flashid desc" case 4: foundstr = "and a.classid in (" & childstr & ") and a.isbest > 0 order by a.addtime desc ,a.flashid desc" case 5: foundstr = "and a.classid in (" & childstr & ") order by a.allhits desc ,a.flashid desc" case else foundstr = "order by a.addtime desc ,a.flashid desc" end select if cint(stype) >= 3 and clng(classid) = 0 then foundstr = "order by a.addtime desc ,a.flashid desc" end if if clng(specialid) <> 0 then foundstr = "and a.specialid =" & clng(specialid) & " " & foundstr end if sql = " a.flashid,a.classid,a.colormode,a.fontmode,a.title,a.author,a.allhits,a.addtime,a.htmlfiledate,a.isbest," sql = "select top " & cint(topnum) & sql & " c.classname,c.colormodes,c.fontmodes,c.htmlfiledir,c.usehtml from [nc_flashlist] a inner join [nc_classify] c on a.classid=c.classid where a.isaccept>0 and a.channelid=" & channelid & " " & foundstr & "" set rs = newasp.execute(sql) j = 0
if rs.bof and rs.eof then strcontent = "没有添加任何信息!" else sql=rs.getrows(-1) strcontent = "<table width=""100%"" border=0 cellpadding=2 cellspacing=0>" for i=0 to ubound(sql,2) if (j mod 2) = 0 then liststyle = trim(styles) & 1 else liststyle = trim(styles) & 2 end if if cint(sql(9,i)) <> 0 then bestcode = 2 beststring = "<font color='" & newasp.mainsetting(3) & "'>推荐</font>" else bestcode = 1 beststring = "" end if 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, "") if cint(newasp.channelusehtml) <> 0 then htmlfileurl = newasp.channelpath & sql(13,i) & newasp.showdatepath(sql(8,i), newasp.channelhtmlpath) & htmlfilename classname = "<a href='" & newasp.channelpath & sql(13,i) & "index" & newasp.channelhtmlext & "'>" & classname & "</a>" else htmlfileurl = newasp.channelpath & "show.asp?id=" & sql(0,i) classname = "<a href='" & newasp.channelpath & "list.asp?classid=" & sql(1,i) & "'>" & classname & "</a>" end if if cint(showclass) = 0 then classname = "" if cint(showdate) <> 0 then addtime = newasp.showdatetime(sql(7,i), cint(datemode)) else addtime = "" end if if cint(newindow) <> 0 then linktarget = " target=""_blank""" else linktarget = "" end if flashtopic = "<a href='" & 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>" end if rs.close: set rs = nothing loadflashlist = strcontent end function '================================================ '函数名:readflashlist '作 用:读取动画列表 '参 数:str ----原字符串 '================================================ public function readflashlist(byval str) dim strtemp, i dim stempcontent, ntempcontent dim arrtempcontent, arrtempcontents, arraylist on error resume next strtemp = str if instr(strtemp, "{$readflashlist(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$readflashlist(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$readflashlist(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(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 end if readflashlist = strtemp end function '================================================ '函数名:loadannouncecontent '作 用:装载内容公告 '参 数:str ----原字符串 '================================================ public function loadannouncecontent(byval stopic, byval channelid) dim sql, rs, strtemp strtemp = "" stopic = newasp.checkstr(stopic) if stopic <> "" and stopic <> "0" then sql = "select announceid,content,posttime,writer from nc_announce where announcetype=1 and title = '" & stopic & "' order by posttime desc,announceid desc" else sql = "select announceid,content from nc_announce where announcetype=1 and channelid in (" & channelid & ",999) order by posttime desc,announceid desc" end if set rs = newasp.execute(sql) if not (rs.bof and rs.eof) then strtemp = rs("content") end if rs.close: set rs = nothing loadannouncecontent = strtemp end function '================================================ '函数名:readannouncecontent '作 用:读取内容公告 '参 数:str ----原字符串 '================================================ public function readannouncecontent(byval str, byval channelid) dim strtemp, i, stempcontent, ntempcontent, strvalue dim arrtempcontent, arrtempcontents on error resume next strtemp = str if instr(strtemp, "{$announcecontent(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$announcecontent(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$announcecontent(", ")}", 0) if ntempcontent = "" then ntempcontent = "0" arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(arrtempcontents) strvalue = arrtempcontent(i) strtemp = replace(strtemp, arrtempcontents(i), loadannouncecontent(strvalue, channelid)) next end if readannouncecontent = strtemp end function '================================================ '函数名:loadannouncelist '作 用:装载公告列表 '参 数:maxnum ----最多公告数 ' maxlen ----字符长度 ' newindow ----是否新窗口打开 1=是,0=否 ' showdate ----是否显示时间 1=是,0=否 ' datemode ----时间模式 ' showtree ----树型显示 '================================================ public function loadannouncelist(byval channelid, byval maxnum, byval maxlen, _ byval newindow, byval showdate, byval datemode, byval showtree)
dim rs, sql, strcontent dim announcetopic, linktarget dim posttime
channelid = newasp.chknumeric(channelid) maxnum = newasp.chknumeric(maxnum) if maxnum = 0 then maxnum = 10
on error resume next set rs = newasp.execute("select top " & cint(maxnum) & " announceid,title,content,posttime,writer,hits from nc_announce where (channelid=" & channelid & " or channelid=999) and announcetype<>1 order by posttime desc,announceid desc") if rs.bof and rs.eof then loadannouncelist = "" set rs = nothing exit function else do while not rs.eof if cint(newindow) <> 0 then linktarget = " target=""_blank""" else linktarget = "" end if if cint(showdate) <> 0 then posttime = newasp.showdatetime(rs("posttime"), cint(datemode)) else posttime = "" end if announcetopic = newasp.gottopic(rs("title"), cint(maxlen)) announcetopic = "<a href=""" & newasp.installdir & "announce.asp?announceid=" & rs("announceid") & """ title=""" & rs("title") & """" & linktarget & ">" & announcetopic & "</a>" if cint(showtree) = 1 then strcontent = strcontent & "<div>· " & announcetopic & "</div><div align=""right"" class=""dottedline"">" & posttime & "</div>" & vbnewline else strcontent = strcontent & "· " & announcetopic & " " & posttime & vbnewline end if rs.movenext loop end if loadannouncelist = strcontent end function '================================================ '函数名:readannouncelist '作 用:读取公告列表 '参 数:str ----原字符串 '================================================ public function readannouncelist(byval str) dim strtemp, i dim stempcontent, ntempcontent, arraylist dim arrtempcontent, arrtempcontents on error resume next strtemp = str if instr(strtemp, "{$readannouncelist(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$readannouncelist(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$readannouncelist(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(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 end if readannouncelist = strtemp end function '================================================ '函数名:loadarticlepic '作 用:装载文章图片列表 '参 数:classid ----分类id ' channelid ----频道id ' stype ----调用文章类型,0=所有最新文章,1=推荐文章,2=热门文章,3=图文文章,4=分类最新文章 ' topnum ----显示文章列表数 ' strlen ----显示标题长度 ' showclass ----是否显示分类 ' showpic ----是否显示图文标题 ' showdate ----是否显示日期 ' datemode ----显示日期模式 ' newindow ----新窗口打开 '================================================ public function loadarticlepic(channelid, classid, specialid, stype, topnum, perrownum, strlen, newindow, width, height, showtopic) dim rs, sql, i, strcontent, foundstr dim stitle, childstr, imageurl, htmlfilename dim htmlfileurl, writetime, linktarget
channelid = newasp.chknumeric(channelid) classid = newasp.chknumeric(classid) specialid = newasp.chknumeric(specialid) stype = newasp.chknumeric(stype)
on error resume next newasp.loadchannel(channelid)
if cint(stype) >= 3 and clng(classid) <> 0 then sql = "select childstr from [nc_classify] where channelid=" & channelid & " and classid=" & classid set rs = newasp.execute(sql) if rs.bof and rs.eof then set rs = nothing loadarticlepic = "" exit function else childstr = rs("childstr") end if set rs = nothing else childstr = 0 end if select case cint(stype) case 0: foundstr = "order by a.writetime desc ,a.articleid desc" case 1: foundstr = "and a.isbest > 0 order by a.writetime desc ,a.articleid desc" case 2: foundstr = "order by a.allhits desc ,a.articleid desc" case 3: foundstr = "and a.classid in (" & childstr & ") order by a.writetime desc ,a.articleid desc" case 4: foundstr = "and a.classid in (" & childstr & ") and a.isbest > 0 order by a.writetime desc ,a.articleid desc" case 5: foundstr = "and a.classid in (" & childstr & ") order by a.allhits desc ,a.articleid desc" case else foundstr = "order by a.writetime desc ,a.articleid desc" end select if cint(stype) >= 4 and clng(classid) = 0 then foundstr = "order by a.writetime desc ,a.articleid desc" end if if clng(specialid) <> 0 then foundstr = "and a.specialid =" & clng(specialid) & " " & foundstr end if sql = " a.articleid,a.classid,a.title,a.allhits,a.writetime,a.htmlfiledate,a.isbest,a.imageurl," sql = "select top " & cint(topnum) & sql & " c.classname,c.htmlfiledir,c.usehtml from [nc_article] a inner join [nc_classify] c on a.classid=c.classid where a.isaccept > 0 and a.imageurl<>'' and a.channelid=" & channelid & " " & foundstr & "" set rs = newasp.execute(sql) if rs.bof and rs.eof then strcontent = "<img src='" & newasp.installdir & "images/no_pic.gif' width=" & width & " height=" & height & " border=0>" else strcontent = "<table width=""100%"" border=0 cellpadding=1 cellspacing=5>" & vbcrlf do while not rs.eof
strcontent = strcontent & "<tr>" & vbcrlf for i = 1 to cint(perrownum) strcontent = strcontent & "<td align=""center"" class=""imagelist"">" if not rs.eof then 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, "") if cint(newasp.channelusehtml) <> 0 then htmlfileurl = newasp.channelpath & rs("htmlfiledir") & newasp.showdatepath(rs("htmlfiledate"), newasp.channelhtmlpath) & htmlfilename else htmlfileurl = newasp.channelpath & "show.asp?id=" & rs("articleid") end if
if cint(newindow) <> 0 then linktarget = " target=""_blank""" else linktarget = "" end if strcontent = strcontent & newasp.mainsetting(18) strcontent = replace(strcontent, "{$articlepicture}", "<a href='" & htmlfileurl & "' title='" & rs("title") & "'" & linktarget & ">" & imageurl & "</a>") if cint(showtopic) = 1 then strcontent = replace(strcontent, "{$articletopic}", "<a href='" & htmlfileurl & "' title='" & rs("title") & "'" & linktarget & ">" & stitle & "</a>") else strcontent = replace(strcontent, "{$articletopic}", vbnullstring) end if strcontent = strcontent & "</td>" & vbcrlf rs.movenext end if next strcontent = strcontent & "</tr>" & vbcrlf loop strcontent = strcontent & "</table>" & vbcrlf end if rs.close: set rs = nothing loadarticlepic = strcontent end function '================================================ '函数名:readarticlepic '作 用:读取文章图片列表 '参 数:str ----原字符串 '================================================ public function readarticlepic(byval str) dim strtemp, i dim stempcontent, ntempcontent, arraylist dim arrtempcontent, arrtempcontents on error resume next strtemp = str if instr(strtemp, "{$readarticlepic(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$readarticlepic(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$readarticlepic(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(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 end if readarticlepic = strtemp end function '================================================ '函数名:loadsoftpic '作 用:装载软件图片列表 '参 数:classid ----分类id ' channelid ----频道id ' stype ----调用软件类型,0=所有最新软件,1=推荐软件,2=热门软件 ' topnum ----显示软件列表数 ' strlen ----显示标题长度 ' newindow ----新窗口打开 '================================================ public function loadsoftpic(channelid, classid, specialid, stype, topnum, perrownum, strlen, newindow, width, height, showtopic) dim rs, sql, i, strcontent, foundstr dim strsoftname, childstr, softimage, htmlfilename dim htmlfileurl, softtime, linktarget
channelid = newasp.chknumeric(channelid) classid = newasp.chknumeric(classid) specialid = newasp.chknumeric(specialid) stype = newasp.chknumeric(stype)
on error resume next newasp.loadchannel(channelid)
if cint(stype) >= 3 and clng(classid) <> 0 then sql = "select childstr from [nc_classify] where channelid = " & channelid & " and classid = " & classid set rs = newasp.execute(sql) if rs.bof and rs.eof then set rs = nothing loadsoftpic = "" exit function else childstr = rs("childstr") end if rs.close else childstr = 0 end if select case cint(stype) case 0: foundstr = "order by a.softtime desc ,a.softid desc" case 1: foundstr = "and a.isbest > 0 order by a.softtime desc ,a.softid desc" case 2: foundstr = "order by a.allhits desc ,a.softid desc" case 3: foundstr = "and a.classid in (" & childstr & ") order by a.softtime desc ,a.softid desc" case 4: foundstr = "and a.classid in (" & childstr & ") and a.isbest > 0 order by a.softtime desc ,a.softid desc" case 5: foundstr = "and a.classid in (" & childstr & ") order by a.allhits desc ,a.softid desc" case else foundstr = "order by a.softtime desc ,a.softid desc" end select if cint(stype) >= 3 and clng(classid) = 0 then foundstr = "order by a.softtime desc ,a.softid desc" end if if clng(specialid) <> 0 then foundstr = "and a.specialid =" & clng(specialid) & " " & foundstr end if sql = " a.softid,a.classid,a.softname,a.softver,a.allhits,a.softtime,a.htmlfiledate,a.isbest,a.softimage," sql = "select top " & cint(topnum) & sql & " c.classname,c.htmlfiledir,c.usehtml from [nc_softlist] a inner join [nc_classify] c on a.classid=c.classid where a.isaccept>0 and a.softimage<>'' and a.channelid=" & channelid & " " & foundstr & "" set rs = newasp.execute(sql) if rs.bof and rs.eof then strcontent = "<img src='" & newasp.installdir & "images/no_pic.gif' width=" & width & " height=" & height & " border=0>" else strcontent = "<table width=""100%"" border=""0"" cellpadding=""1"" cellspacing=""3"">" & vbcrlf do while not rs.eof strcontent = strcontent & "<tr>" & vbcrlf for i = 1 to cint(perrownum) strcontent = strcontent & "<td align=""center"" class=""imagelist"">" if not rs.eof then 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, "") if cint(newasp.channelusehtml) <> 0 then htmlfileurl = newasp.channelpath & rs("htmlfiledir") & newasp.showdatepath(rs("htmlfiledate"), newasp.channelhtmlpath) & htmlfilename else htmlfileurl = newasp.channelpath & "show.asp?id=" & rs("softid") end if if cint(newindow) <> 0 then linktarget = " target=""_blank""" else linktarget = "" end if strcontent = strcontent & newasp.mainsetting(19) strcontent = replace(strcontent, "{$softpicture}", "<a href='" & htmlfileurl & "' title='" & rs("softname") & "'" & linktarget & ">" & softimage & "</a>") if cint(showtopic) = 1 then strcontent = replace(strcontent, "{$softtopic}", "<a href='" & htmlfileurl & "' title='" & rs("softname") & "'" & linktarget & ">" & strsoftname & "</a>") else strcontent = replace(strcontent, "{$softtopic}", vbnullstring) end if strcontent = strcontent & "</td>" & vbcrlf rs.movenext end if next strcontent = strcontent & "</tr>" & vbcrlf loop strcontent = strcontent & "</table>" & vbcrlf end if rs.close: set rs = nothing loadsoftpic = strcontent end function '================================================ '函数名:readsoftpic '作 用:读取软件图片列表 '参 数:str ----原字符串 '================================================ public function readsoftpic(byval str) dim strtemp, i dim stempcontent, ntempcontent, arraylist dim arrtempcontent, arrtempcontents on error resume next strtemp = str if instr(strtemp, "{$readsoftpic(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$readsoftpic(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$readsoftpic(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(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 end if readsoftpic = strtemp end function '================================================ '函数名:loadflashpic '作 用:装载动画图片列表 '参 数:classid ----分类id ' channelid ----频道id ' stype ----调用动画类型,0=所有最新动画,1=推荐动画,2=热门动画 ' topnum ----显示动画列表数 ' strlen ----显示标题长度 ' newindow ----新窗口打开 '================================================ public function loadflashpic(byval channelid, byval classid, byval specialid, _ byval stype, byval topnum, byval perrownum, byval strlen, byval newindow, _ byval width, byval height, byval showtopic)
dim rs, sql, i, strcontent, foundstr dim strtitle, childstr, miniature, htmlfilename dim htmlfileurl, addtime, linktarget
channelid = newasp.chknumeric(channelid) classid = newasp.chknumeric(classid) specialid = newasp.chknumeric(specialid) stype = newasp.chknumeric(stype)
on error resume next newasp.loadchannel(channelid)
if cint(stype) >= 3 and clng(classid) <> 0 then sql = "select childstr from [nc_classify] where channelid = " & channelid & " and classid = " & classid set rs = newasp.execute(sql) if rs.bof and rs.eof then set rs = nothing loadflashpic = "" exit function else childstr = rs("childstr") end if rs.close else childstr = 0 end if
select case cint(stype) case 0: foundstr = "order by a.addtime desc ,a.flashid desc" case 1: foundstr = "and a.isbest > 0 order by a.addtime desc ,a.flashid desc" case 2: foundstr = "order by a.allhits desc ,a.flashid desc" case 3: foundstr = "and a.classid in (" & childstr & ") order by a.addtime desc ,a.flashid desc" case 4: foundstr = "and a.classid in (" & childstr & ") and a.isbest > 0 order by a.addtime desc ,a.flashid desc" case 5: foundstr = "and a.classid in (" & childstr & ") order by a.allhits desc ,a.flashid desc" case else foundstr = "order by a.addtime desc ,a.flashid desc" end select if cint(stype) >= 3 and clng(classid) = 0 then foundstr = "order by a.addtime desc ,a.flashid desc" end if if clng(specialid) <> 0 then foundstr = "and a.specialid =" & clng(specialid) & " " & foundstr end if sql = " a.flashid,a.classid,a.title,a.allhits,a.addtime,a.htmlfiledate,a.isbest,a.miniature," sql = "select top " & cint(topnum) & sql & " c.classname,c.htmlfiledir,c.usehtml from [nc_flashlist] a inner join [nc_classify] c on a.classid=c.classid where a.isaccept>0 and a.miniature<>'' and a.channelid=" & channelid & " " & foundstr & "" set rs = newasp.execute(sql) if rs.bof and rs.eof then strcontent = "<img src='" & newasp.installdir & "images/no_pic.gif' width=" & width & " height=" & height & " border=0>" else strcontent = "<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""3"">" & vbcrlf do while not rs.eof strcontent = strcontent & "<tr>" & vbcrlf for i = 1 to cint(perrownum) strcontent = strcontent & "<td align=""center"" class=""imagelist"">" if not rs.eof then 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, "") if cint(newasp.channelusehtml) <> 0 then htmlfileurl = newasp.channelpath & rs("htmlfiledir") & newasp.showdatepath(rs("htmlfiledate"), newasp.channelhtmlpath) & htmlfilename else htmlfileurl = newasp.channelpath & "show.asp?id=" & rs("flashid") end if if cint(newindow) <> 0 then linktarget = " target=""_blank""" else linktarget = "" end if strcontent = strcontent & newasp.mainsetting(21) strcontent = replace(strcontent, "{$miniature}", "<a href='" & htmlfileurl & "' title='" & rs("title") & "'" & linktarget & ">" & miniature & "</a>") if cint(showtopic) = 1 then strcontent = replace(strcontent, "{$flashtopic}", "<a href='" & htmlfileurl & "' title='" & rs("title") & "'" & linktarget & ">" & strtitle & "</a>") else strcontent = replace(strcontent, "{$flashtopic}", vbnullstring) end if strcontent = strcontent & "</td>" & vbcrlf rs.movenext end if next strcontent = strcontent & "</tr>" & vbcrlf loop strcontent = strcontent & "</table>" & vbcrlf end if rs.close: set rs = nothing loadflashpic = strcontent end function '================================================ '函数名:readflashpic '作 用:读取动画图片列表 '参 数:str ----原字符串 '================================================ public function readflashpic(byval str) dim strtemp, i dim stempcontent, ntempcontent, arraylist dim arrtempcontent, arrtempcontents on error resume next strtemp = str if instr(strtemp, "{$readflashpic(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$readflashpic(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$readflashpic(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(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 end if readflashpic = strtemp end function '================================================ '函数名:loadfriendlink '作 用:装载友情连接 '参 数:str ----原字符串 '================================================ public function loadfriendlink(byval topnum, byval perrownum, byval islogo, byval orders) dim rs, sql, i, strcontent dim strorder, linkaddress
strcontent = "" if not isnumeric(topnum) then exit function if not isnumeric(perrownum) then exit function if not isnumeric(islogo) then exit function if not isnumeric(orders) then exit function on error resume next if cint(orders) = 1 then '-- 首页显示按时间升序排列 strorder = "and isindex > 0 order by linktime desc,linkid desc" elseif cint(orders) = 2 then '-- 首页显示按点击数升序排列 strorder = "and isindex > 0 order by linkhist desc,linkid desc" elseif cint(orders) = 3 then '-- 首页显示按点击数降序排列 strorder = "and isindex > 0 order by linkhist desc,linkid asc" elseif cint(orders) = 4 then '-- 所有按升序排列 strorder = "order by linkid desc" elseif cint(orders) = 5 then '-- 所有按降序排列 strorder = "order by linkid asc" elseif cint(orders) = 6 then '-- 所有按点击数升序排列 strorder = "order by linkhist desc,linkid desc" elseif cint(orders) = 7 then '-- 所有按点击数降序排列 strorder = "order by linkhist desc,linkid asc" elseif cint(orders) = 8 then '-- 首页显示按名称排列 strorder = "and isindex > 0 order by linkname desc,linkid desc" elseif cint(orders) = 9 then '-- 所有按名称排列 strorder = "order by linkname desc,linkid desc" else '-- 首页显示按时间降序排列 strorder = "and isindex > 0 order by linktime asc,linkid asc" end if if cint(islogo) = 1 or cint(islogo) = 3 then sql = "select top " & cint(topnum) & " linkid,linkname,linkurl,logourl,readme,linkhist,islogo from [nc_link] where islock = 0 and islogo > 0 " & strorder & "" else sql = "select top " & cint(topnum) & " linkid,linkname,linkurl,logourl,readme,linkhist,islogo from [nc_link] where islock = 0 and islogo = 0 " & strorder & "" end if set rs = newasp.execute(sql) if not (rs.bof and rs.eof) then strcontent = "<table width=""100%"" border=0 cellpadding=1 cellspacing=3 class=friendlink1>" & vbcrlf do while not rs.eof strcontent = strcontent & "<tr>" & vbcrlf for i = 1 to cint(perrownum) strcontent = strcontent & "<td align=center class=friendlink2>" if not rs.eof then if cint(islogo) < 2 then linkaddress = newasp.installdir & "link/link.asp?id=" & rs("linkid") & "&url=" & trim(rs("linkurl")) else linkaddress = trim(rs("linkurl")) end if if rs("islogo") = 1 or cint(islogo) = 3 then strcontent = strcontent & "<a href='" & linkaddress & "' target=_blank title='主页名称:" & rs("linkname") & "
点击次数:" & rs("linkhist") & "'><img src='" & newasp.readfileurl(rs("logourl")) & "' width=88 height=31 border=0></a>" else strcontent = strcontent & "<a href='" & linkaddress & "' target=_blank title='主页名称:" & rs("linkname") & "
点击次数:" & rs("linkhist") & "'>" & rs("linkname") & "</a>" end if strcontent = strcontent & "</td>" & vbcrlf rs.movenext else if cint(islogo) = 1 or cint(islogo) = 3 then strcontent = strcontent & "<a href='" & newasp.installdir & "link/addlink.asp' target=_blank><img src='" & newasp.installdir & "images/link.gif' width=88 height=31 border=0></a>" else strcontent = strcontent & "<a href='" & newasp.installdir & "link/' target=_blank>更多连接</a>" end if strcontent = strcontent & "</td>" & vbcrlf end if next strcontent = strcontent & "</tr>" & vbcrlf loop strcontent = strcontent & "</table>" & vbcrlf end if loadfriendlink = strcontent end function '================================================ '函数名:readfriendlink '作 用:读取友情连接 '参 数:str ----原字符串 '================================================ public function readfriendlink(byval str) dim strtemp, i dim stempcontent, ntempcontent, arraylist dim arrtempcontent, arrtempcontents on error resume next strtemp = str if instr(strtemp, "{$readfriendlink(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$readfriendlink(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$readfriendlink(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(arrtempcontents) arraylist = split(arrtempcontent(i), ",") strtemp = replace(strtemp, arrtempcontents(i), loadfriendlink(arraylist(0), arraylist(1), arraylist(2), arraylist(3))) next end if readfriendlink = strtemp end function '================================================ '函数名:pageruntime '作 用:页面执行时间 '================================================ public function executiontime() dim endtime executiontime = "" if cint(newasp.isruntime) = 1 then endtime = timer() executiontime = "页面执行时间:" & formatnumber((((endtime - startime) * 5000) + 0.5) / 10, 3, -1) & "毫秒" else executiontime = "" end if end function
'================================================ '函数名:currentstation '作 用:当前位置 '参 数:... '================================================ public function currentstation(byval channelid, byval classid, byval classname, _ byval parentid, byval strparent, byval htmlfiledir, byval compart)
dim rscurrent, sql, strcontent, channeldir
currentstation = "" channelid = newasp.chknumeric(channelid) classid = newasp.chknumeric(classid) parentid = newasp.chknumeric(parentid)
on error resume next newasp.loadchannel(channelid)
channeldir = newasp.channelpath
strcontent = "<a href='" & channeldir & "'>" & newasp.channelname & "</a>" & compart & "" if parentid <> 0 and len(strparent) <> 0 then sql = "select classid,classname,htmlfiledir,usehtml from [nc_classify] where channelid = " & channelid & " and classid in(" & strparent & ")" set rscurrent = newasp.execute(sql) if not (rscurrent.eof and rscurrent.bof) then do while not rscurrent.eof
if cint(newasp.iscreatehtml) <> 0 then strcontent = strcontent & "<a href='" & channeldir & rscurrent("htmlfiledir") & "'>" & rscurrent("classname") & "</a>" & compart & "" else strcontent = strcontent & "<a href='" & channeldir & "list.asp?classid=" & rscurrent("classid") & "'>" & rscurrent("classname") & "</a>" & compart & "" end if rscurrent.movenext loop end if rscurrent.close set rscurrent = nothing end if if cint(newasp.iscreatehtml) <> 0 then strcontent = strcontent & "<a href='" & channeldir & htmlfiledir & "'>" & classname & "</a>" else strcontent = strcontent & "<a href='" & channeldir & "list.asp?classid=" & classid & "'>" & classname & "</a>" end if currentstation = strcontent end function '================================================ '函数名:readcurrentstation '作 用:读取当前位置 '参 数:str ----原字符串 '================================================ public function readcurrentstation(byval str, byval channelid, byval classid, _ byval classname, byval parentid, byval strparent, byval htmlfiledir)
dim strtemp, i dim stempcontent, ntempcontent dim arrtempcontent, arrtempcontents on error resume next strtemp = str if instr(strtemp, "{$currentstation(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$currentstation(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$currentstation(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(arrtempcontents) strtemp = replace(strtemp, arrtempcontents(i), currentstation(channelid, classid, classname, parentid, strparent, htmlfiledir, arrtempcontent(i))) next end if readcurrentstation = strtemp end function '================================================ '函数名:newspictureandtext '作 用:图文混排列表 '================================================ public function newspictureandtext(byval chanid, byval classid, byval specid, _ byval stype, byval height, byval width, byval maxlen, _ byval maxline, byval hspace, byval vspace, byval align, _ byval divcss, byval target, byval start, byval showpic, _ byval showclass, byval showdate, byval dateformat)
dim rs, sql, i, strcontent, foundstr dim childstr, htmlfileurl, htmlfilename, strpicture dim pictopic, newstitle, classname, articletitle, writetime
chanid = newasp.chknumeric(chanid) classid = newasp.chknumeric(classid) specid = newasp.chknumeric(specid) stype = newasp.chknumeric(stype)
on error resume next newasp.loadchannel(chanid)
if cint(stype) >= 3 and clng(classid) <> 0 then sql = "select childstr from [nc_classify] where channelid = " & chanid & " and classid = " & classid set rs = newasp.execute(sql) if rs.bof and rs.eof then set rs = nothing newspictureandtext = "" exit function else childstr = rs("childstr") end if rs.close else childstr = "0" end if select case cint(stype) case 0: foundstr = "order by a.writetime desc ,a.articleid desc" case 1: foundstr = "and a.isbest > 0 order by a.writetime desc ,a.articleid desc" case 2: foundstr = " order by a.allhits desc ,a.articleid desc" case 3: foundstr = "and a.classid in (" & childstr & ") order by a.writetime desc ,a.articleid desc" case 4: foundstr = "and a.classid in (" & childstr & ") and a.isbest > 0 order by a.writetime desc ,a.articleid desc" case 5: foundstr = "and a.classid in (" & childstr & ") and a.allhits > b.leasthothist order by a.allhits desc ,a.articleid desc" case 6: foundstr = "and a.classid in (" & childstr & ") order by a.writetime desc ,a.articleid desc" case else foundstr = "order by a.writetime desc ,a.articleid desc" end select if cint(stype) >= 3 and clng(classid) = 0 then foundstr = "order by a.writetime desc ,a.articleid desc" end if if clng(specid) <> 0 then foundstr = "and a.specialid =" & clng(specid) & " " & foundstr end if sql = " a.articleid,a.classid,a.colormode,a.fontmode,a.title,a.brieftopic,a.allhits,a.writetime,a.htmlfiledate,a.isbest," sql = "select top " & cint(maxline) & sql & " c.classname,c.colormodes,c.fontmodes,c.htmlfiledir from [nc_article] a inner join [nc_classify] c on a.classid=c.classid where a.isaccept>0 and a.channelid=" & chanid & " " & foundstr & "" set rs = newasp.execute(sql) i = 0 strcontent = "" if rs.bof and rs.eof then strcontent = "还没有添加任何内容!" else do while not rs.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, "") if cint(newasp.channelusehtml) <> 0 then htmlfileurl = newasp.channelpath & rs("htmlfiledir") & newasp.showdatepath(rs("htmlfiledate"), newasp.channelhtmlpath) & htmlfilename classname = "[<a href='" & newasp.channelpath & rs("htmlfiledir") & "index" & newasp.channelhtmlext & "'>" & classname & "</a>]" else htmlfileurl = newasp.channelpath & "show.asp?id=" & rs("articleid") classname = "[<a href='" & newasp.channelpath & "list.asp?classid=" & rs("classid") & "'>" & classname & "</a>]" end if if cint(showclass) = 1 then classname = classname else classname = "" end if if cint(showdate) = 1 then writetime = newasp.showdatetime(rs("writetime"), cint(dateformat)) else writetime = "" end if articletitle = "<div " & divcss & ">" & start & classname & " <a href=""" & 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 end if rs.close: set rs = nothing dim sextname, extname, imageurl if cint(showpic) = 1 then 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.leasthothist from ([nc_article] a inner join [nc_classify] c on a.classid=c.classid) inner join [nc_channel] b on a.channelid=b.channelid where a.isaccept>0 and a.channelid=" & cint(chanid) & " and a.imageurl<>'' " & foundstr & "" set rs = newasp.execute(sql) if rs.bof and rs.eof then strpicture = "<img src='" & 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, "") if cint(newasp.channelusehtml) <> 0 then htmlfileurl = newasp.channelpath & rs("htmlfiledir") & newasp.showdatepath(rs("htmlfiledate"), newasp.channelhtmlpath) & htmlfilename else htmlfileurl = newasp.channelpath & "show.asp?id=" & rs("articleid") end if imageurl = newasp.getimageurl(rs("imageurl"), newasp.channeldata(1)) sextname = split(rs("imageurl"), ".") extname = sextname(ubound(sextname)) select case lcase(extname) case "swf", "swi" strpicture = "<object classid=""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 & " <param name=""movie"" value=""" & imageurl & """>" & vbnewline strpicture = strpicture & " <param name=""quality"" value=""high"">" & vbnewline strpicture = strpicture & " <embed src=""" & 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 case else strpicture = "<a href=""" & htmlfileurl & """ target=""" & target & """ title=""" & newasp.channelmodule & "标题:" & rs("title") & "
发布时间:" & rs("writetime") & "
阅览次数:" & rs("allhits") & """><img src=""" & imageurl & """ width=""" & width & """ height=""" & height & """ hspace=""" & hspace & """ vspace=""" & vspace & """ align=""" & align & """ border=""0""></a>" end select end if rs.close: set rs = nothing else strpicture = "" end if newspictureandtext = strpicture & strcontent end function '================================================ '函数名:readnewspicandtext '作 用:读取图文混排列表 '参 数:str ----原字符串 '================================================ public function readnewspicandtext(byval str) dim strtemp, i, stempcontent dim ntempcontent, arraylist dim arrtempcontent, arrtempcontents on error resume next strtemp = str if instr(strtemp, "{$newspictureandtext(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$newspictureandtext(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$newspictureandtext(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(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 end if readnewspicandtext = strtemp end function '================================================ '函数名:softpictureandtext '作 用:软件图文混排列表 '================================================ public function softpictureandtext(byval chanid, byval classid, byval specid, _ byval stype, byval height, byval width, byval maxlen, _ byval maxline, byval hspace, byval vspace, byval align, _ byval divcss, byval target, byval start, byval showpic, _ byval showclass, byval showdate, byval dateformat)
dim rs, sql, i, strcontent, foundstr dim childstr, htmlfileurl, htmlfilename, strpicture dim softtopic, classname, softname, softtime
chanid = newasp.chknumeric(chanid) classid = newasp.chknumeric(classid) specid = newasp.chknumeric(specid) stype = newasp.chknumeric(stype)
on error resume next newasp.loadchannel(chanid)
if cint(stype) >= 3 and clng(classid) <> 0 then sql = "select childstr from [nc_classify] where channelid = " & chanid & " and classid = " & classid set rs = newasp.execute(sql) if rs.bof and rs.eof then set rs = nothing softpictureandtext = "" exit function else childstr = rs("childstr") end if rs.close else childstr = "0" end if select case cint(stype) case 0: foundstr = "order by a.softtime desc ,a.softid desc" case 1: foundstr = "and a.isbest > 0 order by a.softtime desc ,a.softid desc" case 2: foundstr = "order by a.allhits desc ,a.softid desc" case 3: foundstr = "and a.classid in (" & childstr & ") order by a.softtime desc ,a.softid desc" case 4: foundstr = "and a.classid in (" & childstr & ") and a.isbest > 0 order by a.softtime desc ,a.softid desc" case 5: foundstr = "and a.classid in (" & childstr & ") order by a.allhits desc ,a.softid desc" case else foundstr = "order by a.softtime desc ,a.softid desc" end select if cint(stype) >= 3 and clng(classid) = 0 then foundstr = "order by a.softtime desc ,a.softid desc" end if if clng(specid) > 0 then foundstr = "and a.specialid =" & clng(specid) & " " & foundstr end if sql = " a.softid,a.classid,a.colormode,a.fontmode,a.softname,a.softver,a.allhits,a.softtime,a.htmlfiledate,a.isbest," sql = "select top " & cint(maxline) & sql & " c.classname,c.colormodes,c.fontmodes,c.htmlfiledir from [nc_softlist] a inner join [nc_classify] c on a.classid=c.classid where a.isaccept>0 and a.channelid=" & chanid & " " & foundstr & "" set rs = newasp.execute(sql) i = 0 strcontent = "" if rs.bof and rs.eof then strcontent = "还没有添加任何软件!" else do while not rs.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, "") if cint(newasp.channelusehtml) > 0 then htmlfileurl = newasp.channelpath & rs("htmlfiledir") & newasp.showdatepath(rs("htmlfiledate"), newasp.channelhtmlpath) & htmlfilename classname = "[<a href='" & newasp.channelpath & rs("htmlfiledir") & "index" & newasp.channelhtmlext & "'>" & classname & "</a>]" else htmlfileurl = newasp.channelpath & "show.asp?id=" & rs("softid") classname = "[<a href='" & newasp.channelpath & "list.asp?classid=" & rs("classid") & "'>" & classname & "</a>]" end if if cint(showclass) = 1 then classname = classname else classname = "" end if if cint(showdate) = 1 then softtime = newasp.showdatetime(rs("softtime"), cint(dateformat)) else softtime = "" end if softname = "<div " & divcss & ">" & start & classname & " <a href=""" & 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 end if rs.close: set rs = nothing dim sextname, extname, softimage if cint(showpic) = 1 then 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.leasthothist from ([nc_softlist] a inner join [nc_classify] c on a.classid=c.classid) inner join [nc_channel] b on a.channelid=b.channelid where a.isaccept>0 and a.channelid=" & cint(chanid) & " and a.softimage<>'' " & foundstr & "" set rs = newasp.execute(sql) if rs.bof and rs.eof then strpicture = "<img src='" & 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, "") if cint(newasp.channelusehtml) <> 0 then htmlfileurl = newasp.channelpath & rs("htmlfiledir") & newasp.showdatepath(rs("htmlfiledate"), newasp.channelhtmlpath) & htmlfilename else htmlfileurl = newasp.channelpath & "show.asp?id=" & rs("softid") end if softimage = newasp.getimageurl(rs("softimage"), newasp.channeldata(1)) sextname = split(rs("softimage"), ".") extname = sextname(ubound(sextname)) select case lcase(extname) case "swf", "swi" strpicture = "<object classid=""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 & " <param name=""movie"" value=""" & softimage & """>" & vbnewline strpicture = strpicture & " <param name=""quality"" value=""high"">" & vbnewline strpicture = strpicture & " <embed src=""" & 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 case else strpicture = "<a href=""" & htmlfileurl & """ target=""" & target & """ title=""" & newasp.channelmodule & "标题:" & rs("softname") & " " & rs("softver") & "
发布时间:" & rs("softtime") & "
阅览次数:" & rs("allhits") & """><img src=""" & softimage & """ width=""" & width & """ height=""" & height & """ hspace=""" & hspace & """ vspace=""" & vspace & """ align=""" & align & """ border=""0""></a>" end select end if rs.close: set rs = nothing else strpicture = "" end if softpictureandtext = strpicture & strcontent end function '================================================ '函数名:readsoftpicandtext '作 用:读取软件图文混排列表 '参 数:str ----原字符串 '================================================ public function readsoftpicandtext(byval str) on error resume next dim strtemp, i, stempcontent dim ntempcontent, arraylist dim arrtempcontent, arrtempcontents
strtemp = str if instr(strtemp, "{$softpictureandtext(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$softpictureandtext(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$softpictureandtext(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(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 end if readsoftpicandtext = strtemp end function '================================================ '函数名:loadguestlist '作 用:装载留言列表 '参 数:maxnum ----最多留言数 ' maxlen ----字符长度 ' newindow ----是否新窗口打开 1=是,0=否 ' showdate ----是否显示时间 1=是,0=否 ' datemode ----时间模式 ' styles ----风格名称 '================================================ public function loadguestlist(byval maxnum, byval maxlen, byval newindow, _ byval showdate, byval datemode, byval styles)
dim rs, sql, strcontent dim i, liststyle, guesttopic, linktarget dim writetime, lastime, guesttitle,strchanneldir
on error resume next set rs = newasp.execute("select top " & cint(maxnum) & " guestid,topicformat,title,username,writetime,lastime,replynum from nc_guestbook where isaccept>0 order by istop desc,lastime desc,guestid desc") if rs.bof and rs.eof then loadguestlist = "没有任何留言!" set rs = nothing exit function else i = 0 strcontent = "<table width=""100%"" border=0 cellpadding=2 cellspacing=0>" strchanneldir = newasp.getchanneldir(4) do while not rs.eof if (i mod 2) = 0 then liststyle = trim(styles) & 1 else liststyle = trim(styles) & 2 end if if cint(newindow) <> 0 then linktarget = " target=""_blank""" else linktarget = "" end if if cint(showdate) <> 0 then writetime = newasp.showdatetime(rs("writetime"), cint(datemode)) lastime = newasp.showdatetime(rs("lastime"), cint(datemode)) else writetime = "" lastime = "" end if guesttitle = newasp.htmlencode(rs("title")) guesttopic = "<span " & rs("topicformat") & ">" & newasp.gottopic(guesttitle, cint(maxlen)) & "</span>" guesttopic = "<a href=""" & 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>" end if loadguestlist = strcontent end function '================================================ '函数名:readguestlist '作 用:读取留言列表 '参 数:str ----原字符串 '================================================ public function readguestlist(byval str) dim strtemp, i, stempcontent dim ntempcontent, arraylist dim arrtempcontent, arrtempcontents
strtemp = str if instr(strtemp, "{$readguestlist(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$readguestlist(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$readguestlist(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(arrtempcontents) arraylist = split(arrtempcontent(i), ",") strtemp = replace(strtemp, arrtempcontents(i), loadguestlist(arraylist(0), arraylist(1), arraylist(2), arraylist(3), arraylist(4), arraylist(5))) next end if readguestlist = strtemp end function '================================================ '函数名:loadpopularsoft '作 用:装载排行软件列表 '参 数:classid ----分类id ' chanid ----频道id ' stype ----调用类型 ' maxline ----显示列表数 ' maxlen ----显示标题长度 ' showhits ----是否显示下载数 ' target ----连接目标 ' start ----标题头标记 ' styles ----样式名称 '================================================ public function loadpopularsoft(byval chanid, byval classid, byval stype, _ byval maxlen, byval maxline, byval showhits, _ byval target, byval start, byval styles)
dim sql, rs, foundsql, strhits dim childstr, i, strcontent dim htmlfilename, htmlfileurl dim newstitle, allhits, strsoftname dim divstyle
chanid = newasp.chknumeric(chanid) classid = newasp.chknumeric(classid) stype = newasp.chknumeric(stype) if chanid = 0 then chanid = 1
on error resume next newasp.loadchannel(chanid)
if clng(classid) > 0 and trim(classid) <> "" then sql = "select childstr from [nc_classify] where channelid=" & chanid & " and classid=" & classid set rs = newasp.execute(sql) if rs.bof and rs.eof then set rs = nothing loadpopularsoft = "" exit function else childstr = rs("childstr") foundsql = "and a.classid in (" & childstr & ")" end if rs.close else childstr = "0" foundsql = "" end if
select case cint(stype) case 1 foundsql = foundsql & " order by a.dayhits desc ,a.softid desc" strhits = "dayhits" case 2 foundsql = foundsql & " order by a.weekhits desc ,a.softid desc" strhits = "weekhits" case 3 foundsql = foundsql & " order by a.monthhits desc ,a.softid desc" strhits = "monthhits" case 4 foundsql = foundsql & " and a.isbest>0 order by a.allhits desc ,a.softid desc" strhits = "allhits" case else foundsql = foundsql & "order by a.allhits desc ,a.softid desc" strhits = "allhits" end select 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 = "select top " & cint(maxline) & sql & " c.classname,c.colormodes,c.fontmodes,c.htmlfiledir from [nc_softlist] a inner join [nc_classify] c on a.classid=c.classid where a.isaccept>0 and a.channelid=" & chanid & " " & foundsql set rs = newasp.execute(sql) i = 0 strcontent = "" if rs.bof and rs.eof then strcontent = "还没有找到任何内容!" else do while not rs.eof if trim(styles) <> "" and trim(styles) <> "0" then if (i mod 2) = 0 then divstyle = " class=""" & trim(styles) & "1""" else divstyle = " class=""" & trim(styles) & "2""" end if end if
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, "") if cint(newasp.channelusehtml) > 0 then htmlfileurl = newasp.channelpath & rs("htmlfiledir") & newasp.showdatepath(rs("htmlfiledate"), newasp.channelhtmlpath) & htmlfilename else htmlfileurl = newasp.channelpath & "show.asp?id=" & rs("softid") end if if cint(showhits) > 0 then allhits = rs(strhits) else allhits = "" end if strsoftname = "<div" & divstyle & ">" & start & " <a href=""" & 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 end if rs.close: set rs = nothing loadpopularsoft = strcontent end function '================================================ '函数名:readpopularsoft '作 用:读取软件排行列表 '参 数:str ----原字符串 '================================================ public function readpopularsoft(byval str) on error resume next dim strtemp, i, stempcontent dim ntempcontent, arraylist dim arrtempcontent, arrtempcontents
strtemp = str if instr(strtemp, "{$readpopularsoft(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$readpopularsoft(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$readpopularsoft(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(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 end if readpopularsoft = strtemp end function '================================================ '函数名:loadpopulararticle '作 用:装载排行文章列表 '参 数:classid ----分类id ' chanid ----频道id ' stype ----调用类型 ' maxline ----显示列表数 ' maxlen ----显示标题长度 ' showhits ----是否显示下载数 ' target ----连接目标 ' start ----标题头标记 ' styles ----样式名称 '================================================ public function loadpopulararticle(byval chanid, byval classid, byval stype, _ byval maxlen, byval maxline, byval showhits, byval target, _ byval start, byval styles)
dim sql, rs, foundsql, strhits dim childstr, i, strcontent dim htmlfilename, htmlfileurl dim newstitle, allhits, articletitle dim divstyle
chanid = newasp.chknumeric(chanid) classid = newasp.chknumeric(classid) stype = newasp.chknumeric(stype)
if chanid = 0 then chanid = 2
on error resume next newasp.loadchannel(chanid)
if clng(classid) > 0 and trim(classid) <> "" then sql = "select childstr from [nc_classify] where channelid=" & chanid & " and classid=" & clng(classid) set rs = newasp.execute(sql) if rs.bof and rs.eof then set rs = nothing loadpopulararticle = "" exit function else childstr = rs("childstr") foundsql = "and a.classid in (" & childstr & ")" end if rs.close else childstr = "0" foundsql = "" end if select case cint(stype) case 1 foundsql = foundsql & " order by a.dayhits desc ,a.articleid desc" strhits = "dayhits" case 2 foundsql = foundsql & " order by a.weekhits desc ,a.articleid desc" strhits = "weekhits" case 3 foundsql = foundsql & " order by a.monthhits desc ,a.articleid desc" strhits = "monthhits" case 4 foundsql = foundsql & " and a.isbest>0 order by a.allhits desc ,a.articleid desc" strhits = "allhits" case else foundsql = foundsql & "order by a.allhits desc ,a.articleid desc" strhits = "allhits" end select 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 = "select top " & cint(maxline) & sql & " c.classname,c.colormodes,c.fontmodes,c.htmlfiledir from [nc_article] a inner join [nc_classify] c on a.classid=c.classid where a.isaccept>0 and a.channelid=" & chanid & " " & foundsql set rs = newasp.execute(sql) i = 0 strcontent = "" if rs.bof and rs.eof then strcontent = "还没有找到任何软件!" else do while not rs.eof if trim(styles) <> "" and trim(styles) <> "0" then if (i mod 2) = 0 then divstyle = " class=""" & trim(styles) & "1""" else divstyle = " class=""" & trim(styles) & "2""" end if end if 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, "") if cint(newasp.channelusehtml) > 0 then htmlfileurl = newasp.channelpath & rs("htmlfiledir") & newasp.showdatepath(rs("htmlfiledate"), newasp.channelhtmlpath) & htmlfilename else htmlfileurl = newasp.channelpath & "show.asp?id=" & rs("articleid") end if if cint(showhits) > 0 then allhits = rs(strhits) else allhits = "" end if articletitle = "<div" & divstyle & ">" & start & " <a href=""" & 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 end if rs.close: set rs = nothing loadpopulararticle = strcontent end function '================================================ '函数名:readpopularsoft '作 用:读取软件排行列表 '参 数:str ----原字符串 '================================================ public function readpopulararticle(byval str) on error resume next dim strtemp, i, stempcontent dim ntempcontent, arraylist dim arrtempcontent, arrtempcontents
strtemp = str if instr(strtemp, "{$readpopulararticle(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$readpopulararticle(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$readpopulararticle(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(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 end if readpopulararticle = strtemp end function '================================================ '函数名:loadpopularflash '作 用:装载排行动画列表 '参 数:classid ----分类id ' chanid ----频道id ' stype ----调用类型 ' maxline ----显示列表数 ' maxlen ----显示标题长度 ' showhits ----是否显示下载数 ' target ----连接目标 ' start ----标题头标记 ' styles ----样式名称 '================================================ public function loadpopularflash(byval chanid, byval classid, byval stype, _ byval maxlen, byval maxline, byval showhits, _ byval target, byval start, byval styles)
dim sql, rs, foundsql, strhits dim childstr, i, strcontent dim htmlfilename, htmlfileurl dim newstitle, allhits, strtitle dim divstyle
chanid = newasp.chknumeric(chanid) classid = newasp.chknumeric(classid) stype = newasp.chknumeric(stype) if chanid = 0 then chanid = 1
on error resume next newasp.loadchannel(chanid)
if clng(classid) > 0 and trim(classid) <> "" then sql = "select childstr from [nc_classify] where channelid=" & chanid & " and classid=" & classid set rs = newasp.execute(sql) if rs.bof and rs.eof then set rs = nothing loadpopularflash = "" exit function else childstr = rs("childstr") foundsql = "and a.classid in (" & childstr & ")" end if rs.close else childstr = "0" foundsql = "" end if
select case cint(stype) case 1 foundsql = foundsql & " order by a.dayhits desc ,a.flashid desc" strhits = "dayhits" case 2 foundsql = foundsql & " order by a.weekhits desc ,a.flashid desc" strhits = "weekhits" case 3 foundsql = foundsql & " order by a.monthhits desc ,a.flashid desc" strhits = "monthhits" case 4 foundsql = foundsql & " and a.isbest>0 order by a.allhits desc ,a.flashid desc" strhits = "allhits" case else foundsql = foundsql & "order by a.allhits desc ,a.flashid desc" strhits = "allhits" end select 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 = "select top " & cint(maxline) & sql & " c.classname,c.colormodes,c.fontmodes,c.htmlfiledir from [nc_flashlist] a inner join [nc_classify] c on a.classid=c.classid where a.isaccept>0 and a.channelid=" & chanid & " " & foundsql set rs = newasp.execute(sql) i = 0 strcontent = "" if rs.bof and rs.eof then strcontent = "还没有找到任何内容!" else do while not rs.eof if trim(styles) <> "" and trim(styles) <> "0" then if (i mod 2) = 0 then divstyle = " class=""" & trim(styles) & "1""" else divstyle = " class=""" & trim(styles) & "2""" end if end if
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, "") if cint(newasp.channelusehtml) > 0 then htmlfileurl = newasp.channelpath & rs("htmlfiledir") & newasp.showdatepath(rs("htmlfiledate"), newasp.channelhtmlpath) & htmlfilename else htmlfileurl = newasp.channelpath & "show.asp?id=" & rs("flashid") end if if cint(showhits) > 0 then allhits = rs(strhits) else allhits = "" end if strtitle = "<div" & divstyle & ">" & start & " <a href=""" & 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 end if rs.close: set rs = nothing loadpopularflash = strcontent end function '================================================ '函数名:readpopularflash '作 用:读取动画排行列表 '参 数:str ----原字符串 '================================================ public function readpopularflash(byval str) on error resume next dim strtemp, i, stempcontent dim ntempcontent, arraylist dim arrtempcontent, arrtempcontents
strtemp = str if instr(strtemp, "{$readpopularflash(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$readpopularflash(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$readpopularflash(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(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 end if readpopularflash = strtemp end function '================================================ '函数名:loadsofttype '作 用:装载软件类型列表 '参 数:chanid ----频道id ' softtype ----软件类型 ' maxline ----显示列表数 ' maxlen ----显示标题长度 ' showclass ----是否显示分类 ' showdate ----是否显示日期 ' datemode ----显示日期模式 ' newindow ----是否新窗口打开连接 ' styles ----样式名称 '================================================ public function loadsofttype(byval chanid, byval softtype, byval maxlen, _ byval maxline, byval showclass, byval showdate, _ byval datemode, byval newindow, byval styles)
dim sql, rs, foundsql, strcontent, i dim strsoftname, childstr, liststyle, htmlfilename, bestcode, beststring dim classname, htmlfileurl, softtime, linktarget, softtopic
softtype = newasp.checkstr(softtype) chanid = newasp.chknumeric(chanid) maxline = newasp.chknumeric(maxline) if chanid = 0 then chanid = 2 if maxline = 0 then maxline = 10
on error resume next newasp.loadchannel(chanid)
if trim(softtype) <> "" then foundsql = "and a.softtype='" & softtype & "' order by a.softtime desc ,a.softid desc" else foundsql = "order by a.softtime desc ,a.softid desc" end if
sql = " a.softid,a.classid,a.colormode,a.fontmode,a.softname,a.softver,a.softtype,a.allhits,a.softtime,a.htmlfiledate,a.isbest," sql = "select top " & maxline & sql & " c.classname,c.colormodes,c.fontmodes,c.htmlfiledir,c.usehtml from [nc_softlist] a inner join [nc_classify] c on a.classid=c.classid where a.isaccept>0 and a.channelid=" & chanid & " " & foundsql set rs = newasp.execute(sql) i = 0 strcontent = "" if rs.bof and rs.eof then strcontent = "还没有找到任何软件!" else strcontent = "<table width=""100%"" border=0 cellpadding=2 cellspacing=0>" do while not rs.eof if (i mod 2) = 0 then liststyle = trim(styles) & 1 else liststyle = trim(styles) & 2 end if if rs("isbest") <> 0 then bestcode = 2 beststring = "<font color='" & newasp.mainsetting(3) & "'>推荐</font>" else bestcode = 1 beststring = "" end if 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, "") if cint(newasp.channelusehtml) <> 0 then htmlfileurl = newasp.channelpath & rs("htmlfiledir") & newasp.showdatepath(rs("htmlfiledate"), newasp.channelhtmlpath) & htmlfilename classname = "<a href='" & newasp.channelpath & rs("htmlfiledir") & "index" & newasp.channelhtmlext & "'>" & classname & "</a>" else htmlfileurl = newasp.channelpath & "show.asp?id=" & rs("softid") classname = "<a href='" & newasp.channelpath & "list.asp?classid=" & rs("classid") & "'>" & classname & "</a>" end if if cint(showclass) = 0 then classname = "" if cint(showdate) <> 0 then softtime = newasp.showdatetime(rs("softtime"), cint(datemode)) else softtime = "" end if if cint(newindow) <> 0 then linktarget = " target=""_blank""" else linktarget = "" end if
softtopic = "<a href='" & 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>" end if set rs = nothing loadsofttype = strcontent end function '================================================ '函数名:readsofttype '作 用:读取软件类型列表 '参 数:str ----原字符串 '================================================ public function readsofttype(byval str) on error resume next dim strtemp, i, stempcontent dim ntempcontent, arraylist dim arrtempcontent, arrtempcontents
strtemp = str if instr(strtemp, "{$readsofttype(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$readsofttype(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$readsofttype(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(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 end if readsofttype = strtemp end function '================================================ '函数名:loaduserrank '作 用:装用户排行列表 '================================================ public function loaduserrank(byval stype,byval grade,byval maxline,byval styles) dim sql, rs, foundsql, strcontent, i dim liststyle,username
stype = newasp.checknumeric(stype) grade = newasp.checknumeric(grade) maxline = newasp.checknumeric(maxline) if maxline = 0 then maxline = 10 if stype = 1 then foundsql = "order by jointime desc,userid desc" elseif stype = 2 then foundsql = "order by lasttime desc,userid desc" elseif stype = 3 then foundsql = "order by userpoint desc,userid desc" else foundsql = "order by userlogin desc,userid desc" end if if grade > 0 then sql = "select top " & maxline & " userid,username,userpoint,userlogin from [nc_user] where usergrade=" & grade & " " & foundsql else sql = "select top " & maxline & " userid,username,userpoint,userlogin from [nc_user] " & foundsql end if set rs = newasp.execute(sql) i = 0 strcontent = "" if not (rs.bof and rs.eof) then strcontent = "<table width=""100%"" border=0 cellpadding=2 cellspacing=0>" do while not rs.eof if (i mod 2) = 0 then liststyle = trim(styles) & 1 else liststyle = trim(styles) & 2 end if username = "<a href=""" & 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>" end if rs.close: set rs = nothing
loaduserrank = strcontent end function '================================================ '函数名:readuserrank '作 用:读取用户排行列表 '参 数:str ----原字符串 '================================================ public function readuserrank(byval str) on error resume next dim strtemp, i, stempcontent dim ntempcontent, arraylist dim arrtempcontent, arrtempcontents
strtemp = str if instr(strtemp, "{$readuserrank(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$readuserrank(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$readuserrank(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(arrtempcontents) arraylist = split(arrtempcontent(i), ",") strtemp = replace(strtemp, arrtempcontents(i), loaduserrank(arraylist(0), arraylist(1), arraylist(2), arraylist(3))) next end if readuserrank = strtemp end function '================================================ '函数名:loadstatistic '作 用:装载频道统计 '参 数:moduleid ----所属模块 ' channelid ----频道id ' strclass ----所调用的分类id或者软件类型 ' stype ----统计类型,0=全部统计,1=今日更新统计,2=点击数统计,3=软件容量统计 '================================================ public function loadstatistic(byval moduleid, byval channelid, byval strclass, byval stype)
moduleid = newasp.checknumeric(moduleid) channelid = newasp.checknumeric(channelid) stype = newasp.checknumeric(stype)
dim rs, sql, statcount dim foundsql, classid, childstr
classid = newasp.checknumeric(strclass) on error resume next loadstatistic = 0 if classid > 0 then sql = "select childstr from [nc_classify] where channelid = " & channelid & " and classid=" & classid set rs = newasp.execute(sql) if rs.bof and rs.eof then childstr = 0 else childstr = rs("childstr") end if rs.close: set rs = nothing foundsql = "and channelid=" & channelid & " and classid in (" & childstr & ")" else foundsql = "and channelid=" & channelid end if select case moduleid case 1 if stype = 1 then if issqldatabase = 1 then sql = "select count(articleid) from nc_article where isaccept>0 " & foundsql & " and datediff(d,writetime,getdate())=0" else sql = "select count(articleid) from nc_article where isaccept>0 " & foundsql & " and writetime>=date()" end if elseif stype = 2 then sql = "select sum(allhits) from nc_article where isaccept>0 " & foundsql elseif stype = 4 then sql = "select sum(dayhits) from nc_article where isaccept>0 " & foundsql else sql = "select count(articleid) from nc_article where isaccept>0 " & foundsql end if case 2 if not isnumeric(strclass) then foundsql = foundsql & " and softtype='" & newasp.checkstr(strclass) & "'" end if if stype = 1 then if issqldatabase = 1 then sql = "select count(softid) from nc_softlist where isaccept>0 " & foundsql & " and datediff(d,softtime,getdate())=0" else sql = "select count(softid) from nc_softlist where isaccept>0 " & foundsql & " and softtime>=date()" end if elseif stype = 2 then sql = "select sum(allhits) from nc_softlist where isaccept>0 " & foundsql elseif stype = 3 then sql = "select sum(softsize) from nc_softlist where isaccept>0 " & foundsql elseif stype = 4 then sql = "select sum(dayhits) from nc_softlist where isaccept>0 " & foundsql else sql = "select count(softid) from nc_softlist where isaccept>0 " & foundsql end if case 4 if stype = 1 then if issqldatabase = 1 then sql = "select count(guestid) from nc_guestbook where isaccept>0 and datediff(d,writetime,getdate())=0" else sql = "select count(guestid) from nc_guestbook where isaccept>0 and writetime>=date()" end if else sql = "select count(guestid) from nc_guestbook where isaccept>0" end if case 5 if stype = 1 then if issqldatabase = 1 then sql = "select count(flashid) from nc_flashlist where isaccept>0 " & foundsql & " and datediff(d,addtime,getdate())=0" else sql = "select count(flashid) from nc_flashlist where isaccept>0 " & foundsql & " and addtime>=date()" end if elseif stype = 2 then sql = "select sum(allhits) from nc_flashlist where isaccept>0 " & foundsql elseif stype = 3 then sql = "select sum(filesize) from nc_flashlist where isaccept>0 " & foundsql elseif stype = 4 then sql = "select sum(dayhits) from nc_flashlist where isaccept>0 " & foundsql else sql = "select count(flashid) from nc_flashlist where isaccept>0 " & foundsql end if case else if stype = 1 then if issqldatabase = 1 then sql = "select count(userid) from nc_user where datediff(d,jointime,getdate())=0" else sql = "select count(userid) from nc_user where jointime>=date()" end if else sql = "select count(userid) from nc_user" end if end select set rs = newasp.execute(sql) if rs.bof and rs.eof then statcount = 0 else statcount = ccur(rs(0)) if (moduleid = 2 and stype = 3) or (moduleid = 5 and stype = 3) then statcount = round(statcount / 1024 / 1024, 3) statcount = formatnumber(statcount, 3, -1) end if end if rs.close: set rs = nothing loadstatistic = statcount end function '================================================ '函数名:readstatistic '作 用:读取频道统计 '参 数:str ----原字符串 '================================================ public function readstatistic(byval str) on error resume next dim strtemp, i, stempcontent dim ntempcontent, arraylist dim arrtempcontent, arrtempcontents
strtemp = str on error resume next if instr(strtemp, "{$readstatistic(") > 0 then stempcontent = newasp.cutmatchcontent(strtemp, "{$readstatistic(", ")}", 1) ntempcontent = newasp.cutmatchcontent(strtemp, "{$readstatistic(", ")}", 0) arrtempcontents = split(stempcontent, "|||") arrtempcontent = split(ntempcontent, "|||") for i = 0 to ubound(arrtempcontents) arraylist = split(arrtempcontent(i), ",") strtemp = replace(strtemp, arrtempcontents(i), loadstatistic(arraylist(0), arraylist(1), arraylist(2), arraylist(3))) next end if readstatistic = strtemp end function
public function showindex(byval ishtml) dim htmlcontent newasp.loadtemplates 0, 1, 0 htmlcontent = newasp.htmlcontent htmlcontent = replace(htmlcontent, "{$channelrootdir}", newasp.installdir) htmlcontent = replace(htmlcontent, "{$installdir}", newasp.installdir) if len(newasp.htmlsetting(1)) < 2 then htmlcontent = replace(htmlcontent, "{$pagetitle}", "首页") else htmlcontent = replace(htmlcontent, "{$pagetitle}", newasp.htmlsetting(1)) end if 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) if ishtml then showindex = htmlcontent else response.write htmlcontent end if end function
end class %>
申明:本教程内容由威凡网编辑整理并提供IT程序员分享学习,如文中有侵权行为,请与站长联系(QQ:254677821)!
|