<%@LANGUAGE="VBSCRIPT"%> <% '=============================================== ' Personals System 2002 ' ©2002 vSpin.net. www.vspin.net '=============================================== ' All rights reserved. ' Use of this code is covered by the terms and ' conditions in the license agreement. No ' unauthorized duplication or distribution is ' permitted. vSpin.net copyright notices must ' remain in the ASP sections of the code. '=============================================== %> <% dim xxxxm, rsheadUpdatee, rsheadUpdatee_numRows Dim rsdate, rsdate_numRows, sexb, city, agestart, agelast, relationship, heighta, heightb, weighta, weightb, body, hair, ethnicity, religion, employ, education, marital, child, wantchild, smoke, drink, AndsexaString, AndagestartString, AndagelastString Dim AndheightaString, AndheightbString, AndweightaString, AndweightbString, AndcityString, AndphotoString, AndhairString, AndethnicityString, AndreligionString, AndemployString, AndeducationString, AndmaritalString, AndchildString, AndwantchildString, AndsmokeString Dim AnddrinkString, AndbodyString, AndsexbString, AndrelationshipString, SortString, sqlString, rsSearch, rsSearch_numRows, rsSearch_total, rsSearch_first, rsSearch_last, MM_rs, MM_rsCount, MM_size, MM_uniqueCol, MM_paramName, MM_offset, MM_atTotal Dim MM_paramIsDefined, r, i, MM_removeList, MM_keepURL, MM_keepForm, MM_keepBoth, MM_keepNone, Item, NextItem, MM_keepMove, MM_moveParam, params, urlStr, MM_moveFirst, MM_moveLast, MM_moveNext, prev, MM_movePrev, p_sex, p_relationship, aryFileType, numFileLoopCounter Dim strFileStatus, callmode, thepath, fs, numFilePresentCheck '------------------------- 'Expired Ad(s) Auto Inactive '------------------------- set rsdate = Server.CreateObject("ADODB.Recordset") rsdate.ActiveConnection = MM_conn_STRING rsdate.Source = "SELECT p_id FROM p_ads WHERE p_user < Date ()" rsdate.CursorType = 0 rsdate.CursorLocation = 2 rsdate.LockType = 3 rsdate.Open() rsdate_numRows = 0 Dim repeat2__numRows repeat2__numRows = -1 Dim repeat2__index repeat2__index = 0 rsdate_numRows = rsdate_numRows + repeat2__numRows If Not rsdate.EOF Or Not rsdate.BOF Then While ((repeat2__numRows <> 0) AND (NOT rsdate.EOF)) p_idd = rsdate("p_id") Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open MM_conn_STRING sql1 = "UPDATE p_ads SET p_active=1" & p_active & " WHERE p_id=" & p_idd conn.execute(sql1) repeat2__index=repeat2__index+1 repeat2__numRows=repeat2__numRows-1 rsdate.MoveNext() Wend rsdate.close set rsdate= nothing conn.close set conn = nothing end if '--------------------------- 'End Expired Ads Inactive '--------------------------- %> <% Function SafeHTMLEncode(inputstring) If inputstring<>"" then inputstring = server.HTMLEncode(inputstring) End if SafeHTMLEncode=inputstring End Function %> <% sexb = Request("field2") city = Request("field3") agestart = Request("field4") agelast = Request("field5") relationship = Request("field6") heighta = Request("field7") heightb = Request("field8") weighta = Request("field9") weightb = Request("field10") body = Request("field11") hair = Request("field12") ethnicity = Request("field13") religion = Request("field14") employ = Request("field15") education = Request("field16") marital = Request("field17") child = Request("field18") wantchild = Request("field19") smoke = Request("field20") drink = Request("field21") If Request("field1")="1" then AndsexaString = " AND p_seek BETWEEN 1 AND 2" ElseIf Request("field1") ="3" then AndsexaString = " AND p_seek BETWEEN 2 AND 3" Else AndsexaString = "" End If If agestart ="" then AndagestartString = " AND p_age BETWEEN 18" Else AndagestartString = " AND p_age BETWEEN " & agestart End If If agelast ="" then AndagelastString = " AND 100" Else AndagelastString = " AND " & agelast End If If heighta ="" then AndheightaString = " AND p_height BETWEEN 0" Else AndheightaString = " AND p_height BETWEEN " & heighta End If If heightb ="" then AndheightbString = " AND 27" Else AndheightbString = " AND " & heightb End If If weighta ="" then AndweightaString = " AND p_weight BETWEEN 0" Else AndweightaString = " AND p_weight BETWEEN " & weighta End If If weightb ="" then AndweightbString = " AND 1000" Else AndweightbString = " AND " & weightb End If If city ="" then AndcityString = "" Else AndcityString = " AND p_city = " & city End If If Request("field22") ="ON" then AndphotoString = " AND p_photoapprove = '2'" Else AndphotoString = "" End If If hair ="" then AndhairString = "" Else AndhairString = " AND p_hair = " & hair End If If ethnicity ="" then AndethnicityString = "" Else AndethnicityString = " AND p_ethnicity = " & ethnicity End If If religion ="" then AndreligionString = "" Else AndreligionString = " AND p_religion = " & religion End If If employ ="" then AndemployString = "" Else AndemployString = " AND p_employ = " & employ End If If education ="" then AndeducationString = "" Else AndeducationString = " AND p_education = " & education End If If marital ="" then AndmaritalString = "" Else AndmaritalString = " AND p_marital = " & marital End If If child ="" then AndchildString = "" Else AndchildString = " AND p_child = " & child End If If wantchild ="" then AndwantchildString = "" Else AndwantchildString = " AND p_wantchild = " & wantchild End If If smoke ="" then AndsmokeString = "" Else AndsmokeString = " AND p_smoke = " & smoke End If If drink ="" then AnddrinkString = "" Else AnddrinkString = " AND p_drink = " & drink End If If body ="" then AndbodyString = "" Else AndbodyString = " AND p_body = " & body End If If sexb ="" then AndsexbString = "" Else AndsexbString = " AND p_sex = " & sexb End If If relationship ="" then AndrelationshipString = "" Else AndrelationshipString = " AND p_relationship = " & relationship End If SortString = " ORDER BY p_id DESC" sqlString = "select p_ads.p_sex, p_ads.p_relationship, p_ads.p_photoapprove, p_ads.p_id, p_ads.p_headline, p_ads.p_age, p_ads.p_city, p_ads.p_views, p_ads.p_user,p_locations.* from (p_ads INNER JOIN p_locations on p_ads.p_city = p_locations.p_idl) WHERE p_active=0" sqlString = sqlString&AndrelationshipString&AndcityString&AndphotoString&AndhairString&AndethnicityString&AndreligionString&AndemployString&AndeducationString&AndmaritalString&AndchildString&AndwantchildString&AndsmokeString&AnddrinkString&AndsexbString&AndbodyString&AndagestartString&AndagelastString&AndheightaString&AndheightbString&AndweightaString&AndweightbString&AndsexaString&SortString %> <% set rsSearch = Server.CreateObject("ADODB.Recordset") rsSearch.ActiveConnection = MM_conn_STRING rsSearch.Source = ""& sqlString rsSearch.CursorType = 0 rsSearch.CursorLocation = 2 rsSearch.LockType = 3 rsSearch.Open() rsSearch_numRows = 0 %> <% Dim Repeat1__numRows Repeat1__numRows = 20 Dim Repeat1__index Repeat1__index = 0 rsSearch_numRows = rsSearch_numRows + Repeat1__numRows %> <% If rsSearch.EOF Or rsSearch.BOF Then %>

 Search Results

  

 Sorry, no ads found.
