*

kosma

  • *
  • 13
  • Sorry for my English
View city instead of the country
« on: March 04, 2014, 02:41:59 AM »
1. smallprofile.tpl:
Find
Code: [Select]
{$item.countryname}Modify with
Code: [Select]
{$item.cityname}

2. mymatches.php:
Find
Code: [Select]
$users[] = $row;put before
Code: [Select]
$row['cityname'] = getCityName($row['country'], ((isset($row['state_province']) && $row['state_province']!='')?$row['state_province']:'AA'), ((isset($row['city']) && $row['city']!= 'AA')?$row['city']:'AA'), ((isset($row['county']) && $row['county'] != '')?$row['county']:'AA'));
$row['cityname'] = ($row['cityname'] == 'AA') ? get_lang('any_where'): $row['cityname'];   



3. advsearch.php
Find
Code: [Select]
if (count($_SESSION['advsearch']['questionusers']) > 0 ) {put before
Code: [Select]
$row['cityname'] = getCityName($row['country'], ((isset($row['state_province']) && $row['state_province']!='')?$row['state_province']:'AA'), ((isset($row['city']) && $row['city']!= 'AA')?$row['city']:'AA'), ((isset($row['county']) && $row['county'] != '')?$row['county']:'AA'));

4. onlineusers.php
Find
Code: [Select]
$list[] = $row;put before
Code: [Select]
$row['cityname'] = getCityName($row['country'], ((isset($row['state_province']) && $row['state_province']!='')?$row['state_province']:'AA'), ((isset($row['city']) && $row['city']!= 'AA')?$row['city']:'AA'), ((isset($row['county']) && $row['county'] != '')?$row['county']:'AA'));

5. iplocation_profiles_display.php
Find
Code: [Select]
$list[] = $row;put before
Code: [Select]
$row['cityname'] = getCityName($row['country'], ((isset($row['state_province']) && $row['state_province']!='')?$row['state_province']:'AA'), ((isset($row['city']) && $row['city']!= 'AA')?$row['city']:'AA'), ((isset($row['county']) && $row['county'] != '')?$row['county']:'AA'));

6. newest_profiles_display.php
Find
Code: [Select]
$list[] = $row;put before
Code: [Select]
$row['cityname'] = getCityName($row['country'], ((isset($row['state_province']) && $row['state_province']!='')?$row['state_province']:'AA'), ((isset($row['city']) && $row['city']!= 'AA')?$row['city']:'AA'), ((isset($row['county']) && $row['county'] != '')?$row['county']:'AA'));

--------------------------------------------------
PROBLEM

7. newest_profpics_display.php
Find
Code: [Select]
}
}
$list[] = $row;
put before
Code: [Select]
$row['cityname'] = getCityName($row['country'], ((isset($row['state_province']) && $row['state_province']!='')?$row['state_province']:'AA'), ((isset($row['city']) && $row['city']!= 'AA')?$row['city']:'AA'), ((isset($row['county']) && $row['county'] != '')?$row['county']:'AA'));
}

Find
Code: [Select]
if ($profpicgender == 'A') {
$profpicUsers = $osDB->getAll( "SELECT distinct user.username, user.id, user.gender,  floor((to_days(curdate())-to_days(user.birth_date))/365.25)  as age, user.country, user.state_province, pic.picno  FROM ! as pic, ! as user WHERE user.id = pic.userid and user.status in (?, ?)  and (pic.album_id = 0 or pic.album_id = null)and pic.active = ? and user.id <> ? ! ORDER BY pic.ins_time desc, user.username asc limit !", array( USER_SNAP_TABLE, USER_TABLE , get_lang('status_enum','active'), 'active', 'Y', $xid, $bannedlist, $config['newest_profpics_dispcnt'] ) );
} else {
$profpicUsers = $osDB->getAll( "SELECT distinct user.username, user.id, user.gender,  floor((to_days(curdate())-to_days(user.birth_date))/365.25)  as age, user.country, user.state_province, pic.picno  FROM ! as pic, ! as user WHERE user.id = pic.userid and user.status in (?, ?) and user.gender = ? and (pic.album_id = 0 or pic.album_id = null) and pic.active = ? and user.id <> ? ! ORDER BY pic.ins_time desc, user.username asc limit !", array( USER_SNAP_TABLE, USER_TABLE , get_lang('status_enum','active'), 'active',  $profpicgender, 'Y', $xid, $bannedlist,  $config['newest_profpics_dispcnt'] ) );
}
replace
Code: [Select]
if ($profpicgender == 'A') {
$profpicUsers = $osDB->getAll( "SELECT distinct user.username, user.id, user.gender,  floor((to_days(curdate())-to_days(user.birth_date))/365.25)  as age, user.country, user.state_province, user.city, pic.picno  FROM ! as pic, ! as user WHERE user.id = pic.userid and user.status in (?, ?)  and (pic.album_id = 0 or pic.album_id = null)and pic.active = ? and user.id <> ? ! ORDER BY pic.ins_time desc, user.username asc limit !", array( USER_SNAP_TABLE, USER_TABLE , get_lang('status_enum','active'), 'active', 'Y', $xid, $bannedlist, $config['newest_profpics_dispcnt'] ) );
} else {
$profpicUsers = $osDB->getAll( "SELECT distinct user.username, user.id, user.gender,  floor((to_days(curdate())-to_days(user.birth_date))/365.25)  as age, user.country, user.state_province, user.city, pic.picno  FROM ! as pic, ! as user WHERE user.id = pic.userid and user.status in (?, ?) and user.gender = ? and (pic.album_id = 0 or pic.album_id = null) and pic.active = ? and user.id <> ? ! ORDER BY pic.ins_time desc, user.username asc limit !", array( USER_SNAP_TABLE, USER_TABLE , get_lang('status_enum','active'), 'active',  $profpicgender, 'Y', $xid, $bannedlist,  $config['newest_profpics_dispcnt'] ) );
}

