@Teseo
There is bug in your code.
If there is 2 (or more) cities with the same name in different region, your code return data like link, item count, etc. ONLY to first city ()
Can you fix this?
$popularCities = new DAO();
$popularCities->dao->select('c.s_name as city_name, cs.i_num_items as items');
$popularCities->dao->from(DB_TABLE_PREFIX.'t_city_stats cs');
$popularCities->dao->join(DB_TABLE_PREFIX.'t_city c', 'c.pk_i_id = cs.fk_i_city_id', "INNER");
$popularCities->dao->where('cs.i_num_items > 0');
$popularCities->dao->orderBy('cs.i_num_items', 'DESC');
$popularCities->dao->limit(0, 10);
$result = $popularCities->dao->get();
$popular_cities = $result->result();
View::newInstance()->_exportVariableToView('cities', $popular_cities);
while(osc_has_cities()) {
echo osc_city_name() . ' (' . osc_city_items() . ')<br />';
?>
<a href="<?php echo osc_city_url(); ?>" title="<?php echo osc_city_name() ; ?>"><?php echo osc_city_name() ; ?> <em>(<?php echo osc_city_items() ; ?>)</em></a>
<?php
}