<% end if %> <% If Not rsSearch.EOF Or Not rsSearch.BOF Then 'If the recordset rsSearch is not empty ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables ' set the record count rsSearch_total = rsSearch.RecordCount ' set the number of rows displayed on this page If (rsSearch_numRows < 0) Then rsSearch_numRows = rsSearch_total Elseif (rsSearch_numRows = 0) Then rsSearch_numRows = 1 End If ' set the first and last displayed record rsSearch_first = 1 rsSearch_last = rsSearch_first + rsSearch_numRows - 1 ' if we have the correct record count, check the other stats If (rsSearch_total <> -1) Then If (rsSearch_first > rsSearch_total) Then rsSearch_first = rsSearch_total If (rsSearch_last > rsSearch_total) Then rsSearch_last = rsSearch_total If (rsSearch_numRows > rsSearch_total) Then rsSearch_numRows = rsSearch_total End If %> <% ' *** Recordset Stats: if we don't know the record count, manually count them If (rsSearch_total = -1) Then ' count the total records by iterating through the recordset rsSearch_total=0 While (Not rsSearch.EOF) rsSearch_total = rsSearch_total + 1 rsSearch.MoveNext Wend ' reset the cursor to the beginning If (rsSearch.CursorType > 0) Then rsSearch.MoveFirst Else rsSearch.Requery End If ' set the number of rows displayed on this page If (rsSearch_numRows < 0 Or rsSearch_numRows > rsSearch_total) Then rsSearch_numRows = rsSearch_total End If ' set the first and last displayed record rsSearch_first = 1 rsSearch_last = rsSearch_first + rsSearch_numRows - 1 If (rsSearch_first > rsSearch_total) Then rsSearch_first = rsSearch_total If (rsSearch_last > rsSearch_total) Then rsSearch_last = rsSearch_total End If %> <% ' *** Move To Record and Go To Record: declare variables Set MM_rs = rsSearch MM_rsCount = rsSearch_total MM_size = rsSearch_numRows MM_uniqueCol = "" MM_paramName = "" MM_offset = 0 MM_atTotal = false MM_paramIsDefined = false If (MM_paramName <> "") Then MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "") End If %> <% ' *** Move To Record: handle 'index' or 'offset' parameter if (Not MM_paramIsDefined And MM_rsCount <> 0) then ' use index parameter if defined, otherwise use offset parameter r = Request.QueryString("index") If r = "" Then r = Request.QueryString("offset") If r <> "" Then MM_offset = Int(r) ' if we have a record count, check if we are past the end of the recordset If (MM_rsCount <> -1) Then If (MM_offset >= MM_rsCount Or MM_offset = -1) Then ' past end or move last If ((MM_rsCount Mod MM_size) > 0) Then ' last page not a full repeat region MM_offset = MM_rsCount - (MM_rsCount Mod MM_size) Else MM_offset = MM_rsCount - MM_size End If End If End If ' move the cursor to the selected record i = 0 While ((Not MM_rs.EOF) And (i < MM_offset Or MM_offset = -1)) MM_rs.MoveNext i = i + 1 Wend If (MM_rs.EOF) Then MM_offset = i ' set MM_offset to the last possible record End If %> <% ' *** Move To Record: if we dont know the record count, check the display range If (MM_rsCount = -1) Then ' walk to the end of the display range for this page i = MM_offset While (Not MM_rs.EOF And (MM_size < 0 Or i < MM_offset + MM_size)) MM_rs.MoveNext i = i + 1 Wend ' if we walked off the end of the recordset, set MM_rsCount and MM_size If (MM_rs.EOF) Then MM_rsCount = i If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount End If ' if we walked off the end, set the offset based on page size If (MM_rs.EOF And Not MM_paramIsDefined) Then If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then If ((MM_rsCount Mod MM_size) > 0) Then MM_offset = MM_rsCount - (MM_rsCount Mod MM_size) Else MM_offset = MM_rsCount - MM_size End If End If End If ' reset the cursor to the beginning If (MM_rs.CursorType > 0) Then MM_rs.MoveFirst Else MM_rs.Requery End If ' move the cursor to the selected record i = 0 While (Not MM_rs.EOF And i < MM_offset) MM_rs.MoveNext i = i + 1 Wend End If %> <% ' *** Move To Record: update recordset stats ' set the first and last displayed record rsSearch_first = MM_offset + 1 rsSearch_last = MM_offset + MM_size If (MM_rsCount <> -1) Then If (rsSearch_first > MM_rsCount) Then rsSearch_first = MM_rsCount If (rsSearch_last > MM_rsCount) Then rsSearch_last = MM_rsCount End If ' set the boolean used by hide region to check if we are on the last record MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount) %> <% ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters ' create the list of parameters which should not be maintained MM_removeList = "&index=" If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "=" MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone="" ' add the URL parameters to the MM_keepURL string For Each Item In Request.QueryString NextItem = "&" & Item & "=" If (InStr(1,MM_removeList,NextItem,1) = 0) Then MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item)) End If Next ' add the Form variables to the MM_keepForm string For Each Item In Request.Form NextItem = "&" & Item & "=" If (InStr(1,MM_removeList,NextItem,1) = 0) Then MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item)) End If Next ' create the Form + URL string and remove the intial '&' from each of the strings MM_keepBoth = MM_keepURL & MM_keepForm if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1) if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1) if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1) ' a utility function used for adding additional parameters to these strings Function MM_joinChar(firstItem) If (firstItem <> "") Then MM_joinChar = "&" Else MM_joinChar = "" End If End Function %> <% ' *** Move To Record: set the strings for the first, last, next, and previous links MM_keepMove = MM_keepBoth MM_moveParam = "index" ' if the page has a repeated region, remove 'offset' from the maintained parameters If (MM_size > 0) Then MM_moveParam = "offset" If (MM_keepMove <> "") Then params = Split(MM_keepMove, "&") MM_keepMove = "" For i = 0 To UBound(params) nextItem = Left(params(i), InStr(params(i),"=") - 1) If (StrComp(nextItem,MM_moveParam,1) <> 0) Then MM_keepMove = MM_keepMove & "&" & params(i) End If Next If (MM_keepMove <> "") Then MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1) End If End If End If ' set the strings for the move to links If (MM_keepMove <> "") Then MM_keepMove = MM_keepMove & "&" urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "=" MM_moveFirst = urlStr & "0" MM_moveLast = urlStr & "-1" MM_moveNext = urlStr & Cstr(MM_offset + MM_size) prev = MM_offset - MM_size If (prev < 0) Then prev = 0 MM_movePrev = urlStr & Cstr(prev) End If 'End If recordset rsSearch is empty. %> <% If NOT rsSearch.EOF Or NOT rsSearch.BOF Then %>

 <%=(rsSearch_total)%> Matches Found!

  

