[Fusionforge-commits] r7560 - branches/Branch_4_8/gforge/www/softwaremap

Roland Mas lolando at libremir.placard.fr.eu.org
Mon May 4 17:03:52 CEST 2009


Author: lolando
Date: 2009-05-04 17:03:51 +0200 (Mon, 04 May 2009)
New Revision: 7560

Modified:
   branches/Branch_4_8/gforge/www/softwaremap/trove_list.php
Log:
Removed PHP warnings and fixed logic for trove-map browsing and filtering

Modified: branches/Branch_4_8/gforge/www/softwaremap/trove_list.php
===================================================================
--- branches/Branch_4_8/gforge/www/softwaremap/trove_list.php	2009-05-04 14:37:09 UTC (rev 7559)
+++ branches/Branch_4_8/gforge/www/softwaremap/trove_list.php	2009-05-04 15:03:51 UTC (rev 7560)
@@ -1,13 +1,27 @@
 <?php
 /**
-  *
-  * SourceForge Trove Software Map
-  *
-  * SourceForge: Breaking Down the Barriers to Open Source Development
-  * Copyright 1999-2001 (c) VA Linux Systems
-  * http://sourceforge.net
-  *
-  */
+ * FusionForge Trove Software Map
+ *
+ * Copyright 1999-2001, VA Linux Systems, Inc.
+ * Copyright 2009, Roland Mas
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ * 
+ * FusionForge is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
 
 require_once('../env.inc.php');
 require_once $gfwww.'include/pre.php'; 
@@ -77,23 +91,19 @@
 $discrim_desc = '';
 
 if ($discrim) {
-	unset ($discrim_queryalias);
-	unset ($discrim_queryand);
-	unset ($discrim_url_b);
+	$discrim_queryalias = '';
+	$discrim_queryand = '';
+	$discrim_url_b = array();
 
 	// commas are ANDs
 	$expl_discrim = explode(',',$discrim);
 
-	// need one link for each "get out of this limit" links
-	$discrim_url = '&discrim=';
-
-	$lims=sizeof($expl_discrim);
-	if ($lims > 6) {
-		$lims=6;
+	if (sizeof($expl_discrim) > 6) {
+		array_splice ($expl_discrim, 6) ;
 	}
 
 	// one per argument	
-	for ($i=0;$i<$lims;$i++) {
+	for ($i=0;$i<sizeof($expl_discrim);$i++) {
 		// make sure these are all ints, no url trickery
 		$expl_discrim[$i] = intval($expl_discrim[$i]);
 
@@ -109,33 +119,24 @@
 			.$expl_discrim[$i].' AND trove_agg_'.$i.'.group_id='
 			.'trove_agg.group_id ';
 
-		// must build query string for all urls
-		if ($i==0) {
-			$discrim_url .= $expl_discrim[$i];
-		} else {
-			$discrim_url .= ','.$expl_discrim[$i];
-		}
-		// must also do this for EACH "get out of this limit" links
-		// convoluted logic to build urls for these, but works quickly
+		$expl_discrim_b = array () ;
 		for ($j=0;$j<sizeof($expl_discrim);$j++) {
 			if ($i!=$j) {
-				if (!$discrim_url_b[$j]) {
-					$discrim_url_b[$j] = '&discrim='.$expl_discrim[$i];
-				} else {
-					$discrim_url_b[$j] .= ','.$expl_discrim[$i];
-				}
+				$expl_discrim_b[] = $expl_discrim[$j] ;
 			}
 		}
+		$discrim_url_b[$i] = '&discrim=' . implode (',', $expl_discrim_b) ;
 
 	}
+	$discrim_url = '&discrim=' . implode (',', $expl_discrim);
 
 	// build text for top of page on what viewier is seeing
-	$discrim_desc = _('Now limiting view to projects in the following categories').':';
+	$discrim_desc = _('Now limiting view to projects in the following categories:');
 	
 	for ($i=0;$i<sizeof($expl_discrim);$i++) {
 		$discrim_desc .= '<br /> &nbsp; &nbsp; &nbsp; '
 			.trove_getfullpath($expl_discrim[$i])
-			.util_make_link ('/softwaremap/trove_list.php?form_cat='.$form_cat .$discrim_url_b[$i],'['._('Remove This Filter').']');
+			.util_make_link ('/softwaremap/trove_list.php?form_cat='.$form_cat .$discrim_url_b[$i],' ['._('Remove This Filter').']');
 	}
 	$discrim_desc .= "<hr />\n";
 } 




More information about the Fusionforge-commits mailing list