/** * Gets the url of current "list city"" * * @return string */ function osc_list_city_url() { return osc_search_url(array('sCity' => osc_list_city_name())); }
function osclasswizards_popular_cities($limit = 20) { View::newInstance()->_exportVariableToView('list_cities', Search::newInstance()->listCities('%%%%', '>=')); if (osc_count_list_cities() > 0) { $array = array(); while (osc_has_list_cities()) { if (osc_list_city_items() > 0) { $city_name = osc_list_city_name(); $array[$city_name] = osc_list_city_items(); } } arsort($array); return array_slice($array, 0, $limit); } else { return false; } }
/** * Gets the url of current "list city"" * * @return string */ function osc_list_city_url() { if (osc_rewrite_enabled()) { $url = osc_base_url(); if (osc_get_preference('seo_url_search_prefix') != '') { $url .= osc_get_preference('seo_url_search_prefix') . '/'; } $url .= osc_sanitizeString(osc_list_city_name()) . '-c' . osc_list_city_id(); return $url; } else { return osc_search_url(array('sCity' => osc_list_city_id())); } }
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 } ?> </div> </div>