Advertisement:

Author Topic: [Tuturial]Show all countries,regions and cities in sidebar  (Read 29648 times)

pmay68

  • Newbie
  • *
  • Posts: 1
Re: [Tuturial]Show all countries,regions and cities in sidebar
« Reply #15 on: January 02, 2013, 03:18:22 am »
Hello new here,

I think I am looking for the same thing but am unsure how to make the changes as per directions above.   In main.php under section sidebar I currently show this under themes modern

Code: [Select]
<div id="sidebar">
                <div class="navigation">
                    <?php if(osc_count_list_regions() > ) { ?>
                    <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_list_region_url() ; ?>"><?php echo osc_list_region_name() ; ?></a> <em>(<?php echo osc_list_region_items() ; ?>)</em></li>
                        <?php ?>
                        </ul>
                    </div>
                    <?php ?>
                </div>
            </div>
        </div>
        <?php osc_current_web_theme_path('footer.php') ; ?>
    </body>
</html>

Can you please make the corrections so that my side bar shows only the cities within my only region which is Texas instead of Just Texas.   
« Last Edit: January 02, 2013, 03:23:01 am by pmay68 »

gesthost

  • Guest
Show all countries in sidebar
« Reply #16 on: January 02, 2013, 04:48:59 am »
Hello and my wishes of a Happy New Year to you all.
Also thank you for this great code I'm just starting to use.

1. I would like to display ALL countries in the side bar of main.php
I managed to display the countries with items but would like them ALL.
How to do that?

2. Also how to display alphabetically ascendent?
When I enter at the code

<?php View::newInstance()->_exportVariableToView('list_countries', Search::newInstance()->listCountries('%%%%', '>=', 'country_name ASC') ) ; ?>

countries doesn't show anymore)

Thank you for your patience.

Best regards.

maxeem

  • Newbie
  • *
  • Posts: 13
Re: [Tuturial]Show all countries,regions and cities in sidebar
« Reply #17 on: January 24, 2013, 12:19:19 pm »
hello Osclasser,

I used the following code because I want to see all countries and their regions!
I have 3 countries but the code shows me the first country and its regions 3 times and the second and third country does not appear.

idea?

thanks in advance :)

Code: [Select]
<?php 
$countries = array( osc_list_country_code() => osc_list_country_name());
 while(osc_has_list_countries() ) {
 foreach ($countries as $key => $value) {
 View::newInstance()->_exportVariableToView('list_regions'Search::newInstance()->listRegions($key'>=''region_name ASC') ) ;  ?>


<div class="box location">
  <h3><strong><?php _e("$value"'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> (<?php echo osc_list_region_items() ; ?>)
  </li>
   <?php ?>
   </ul>
<?php ?>
</div>
<?php ?>

maxeem

  • Newbie
  • *
  • Posts: 13
Re: [Tuturial]Show all countries,regions and cities in sidebar
« Reply #18 on: January 24, 2013, 03:44:14 pm »
hi,
i got it :) :)

Legion

  • Hero Member
  • *****
  • Posts: 622
  • I am founder of top20remedies.com buyeradvise.com
Re: [Tuturial]Show all countries,regions and cities in sidebar
« Reply #19 on: February 05, 2013, 01:53:32 pm »
i want quikr.com like cities code at left sidebar

phmig.com

  • Full Member
  • ***
  • Posts: 238
Re: [Tuturial]Show all countries,regions and cities in sidebar
« Reply #20 on: March 21, 2013, 09:17:51 am »
Hi Legion, did you manage to do this?

alfetra

  • Newbie
  • *
  • Posts: 30
Re: [Tuturial]Show all countries,regions and cities in sidebar
« Reply #21 on: March 22, 2013, 03:04:14 am »
hello ! i tried all the code posting here and always giving me the same error :


Code: [Select]
Parse error: syntax error, unexpected $end in public_html/www.youadd.us/oc-content/themes/modern/main.php on line 140
please help


thank you .

Hostingames

  • Full Member
  • ***
  • Posts: 189
Re: [Tuturial]Show all countries,regions and cities in sidebar
« Reply #22 on: April 11, 2013, 03:36:52 am »
good evening
I want to know how to add city region postal code and other options next to select a category, and also what you have to edit php file like picture
http://www.hostingpics.net/viewer.php?id=273438Sanstitre.png

I use the theme France
thank you

Hostingames

  • Full Member
  • ***
  • Posts: 189
Re: [Tuturial]Show all countries,regions and cities in sidebar
« Reply #23 on: April 19, 2013, 05:23:57 pm »
bonjour

j'ai besoin aide svp merci

je voudrais ajouter régions et code postaux a cote de Sélectionnez une catégorie c'est il possible de faire ? utiliser le thèmes France je recherche le code  et  quelle fichier faut édite ( main ou header   voila pourquoi je demande l'aide il me reste plus ça a faire 

bhanu4funn

  • Newbie
  • *
  • Posts: 3
Re: [Tuturial]Show all countries,regions and cities in sidebar
« Reply #24 on: May 11, 2013, 03:50:48 pm »
Dear sir, I want to show City Areas with their links on my site. Please explain me how to do it?

Silent Reader

  • Jr. Member
  • **
  • Posts: 54
Re: [Tuturial]Show all countries,regions and cities in sidebar
« Reply #25 on: May 25, 2013, 03:32:32 am »
is it possible to display only few number of region instead of showing them all..

phmig.com

  • Full Member
  • ***
  • Posts: 238
Re: [Tuturial]Show all countries,regions and cities in sidebar
« Reply #26 on: May 25, 2013, 12:58:10 pm »
Hi,

Yes.

1] Add loop counter
2] Select only top 5 or 10 or xyz region
3] Select only region with ads (a little bit complicated. never tried though.)

respect25

  • Newbie
  • *
  • Posts: 10
  • new roollver site http://anunturi-reale.com/
Re: [Tuturial]Show all countries,regions and cities in sidebar
« Reply #27 on: August 02, 2013, 12:42:54 am »
Finnaly, i finnish and all it`s done. thank.

www.anunturi-reale.com

bettyb_87

  • Newbie
  • *
  • Posts: 19
Re: [Tuturial]Show all countries,regions and cities in sidebar
« Reply #28 on: October 05, 2013, 01:33:34 am »
Hi all sorry for ressurect an old topic but since I'd like to make something similar I didn't think starting a new one could be a good idea  ???
I tried the first post code and it didn't work for me in modern theme, is this because of the new version of osclass? Anyone knows how to make this work again? Thanks

bettyb_87

  • Newbie
  • *
  • Posts: 19
Re: [Tuturial]Show all countries,regions and cities in sidebar
« Reply #29 on: October 07, 2013, 11:37:47 pm »
There's noone that knows how to do this? I tried with this helpers but doesn't work http://doc.osclass.org/HLocation.php
here's my code, I eliminate the "if" but it doesn't work  :'(
Code: [Select]
<div class="box location">
                        <h3 class="block-title"><?php _e("Sfoglia per regione"'hyperlink'); ?></h3>
                        <ul>
                        <?php while(osc_has_countries() ) { ?>
                            <li><a href="osc_country_url()"><?php echo osc_country_name() ; ?></a> <em>(<?php echo osc_country_items() ; ?>)</em></li>
                        <?php ?>
                        </ul>
                    </div>
please help  ::)