Advertisement:

Author Topic: Drop-down selection for city at search  (Read 17819 times)

akapar

  • Premium
  • Full Member
  • *****
  • Posts: 152
Drop-down selection for city at search
« on: August 11, 2011, 08:12:36 pm »
Hi there,

I would like to have a drop-down selection for city at the search menu. I think this is much more convenient for users rather than typing the name of the city. I think some code change should be made at search.php around line 80 but I don't know how to do it. Can anyone help with this?

Thanks

Atillla

RajaSekar

  • Hero Member
  • *****
  • Posts: 791
  • ராஜசேகர்
Re: Drop-down selection for city at search
« Reply #1 on: August 11, 2011, 08:25:32 pm »
i inserted the above code but it dosnt works for selecting city options(drop down) in inc.search.php

Code: [Select]
<?php  if ( osc_count_cities() ) { ?>
<?php osc_cities_select('sCity'null__('Select a City''modern')) ; ?>
<?php  ?>

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Drop-down selection for city at search
« Reply #2 on: August 12, 2011, 01:50:46 pm »
try this:


                                
<h3><strong><?php _e('Location''modern') ; ?></strong></h3>
                                <div class="row one_input">
                                    <h6><?php _e('City''modern'); ?></h6>
                                    <?php $aCities City::newInstance()->listAll(); ?>
                                    <?php if(count($aCities) > ) { ?>
                                    <select name="sCity" id="sCity">
                                        <?php foreach($aCities as $city) { ?>
                                        <option value="<?php echo $city['s_name'] ; ?>"><?php echo $city['s_name'] ; ?></option>
                                        <?php ?>
                                    </select>
                                    <?php ?>
                                </div>

RajaSekar

  • Hero Member
  • *****
  • Posts: 791
  • ராஜசேகர்
Re: Drop-down selection for city at search
« Reply #3 on: August 12, 2011, 05:44:30 pm »
it works perfectly for me

Diablos

  • Full Member
  • ***
  • Posts: 127
Re: Drop-down selection for city at search
« Reply #4 on: August 12, 2011, 07:06:33 pm »
how display cities in alphabetical order?

akapar

  • Premium
  • Full Member
  • *****
  • Posts: 152
Re: Drop-down selection for city at search
« Reply #5 on: August 14, 2011, 11:53:33 pm »
When I install cars or real estate plugins, the sidebar search stops working for me and doesn't give any results. This is regardless of the change above mentioned by Juan. At other categories the sidebar search still works fine. How is it for you guys, is the sidebar search working for you?

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382
Re: Drop-down selection for city at search
« Reply #6 on: August 16, 2011, 06:45:39 pm »
It seems to work fine to me. Which plugins versions are you using? Can I see the results? Do you have online the site?

akapar

  • Premium
  • Full Member
  • *****
  • Posts: 152
Re: Drop-down selection for city at search
« Reply #7 on: August 17, 2011, 01:51:20 am »
Please check the real estate sidebar search here

http://www.jedaar.com/index.php?page=search&sCategory=101

I couldn't upload the plugin via Admin panel, it was giving error message so I uploaded via ftp, maybe this is the reason. I am using the latest version which is at tar format. I am converting it to zip before I try to load it from admin panel.

Diablos

  • Full Member
  • ***
  • Posts: 127
Re: Drop-down selection for city at search
« Reply #8 on: August 17, 2011, 02:15:45 pm »
how display cities in alphabetical order?
pls

Juan Ramón

  • Osclass Developer
  • Hero Member
  • *****
  • Posts: 2382

loveisabird777

  • Newbie
  • *
  • Posts: 13
Re: Drop-down selection for city at search
« Reply #10 on: August 23, 2011, 10:36:32 pm »
where i have to insert the code for the drop down for city can u please guide me ? as i am also looking at the same feature to be built in my own classified or can we have a city list populated which is dependent on the region vice verse ? can u please guide me ?

kalkaska

  • Newbie
  • *
  • Posts: 37
Re: Drop-down selection for city at search
« Reply #11 on: August 24, 2011, 05:03:16 pm »
Where exactly do we place this code? Than You, Jerry

luka

  • Newbie
  • *
  • Posts: 1
Re: Drop-down selection for city at search
« Reply #12 on: November 15, 2012, 01:58:27 pm »
a small modification to the script where the appropriate city is selected automatically in the search result

Code: [Select]
<h3><strong><?php _e('Location''modern') ; ?></strong></h3>
                                <div class="row one_input">
                                    <h6><?php _e('City''modern'); ?></h6>
                                    <?php $aCities City::newInstance()->listAll(); ?>
                                    <?php if(count($aCities) > ) { ?>
                                    <select name="sCity" id="sCity">
<option value="">Select a city</option>
                                        <?php foreach($aCities as $city) { ?>

                                        <option value="<?php echo $city['s_name'] ; ?>" <?php if (osc_esc_htmlosc_search_city() )==$city['s_name']) echo ' selected="selected" '?>><?php echo $city['s_name'] ; ?></option>
                                        <?php ?>
                                    </select>
                                    <?php ?>
                                </div>


serjuc11111

  • Hero Member
  • *****
  • Posts: 814
Re: Drop-down selection for city at search
« Reply #13 on: January 17, 2013, 05:59:27 pm »
hy!add "select a city" in inc.search....how to select a city from a region select?if i select region when i click "select a city" to display only city from that region?can u help me with code?thank you!

kanum

  • Newbie
  • *
  • Posts: 20
Re: Drop-down selection for city at search
« Reply #14 on: January 30, 2013, 09:26:04 pm »
hy!add "select a city" in inc.search....how to select a city from a region select?if i select region when i click "select a city" to display only city from that region?can u help me with code?thank you!

I have take a look at code:

Code: [Select]
                                <div class="row one_input">
                                    <?php $aCities City::newInstance()->listAll(); ?>
                                    <?php if(count($aCities) > ) { ?>
                                    <select name="sCity" id="sCity">
                                    <option value=""><?php _e('Select a city...')?></option>
                                        <?php foreach($aCities as $city) { ?>
                                        <option value="<?php echo $city['s_name'] ; ?>"><?php echo $city['s_name'] ; ?></option>
                                        <?php ?>
                                    </select>
                                    <?php ?>
                                </div>

I see the code listAll is for show all cities want is the code for show Cities by region?

Thanks

Guys please a little help here :)
« Last Edit: February 01, 2013, 08:26:20 pm by kanum »