|
下面的修改比较负责,建议修改之前备份
1、首先打开Index.asp文件:
在约31行处找到“Dim i,j,n,ii”,在后面增加
\'功能介绍:定义 topic_first_pic 所需变量
Dim KN_rs , KN_AnnounceID , KN_F_AnnounceID , KN_F_Filename , KN_F_FileType , KN_F_Viewname , KN_Img_Url
然后找到“Case \"boardid\" : TPL_Echo TopTopic(1,i)”在后面增加:
\'功能介绍:读取固顶帖子中的第一张图片
Case \"topic_first_pic\" \'这里定义了“topic_first_pic”一个系统变量
Set KN_rs=Dvbbs.Execute(\"select AnnounceID,RootID from [Dv_bbs1] where RootID=\"&TopTopic(0,i)&\" and BoardID=\"&TopTopic(1,i)&\" and ParentID=0 order by AnnounceID desc\")
if KN_rs.eof and KN_rs.bof then
KN_Img_Url=\"images/Topic_NoFirstPic.gif\"
else
KN_AnnounceID=KN_rs(\"AnnounceID\")
end if
KN_rs.close
KN_F_AnnounceID=TopTopic(0,i)&\"|\"&KN_AnnounceID
Set KN_rs=Dvbbs.Execute(\"Select top 1 F_ID,F_AnnounceID,F_BoardID,F_Filename,F_FileType,F_Viewname,F_OldName From [Dv_Upfile] where F_AnnounceID=\'\"&KN_F_AnnounceID&\"\' and F_BoardID=\"&TopTopic(1,i)&\" order by F_ID asc\")
if KN_rs.eof and KN_rs.bof then
KN_Img_Url=\"images/Topic_NoFirstPic.gif\"
else
KN_F_Filename=KN_rs(\"F_Filename\")
KN_F_FileType=KN_rs(\"F_FileType\")
KN_F_Viewname=KN_rs(\"F_Viewname\")
end if
KN_rs.close:set KN_rs=nothing
if KN_F_FileType=\"jpg\" or KN_F_FileType=\"jpeg\" or KN_F_FileType=\"tif\" or KN_F_FileType=\"tiff\" or KN_F_FileType=\"png\" or KN_F_FileType=\"bmp\" then
if KN_F_Viewname<>\"\" then
KN_Img_Url=KN_F_Viewname
else
if KN_F_Filename<>\"\" then
KN_Img_Url=KN_F_Filename
else
KN_Img_Url=\"images/Topic_NoFirstPic.gif\"
end if
end if
else
KN_Img_Url=\"images/Topic_NoFirstPic.gif\"
end if
TPL_Echo KN_Img_Url
然后找到“Case \"boardid\" : TPL_Echo Topic(1,i)”,在后面增加:
|
|