100) $errorstring .= "
  • Distance searches must be between 10 and 100 miles
  • "; if(empty($gender)) $errorstring .= "
  • Please select your gender
  • "; if(empty($gender2)) $errorstring .= "
  • Please select the gender you are looking for
  • "; //if(!empty($postcode) && empty($distance)) $errorstring .= "
  • Please select a distance you want to look for members in
  • "; if(empty($errorstring)){ if(!empty($postcode)){ include("$root/includes/distance-calc.php"); //check postcode exists $temp = q("SELECT COUNT(1) AS cnt FROM postcodes WHERE areacode = \"".es($postcode)."\"", $SESS_DBH); if(mysql_result($temp, 0, cnt) > 0){ $coords_array = getCoords($postcode, $distance); $join = "INNER JOIN postcodes ON m.postcode = postcodes.areacode"; $postcodes .= "AND (postcodes.x > {$coords_array[0]} AND postcodes.x < {$coords_array[1]} AND postcodes.y > {$coords_array[2]} AND postcodes.y < {$coords_array[3]})"; } } //construct dobs if($agemin > 0) $agemin1 = date("Y-m-d H:i:s", mktime(0, 0, 0, date("m")-11, date("d")+1, date("Y") - $agemin)); if($agemax > 0) $agemax1 = date("Y-m-d H:i:s", mktime(0, 0, 0, date("m")-11, date("d")+1, date("Y") - $agemax)); if(!empty($postcode)) $postcode = "AND postcode = \"".es($postcode)."\""; //work oiut if lookin for gay if($gender == $gender2) $class = "AND (pr.class = 2 OR pr.class = 3)"; $temp = q("SELECT COUNT(1) AS cnt FROM members m $join INNER JOIN profile pr ON m.userid = pr.userid LEFT JOIN photos p ON m.userid = p.userid AND p.profile = 1 WHERE pr.dob BETWEEN \"$agemax1\" AND \"$agemin1\" AND m.gender = $gender2 $postcodes $class", $SESS_DBH); $results = mysql_result($temp, 0, cnt); if($results == 0) $numpages = 1; else $numpages = ceil($results / $numperpage); $startnumber = ($numperpage * $n) - $numperpage; $endnumber = $results < $numperpage ? $results : $startnumber + $numperpage; $limit = "LIMIT $startnumber, $endnumber"; $result = q("SELECT m.extras, m.extras_renewal, m.username, m.userid, m.lastlogin, p.filename, pr.text, pr.dob FROM members m $join INNER JOIN profile pr ON m.userid = pr.userid LEFT JOIN photos p ON m.userid = p.userid AND p.profile = 1 WHERE pr.dob BETWEEN \"$agemax1\" AND \"$agemin1\" AND m.gender = $gender2 $postcodes $class ORDER BY p.filename DESC $limit", $SESS_DBH); //sort out next and prev links $prev = ""; $next = ""; $donesearch = true; } } //free members left? $temp = q("SELECT COUNT(*) AS cnt FROM members", $SESS_DBH); $nummember = mysql_result($temp, 0, cnt); $numleft = 10000 - $nummember; $hpphotos = q("SELECT * FROM latestphotos ORDER BY gender ASC", $SESS_DBH); ?>
    Welcome to heavendating.co.uk

    Register now and start messaging other users straight away and discuss hot dating topics on the dating forum, both completely free!

    Join for free

    "; if(!$donesearch){ ?>

    Welcome to heavendating.co.uk, the newest, freshest dating website on the net. You could be seconds away from finding that perfect soul mate or someone who shares your search for casual fun. Why not use our simple search below and see some of the members we have waiting for you!

    0 && !$_SESSION['s_loginstatus']){?>

    The next members to join will get premium membership free for a year! Below are the great features you will receive!

    Join free

    ".$errorstring.""); ?>
    "; echo "

    Recent Women

    "; $lastgender = 1; while($row = mysql_fetch_assoc($hpphotos)){ $userid = $row['userid']; $gender = $row['gender']; $username = $row['username']; $age = $row['age']; $text = $row['text']; $filename = $row['filename']; if($gender != $lastgender){ echo "
    "; echo "

    Recent Men

    "; } echo "
    $username aged $age

    $text [more][contact]



    "; $lastgender = $gender; } echo "


    "; ?>

    Find love online

    I am a:
    Male
    Female
    Looking for a:
    Male
    Female


    Between the ages: -


    Who lives miles within the postcode (first half e.g. ME12):

    Join for free
    1){ echo "
    "; if($n > 1) echo $prev; if($n < $numpages) echo $next; echo "
    "; } if($results == 0) echo "Sorry your search returned no matches"; else{ $counter = 0; echo "
    "; echo "

    Your Search Results

    "; while($row = mysql_fetch_assoc($result)){ $username = $row['username']; $userid = $row['userid']; $extras = $row['extras']; $extras_ren = $row['extras_renewal']; $dob = $row['dob']; $text = strlen($row['text']) > 100 ? substr($row['text'], 0, 100)."..." : $row['text']; if($extras == 1 && $extras_ren > time()) $userhasextras = true; else $userhasextras = false; if($userhasextras){ $nums = array(); $num = rand(1, 4); while(in_array($num, $nums)) $num = rand(1, 4); array_push($nums, $num); if(count($nums) == 4) $nums = array(); switch($num){ case 1: $color = "#99CCFF"; break; case 2: $color = "#FFFF99"; break; case 3: $color = "#FFCC99"; break; case 4: $color = "#FFCCFF"; break; } $filename = $row['filename']; } else{ $color = "#f7f1f1"; $filename = "contactuser3.gif"; } if(empty($filename)) $filename = "contactuser3.gif"; ?>

    age:
    Conact username for more info"; else echo $text;?>