".sprintf(_("Total projects in associated forges: %1$d"),stats_get_total_projects_assoc_sites()). "
";
$return .= $HTML->boxBottom();
return $return;
}
function search_box() {
global $gwords,$gexact,$otherfreeknowledge;
$return = 'Search in other associated forges:
'._('Extend search to include non-software projects').'
'._("Require all words").'';
return $return;
}
/**
* show_top_n_assocsites() - Show the n top ranked associated sites
*
* @param string Number of associated sites to show
*
*/
function show_top_n_assocsites($num_assocsites) {
$res_top_n_assoc = db_query_params ('
SELECT a.title, a.link, count(*) AS numprojects
FROM plugin_globalsearch_assoc_site_project p, plugin_globalsearch_assoc_site a
WHERE p.assoc_site_id = a.assoc_site_id AND p.assoc_site_id IN
(SELECT assoc_site_id FROM plugin_globalsearch_assoc_site
WHERE status_id = 2 AND enabled=$1 ORDER BY rank LIMIT $2)
GROUP BY a.title, a.link',
array('t',
$num_assocsites));
if (db_numrows($res_top_n_assoc) == 0) {
return _('No stats available')." ".db_error();
}
$return .= "
";
while ($row_topdown = db_fetch_array($res_top_n_assoc)) {
if ($row_topdown['numprojects'] > 0)
$return .= "
";
return $return;
}
/**
* stats_get_total_projects_assoc_sites() - Show the total number of projects of associated sites
*
* @param string Number of associated sites to show
*
*/
function stats_get_total_projects_assoc_sites() {
$res_count = db_query_params ('SELECT count(*) AS numprojects FROM plugin_globalsearch_assoc_site_project p, plugin_globalsearch_assoc_site a WHERE p.assoc_site_id = a.assoc_site_id AND a.status_id = 2',
array());
if (db_numrows($res_count) > 0) {
$row_count = db_fetch_array($res_count);
return $row_count['numprojects'];
} else {
return _('No stats available')." ".db_error();
}
}
}
// Local Variables:
// mode: php
// c-file-style: "bsd"
// End:
?>