function fs_get_countries_list() { $countries = fs_get_country_codes_percentage(fs_get_max_countries_num(), fs_countries_list_days_ago()); if ($countries === false) { return fs_db_error(); } $res = ''; if (count($countries) == 0) { $res .= fs_r('No data yet, go get some hits'); } else { $res = "<ul>"; foreach ($countries as $country) { $name = $country->name; $flag = $country->img; $percentage = sprintf("%.2F", $country->percentage); $res .= "<li>{$flag} {$name} <b>{$percentage}%</b></li>\n"; } $res .= "</ul>"; } return $res; }
<div id="fs_os_tree" class="tree_container"> <div id="os_tree_id">--</div> </div> </div> <!-- warp --> <div class="fwrap"> <h2><?php fs_e('Countries'); fs_create_anchor('Countries'); ?> <?php fs_cfg_button('countries_config'); ?> <span id="countries_config" class="normal_font hidden"> <?php $max = fs_get_num_textfield('firestats_max_countries_in_list', 'countries_list', fs_get_max_countries_num(), 4); $days = fs_get_num_textfield('firestats_countries_list_days_ago', 'countries_list', fs_countries_list_days_ago(), 4); $show_at_most_X_for_the_last_Y_days = sprintf(fs_r("Show at most %s items for the last %s days"), $max, $days); ?> <span> <?php echo $show_at_most_X_for_the_last_Y_days; ?> <button class="button" onclick="saveOptions('firestats_countries_list_days_ago,firestats_max_countries_in_list','countries_list')"><?php fs_e('Apply'); ?> </button> </span> </span> </h2>