Osclass Support Forums
Osclass theme support => Veronika Osclass Responsive Theme => Topic started by: mohsan on February 28, 2017, 08:43:22 PM
-
Dear Admin,
In the bottom right corner of the footer. It show the state name. would you like to let me know how can i i change to city name instead of state name.
Thanks
Mohsan
-
@mohsan
in footer.php in theme folder you have:
<?php $regions = RegionStats::newInstance()->listRegions('%%%%', '>', 'i_num_items DESC'); ?>
<?php $i = 1; ?>
<?php foreach($regions as $r) { ?>
<?php if($i <= 12) { ?>
<span class="region-span"><a href="<?php echo osc_search_url(array('page' => 'search', 'sRegion' => $r['pk_i_id']));?>"><?php echo $r['s_name']; ?></a></span>
<?php $i++; ?>
<?php } ?>
<?php } ?>
change it to:
<?php $cities = CityStats::newInstance()->listCities('%%%%', '>', 'i_num_items DESC'); ?>
<?php $i = 1; ?>
<?php foreach($cities as $r) { ?>
<?php if($i <= 12) { ?>
<span class="region-span"><a href="<?php echo osc_search_url(array('page' => 'search', 'sCity' => $r['pk_i_id']));?>"><?php echo $r['s_name']; ?></a></span>
<?php $i++; ?>
<?php } ?>
<?php } ?>
-
Is that possible, you can add this option in the admin panel.
1. Show/hide Footer Menu
2. Show city or Region name (if possible) (One more thing. also define the city limit max 10 to 15 cities can be show.According to design need to be adjusted. if possible)
<?php $cities = CityStats::newInstance()->listCities('%%%%', '>', 'i_num_items DESC'); ?>
<?php $i = 1; ?>
<?php foreach($cities as $r) { ?>
<?php if($i <= 12) { ?>
<span class="region-span"><a href="<?php echo osc_search_url(array('page' => 'search', 'sCity' => $r['pk_i_id']));?>"><?php echo $r['s_name']; ?></a></span>
<?php $i++; ?>
<?php } ?>
<?php } ?>
This code i replace with sregion. It can't show me any cities in the footer. can you please let me know what mistake am i doing?
-
@mohsan
Thanks for suggestion, will consider it in next update.
-
Dear Frosticek,
This code is not working.
<?php $cities = CityStats::newInstance()->listCities('%%%%', '>', 'i_num_items DESC'); ?>
<?php $i = 1; ?>
<?php foreach($cities as $r) { ?>
<?php if($i <= 12) { ?>
<span class="region-span"><a href="<?php echo osc_search_url(array('page' => 'search', 'sCity' => $r['pk_i_id']));?>"><?php echo $r['s_name']; ?></a></span>
<?php $i++; ?>
<?php } ?>
<?php } ?>
It show blank instead of showing cities.
Thanks
Mohsan
-
@Mohsan
Replace code :
<div class="location">
<?php $regions = RegionStats::newInstance()->listRegions('%%%%', '>', 'i_num_items DESC'); ?>
<?php $i = 1; ?>
<?php foreach($regions as $r) { ?>
<?php if($i <= 12) { ?>
<span class="region-span"><a href="<?php echo osc_search_url(array('page' => 'search', 'sRegion' => $r['pk_i_id']));?>"><?php echo $r['s_name']; ?></a></span>
<?php $i++; ?>
<?php } ?>
<?php } ?>
</div>
With this one:
<div class="location">
<?php $i_count=0;
while(osc_has_list_cities()) { ?>
<a href="<?php echo osc_search_url(array('sCity' => osc_list_city_name()));?>"><?php echo osc_list_city_name() ; ?> <em>(<?php echo osc_list_city_items() ; ?>)</em></a>
<?php $i_count++;
if ($i_count==25) {
break;
} } ?>
</div>
-
Dear Ivanko,
Thanks this code work for me. I need some change in design aspect. I am sending you image. Please have a look on it.
1. I don't need the count of the item
2. need to show the city name same as it before you showing the region.
Thanks
Mohsan
-
Then you just remove counts :
<div class="location">
<?php $i_count=0;
while(osc_has_list_cities()) { ?>
<a href="<?php echo osc_search_url(array('sCity' => osc_list_city_name()));?>"><?php echo osc_list_city_name() ; ?> </a>
<?php $i_count++;
if ($i_count==25) {
break;
} } ?>
</div>
-
Thank you. I add one more class and also i edit in the cities function. it show the same output. which i need.
Thanks for your help
-
Sorry to bother you again and again. one more thing. it's showing cities name design is also fine. now i want one more small change, show the latest ads post city name instead of showing the alphabetic.
Thanks
Mohsan
-
@Mohsan
Sorry we are discussing bugs and malfunctions, missed items in theme, in order admin can follow up and upgrade the staff if he consider so.
For the custom functions better you go to osclass forum, sure you will get faster reply.
-
@mohsan
in footer.php in theme folder you have:
<?php $regions = RegionStats::newInstance()->listRegions('%%%%', '>', 'i_num_items DESC'); ?>
<?php $i = 1; ?>
<?php foreach($regions as $r) { ?>
<?php if($i <= 12) { ?>
<span class="region-span"><a href="<?php echo osc_search_url(array('page' => 'search', 'sRegion' => $r['pk_i_id']));?>"><?php echo $r['s_name']; ?></a></span>
<?php $i++; ?>
<?php } ?>
<?php } ?>
change it to:
<?php $cities = CityStats::newInstance()->listCities('%%%%', '>', 'i_num_items DESC'); ?>
<?php $i = 1; ?>
<?php foreach($cities as $r) { ?>
<?php if($i <= 12) { ?>
<span class="region-span"><a href="<?php echo osc_search_url(array('page' => 'search', 'sCity' => $r['pk_i_id']));?>"><?php echo $r['s_name']; ?></a></span>
<?php $i++; ?>
<?php } ?>
<?php } ?>
Hi,
I changed the regions code to cities code but it doesn't work, could you fixe it please ?
Regards,
-
@amraneo
what does not work there?
-
There is nothing shown in the footer right side with the cities code. When I put back the code of regions theses are shown.
-
@amraneo
Then try to refresh status for cities/locations and if does not work, you need to play with this line:
<?php $cities = CityStats::newInstance()->listCities('%%%%', '>', 'i_num_items DESC'); ?>
alternative could be:
<?php $cities = CityStats::newInstance()->listCities('', '>', 'i_num_items DESC'); ?>
Try to check on osclass forums how people use this function.
-
Then you just remove counts :
<div class="location">
<?php $i_count=0;
while(osc_has_list_cities()) { ?>
<a href="<?php echo osc_search_url(array('sCity' => osc_list_city_name()));?>"><?php echo osc_list_city_name() ; ?> </a>
<?php $i_count++;
if ($i_count==25) {
break;
} } ?>
</div>
Hey @Ivanko
thanks for the tips. its now showing. but one more thing. how to arrange them in column as shown in veronika demo site?
also is there a way to only show popular cities instead of alphabetical order? Thanks
-
if you use original footer.php everything works fine eddy
-
I want to change the color of the menu of which folder is the file menu
veronika themes
-
@zhongguo
All styles are in CSS files, you can find it using inspect tools from your browser.