1cls_public.asp
来自「小游戏网站演示www.4399.io 拥有4万条游戏数据」· ASP 代码 · 共 1,477 行 · 第 1/5 页
ASP
1,477 行
else
foundstr = "order by rnd(a.flashid)"
end if
case else
foundstr = "order by a.addtime desc ,a.flashid desc"
end select
if clng(classid) > 0 then
foundstr = "and a.classid in (" & childstr & ") " & foundstr
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 = "<li>没有添加任何信息!</li>"
else
sql=rs.getrows(-1)
strcontent = ""
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
if showclass > 0 then
classlength = newasp.strlength(sql(10,i))
else
classlength = 0
end if
strcontent = strcontent & newasp.mainsetting(22)
strtitle = newasp.gottopic(sql(4,i), cint(strlen) - classlength)
strtitle = newasp.readfontmode(strtitle, sql(2,i), sql(3,i))
classname = newasp.readfontmode(sql(10,i), sql(11,i), sql(12,i))
if cint(newasp.channelusehtml) <> 0 then
htmlfileurl = newasp.channeldomain & newasp.readdestination(newasp.m_infodestination, newasp.m_channeldir, sql(8,i),sql(13,i),sql(1,i),sql(0,i),1,"")
htmlfilename = newasp.channeldomain & newasp.readdestination(newasp.m_sortdestination, newasp.m_channeldir, sql(8,i),sql(13,i),sql(1,i),sql(0,i),1,"")
classname = "<a href=""" & htmlfilename & """>" & classname & "</a>"
else
if isurlrewrite then
htmlfileurl = newasp.channelpath & sql(0,i) & newasp.channelhtmlext
classname = "<a href=""" & newasp.channelpath & "list_1_" & sql(1,i) & 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
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 & loadremark(sql(4,i)) &">" & strtitle & "</a>"
strcontent = replace(strcontent, "{$flashtopic}", flashtopic)
strcontent = replace(strcontent, "{$flashid}", sql(0,i))
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
strcontent = replace(strcontent, "{$orderid}", j) & vbnewline
next
sql=null
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
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
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, i
dim announcetopic, linktarget
dim posttime, announceurl
channelid = newasp.chknumeric(channelid)
maxnum = newasp.chknumeric(maxnum)
if maxnum = 0 then maxnum = 10
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
i = 0
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
announceurl = newasp.installdir & "announce.asp?announceid=" & rs("announceid")
if newasp.isbinddomain = 1 then announceurl = newasp.siteurl & announceurl
announcetopic = newasp.gottopic(rs("title"), cint(maxlen))
announcetopic = "<a href=""" & announceurl & """ title=""" & rs("title") & """" & linktarget & ">" & announcetopic & "</a>"
if cint(showtree) = 1 then
strcontent = strcontent & newasp.mainsetting(25)
else
strcontent = strcontent & newasp.mainsetting(26)
end if
strcontent = replace(strcontent, "{$posttime}", posttime)
strcontent = replace(strcontent, "{$announcetopic}", announcetopic)
strcontent = replace(strcontent, "{$announceurl}", announceurl)
strcontent = replace(strcontent, "{$announcetitle}", rs("title"))
strcontent = replace(strcontent, "{$announcedate}", formatdatetime(rs("posttime"), 2))
rs.movenext
i = i + 1
strcontent = replace(strcontent, "{$orderid}", i)
loop
end if
loadannouncelist = strcontent
end function
'================================================
'函数名:readannouncelist
'作 用:读取公告列表
'参 数:str ----原字符串
'================================================
public function readannouncelist(byval str)
dim strtemp, i
dim stempcontent, ntempcontent, arraylist
dim arrtempcontent, arrtempcontents
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, slide,strmaxlen,id)
dim rs, sql, i, strcontent, foundstr, n
dim stitle, childstr, imageurl, htmlfilename
dim htmlfileurl, writetime, linktarget,textcontent,m_strid
dim xmldom,xmlnode,node,xslt,xmlstyle,proc
channelid = newasp.chknumeric(channelid)
classid = newasp.chknumeric(classid)
specialid = newasp.chknumeric(specialid)
stype = newasp.chknumeric(stype)
height = newasp.chknumeric(height)
width = newasp.chknumeric(width)
slide = newasp.chknumeric(slide)
strmaxlen = newasp.chknumeric(strmaxlen)
m_strid = replace(replace(trim(id), ";", ","), ";", ",")
newasp.loadchannel(channelid)
if 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,3: foundstr = "order by a.writetime desc ,a.articleid desc"
case 1,4: foundstr = "and a.isbest > 0 order by a.writetime desc ,a.articleid desc"
case 2,5: foundstr = "order by a.allhits desc ,a.articleid desc"
case 9
if issqldatabase = 1 then
foundstr = "order by newid()"
else
foundstr = "order by rnd(a.articleid)"
end if
case else
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?