Why can't only a code ['city'] see the name of the city ['cityname']?
Where is error?
« Last Edit: March 06, 2014, 10:47:47 AM by kosma »
osDate 2.6 | PHP: 5.3.18 | MySQL: 5.1.58 | Apache 2.2.23

*

kosma

  • *
  • 13
  • Sorry for my English
Re: View city instead of the country
« Reply #1 on: March 04, 2014, 06:16:38 AM »
Error:
osDate 2.6 | PHP: 5.3.18 | MySQL: 5.1.58 | Apache 2.2.23

*

kosma

  • *
  • 13
  • Sorry for my English
Re: View city instead of the country
« Reply #2 on: March 04, 2014, 06:37:16 AM »
8. random_profiles_display.php
Find
Code: [Select]
$list[] = $row;put before
Code: [Select]
$row['cityname'] = getCityName($row['country'], ((isset($row['state_province']) && $row['state_province']!='')?$row['state_province']:'AA'), ((isset($row['city']) && $row['city']!= 'AA')?$row['city']:'AA'), ((isset($row['county']) && $row['county'] != '')?$row['county']:'AA'));


9. recent_active_profiles_display.php
Find
Code: [Select]
$list[] = $row;put before
Code: [Select]
$row['cityname'] = getCityName($row['country'], ((isset($row['state_province']) && $row['state_province']!='')?$row['state_province']:'AA'), ((isset($row['city']) && $row['city']!= 'AA')?$row['city']:'AA'), ((isset($row['county']) && $row['county'] != '')?$row['county']:'AA'));
}
« Last Edit: March 06, 2014, 10:46:27 AM by kosma »
osDate 2.6 | PHP: 5.3.18 | MySQL: 5.1.58 | Apache 2.2.23

*

kosma

  • *
  • 13
  • Sorry for my English
Re: View city instead of the country
« Reply #3 on: March 06, 2014, 10:29:10 AM »
ad 7. Repaired

Find
Code: [Select]
if ($profpicgender == 'A') {
$profpicUsers = $osDB->getAll( "SELECT distinct user.username, user.id, user.gender,  floor((to_days(curdate())-to_days(user.birth_date))/365.25)  as age, user.country, user.state_province, pic.picno  FROM ! as pic, ! as user WHERE user.id = pic.userid and user.status in (?, ?)  and (pic.album_id = 0 or pic.album_id = null)and pic.active = ? and user.id <> ? ! ORDER BY pic.ins_time desc, user.username asc limit !", array( USER_SNAP_TABLE, USER_TABLE , get_lang('status_enum','active'), 'active', 'Y', $xid, $bannedlist, $config['newest_profpics_dispcnt'] ) );
} else {
$profpicUsers = $osDB->getAll( "SELECT distinct user.username, user.id, user.gender,  floor((to_days(curdate())-to_days(user.birth_date))/365.25)  as age, user.country, user.state_province, pic.picno  FROM ! as pic, ! as user WHERE user.id = pic.userid and user.status in (?, ?) and user.gender = ? and (pic.album_id = 0 or pic.album_id = null) and pic.active = ? and user.id <> ? ! ORDER BY pic.ins_time desc, user.username asc limit !", array( USER_SNAP_TABLE, USER_TABLE , get_lang('status_enum','active'), 'active',  $profpicgender, 'Y', $xid, $bannedlist,  $config['newest_profpics_dispcnt'] ) );
}
replace
Code: [Select]
if ($profpicgender == 'A') {
$profpicUsers = $osDB->getAll( "SELECT distinct user.username, user.id, user.gender,  floor((to_days(curdate())-to_days(user.birth_date))/365.25)  as age, user.country, user.county, user.state_province, user.city, pic.picno  FROM ! as pic, ! as user WHERE user.id = pic.userid and user.status in (?, ?)  and (pic.album_id = 0 or pic.album_id = null)and pic.active = ? and user.id <> ? ! ORDER BY pic.ins_time desc, user.username asc limit !", array( USER_SNAP_TABLE, USER_TABLE , get_lang('status_enum','active'), 'active', 'Y', $xid, $bannedlist, $config['newest_profpics_dispcnt'] ) );
} else {
$profpicUsers = $osDB->getAll( "SELECT distinct user.username, user.id, user.gender,  floor((to_days(curdate())-to_days(user.birth_date))/365.25)  as age, user.country, user.county, user.state_province, user.city, pic.picno  FROM ! as pic, ! as user WHERE user.id = pic.userid and user.status in (?, ?) and user.gender = ? and (pic.album_id = 0 or pic.album_id = null) and pic.active = ? and user.id <> ? ! ORDER BY pic.ins_time desc, user.username asc limit !", array( USER_SNAP_TABLE, USER_TABLE , get_lang('status_enum','active'), 'active',  $profpicgender, 'Y', $xid, $bannedlist,  $config['newest_profpics_dispcnt'] ) );
}



10. min_profile.tpl:
Find
Code: [Select]
{$item.countryname}Modify
Code: [Select]
{$item.cityname}
birthday_profiles_display.php:
Find
Code: [Select]
}
}
$list[] = $row;
put before
Code: [Select]
if (isset($row['city'])) {
$row['cityname'] = getCityName($row['country'], ((isset($row['state_province']) && $row['state_province']!='')?$row['state_province']:'AA'), ((isset($row['city']) && $row['city']!= '')?$row['city']:'AA'), ((isset($row['county']) && $row['county'] != '')?$row['county']:'AA'));
}

Find
Code: [Select]
if ($bdpgender == 'A') {
$bdpUsers = $osDB->getAll( "SELECT user.username, user.id, user.gender,  floor((to_days(curdate())-to_days(user.birth_date))/365.25)  as age, user.country, user.state_province  FROM ! as user WHERE user.status in (?, ?)  and month(user.birth_date) = month(now()) and dayofmonth(user.birth_date) = dayofmonth(now()) and user.id <> ? ! ORDER BY user.username", array( USER_TABLE , get_lang('status_enum','active'), 'active', $uid, $bannedlist ) );
} else {
$bdpUsers = $osDB->getAll( "SELECT user.username, user.id, user.gender,  floor((to_days(curdate())-to_days(user.birth_date))/365.25)  as age, user.country, user.state_province  FROM ! as user WHERE user.status in (?, ?)  and month(user.birth_date) = month(now()) and dayofmonth(user.birth_date) = dayofmonth(now())  and user.gender = ? and user.id <> ? ! ORDER BY user.username", array( USER_TABLE , get_lang('status_enum','active'), 'active',  $bdpgender, $uid, $bannedlist ) );
}
Modify
Code: [Select]
if ($bdpgender == 'A') {
$bdpUsers = $osDB->getAll( "SELECT user.username, user.id, user.gender,  floor((to_days(curdate())-to_days(user.birth_date))/365.25)  as age, user.country, user.state_province, user.city, user.county  FROM ! as user WHERE user.status in (?, ?)  and month(user.birth_date) = month(now()) and dayofmonth(user.birth_date) = dayofmonth(now()) and user.id <> ? ! ORDER BY user.username", array( USER_TABLE , get_lang('status_enum','active'), 'active', $uid, $bannedlist ) );
} else {
$bdpUsers = $osDB->getAll( "SELECT user.username, user.id, user.gender,  floor((to_days(curdate())-to_days(user.birth_date))/365.25)  as age, user.country, user.state_province, user.city, user.county  FROM ! as user WHERE user.status in (?, ?)  and month(user.birth_date) = month(now()) and dayofmonth(user.birth_date) = dayofmonth(now())  and user.gender = ? and user.id <> ? ! ORDER BY user.username", array( USER_TABLE , get_lang('status_enum','active'), 'active',  $bdpgender, $uid, $bannedlist ) );
}



END :-)
« Last Edit: March 06, 2014, 10:45:33 AM by kosma »
osDate 2.6 | PHP: 5.3.18 | MySQL: 5.1.58 | Apache 2.2.23

*

kosma

  • *
  • 13
  • Sorry for my English
Re: View city instead of the country
« Reply #4 on: March 06, 2014, 11:05:06 AM »
Visible changes in:

- Members celebrating Birthday Today
- Members near (City)
- Newest profile pictures
- Our Members
- Newest Profiles
- Recently Active Users
osDate 2.6 | PHP: 5.3.18 | MySQL: 5.1.58 | Apache 2.2.23

Re: View city instead of the country
« Reply #5 on: April 20, 2014, 05:25:05 PM »
Do u know if it works with 2.65? I tried and just got white screen

Re: View city instead of the country
« Reply #6 on: May 28, 2016, 08:15:02 AM »
Thank you. Good work.  :D