3

我在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;
      }
  }

请帮我打电话和联系城市..

4

1 回答 1

5

您可以在搜索页面的主题文件夹内的搜索页面中查看示例。例如。Themes/modern/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")) ; ?>

对于城市和市区的链接,您也必须修改您的数据库。没收到可以问。干杯

于 2013-05-27T10:45:48.200 回答