Support Forums - Classified Ads Script Osclass
Osclass theme support => Free themes => Sofia Osclass Responsive Theme => Topic started by: victorelectronics on February 18, 2016, 09:33:14 AM
-
Hello,
I have a problem with the page user profile : it block or load in 5- 10 min. I have 8 country installed with all city.
After I choose a region and want to choose the city I have all city from all country.
If you know what I can do in this case.
Thanks for help.
The website is xannia.com
-
@victorelectronics
Thanks for reporting, this is caused by loading everything at once.
Please go to user-profile.php and do this:
Find this code:
<div class="row">
<label for="country"><?php _e('Country', 'sofia'); ?> <sup>*</sup></label>
<?php UserForm::country_select(osc_get_countries(), osc_user()); ?>
</div>
above this block, place following code:
<?php $user = osc_user(); ?>
<?php $country = Country::newInstance()->listAll(); ?>
<?php
if(count($country) <= 1) {
$u_country = Country::newInstance()->listAll();
$u_country = $u_country[0];
$user['fk_c_country_code'] = $u_country['pk_c_code'];
}
?>
Now find this block:
<div class="row">
<label for="country"><?php _e('Country', 'sofia'); ?> <sup>*</sup></label>
<?php UserForm::country_select(osc_get_countries(), osc_user()); ?>
</div>
<div class="row">
<label for="region"><?php _e('Region', 'sofia'); ?> <sup>*</sup></label>
<?php UserForm::region_select(osc_get_regions(), osc_user()); ?>
</div>
<div class="row">
<label for="city"><?php _e('City', 'sofia'); ?> <sup>*</sup></label>
<?php UserForm::city_select(osc_get_cities(), osc_user()); ?>
</div>
Replace it with:
<div class="row">
<label for="country"><?php _e('Country', 'sofia'); ?> <sup>*</sup></label>
<?php UserForm::country_select(Country::newInstance()->listAll(), osc_user()); ?>
</div>
<div class="row">
<label for="region"><?php _e('Region', 'sofia'); ?> <sup>*</sup></label>
<?php UserForm::region_select($user['fk_c_country_code'] <> '' ? osc_get_regions($user['fk_c_country_code']) : '', osc_user()) ; ?>
</div>
<div class="row">
<label for="city"><?php _e('City', 'sofia'); ?> <sup>*</sup></label>
<?php UserForm::city_select($user['fk_i_region_id'] <> '' ? osc_get_cities($user['fk_i_region_id']) : '', osc_user()) ; ?>
</div>
Let me know if it helped ;)
-
OK.
Thank you. i will do it .