header(array('title'=>_('Tag Cloud'),'pagename'=>'softwaremap'));
$HTML->printSoftwareMapLinks();
$selected_tag = getStringFromRequest('tag');
$page = getIntFromRequest('page', 1);
echo '
' . tag_cloud(array('selected' => $selected_tag, 'nb_max' => 100)) . '
';
if ($selected_tag) {
$res_grp = db_query_params('
SELECT groups.group_id, group_name, unix_group_name, short_description, register_time
FROM project_tags, groups
WHERE name = $1
AND project_tags.group_id = groups.group_id
AND status = $2 AND type_id=1 AND register_time > 0
ORDER BY group_name ASC',
array($selected_tag, 'A'), $TROVE_HARDQUERYLIMIT);
$projects = array();
$project_ids = array();
while ($row_grp = db_fetch_array($res_grp)) {
if (!forge_check_perm('project_read', $row_grp['group_id'])) {
continue;
}
$projects[] = $row_grp;
$project_ids[] = $row_grp['group_id'];
}
$querytotalcount = count($projects);
// #################################################################
// limit/offset display
// store this as a var so it can be printed later as well
$html_limit = '';
if ($querytotalcount == $TROVE_HARDQUERYLIMIT){
$html_limit .= sprintf(_('More than %1$s projects have %2$s as tag.'), $TROVE_HARDQUERYLIMIT, htmlspecialchars($selected_tag));
}
else {
$html_limit .= sprintf(ngettext('%d project in result set.',
'%d projects in result set.',
$querytotalcount),
$querytotalcount);
}
// only display pages stuff if there is more to display
if ($querytotalcount > $TROVE_BROWSELIMIT) {
$html_limit .= ' ';
$html_limit .= sprintf(ngettext('Displaying %d project per page. Projects sorted by alphabetical order.',
'Displaying %d projects per page. Projects sorted by alphabetical order.',
$TROVE_BROWSELIMIT),
$TROVE_BROWSELIMIT);
$html_limit .= '.
';
// display all the numbers
for ($i=1 ;$i <= ceil($querytotalcount/$TROVE_BROWSELIMIT); $i++) {
$html_limit .= ' ';
if ($page != $i) {
$html_limit .= util_make_link ('/softwaremap/tag_cloud.php?tag='.$selected_tag.'&page='.$i,
'<'.$i.'>');
} else {
$html_limit .= '<'.$i.'>';
}
$html_limit .= ' ';
}
}
print $html_limit."
'; print util_make_link ('/projects/'. strtolower($row_grp['unix_group_name']).'/', ''.$row_grp['group_name'].' '); if ($row_grp['short_description']) { print "- " . $row_grp['short_description']; } // extra description print ' | |
'; print _('Tags') . _(': ') . list_project_tag($row_grp['group_id']); print ' | |
'; // list all trove categories print trove_getcatlisting($row_grp['group_id'],0,1,0); print ' | '."\n".''; // now the right side of the display
$res = db_query_params('SELECT percentile, ranking
FROM project_weekly_metric
WHERE group_id=$1', array($row_grp['group_id']));
$nb_line = db_numrows($res);
if (! $nb_line) {
$percentile = 'N/A';
$ranking = 'N/A';
}
else {
$percentile = number_format(db_result($res, 0, 'percentile'));
$ranking = number_format(db_result($res, 0, 'ranking'));
}
printf (' '._('Activity Percentile: %3.0f'), $percentile); printf (' '._('Activity Ranking: %d'), $ranking); printf (' '._('Registered') . _(': ')); printf ('%s', date(_('Y-m-d H:i'),$row_grp['register_time'])); print ' |
' .util_make_link ('/people/?group_id='.$row_grp['group_id'],_("[This project needs help]")).' | '; } */ print '