2013-05-27 25 views
3

我在osclass功能..如何鏈接osclass中的城市地區?

function item_city_area($cityarea_txt, $cityarea_select_txt) { 
     $aCityArea = osc_get_cityarea() ; 
     $item  = (osc_item() != null) ? osc_item() : array() ; 

     switch(count($aCityArea)) { 
      case 0:  // 0 regions ?> 
<div class="clearfix"> 
<label><?php echo $cityarea_txt ; ?></label> 
<div class="input"> 
    <input class="city_name" id="city_name" type="text" name="city" value="<?php echo get_city_name($item) ; ?>" /> 
</div> 
</div> 
<?php 
      break; 
      case 1:  ?> 
<input class="city_id" id="city_id" type="hidden" name="cityId" value="<?php echo get_city_id($item) ; ?>" /> 
<?php 
      break; 
      default: // more than one region ?> 
<div class="clearfix"> 
<label><?php echo $cityarea_txt ; ?></label> 
<div class="input"> 
    <select class="cityarea_id" id="cityarea_id" name="cityArea"> 
    <option value=""><?php echo $cityarea_select_txt ; ?></option> 
    <?php //foreach($aCityArea as $city) { ?> 
    <option value="<?php echo $city['pk_i_id'] ; ?>"><?php echo $city['s_name'] ; ?></option> 
    <?php //} ?> 
    </select> 
</div> 
</div> 
<?php 
      break; 
     } 
    } 

,並請幫助我在此呼籲,並聯動全市..

回答

5

可以作爲例如在搜索頁面在搜索頁面中看到的主題文件夾內。 例如。主題/現代/ search.php中 可以作爲 致電呼叫您

<?php item_city_box(__("city", "theme_name"), __("Select a city...", "theme_name")) ; ?> 
**For the cityarea you can call as** 
<?php item_city_area(__("cityarea", "theme_name"), __("Select a cityarea...", "theme_name")) ; ?> 

對於聯動城市和cityarea,你必須得修改數據庫的城市。 你可以問,如果你沒有得到它。 乾杯

+0

它完美的作品 – edd

相關問題