Showing Records <%=(rsSearch_first)%> to <%=(rsSearch_last)%> of <%=(rsSearch_total)%>

<% If MM_offset <> 0 Then %> Previous Results   <% End If ' end MM_offset <> 0 %><% If Not MM_atTotal Then %> Next Results  <% End If ' end Not MM_atTotal %>
<% While ((Repeat1__numRows <> 0) AND (NOT rsSearch.EOF)) If rsSearch.Fields.Item("p_sex") = "1" then p_sex = "Bottom" ElseIf rsSearch.Fields.Item("p_sex") = "2" then p_sex = "Top" else p_sex = "Versatile" end if If rsSearch.Fields.Item("p_relationship") = "1" then p_relationship = "Friends" ElseIf rsSearch.Fields.Item("p_relationship") = "2" then p_relationship = "Hang Out" ElseIf rsSearch.Fields.Item("p_relationship") = "3" then p_relationship = "Short-term" ElseIf rsSearch.Fields.Item("p_relationship") = "4" then p_relationship = "Long-term" ElseIf rsSearch.Fields.Item("p_relationship") = "5" then p_relationship = "Sexual" ElseIf rsSearch.Fields.Item("p_relationship") = "6" then p_relationship = "Talk/E-mail" ElseIf rsSearch.Fields.Item("p_relationship") = "7" then p_relationship = "Photo Exchange" else p_relationship = "Other" end if %> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 rsSearch.MoveNext() Wend %>

