📄 img.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn_news.asp" -->
<%
dim style
style = request("s")
%>
<%
Dim rs__MMColParam
rs__MMColParam = "0"
If (Request.QueryString("n_tid") <> "") Then
rs__MMColParam = Request.QueryString("n_tid")
End If
%>
<%
Dim rs
Dim rs_numRows
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_conn_news_STRING
if rs__MMColParam = "0" then
rs.Source = "SELECT * FROM t_news WHERE n_index = true and n_check = true ORDER BY n_id DESC"
else
rs.Source = "SELECT * FROM t_news WHERE n_tid = " + Replace(rs__MMColParam, "'", "''") + " and n_check = true and n_index = true ORDER BY n_date DESC"
end if
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()
rs_numRows = 0
%>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
function DoTrimProperly(str, nNamedFormat, properly, pointed, points)
dim strRet
strRet = Server.HTMLEncode(str)
strRet = replace(strRet, vbcrlf,"")
strRet = replace(strRet, vbtab,"")
If (LEN(strRet) > nNamedFormat) Then
strRet = LEFT(strRet, nNamedFormat)
If (properly = 1) Then
Dim TempArray
TempArray = split(strRet, " ")
Dim n
strRet = ""
for n = 0 to Ubound(TempArray) - 1
strRet = strRet & " " & TempArray(n)
next
End If
If (pointed = 1) Then
strRet = strRet & points
End If
End If
DoTrimProperly = strRet
End Function
</SCRIPT>
document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="35%" rowspan="2" align="center"><a href="news/<%=(rs.Fields.Item("n_tid").Value)%>/<%=(rs.Fields.Item("n_fname").Value)%>" target="_blank"><img src="news/upload/<%=(rs.Fields.Item("n_mpic").Value)%>" border="0"></a><% if style=1 then %><br><a href="news/<%=(rs.Fields.Item("n_tid").Value)%>/<%=(rs.Fields.Item("n_fname").Value)%>" target="_blank"><%=DoTrimProperly((rs.Fields.Item("n_title").Value), 20, 0, 1, "...")%></a></td></tr></table><% else %><td width="65%" height="33" > <%=DoTrimProperly((rs.Fields.Item("n_content").Value), 100, 0, 1, "...")%></td></tr><tr><td align="right"><a href="news/<%=(rs.Fields.Item("n_tid").Value)%>/<%=(rs.Fields.Item("n_fname").Value)%>">查看更多...</a> </td></tr></table><% end if %>');
<%
rs.Close()
Set rs = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -