function chosen_region_select() { View::newInstance()->_exportVariableToView('list_regions', Search::newInstance()->listRegions('%%%%', '>=', 'region_name ASC')); if (osc_count_list_regions() > 0) { echo '<select name="sRegion" data-placeholder="' . __('Select a region...', 'twitter') . '" style="width: 200px;" class="chzn-select"">'; echo '<option></option>'; while (osc_has_list_regions()) { echo '<option value="' . osc_list_region_name() . '">' . osc_list_region_name() . '</option>'; } echo '</select>'; } View::newInstance()->_erase('list_regions'); }
/** * Gets the url of current "list region"" * * @return string */ function osc_list_region_url() { return osc_search_url(array('sRegion' => osc_list_region_name())); }
function osclasswizards_popular_regions($limit = 20) { View::newInstance()->_exportVariableToView('list_regions', Search::newInstance()->listRegions('%%%%', '>=')); if (osc_count_list_regions() > 0) { $array = array(); while (osc_has_list_regions()) { if (osc_list_region_items() > 0) { $region_name = osc_list_region_name(); $array[$region_name] = osc_list_region_items(); } } arsort($array); return array_slice($array, 0, $limit); } else { return false; } }
/** * Gets the url of current "list region" * * @return string */ function osc_list_region_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_region_name()) . '-r' . osc_list_region_id(); return $url; } else { return osc_search_url(array('sRegion' => osc_list_region_id())); } }
if (osc_count_list_regions() > 0) { ?> <div class="box location"> <h3><strong><?php _e("Location", 'bender'); ?> </strong></h3> <ul> <?php while (osc_has_list_regions()) { ?> <li><a href="<?php echo osc_list_region_url(); ?> "><?php echo osc_list_region_name(); ?> <em>(<?php echo osc_list_region_items(); ?> )</em></a></li> <?php } ?> </ul> </div> <?php } ?> </div> </div>