📄 news.inc
字号:
<%
Function TableHeader()
' sFileName = "tasktodo.asp"
Response.Write TableTitle("大楼动态新闻", 600, "", "#0040a0")
TableHeader = _
"<table cellspacing=0 cellpadding=0 width=600 align=center class=tablelist style=""table-layout:fixed"">" & _
"<tr>" & _
"<td class=tdHead width=110> " & TableHeaderField(sFileName, "record_time", "记录时间", sFormParams, iSort, iSorted) & "</td>" & _
"<td class=tdHead width=""*""> " & TableHeaderField(sFileName, "subject", "新闻标题", sFormParams, iSort, iSorted) & "</td>" & _
"</tr>"
End Function
Function TableRecords(sSQL, iCols, iRecordsPerPage, iTotalRecords, iCurrentPage, iTotalPages, sFileName, sFormParams, sSortParams)
dim sTemp : sTemp = "" ' 临时字符串变量
dim j ' 临时循环变量
'------------------------------------
' 分页所需的变量定义
'------------------------------------
Dim iCounter : iCounter = 1
Dim iPrevPage, iNextPage
'------------------------------------
' 获取数据库连接
'------------------------------------
dim crs : set crs = New CRecordset
dim rs : set rs = crs.open(dbLocal,sSQL)
dim iSerial, sSubject, sRecordTime
' 如果未到记录尾,将记录定位到你翻到的页面的第一个记录,否则显示空行
if Not rs.EOF then
rs.Move (iCurrentPage - 1) * iRecordsPerPage
end if
while not rs.EOF and iCounter <= iRecordsPerPage
iSerial = crs.GetValue("Serial")
sSubject = crs.GetValue("subject")
sRecordTime = crs.GetValue("record_time")
sRecordTime = FormatDT(sRecordTime, "yyyy-mm-dd hh:mm")
sTemp = sTemp & "<tr>" & _
"<td class=tdlist align=left> " & sRecordTime & " </td>" & _
"<td class=tdlist title='" & sSubject & "' style=""cursor:hand"" onclick=""javascript:location.href='newsdetail.asp?serial=" & iSerial & "';"" nowrap> <img src=""../images/bg/ar-g.gif"" width=8 height=8> " & ToHtml(sSubject) & " </td>" & _
"</tr>"
iCounter = iCounter + 1
rs.movenext
wend
crs.Close()
' 填补空白行
sTemp = sTemp & WhiteRows(iCols, iCounter, iRecordsPerPage)
' 首页、前页、后页、尾页等分页信息
sTemp = sTemp & "<tr><td class=tdlist colspan=" & iCols & " align=right>" & _
Paginate(sFileName, sFormParams, sSortParams, iCurrentPage, iTotalPages) & _
" </td></tr>"
TableRecords = sTemp
End Function
Function TableLink()
dim sTemp : sTemp = ""
'' 只有系统管理员才能编辑大楼动态新闻
if IsNewsAdmin then
sTemp = "<img src=""../images/goto.gif""> <a href=""../news/news_e.asp"">新增大楼动态</a>" & vbLF & _
" " & vbLF
end if
TableLink = _
"<table width=600 cellspacing=0 cellpadding=0 border=0 align=center>" & vbLF & _
"<tr height=10>" & vbLF & _
" <td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & vbLF & _
"</tr>" & vbLF & _
"<tr height=20>" & vbLF & _
" <td width=600> " & vbLF & _
sTemp & vbLF & _
" <img src=""../images/goto.gif""> <a href=""../common/home.asp"">回到首页</a></td>" & vbLF & _
"</tr>" & vbLF & _
"</table>" & vbLF
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -