function tag_cloud($obj) { $html = ''; $levels = 5; $thresholds = array(); for ($i = 0; $i < $levels; $i++) { $thresholds[$i] = pow($obj->max_frequency - $obj->min_frequency + 1, (double) $i / (double) $levels); } $html = ''; foreach ($obj->tag_list as $key => $row) { $font_size = 4 + 8 * class_from_weight($row['freq'] - $obj->min_frequency, $thresholds); $html .= '<a style="font-size:' . $font_size . 'px;"'; $html .= ' href="http://www.connotea.org/tag/' . urlencode($row['term']); $html .= '">'; $html .= $row['term']; $html .= '</a> '; $html .= "\n"; } return $html; }
function tag_cloud($obj) { global $config; $html = ''; $levels = 5; $thresholds = array(); for ($i = 0; $i < $levels; $i++) { $thresholds[$i] = pow($obj->max_frequency - $obj->min_frequency + 1, (double) $i / (double) $levels); } $html = ''; foreach ($obj->names as $name) { $font_size = 8 + 3 * class_from_weight($name['count'] - $obj->min_frequency, $thresholds); $html .= '<a style="font-size:' . $font_size . 'px;"'; // $html .= ' ' . 'href="' . $config['web_root'] . 'name/' . $name['NameBankID']; $html .= ' ' . 'href="' . $config['web_root'] . 'name/' . $name['namestring']; $html .= '">'; $html .= $name['namestring']; $html .= '</a> '; $html .= "\n"; } return $html; }