Photo

Headline (click to view)

Sex

Relationship

Age

Location

Views

User Name

<% If rsSearch.Fields.Item("p_photoapprove") = "2" then '----------------------------------------- 'FIND AND SHOW EXISTING IMAGE (IF ANY) '----------------------------------------- aryFileType = split("jpg,jpeg,gif,png",",",-1) 'SPLITS LIST OF ACCEPTABLE FILE TYPES IN CONFIG.ASP INTO ARRAY numFileLoopCounter = Ubound(aryFileType) strFileStatus = "" If callmode<>"new" then Do while numFileLoopCounter>-1 thepath = Server.MapPath("ad_photos/" & rsSearch.Fields.Item("p_id").Value & "." & aryFileType(numFileLoopCounter)) set fs=CreateObject("Scripting.FileSystemObject") If fs.FileExists(thepath) then strFileStatus = "" numFilePresentCheck = 1 End if numFileLoopCounter = numFileLoopCounter-1 Loop end if response.write(strFileStatus) End if %>

<% = p_sex %>

<% = p_relationship %>

<%=(rsSearch.Fields.Item("p_age").Value)%>

<% = rsSearch("p_location") %>

<%=(rsSearch.Fields.Item("p_views").Value)%>

<%=(rsSearch.Fields.Item("p_user").Value)%>

<% If MM_offset <> 0 Then %> Previous Results   <% End If ' end MM_offset <> 0 %><% If Not MM_atTotal Then %> Next Results  <% End If ' end Not MM_atTotal %>
<% End If %> <% rsSearch.Close() MM_conn_STRING.close set rsSearch = nothing set MM_conn_STRING = nothing %>