header("Cache-control: private"); // ie 6 fix for hitting back buttons.. if (array_key_exists('next',$_GET)) { $country=$_GET['country']; $cityother=$_GET['cityother']; $citystate=$_GET['citystate']; $sqlCategory=$_GET['sqlCategory']; $error=""; } if (array_key_exists('form_complete',$_POST)) { $error=""; //Check if it is a NEXT call by seeing if a 'next'='yes' is passed in the url // Check if all variables are good. $screenName=$_POST['screenName']; $Password=$_POST['password1']; $email=$_POST['Email']; $email=strtolower($email); // set to lowercase. $sqlCategory=$_POST['searchCategory']; $country=$_POST['country']; $cityother=$_POST['cityother']; $citystate=$_POST['citystate']; } if ($cityother!="") { //set the location $cityLocation=$cityother; } //if USA city state is specified , split it and then override the city if (($citystate!="")&&($country=="USA")) { // $cityStatePieces = explode(":", $citystate); $cityLocation=$cityStatePieces[0]; $BillState=$cityStatePieces[1]; } //if UK, CA, AUS city is the citylocation if (($country=="Canada")||($country=="United Kingdom")||($country=="Australia")) { $cityLocation=$citystate; } // All good; if ($error!="yes") { //-----------MySQL Code------------------------------------------------------------- include ("../includes/mySQLpref.php"); include ("../includes/functions.php"); $sessionID=session_id(); $BillCity=$cityLocation; $BillState=$_POST['BillState']; $Country=$country; $countryName=$country; $UserId=$_SESSION['userID']; $screenName=$_SESSION['screenName']; $sqlBase=" SELECT adID,Premium FROM AdShort WHERE Category=\"$sqlCategory\" AND Active=\"1\" "; if ($Country!="") { $sqlCountry=$sqlBase."AND Country=\"$Country\""; $sql=$sqlCountry; } //no country selected, then go for base else { $sql=$sqlBase; $sqlCountry=$sqlBase; } if ($cityother!="") { $sqlCityLocation=$sqlCountry."AND City=\"$BillCity\""; $sql=$sqlCityLocation; } else { if ($BillCity!="") { $sqlCity=$sqlCountry."AND City=\"$BillCity\""; $sql=$sqlCity; } if ($BillState!="") { $sqlState=$sqlCity."AND State=\"$BillState\""; $sql=$sqlState; } } //print "$sql

