<%Option Explicit%> <% 'declare and set variables 'arrays used to display proper sorting method 'also sets column widths Dim fieldDescriptions, fieldNames, fieldWidths fieldDescriptions = Array("Θέματα", "Αποστολέας", "Ημερομηνία", "Απαντήσεις") fieldNames = Array("topic", "author", "date_posted", "replies") fieldWidths = Array("290", "155", "100", "85") Dim curPage, pageCount, topicCount Dim sortBy, sortDir, sortDirOpp Dim strSearch Dim strSQL Dim dbRS Dim stateQS Dim i, x, c x = 0 'get the new current page if available - otherwise set to 1 curPage = CInt(Request("curPage")) If curPage = "" Or IsNumeric(curPage) = False Then curPage = 1 Else If curPage < 1 Then curPage = 1 End If End If 'get sort settings If Request("sortBy") = "" Then sortBy = Session("sortBy") Else sortBy = Request("sortBy") End If If Request("sortDir") = "" Then sortDir = Session("sortDir") Else sortDir = Request("sortDir") End If If sortBy = "" Then sortBy = "orderit" End If If sortDir = "" Then sortDir = "DESC" End If 'get the opposite of the current sort direction in case of change If sortDir = "DESC" Then sortDirOpp = "ASC" ElseIf sortDir = "ASC" Then sortDirOpp = "DESC" End If 'get the search string and build the SQL statement strSearch = Request("search") strSQL = "SELECT ID,parentID,topic,author,date_posted,replies,orderit FROM board1 " If Not strSearch = "" Then strSQL = strSQL & "WHERE (topic LIKE '%" & web2db(strSearch) & "%' OR" strSQL = strSQL & " body LIKE '%" & web2db(strSearch) & "%' OR" strSQL = strSQL & " author LIKE '%" & web2db(strSearch) & "%') " Else strSQL = strSQL & "WHERE parentID = 0 " End If strSQL = strSQL & "ORDER BY " & sortBy & " " & sortDir 'connect to the database Set dbRS = Server.CreateObject("ADODB.Recordset") With dbRS .CursorLocation = 3 .CacheSize = C_dbPageSize .Open strSQL, C_dbConnect End With If dbRS.EOF = False Then With dbRS .MoveFirst topicCount = CInt(.RecordCount) .PageSize = C_dbPageSize pageCount = CInt(.PageCount) .AbsolutePage = curPage End With Else topicCount = 0 pageCount = 1 End If 'preconstruct query strings to keep things simple stateQS = "curPage=" & curPage & "&" stateQS = stateQS & "search=" & Server.URLEncode(strSearch) %> Konstantinos Kenteris, the world champion!
                         

 

<%If Not strSearch = "" Then%> <%Else%> <%End If%>
     
Αποτελέσματα για:
"<%=strSearch%>"
  

<%For c = 0 To UBound(fieldNames)%> <%If LCase(fieldNames(c)) = sortBy Then%> <%Else%> <%End If%> <%Next%>
<%=fieldDescriptions(c)%> <%=fieldDescriptions(c)%>

<% If dbRS.EOF Then %> <% Else Do Until dbRS.EOF Or x >= C_dbPageSize %>
Δε βρέθηκε κανένα σχετικό θέμα.
&<%=stateQS%>"><%=db2web(dbRS("topic"))%>
<%=db2web(dbRS("author"))%>
<%=FormatDate(dbRS("date_posted"),False)%>
<% If dbRS("parentID") = 0 Then Response.Write dbRS("replies") Else Response.Write "-" End If %>

<% x = x + 1 dbRS.MoveNext Loop End If %>
    
<%=topicCount%> Σχετικά θέματα:
Σελίδα από<%=pageCount%>




 |   ome | end by you | nterviews
powered by comitech 
comitech, communication, & information technology
http://www.cosmote.gr το web site του προπονητή των πρωταθλητών! visit the site of puma! <% 'clear recordset from memory Set dbRS = Nothing 'store sort settings in session variables Session("sortBy") = sortBy Session("sortDir") = sortDir %>