open browse.php
near line 350 find
- Code: Select all
$ages = array();
$ages["Age 18 to 25"] = "age_from=18&age_to=25";
$ages["Age 26 to 30"] = "age_from=26&age_to=30";
$ages["Age 31 to 35"] = "age_from=31&age_to=35";
$ages["Age 36 to 40"] = "age_from=36&age_to=40";
$ages["Age 41 to 45"] = "age_from=41&age_to=45";
$ages["Age 46 to 50"] = "age_from=46&age_to=50";
$ages["Over 50"] = "age_from=50&age_to=199";
add this line into the function after array() $ages["Browse All Ages"] = "age_from=18&age_to=199";
- Code: Select all
$ages = array();
$ages["Browse All Ages"] = "age_from=18&age_to=199";
$ages["Age 18 to 25"] = "age_from=18&age_to=25";
$ages["Age 26 to 30"] = "age_from=26&age_to=30";
$ages["Age 31 to 35"] = "age_from=31&age_to=35";
$ages["Age 36 to 40"] = "age_from=36&age_to=40";
$ages["Age 41 to 45"] = "age_from=41&age_to=45";
$ages["Age 46 to 50"] = "age_from=46&age_to=50";
$ages["Over 50"] = "age_from=50&age_to=199";
you had the right idea but you need to modify this for browse.php and browse_gender_age.php
while I was looking at it I noticed that you had to select each town within a state.. this is another headache so I wrote some code to choose Browse All Cities...
Near line 175 find these lines
- Code: Select all
$cities_list = "<table border=0 cellspacing=2 cellpadding=2 width=99% align=center>";
$i = 0;
$was_tr = 0;
add this line after so it will now look like this
- Code: Select all
$cities_list = "<table border=0 cellspacing=2 cellpadding=2 width=99% align=center>";
$i = 0;
$was_tr = 0;
$cities_list .= '<td align=center width=33%><a href="index.php?page=browse&browse_page=browse_profiles&gender='.$gender.'&'.$ages_link.'&country='.$country.'&state='.$state.'">Browse All Cities</a></td>';
near line 219 find:
- Code: Select all
if($state == "") $state_sql = "";
else $state_sql = " AND profile.state='$state' ";
add these lines before it so it will look like this
- Code: Select all
if($city=="")$city_sql="";
else $city_sql="AND profile.city='$city'";
if($state == "") $state_sql = "";
else $state_sql = " AND profile.state='$state' ";
the next line is the sql and you need to change it to this
- Code: Select all
$sql = "
SELECT *, country.name as country, profile.id as id, profile.name as name, mb.age as age
FROM dt_profile profile, dt_countries as country, dt_members as mb
WHERE profile.country='$country' AND profile.gender='$gender' AND mb.age>='$age_from' AND mb.age<='$age_to' AND mb.id=profile.member_id
$state_sql $city_sql AND country.id=profile.country AND profile.status='1'
GROUP BY profile.id ORDER BY profile.name
";
now you should be up and running with the all ages and any city browse..
let me know how it goes for you
Paul