[Fusionforge-commits] r7891 - in trunk/gforge/plugins/wiki: cronjobs include

Roland Mas lolando at libremir.placard.fr.eu.org
Fri Jun 19 15:02:39 CEST 2009


Author: lolando
Date: 2009-06-19 15:02:39 +0200 (Fri, 19 Jun 2009)
New Revision: 7891

Modified:
   trunk/gforge/plugins/wiki/cronjobs/create_groups.php
   trunk/gforge/plugins/wiki/include/WikiSearchQuery.class.php
Log:
Semi-automated db_query_params() transition for simple cases

Modified: trunk/gforge/plugins/wiki/cronjobs/create_groups.php
===================================================================
--- trunk/gforge/plugins/wiki/cronjobs/create_groups.php	2009-06-19 13:02:30 UTC (rev 7890)
+++ trunk/gforge/plugins/wiki/cronjobs/create_groups.php	2009-06-19 13:02:39 UTC (rev 7891)
@@ -49,7 +49,9 @@
 	exit;
 }
 
-$res = db_query("SELECT unix_group_name FROM groups WHERE status != 'P' AND status != 'D';");
+$res = db_query_params ('SELECT unix_group_name FROM groups WHERE status != $1 AND status != $2;',
+			array('P',
+				'D'));
 if (!$res) {
 	$err .=  "Error! Database Query Failed: ".db_error();
 	cron_entry(23,$err);

Modified: trunk/gforge/plugins/wiki/include/WikiSearchQuery.class.php
===================================================================
--- trunk/gforge/plugins/wiki/include/WikiSearchQuery.class.php	2009-06-19 13:02:30 UTC (rev 7890)
+++ trunk/gforge/plugins/wiki/include/WikiSearchQuery.class.php	2009-06-19 13:02:39 UTC (rev 7891)
@@ -43,24 +43,24 @@
 		
 		$pat = '_g'.$this->groupId.'_';
 		$len = strlen($pat)+1;
-		$sql = "SELECT plugin_wiki_page.id AS id, " .
-					"substring(plugin_wiki_page.pagename from $len) AS pagename, " .
-					"plugin_wiki_page.hits AS hits, " .
-					"plugin_wiki_page.pagedata as pagedata, " .
-					"plugin_wiki_version.version AS version, " .
-					"plugin_wiki_version.mtime AS mtime, " .
-					"plugin_wiki_version.minor_edit AS minor_edit, " .
-					"plugin_wiki_version.content AS content, " .
-					"plugin_wiki_version.versiondata AS versiondata " .
-				"FROM plugin_wiki_nonempty, plugin_wiki_page, plugin_wiki_recent, " .
-					"plugin_wiki_version " .
-				"WHERE plugin_wiki_nonempty.id=plugin_wiki_page.id " .
-					"AND plugin_wiki_page.id=plugin_wiki_recent.id " .
-					"AND plugin_wiki_page.id=plugin_wiki_version.id " .
-					"AND latestversion=version " .
-					"AND substring(plugin_wiki_page.pagename from 0 for $len) = '$pat' " .
-					"AND ((".$this->getIlikeCondition('pagename', $this->words).") " .
-					"OR (".$this->getIlikeCondition('content', $this->words)."))";
+		$sql = "SELECT plugin_wiki_page.id AS id, 
+substring(plugin_wiki_page.pagename from $len) AS pagename, 
+plugin_wiki_page.hits AS hits, 
+plugin_wiki_page.pagedata as pagedata, 
+plugin_wiki_version.version AS version, 
+plugin_wiki_version.mtime AS mtime, 
+plugin_wiki_version.minor_edit AS minor_edit, 
+plugin_wiki_version.content AS content, 
+plugin_wiki_version.versiondata AS versiondata 
+FROM plugin_wiki_nonempty, plugin_wiki_page, plugin_wiki_recent, 
+plugin_wiki_version 
+WHERE plugin_wiki_nonempty.id=plugin_wiki_page.id 
+AND plugin_wiki_page.id=plugin_wiki_recent.id 
+AND plugin_wiki_page.id=plugin_wiki_version.id 
+AND latestversion=version 
+AND substring(plugin_wiki_page.pagename from 0 for $len) = '$pat' 
+AND ((".$this->getIlikeCondition('pagename', $this->words).") 
+OR (".$this->getIlikeCondition('content', $this->words)."))";
 //print "SQL: $sql\n";
 		return $sql;
 	}




More information about the Fusionforge-commits mailing list