[Fusionforge-commits] r8155 - in trunk/gforge/www/docman: . include

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Sep 23 17:18:48 CEST 2009


Author: lolando
Date: 2009-09-23 17:18:47 +0200 (Wed, 23 Sep 2009)
New Revision: 8155

Modified:
   trunk/gforge/www/docman/include/doc_utils.php
   trunk/gforge/www/docman/search.php
Log:
db_query_params() migration

Modified: trunk/gforge/www/docman/include/doc_utils.php
===================================================================
--- trunk/gforge/www/docman/include/doc_utils.php	2009-09-23 15:18:38 UTC (rev 8154)
+++ trunk/gforge/www/docman/include/doc_utils.php	2009-09-23 15:18:47 UTC (rev 8155)
@@ -34,12 +34,11 @@
 	if (!$group_id) {
 		exit_no_group();
 	} else {
-		$query = "select doc_group, groupname "
-		."from doc_groups "
-		."where group_id = '$group_id' "
-		."order by groupname";
-		$result = db_query($query);
-
+		$result = db_query_params ('SELECT doc_group, groupname
+FROM doc_groups
+WHERE group_id = $1
+ORDER BY groupname',
+					   array ($group_id)) ;
 		echo html_build_select_box ($result,'doc_group',$checkedval,false);
 
 	} //end else
@@ -115,9 +114,9 @@
 
 	if (db_numrows($gresult) >= 1) {
 
-		print "<form name=\"langchoice\" action=\"index.php?group_id=".$l_group_id."\" method=\"post\"><table border=\"0\">"
-			." <tr><td valign=\"middle\"><strong>"._('Language')." </strong></td>"
-			." <td valign=\"middle\"><select name=\"language_id\">\n\n";
+		print "<form name=\"langchoice\" action=\"index.php?group_id=".$l_group_id."\" method=\"post\"><table border=\"0\">
+ <tr><td valign=\"middle\"><strong>"._('Language')." </strong></td>
+ <td valign=\"middle\"><select name=\"language_id\">\n\n";
 		print "<option value=\"*\">"._('All Languages')." </option>";
 		while($grow = db_fetch_array($gresult)) {
 
@@ -224,11 +223,11 @@
 					$tooltip = htmlspecialchars($tooltip);					
 					echo "<li>".
 							html_image('ic/docman16b.png',"20","20",array("border"=>"0")).
-							" ".
-							"<a href=\"".$link."\" title=\"$tooltip\">".
+							" 
+<a href=\"".$link."\" title=\"$tooltip\">".
 							$docs[$j]->getName().
-							"</a> - " . $tooltip . "</li>".
-							"(".$docs[$j]->getFileSize()." "._('bytes').")";
+							"</a> - " . $tooltip . "</li>
+(".$docs[$j]->getFileSize()." "._('bytes').")";
 							//add description
 							echo "<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
 							echo "<i>".$docs[$j]->getDescription()."</i>";

Modified: trunk/gforge/www/docman/search.php
===================================================================
--- trunk/gforge/www/docman/search.php	2009-09-23 15:18:38 UTC (rev 8154)
+++ trunk/gforge/www/docman/search.php	2009-09-23 15:18:47 UTC (rev 8155)
@@ -165,9 +165,8 @@
  	// print_debug ($sql);
 	// need groups infos
 	$groupsarr = array();
-	$sql = "SELECT doc_group, groupname, parent_doc_group FROM doc_groups WHERE group_id = $_GET[group_id] \n";
-	$groupsarr = array();
-	$result=db_query($sql);
+	$result = db_query_params ('SELECT doc_group, groupname, parent_doc_group FROM doc_groups WHERE group_id=$1',
+				   array (getIntFromRequest ('group_id')));
 	if ($result && db_numrows($result) > 0)
 	{
 		while ($arr = db_fetch_array($result))
@@ -202,7 +201,6 @@
 
 // print_debug (print_r($_POST,true));
 // print_debug (print_r($groupsarr,true));
-// print_debug ($sql);
 
 docman_footer(array());
 




More information about the Fusionforge-commits mailing list