Advertisement:

Author Topic: Show All Region on Home Page Location  (Read 17191 times)

Harsh Vora

  • Jr. Member
  • **
  • Posts: 50
Show All Region on Home Page Location
« on: August 03, 2011, 11:13:51 am »
hello,
I want to show all regions on home page location search, even if there is no ad in from that region.

mrdl

  • Jr. Member
  • **
  • Posts: 92
Re: Show All Region on Home Page Location
« Reply #1 on: August 04, 2011, 03:11:41 am »
I want the same thing like Craigslist good luck getting it

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Show All Region on Home Page Location
« Reply #2 on: August 04, 2011, 01:53:00 pm »
You should change in the main.php of your theme the next code:

                        
<?php if(osc_count_list_cities()>0) {?>
                        <div class="box location">
                            <h3><strong><?php _e("Location"'modern'); ?></strong></h3>
                            <ul>
                            <?php while(osc_has_list_cities()) { ?>
                                <li><a href="<?php echo osc_search_url(array('sCity' => osc_list_city_name()));?>"><?php echo osc_list_city_name();?></a> <em>(<?php echo osc_list_city_items();?>)</em></li>
                            <?php ?>
                            </ul>
                        </div>
                        <?php ?>


for the next code:

                        
<?php View::newInstance()->_exportVariableToView('list_regions'Search::newInstance()->listRegions('%%%%''>=') ) ; ?>
                        <?php if(osc_count_list_regions() > 0) {?>
                        <div class="box location">
                            <h3><strong><?php _e("Location"'modern'); ?></strong></h3>
                            <ul>
                            <?php while(osc_has_list_regions()) { ?>
                                <li><a href="<?php echo osc_search_url(array('sRegion' => osc_list_region_name()));?>"><?php echo osc_list_region_name();?></a> <em>(<?php echo osc_list_region_items();?>)</em></li>
                            <?php ?>
                            </ul>
                        </div>
                        <?php ?>

Diablos

  • Full Member
  • ***
  • Posts: 127
Re: Show All Region on Home Page Location
« Reply #3 on: August 04, 2011, 02:27:43 pm »
to see all cities? tnx

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Show All Region on Home Page Location
« Reply #4 on: August 04, 2011, 02:31:17 pm »

                        
<?php View::newInstance()->_exportVariableToView('list_cities'Search::newInstance()->listCities('%%%%''>=') ) ; ?>
                        <?php if(osc_count_list_cities()>0) {?>
                        <div class="box location">
                            <h3><strong><?php _e("Location"'modern'); ?></strong></h3>
                            <ul>
                            <?php while(osc_has_list_cities()) { ?>
                                <li><a href="<?php echo osc_search_url(array('sCity' => osc_list_city_name()));?>"><?php echo osc_list_city_name();?></a> <em>(<?php echo osc_list_city_items();?>)</em></li>
                            <?php ?>
                            </ul>
                        </div>
                        <?php ?>

Diablos

  • Full Member
  • ***
  • Posts: 127
Re: Show All Region on Home Page Location
« Reply #5 on: August 04, 2011, 03:08:41 pm »
it works, but:
1) it's possible to see cities in alphabetical order? (I think it's important)
2) and to show them in two columns?

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Show All Region on Home Page Location
« Reply #6 on: August 04, 2011, 03:16:47 pm »
it works, but:
1) it's possible to see cities in alphabetical order? (I think it's important)
2) and to show them in two columns?

1. You should use the next line
<?php View::newInstance()->_exportVariableToView('list_cities'Search::newInstance()->listCities('%%%%''>=''city_name ASC') ) ; ?>

2. You should modify the design

Diablos

  • Full Member
  • ***
  • Posts: 127
Re: Show All Region on Home Page Location
« Reply #7 on: August 04, 2011, 05:50:39 pm »
I've problem with cities with apostroph...

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Show All Region on Home Page Location
« Reply #8 on: August 04, 2011, 06:36:56 pm »
Which is your problem? Can I see it?

Diablos

  • Full Member
  • ***
  • Posts: 127
Re: Show All Region on Home Page Location
« Reply #9 on: August 04, 2011, 06:51:51 pm »
my site is http://bachecannunci.net/

In Italy there is a city called L'Aquila. When i add an item on it I select its region (Abruzzo) and then when I'm writing L'Aquila doesn't appear the automatic suggestion. However I write all the name of the city and add the item. But in homepage write always 0 item and when I click on the city doesn't find any item. Same problem if i try to search a region called Valle D'Aosta.

Romeo

  • Jr. Member
  • **
  • Posts: 63
Re: Show All Region on Home Page Location
« Reply #10 on: August 04, 2011, 11:19:19 pm »
This is very nice. There is a little something missing. My site is bilingual.....English and French. When I switch to French the region names are still showing in English. Is there a way to have these show up in French when on the French interface. Thank you.

holydevil

  • Newbie
  • *
  • Posts: 41
Re: Show All Region on Home Page Location
« Reply #11 on: August 05, 2011, 01:23:57 pm »

                        
<?php View::newInstance()->_exportVariableToView('list_cities'Search::newInstance()->listCities('%%%%''>=') ) ; ?>
                        <?php if(osc_count_list_cities()>0) {?>
                        <div class="box location">
                            <h3><strong><?php _e("Location"'modern'); ?></strong></h3>
                            <ul>
                            <?php while(osc_has_list_cities()) { ?>
                                <li><a href="<?php echo osc_search_url(array('sCity' => osc_list_city_name()));?>"><?php echo osc_list_city_name();?></a> <em>(<?php echo osc_list_city_items();?>)</em></li>
                            <?php ?>
                            </ul>
                        </div>
                        <?php ?>


i follow your code, it works.
but it does not show how many ads posted in that region.
i posted 3-4 ads on the same region, it does not show the value.

Diablos

  • Full Member
  • ***
  • Posts: 127
Re: Show All Region on Home Page Location
« Reply #12 on: August 05, 2011, 02:00:07 pm »

                        
<?php View::newInstance()->_exportVariableToView('list_cities'Search::newInstance()->listCities('%%%%''>=') ) ; ?>
                        <?php if(osc_count_list_cities()>0) {?>
                        <div class="box location">
                            <h3><strong><?php _e("Location"'modern'); ?></strong></h3>
                            <ul>
                            <?php while(osc_has_list_cities()) { ?>
                                <li><a href="<?php echo osc_search_url(array('sCity' => osc_list_city_name()));?>"><?php echo osc_list_city_name();?></a> <em>(<?php echo osc_list_city_items();?>)</em></li>
                            <?php ?>
                            </ul>
                        </div>
                        <?php ?>


i follow your code, it works.
but it does not show how many ads posted in that region.
i posted 3-4 ads on the same region, it does not show the value.
true

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Show All Region on Home Page Location
« Reply #13 on: August 05, 2011, 02:05:48 pm »
Maybe because when you insert the item you don't choose the region/city in the autocomplete?

Diablos

  • Full Member
  • ***
  • Posts: 127
Re: Show All Region on Home Page Location
« Reply #14 on: August 05, 2011, 02:17:21 pm »
no I dont' think, I always use autocomplete...
for the apostrophe problem?