[Fusionforge-commits] r8503 - trunk/gforge/www/include

Roland Mas lolando at libremir.placard.fr.eu.org
Thu Dec 10 14:17:11 CET 2009


Author: lolando
Date: 2009-12-10 14:17:10 +0100 (Thu, 10 Dec 2009)
New Revision: 8503

Modified:
   trunk/gforge/www/include/features_boxes.php
Log:
db_query_params for features_boxes

Modified: trunk/gforge/www/include/features_boxes.php
===================================================================
--- trunk/gforge/www/include/features_boxes.php	2009-12-10 13:16:57 UTC (rev 8502)
+++ trunk/gforge/www/include/features_boxes.php	2009-12-10 13:17:10 UTC (rev 8503)
@@ -147,10 +147,7 @@
 }
 
 function show_newest_projects() {
-	$sql =	"SELECT group_id,unix_group_name,group_name,register_time FROM groups 
-WHERE is_public=1 AND status='A' AND type_id=1 AND register_time > 0 
-ORDER BY register_time DESC";
-	$res_newproj = db_query($sql,10);
+	$res_newproj = db_query_params ('SELECT group_id,unix_group_name,group_name,register_time FROM groups WHERE is_public=1 AND status=$1 AND type_id=1 AND register_time > 0 ORDER BY register_time DESC', array ('A'), 10);
 
 	$return = '';
 
@@ -170,11 +167,8 @@
 
 function show_highest_ranked_users() {
 	//select out the users information to show the top users on the site
-	$sql="SELECT users.user_name,users.user_id,users.realname,user_metric.metric
-		FROM user_metric,users
-		WHERE users.user_id=user_metric.user_id AND user_metric.ranking < 11 AND users.status != 'D'  
-		ORDER BY ranking ASC";
-	$res=db_query($sql);
+	$res = db_query_params ('SELECT users.user_name,users.user_id,users.realname,user_metric.metric	FROM user_metric,users WHERE users.user_id=user_metric.user_id AND user_metric.ranking < 11 AND users.status != $1 ORDER BY ranking ASC',
+				array ('D')) ;
 	$rows=db_numrows($res);
 	if (!$res || $rows<1) {
 		return  _('No Stats Available').db_error();
@@ -191,16 +185,9 @@
 }
 
 function show_highest_ranked_projects() {
-	$sql="SELECT groups.group_name,groups.unix_group_name,groups.group_id,
-project_weekly_metric.ranking,project_weekly_metric.percentile 
-FROM groups,project_weekly_metric 
-WHERE groups.group_id=project_weekly_metric.group_id 
-AND groups.is_public=1 
-AND groups.type_id=1  
-AND groups.status != 'D'  
-AND groups.use_stats=1  
-ORDER BY ranking ASC";
-	$result=db_query($sql,20);
+	$result = db_query_params ('SELECT groups.group_name,groups.unix_group_name,groups.group_id,project_weekly_metric.ranking,project_weekly_metric.percentile FROM groups,project_weekly_metric WHERE groups.group_id=project_weekly_metric.group_id AND groups.is_public=1 AND groups.type_id=1 AND groups.status != $1 AND groups.use_stats=1 ORDER BY ranking ASC', 
+				   array ('D'),
+				   20);
 	if (!$result || db_numrows($result) < 1) {
 		return _('No Stats Available')." ".db_error();
 	} else {




More information about the Fusionforge-commits mailing list