The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
I didn't like the old mod from SnitzBitz, so I redid it to include an admin page, etc. I only have one odd issue that I haven't been able to iron out. If you search for something and there is only 1 match, it says there are none. As soon as there are two or more, it works properly. Anyone want to take a look? This issue is resolved, file on SnitzBitz has been updated.
آخرین ویرایش توسط
نوشته شده در
post your code, sounds like you have an array indexing problem
نوشته شده در
OK, this works.
Code:
<%
'###############################################################################
'##
'## Snitz Forums 2000 v3.4.07
'##
'###############################################################################
'##
'## Copyright © 2000-06 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free. You can redistribute and/or modIfy it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; either version 2 or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in
'## the scripts and in the HTML output. The "powered by" text/logo with a
'## link back to http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful but
'## WITHOUT ANY WARRANTY; without even an implied warranty of MERCHANTABILITY
'## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
'## for more details.
'##
'## You should have received a copy of the GNU General Public License along
'## with this program; If not, write to:
'##
'## Free Software Foundation, Inc.
'## 59 Temple Place, Suite 330
'## Boston, MA 02111-1307
'##
'## Support can be obtained from our support forums at:
'##
'## http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'##
'## manderson@snitz.com
'##
'###############################################################################
'##
'## Referer Log by TechStud, updated by Carefree
'##
'###############################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_func_admin.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp"-->
<!--#INCLUDE FILE="inc_func_secure.asp"-->
<script>
function ChangePage(fnum){
if (fnum == 1) {
document.PageNum1.submit();
} else {
document.PageNum2.submit();
}
}
</script>
<%
If Session(strCookieURL & "Approval") <> "15916941253" Then
ScriptName = split(Request.ServerVariables("SCRIPT_NAME"),"/")
Response.Redirect "admin_login.asp?target=" & ScriptName(ubound(ScriptName))
End If
Response.Write "<table border=""0"" width=""100%"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td width=""33%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
" " & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""admin_home.asp"">Admin Section</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBlank,"","") & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpenTopic,"","") & " Referer Log<br /></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
MyPage = trim(chkString(Request("WhichPage"),"SQLString"))
If ((MyPage = "") or (IsNumeric(MyPage) = FALSE)) Then
MyPage = 1
MyPage = cLng(MyPage)
End If
If trim(chkString(Request("Method"),"SQLString")) <> "" Then
strSort = Request.QueryString("Method")
If left(strSort,5) = "RefIP" Then
strWhere = " WHERE REFIP LIKE '" & trim(chkString(strRefIP, "message")) & "%'"
ElseIf left(strSort,5) = "Refer" Then
strWhere = " WHERE REFERER LIKE '" & trim(chkString(strReferer, "message")) & "%'"
ElseIf left(strSort,5) = "RefRQ" Then
strWhere = " WHERE REQUEST LIKE '" & trim(chkString(strReferer, "message")) & "%'"
ElseIf left(strSort,5) = "RefQY" Then
strWhere = " WHERE QUERY LIKE '" & trim(chkString(strReferer, "message")) & "%'"
ElseIf left(strSort,5) = "RefDT" Then
strWhere = " WHERE DATE_LOGGED LIKE '" & trim(chkString(strReferer, "message")) & "%'"
Else
strWhere = ""
End If
strSort1 = "&Method=" & strSort
strSort2 = "?Method=" & strSort
If strSort > "" Then
strOrder = " ORDER BY " & strSort
Else
strOrder = ""
End If
End If
If Request.Form("Mode") <> "" Then
strMode = Request.Form("Mode")
If strMode <> "Search" Then
strMode = ""
End If
End If
strRefIP = trim(Request.Form("RefIP"))
If strRefIP > "" Then
strRefIP = trim(chkString(strRefIP, "message"))
End If
strReferer = trim(Request.Form("Referer"))
If strReferer > "" Then
strReferer = trim(chkString(strReferer, "message"))
End If
strRequest = trim(Request.Form("RefFQ"))
If strRequest > "" Then
strRequest = trim(chkString(strRequest, "message"))
End If
strQuery = trim(Request.Form("RefQY"))
If strQuery > "" Then
strQuery = trim(chkString(strQuery, "message"))
End If
strDate = trim(Request.Form("RefDT"))
If strDate > "" Then
strDate = trim(chkString(strDate, "message"))
End If
If strMode = "Search" Then
TempSql = ""
TmpSql = ""
strSql = "SELECT REFIP, REFERER, REQUEST, QUERY, AGENT, DATE_LOGGED, LOG_COUNT FROM " & strTablePrefix & "REFERER "
If strRefIP > "" Then
TmpSql = "REFIP LIKE '%" & strRefIP & "%'"
End If
If strReferer > "" Then
TempSql = "lCase(REFERER) LIKE '%" & lCase(strReferer) & "%'"
If TmpSql > "" Then
TmpSql = TmpSql & " AND " & TempSql
Else
TmpSql = TempSql
End If
End If
If strRequest > "" Then
TempSql = "lCase(REQUEST) LIKE '%" & lCase(strRequest) & "%'"
If TmpSql > "" Then
TmpSql = TmpSql & " AND " & TempSql
Else
TmpSql = TempSql
End If
End If
If strQuery > "" Then
TempSql = "lCase(QUERY) LIKE '%" & lCase(strQuery) & "%'"
If TmpSql > "" Then
TmpSql = TmpSql & " AND " & TempSql
Else
TmpSql = TempSql
End If
End If
If strDate > "" Then
TempSql = "DATE_LOGGED LIKE '%" & strDate & "%'"
If TmpSql > "" Then
TmpSql = TmpSql & " AND " & TempSql
Else
TmpSql = TempSql
End If
End If
If TmpSql > "" Then
strWhere = " WHERE " & TmpSql &""
End If
Else
strSql = "SELECT REFIP, REFERER, REQUEST, QUERY, AGENT, DATE_LOGGED, LOG_COUNT FROM " & strTablePrefix & "REFERER"
strWhere = ""
End If
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CacheSize = strPageSize
If strWhere > "" Then strSql = strSql & strWhere
If strOrder > "" Then strSql = strSql & strOrder
rs.Open strSql, My_Conn, adOpenStatic
If not (rs.BOF or rs.EOF) Then
rs.MoveFirst
rs.PageSize = strPageSize
rs.AbsolutePage = MyPage
MaxPages = cLng(rs.PageCount)
arrRefLogData = rs.GetRows(strPageSize)
iRefLogCount = UBound(arrRefLogData, 2)
iRefLogLimit = iRefLogCount +1
rs.Close
Else
iRefLogCount = 0
End If
Set rs = Nothing
If iRefLogCount = 0 Then
Set rsCheck = My_Conn.Execute(strSql)
If not (rsCheck.BOF or rsCheck.EOF) Then
If rsCheck("REFIP") > "" Then
iRefLogCount = 1
iRefLogLimit = 1
End If
rsCheck.Close
End If
Set rsCheck = Nothing
End If
Response.Write "<form action=""admin_refer_log.asp" & strSort2 & """ Method=""post"" name=""RefererLog"">" & vbNewline & _
" <input type=""hidden"" name=""Mode"" value=""Search"">" & vbNewLine & _
" <table border=""0"" width=""50%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewline & _
" <tr valign=""middle"">" & vbNewLine & _
" <td bgColor=""" & strPageBGColor & """ width=""100%"" align=""center"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ color=""" & strDefaultFontColor & """ size=""" & strHeaderFontSize+1 & """><b>Referer Log</b><br><small>(Sort Before Searching)</small><br><br>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewline & _
" <td bgcolor=""" & strPopUpBorderColor & """>" & vbNewline & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewline & _
" <tr valign=""middle"">" & vbNewline & _
" <td align=""center"" colspan=""2"" bgcolor=""" & strPopUpTableColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ color = """ & strDefaultFontColor & """ size=""" & strDefaultFontSize & """><b>Search:</b> " & vbNewline & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewline & _
" <td width=""50%"" align=""right"" bgcolor=""" & strPopUpTableColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>User IP:</b> " & vbNewline & _
" </td>" & vbNewline & _
" <td width=""50%"" align=""left"" bgcolor=""" & strPopUpTableColor & """> " & vbNewLine & _
" <input type=""text"" size=""50"" maxlength=""16"" name=""RefIP"" value=""" & strRefIP & """>" & vbNewLine & _
" </td>" & vbNewline & _
" </tr>" & vbNewline & _
" <tr valign=""middle"">" & vbNewline & _
" <td width=""50%"" align=""right"" bgcolor=""" & strPopUpTableColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Referer:</b> " & vbNewline & _
" </font>" & vbNewLine & _
" </td>" & vbNewline & _
" <td width=""50%"" align=""left"" bgcolor=""" & strPopUpTableColor & """> " & vbNewLine & _
" <input type=""text"" size=""50"" maxlength=""100"" name=""Referer"" value=""" & strReferer & """>" & vbNewLine & _
" </td>" & vbNewline & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewline & _
" <td width=""50%"" align=""right"" bgcolor=""" & strPopUpTableColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Request:</b> " & vbNewline & _
" </td>" & vbNewline & _
" <td width=""50%"" align=""left"" bgcolor=""" & strPopUpTableColor & """> " & vbNewLine & _
" <input type=""text"" size=""50"" maxlength=""16"" name=""RefRQ"" value=""" & strRequest & """>" & vbNewLine & _
" </td>" & vbNewline & _
" </tr>" & vbNewline & _
" <tr valign=""middle"">" & vbNewline & _
" <td width=""50%"" align=""right"" bgcolor=""" & strPopUpTableColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Query:</b> " & vbNewline & _
" </td>" & vbNewline & _
" <td width=""50%"" align=""left"" bgcolor=""" & strPopUpTableColor & """> " & vbNewLine & _
" <input type=""text"" size=""50"" maxlength=""16"" name=""RefQY"" value=""" & strQuery & """>" & vbNewLine & _
" </td>" & vbNewline & _
" </tr>" & vbNewline & _
" <tr valign=""middle"">" & vbNewline & _
" <td width=""50%"" align=""right"" bgcolor=""" & strPopUpTableColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Date (YYYYMMDD):</b> " & vbNewline & _
" </td>" & vbNewline & _
" <td width=""50%"" align=""left"" bgcolor=""" & strPopUpTableColor & """> " & vbNewLine & _
" <input type=""text"" size=""50"" maxlength=""16"" name=""RefDT"" value=""" & strDate & """>" & vbNewLine & _
" </td>" & vbNewline & _
" </tr>" & vbNewline & _
" <tr valign=""middle"">" & vbNewline & _
" <td colspan=""2"" bgcolor=""" & strPopUpTableColor & """ align=""center"">" & vbNewline
If strGfxButtons = "1" Then
Response.Write " <input src=""" & strImageUrl & "button_go.gIf"" alt=""Quick Search"" type=""image"" value=""Search"" id=""Submit"" name=""Submit"">" & vbNewline
Else
Response.Write " <input type=""Submit"" value=""Search"" id=""Submit"" name=""Submit"">" & vbNewline
End If
Response.Write " </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
"</form>" & vbNewLine
If MaxPages > 1 Then
Response.Write "<table border=""0"" align=""right"">" & vbNewLine & _
" <tr>" & vbNewLine
Call Paging2(1)
Response.Write " </tr>" & vbNewLine & _
"</table>" & vbNewLine
Else
Response.Write " " & vbNewLine
End If
Response.Write "<table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""3"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td width=""12%"" align=""center"" bgcolor=""" & strHeadCellColor & """><a href=""admin_refer_log.asp?"& strRefIP & "Link=Sort&Mode=Search&RefIP="&strRefIP & "&Method="
If Request.QueryString("Method") = "RefIP ASC" Then Response.Write("RefIP DESC") Else Response.Write("RefIP ASC")
Response.Write """" & dWStatus("Sort by User IP") & "><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """>User IP</font></b></a></td>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td width=""20%"" align=""center"" bgcolor=""" & strHeadCellColor & """><a href=""?" & strNames & "Link=Sort&Mode=Search&Referer=" & strReferer & "&Method="
If Request.QueryString("Method") = "Referer ASC" Then Response.Write("Referer DESC") Else Response.Write("Referer ASC")
Response.Write """" & dWStatus("Sort by Referer") & "><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """>Referer</font></b></a></td>" & vbNewLine & _
" <td width=""14%"" align=""center"" bgcolor=""" & strHeadCellColor & """><a href=""?" & strNames & "Link=Sort&Mode=Search&Referer=" & strReferer & "&Method="
If Request.QueryString("Method") = "Request ASC" Then Response.Write("Request DESC") Else Response.Write("Request ASC")
Response.Write """" & dWStatus("Sort by Request") & "><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """>Request</font></b></a></td>" & vbNewLine & _
" <td width=""20%"" align=""center"" bgcolor=""" & strHeadCellColor & """><a href=""?" & strNames & "Link=Sort&Mode=Search&Referer=" & strReferer & "&Method="
If Request.QueryString("Method") = "Query ASC" Then Response.Write("Query DESC") Else Response.Write("Query ASC")
Response.Write """" & dWStatus("Sort by Query") & "><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """>Query</font></b></a></td>" & vbNewLine & _
" <td width=""20%"" align=""center"" bgcolor=""" & strHeadCellColor & """><a href=""?" & strNames & "Link=Sort&Mode=Search&Referer=" & strReferer & "&Method="
If Request.QueryString("Method") = "Agent ASC" Then Response.Write("Agent DESC") Else Response.Write("Agent ASC")
Response.Write """" & dWStatus("Sort by Agent") & "><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """>Agent</font></b></a></td>" & vbNewLine & _
" <td width=""6%"" align=""center"" bgcolor=""" & strHeadCellColor & """><a href=""?" & strNames & "Link=Sort&Mode=Search&Referer=" & strReferer & "&Method="
If Request.QueryString("Method") = "DATE_LOGGED ASC" Then Response.Write("DATE_LOGGED DESC") Else Response.Write("DATE_LOGGED ASC")
Response.Write """" & dWStatus("Sort by Date") & "><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """>Date</font></b></a></td>" & vbNewLine & _
" <td width=""8%"" align=""center"" bgcolor=""" & strHeadCellColor & """><a href=""?" & strNames & "Link=Sort&Mode=Search&Referer=" & strReferer & "&Method="
If Request.QueryString("Method") = "LOG_COUNT ASC" Then Response.Write("LOG_COUNT DESC") Else Response.Write("LOG_COUNT ASC")
Response.Write """" & dWStatus("Sort by Day Count") & "><b><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """>Day Cnt</font></b></a></td>" & vbNewLine & _
" </tr>" & vbNewLine
If iRefLogCount = 0 Then
Response.Write " <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""100%"" colspan=""7"" bgcolor=""" & strForumCellColor & """ >" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize+1 & """ color=""" & strForumFontColor & """><b>No Matches Found</b>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
Else
rREFIP = 0
rREFERER = 1
rREQUEST = 2
rQUERY = 3
rAGENT = 4
rDATE_LOGGED = 5
rLOG_COUNT = 6
rec = 1
intI = 0
For iRefLogCt = 0 To iRefLogLimit -1
If (strPageSize + 1 = rec) Then Exit For
Ref_REFIP = arrRefLogData(rREFIP, iRefLogCt)
Ref_REFERER = arrRefLogData(rREFERER, iRefLogCt)
Ref_REQUEST = arrRefLogData(rREQUEST, iRefLogCt)
Ref_QUERY = arrRefLogData(rQUERY, iRefLogCt)
Ref_AGENT = arrRefLogData(rAGENT, iRefLogCt)
Ref_DATE_LOGGED = arrRefLogData(rDATE_LOGGED, iRefLogCt)
Ref_LOG_COUNT = arrRefLogData(rLOG_COUNT, iRefLogCt)
If intI = 1 Then
CColor = strForumCellColor
Else
CColor = strForumFirstCellColor
End If
Response.Write " <tr valign=""middle"">" & vbNewLine & _
" <td width=""12%"" bgcolor=""" & CColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & Ref_REFIP & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td width=""20%"" bgcolor=""" & CColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & Ref_REFERER & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td width=""14%"" bgcolor=""" & CColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & Ref_REQUEST & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td width=""20%"" bgcolor=""" & CColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & Ref_QUERY & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td width=""20%"" bgcolor=""" & CColor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & Ref_AGENT & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td width=""6%"" bgcolor=""" & CColor & """ align=""center"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & Ref_DATE_LOGGED & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td width=""8%"" bgcolor=""" & CColor & """ align=""center"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & Ref_LOG_COUNT & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
rec = rec + 1
intI = 1 - intI
Next
End If
Response.Write " </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td colspan=""2"">" & vbNewLine
If MaxPages > 1 Then
Response.Write " <table border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine
Call Paging2(2)
Response.Write " </tr>" & vbNewLine & _
" </table>" & vbNewLine
End If
WriteFooter
Response.End
Sub Paging2(fnum)
If MaxPages > 1 Then
If MyPage = "" Then
sPageNumber = 1
Else
sPageNumber = MyPage
End If
If strSort = "" Then
sMethod = "REFERER ASC"
Else
sMethod = strSort
End If
Response.Write " <form name=""PageNum" & fnum & """ action=""admin_refer_log.asp?method=" & Request.QueryString("Method") & """ method=""post"">" & vbNewLine
If fnum = 1 Then
Response.Write " <td align=""right"" valign=""bottom"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
Else
Response.Write " <td>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
End If
If strMode <> "" Then
Response.Write " <input type=""hidden"" name=""Mode"" value=""Search"">" & vbNewLine
End If
If strRefIP <> "" Then
Response.Write " <input type=""hidden"" name=""RefIP"" value=""" & strRefIP & """>" & vbNewLine
End If
If strReferer <> "" Then
Response.Write " <input type=""hidden"" name=""Referer"" value=""" & strReferer & """>" & vbNewLine
End If
If strQuery <> "" Then
Response.Write " <input type=""hidden"" name=""RefQY"" value=""" & strQuery & """>" & vbNewLine
End If
If strRequest <> "" Then
Response.Write " <input type=""hidden"" name=""RefRQ"" value=""" & strRequest & """>" & vbNewLine
End If
If strDate <> "" Then
Response.Write " <input type=""hidden"" name=""RefDT"" value=""" & strDate & """>" & vbNewLine
End If
If fnum = 1 Then
Response.Write " <b>Page: </b><select name=""WhichPage"" size=""1"" onchange=""ChangePage(" & fnum & ");"">" & vbNewLine
Else
Response.Write " <b>Log is " & MaxPages & " Pages Long: </b><select name=""WhichPage"" size=""1"" onchange=""ChangePage(" & fnum & ");"">" & vbNewLine
End If
For counter = 1 To MaxPages
If counter <> cLng(sPageNumber) Then
Response.Write " <option value=""" & counter & """>" & counter & "</option>" & vbNewLine
Else
Response.Write " <option selected value=""" & counter & """>" & counter & "</option>" & vbNewLine
End If
Next
If fnum = 1 Then
Response.Write " </select><b> of " & maxPages & "</b>" & vbNewLine
Else
Response.Write " </select>" & vbNewLine
End If
Response.Write " </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </form>" & vbNewLine
End If
End Sub
%>
آخرین ویرایش توسط
نوشته شده در
works great carefree THANKS
نوشته شده در
You're welcome. Keep in mind that array error until it's found and fixed.
نوشته شده در
ill will do that carefree.
نوشته شده در
carefree, try changing this
to
unless you want to do a move previous there is no point in checking for BOF checking for EOF should tell you if there are records or not
Code:
rs.Open strSql, my_Conn, adOpenStatic
If not (rs.BOF or rs.EOF) Then
rs.MoveFirst
rs.PageSize = strPageSize
rs.AbsolutePage = MyPage
MaxPages = cLng(rs.PageCount)
arrRefLogData = rs.GetRows(strPageSize)
iRefLogCount = UBound(arrRefLogData, 2)
rs.Close
Else
iRefLogCount = 0
End IfCode:
rs.Open strSql, my_Conn, adOpenStatic, adLockReadOnly, adCmdText
If not rs.EOF Then
rs.PageSize = strPageSize
rs.AbsolutePage = MyPage
MaxPages = cLng(rs.PageCount)
arrRefLogData = rs.GetRows(strPageSize)
iRefLogCount = UBound(arrRefLogData, 2)
rs.Close
Else
iRefLogCount = 0
End Ifunless you want to do a move previous there is no point in checking for BOF checking for EOF should tell you if there are records or not
نوشته شده در
That didn't fix it, HuwR, but thanks for trying. I added a check for legitimacy of the count and fixed it that way.
Code:
rs.Open strSql, My_Conn, adOpenStatic
If not (rs.BOF or rs.EOF) Then
rs.MoveFirst
rs.PageSize = strPageSize
rs.AbsolutePage = MyPage
MaxPages = cLng(rs.PageCount)
arrRefLogData = rs.GetRows(strPageSize)
iRefLogCount = UBound(arrRefLogData, 2)
iRefLogLimit = iRefLogCount +1
rs.Close
Else
iRefLogCount = 0
End If
Set rs = Nothing
If iRefLogCount = 0 Then
Set rsCheck = My_Conn.Execute(strSql)
If not (rsCheck.BOF or rsCheck.EOF) Then
If rsCheck("REFIP") > "" Then
iRefLogCount = 1
iRefLogLimit = 1
End If
rsCheck.Close
End If
Set rsCheck = Nothing
End If
and further down,
For iRefLogCt = 0 To iRefLogLimit -1
آخرین ویرایش توسط
Email Member
Message Member
Post Moderation
بارگزاری فایل
If you're having problems uploading, try choosing a smaller image.
پیشنمایش مطلب
Send Topic
Loading...