"; $notFound=""; $searchesFound=""; //test the exact match at the city and state (if applicable) $searchResult = mysql_query($sql); $num_rows = mysql_num_rows($searchResult); if ($num_rows!=0) { //print "found exact match"; $searchesFoundSql= $sql; $notFound="
Results for $BillCity $country
"; $nomatches="FALSE"; } else { //only display not found message if search was actually made. If going to search page without any para if ($sqlCategory!="") { $notFound="
We couldn't find any exact matches based on your search, but feel free to browse below for closest matches:
"; } $searchResult2=mysql_query($sqlCountry); $num_rows = mysql_num_rows($searchResult2); //print " $sqlCountry country num: $num_rows
"; if ($num_rows==0){ //print"
not at country level, so it's gotta be base
"; $searchResult3=mysql_query($sqlBase); $num_rows = mysql_num_rows($searchResult3); if ($num_rows==0) { //print"nothing at base!"; $nomatches="true"; } else { //base $searchesFoundSql=$sqlBase; } } //Found a match on the country else { $searchesFoundSql=$sqlCountry; } } if ($nomatches=="true") { //$notFound="
Sorry, there are no matches that fit your search
"; } else { // print "$searchesFoundSql
"; $searchesFound=mysql_query($searchesFoundSql); $premCount=0; $stanCount=0; while ($sortRow = mysql_fetch_array($searchesFound, MYSQL_NUM)) { //if it is a premium/upgraded ad, then add to the features / premium array if ($sortRow[1]==1) { $premiumArray[$premCount]=$sortRow[0]; //put the adID into the premium array $premCount++; } //else it's a standard else { $standardArray[$stanCount]=$sortRow[0];// else put into the standard array $stanCount++; } } //randomize the order or the arrays to display random ranking if ($premiumArray[0]!="") { shuffle($premiumArray); } if ($standardArray[0]!="") { shuffle($standardArray); } //display random premium ads if ($premCount!=0) { //loop through the randomized array and print out the ads $color=0; foreach($premiumArray as $key => $adIDvalue) { updateStats($adIDvalue,'imp'); // Record an impression for this ad $breed=getBreedName($adIDvalue); $premiumAdCopy=getAdCode($adIDvalue,$color,$breed,1); //pass adid, color, and '1' = featured to display linking $searchResultsText.=$premiumAdCopy; $color++; if ($color==3) { break; // just show 3 featured / premium ads } }//end foreach premium }//end if premium count!=0 //display random standard ads if ($standardArray[0]!="") { //go through the stand advertisers //$color=1; // start with grey foreach($standardArray as $key => $adIDvalue) { updateStats($adIDvalue,'imp'); // Record an impression for this ad $breed=getBreedName($adIDvalue); $standardAdCopy=getAdCode($adIDvalue,$color,$breed,0); //pass adid, color, and '0' = no featured display linking $searchResultsText.=$standardAdCopy; $color++; if ($color==7) { break; } }//end standard array foreach }//end standard array if }//end no matches if }//no error ?> //mysql variables $user = "88date"; $pass = "date168"; $host = "mysql.88date.com"; $db_name = "88date"; $dsn = "mysql://$user:$pass@$host/$db_name"; //windows // domain information $url_Prefix="fourthring.com"; $full_url="http://www.fourthring.com"; $theDomainName="Fourthring Personals"; $infoEmail="info@fourthring.com"; $adminDomain="https://admin.fourthring.com"; /* CHANGE THE FOLLOWING HARDCODED URLS: 1) /login/index.php I had to hardcode the forwarding url - didn't work with using $full_url for some reason. I think it's a server setting. 2) /billing/index.php Change the hardcoded url for the paypal return url */ //ALSO DON'T FORGET TO MANUALLY SET UP THE CHRON JOBS // need to set /ad_logos and /chron folders as writeable (chmod777) // go to fourthring.com and do crontab -l to get the cron job scripts for both chron.php and unverified.php $link = mysql_connect($host, $user, $pass); if (!$link) { echo " Sorry we are having network issues. Please revisit in a short while."; exit; } // set the current db $db_selected = mysql_select_db($db_name, $link); if (!$db_selected) { echo" Sorry we are having network issues. Please revisit in a short while."; exit; } ?> Search Personals


--> Search / Browse Personals

 
Who are you looking for?
Country :


Location :


Location :
*Required



Meet These
Fourth Ring Members:


// include('mySQLpref.php'); //5 random - chooses 5 random users who have active ads and have photos $getPeopleSql="SELECT a1.adID, a1.userID, a1.Active, a2.adID,a2.Logo FROM AdShort a1, AdTable a2 WHERE a1.Active='1' AND a1.adID=a2.adID AND a2.Logo!='default.jpg'"; $result = mysql_query($getPeopleSql); //Loop through the results and place all the userIDs into an array (should be a way to randomly access this data directly, but I'm dumb) $stanCount=0; while ($peopleRow = mysql_fetch_array($result, MYSQL_NUM)) { //if it is a premium/upgraded ad, then add to the features / premium array $userIDarray[$stanCount]=$peopleRow[1];// just store the userID into the array. $stanCount++; } //Mix it up shuffle($userIDarray); //Loop and display 5 users for ($userNum=0; $userNum<5; $userNum++) { $userID=$userIDarray[$userNum]; $iconHTML= getIconImage($userID); print "$iconHTML

"; } ?>