(asp)jtbc1.0调用模块下最新分类文章列表方法
打开commonincfilesmodule.asp
添加函数
//add
Function get_topcid(ByVal strgenre)
Dim trs, tsqlstr
tsqlstr = "select max(sortid) from jtbc_sys_sort where sort_genre='" & strgenre &"' and sort_hidden=0"
Set trs = conn.Execute(tsqlstr)
get_topcid = trs(0)
Set trs = Nothing
End Function
修改函数
Function itransfer(ByVal itype, ByVal itpl, ByVal ivars)
找到
Case "top"
tsqlstr = "select top " & ttopx & " * from " & tdatabase & " where " & tfpre & "hidden=0"
tsqlorder =" order by " & tidfield & " asc"
下面添加
Case "top_cid"
tclass = get_num(get_topcid(tgenre), 0)
tsqlstr = "select top " & ttopx & " * from " & tdatabase & " where " & tfpre & "hidden=0"
tsqlorder =" order by " & tidfield & " desc"
调用实例
{$=itransfer('top_cid', 'anli_img', 'topx=1;tnum=25;rows=2;genre=anli;')}