This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

mohsan

  • ***
  • 42 posts
Footer Menu
« 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

*

MB Themes

Re: Footer Menu
« Reply #1 on: February 28, 2017, 09:29:23 PM »
@mohsan
in footer.php in theme folder you have:
Code: [Select]
        <?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:
Code: [Select]
        <?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 ?>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

mohsan

  • ***
  • 42 posts
Re: Footer Menu
« Reply #2 on: March 02, 2017, 10:11:20 PM »
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?
« Last Edit: March 02, 2017, 10:44:40 PM by mohsan »

*

MB Themes

Re: Footer Menu
« Reply #3 on: March 03, 2017, 09:22:08 AM »
@mohsan
Thanks for suggestion, will consider it in next update.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

mohsan

  • ***
  • 42 posts
Re: Footer Menu
« Reply #4 on: March 03, 2017, 04:08:57 PM »
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

*

Ivanko

  • *****
  • 388 posts
Re: Footer Menu
« Reply #5 on: March 04, 2017, 12:15:57 AM »
@Mohsan

Replace code :

Code: [Select]
<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:

Code: [Select]
<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>

*

mohsan

  • ***
  • 42 posts
Re: Footer Menu
« Reply #6 on: March 04, 2017, 02:09:29 PM »
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

Marked as best answer by frosticek on March 04, 2017, 03:32:59 PM
*

Ivanko

  • *****
  • 388 posts
Re: Footer Menu
« Reply #7 on: March 04, 2017, 02:25:51 PM »
Then you just remove counts :

Code: [Select]
<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>

*

mohsan

  • ***
  • 42 posts
Re: Footer Menu
« Reply #8 on: March 04, 2017, 03:59:19 PM »
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

*

mohsan

  • ***
  • 42 posts
Re: Footer Menu
« Reply #9 on: March 04, 2017, 04:08:08 PM »
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

*

Ivanko

  • *****
  • 388 posts
Re: Footer Menu
« Reply #10 on: March 04, 2017, 04:53:54 PM »
@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.

*

amraneo

  • ***
  • 31 posts
Re: Footer Menu
« Reply #11 on: August 07, 2017, 03:35:35 PM »
@mohsan
in footer.php in theme folder you have:
Code: [Select]
        <?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:
Code: [Select]
        <?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,

*

MB Themes

Re: Footer Menu
« Reply #12 on: August 07, 2017, 04:05:11 PM »
@amraneo
what does not work there?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

amraneo

  • ***
  • 31 posts
Re: Footer Menu
« Reply #13 on: August 07, 2017, 04:59:51 PM »
There is nothing shown in the footer right side with the cities code. When I put back the code of regions theses are shown.

*

MB Themes

Re: Footer Menu
« Reply #14 on: August 07, 2017, 05:03:53 PM »
@amraneo
Then try to refresh status for cities/locations and if does not work, you need to play with this line:
Code: [Select]
<?php $cities CityStats::newInstance()->listCities('%%%%''>''i_num_items DESC'); ?>
alternative could be:
Code: [Select]
<?php $cities CityStats::newInstance()->listCities('''>''i_num_items DESC'); ?>
Try to check on osclass forums how people use this function.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots