summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/filter.module12
-rw-r--r--modules/filter/filter.module12
-rw-r--r--modules/search.module5
-rw-r--r--modules/search/search.module5
-rw-r--r--modules/user.module7
-rw-r--r--modules/user/user.module7
6 files changed, 20 insertions, 28 deletions
diff --git a/modules/filter.module b/modules/filter.module
index 96287c911..cc4ccfbcf 100644
--- a/modules/filter.module
+++ b/modules/filter.module
@@ -467,20 +467,20 @@ function filter_formats() {
if (!isset($formats)) {
$formats = array();
- $query = array('SELECT * FROM {filter_formats}');
+ $query = 'SELECT * FROM {filter_formats}';
// Build query for selecting the format(s) based on the user's roles.
if (!$all) {
$where = array();
foreach ($user->roles as $rid => $role) {
$where[] = "roles LIKE '%%,%d,%%'";
- $query[] = $rid;
+ $args[] = $rid;
}
- $query[0] .= ' WHERE '. implode(' OR ', $where) . ' OR format = %d';
- $query[] = variable_get('filter_default_format', 1);
+ $query .= ' WHERE '. implode(' OR ', $where) . ' OR format = %d';
+ $args[] = variable_get('filter_default_format', 1);
}
- $result = call_user_func_array('db_query', $query);
+ $result = db_query($query, $args);
while ($format = db_fetch_object($result)) {
$formats[$format->format] = $format;
}
@@ -867,4 +867,4 @@ function _filter_autop($text) {
* @} End of "Standard filters".
*/
-?>
+?> \ No newline at end of file
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index 96287c911..cc4ccfbcf 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -467,20 +467,20 @@ function filter_formats() {
if (!isset($formats)) {
$formats = array();
- $query = array('SELECT * FROM {filter_formats}');
+ $query = 'SELECT * FROM {filter_formats}';
// Build query for selecting the format(s) based on the user's roles.
if (!$all) {
$where = array();
foreach ($user->roles as $rid => $role) {
$where[] = "roles LIKE '%%,%d,%%'";
- $query[] = $rid;
+ $args[] = $rid;
}
- $query[0] .= ' WHERE '. implode(' OR ', $where) . ' OR format = %d';
- $query[] = variable_get('filter_default_format', 1);
+ $query .= ' WHERE '. implode(' OR ', $where) . ' OR format = %d';
+ $args[] = variable_get('filter_default_format', 1);
}
- $result = call_user_func_array('db_query', $query);
+ $result = db_query($query, $args);
while ($format = db_fetch_object($result)) {
$formats[$format->format] = $format;
}
@@ -867,4 +867,4 @@ function _filter_autop($text) {
* @} End of "Standard filters".
*/
-?>
+?> \ No newline at end of file
diff --git a/modules/search.module b/modules/search.module
index 69714827d..7e02865d2 100644
--- a/modules/search.module
+++ b/modules/search.module
@@ -454,8 +454,7 @@ function do_search($keys, $type, $join = '', $where = '1') {
// Do pager query
$query = "SELECT i.type, i.sid, i.word, SUM(i.score/t.count) AS score FROM {search_index} i $join INNER JOIN {search_total} t ON i.word = t.word WHERE $where GROUP BY i.type, i.sid ORDER BY score DESC";
- $arguments = array_merge(array($query, 15, 0, $count_query), $arguments);
- $result = call_user_func_array('pager_query', $arguments);
+ $result = pager_query($query, 15, 0, $count_query, $arguments);
$results = array();
while ($item = db_fetch_object($result)) {
@@ -754,4 +753,4 @@ function theme_search_item($item, $type) {
}
-?>
+?> \ No newline at end of file
diff --git a/modules/search/search.module b/modules/search/search.module
index 69714827d..7e02865d2 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -454,8 +454,7 @@ function do_search($keys, $type, $join = '', $where = '1') {
// Do pager query
$query = "SELECT i.type, i.sid, i.word, SUM(i.score/t.count) AS score FROM {search_index} i $join INNER JOIN {search_total} t ON i.word = t.word WHERE $where GROUP BY i.type, i.sid ORDER BY score DESC";
- $arguments = array_merge(array($query, 15, 0, $count_query), $arguments);
- $result = call_user_func_array('pager_query', $arguments);
+ $result = pager_query($query, 15, 0, $count_query, $arguments);
$results = array();
while ($item = db_fetch_object($result)) {
@@ -754,4 +753,4 @@ function theme_search_item($item, $type) {
}
-?>
+?> \ No newline at end of file
diff --git a/modules/user.module b/modules/user.module
index 54364b3ed..cabb5b773 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -61,10 +61,7 @@ function user_load($array = array()) {
$params[] = strtolower($value);
}
}
- array_unshift($params, "SELECT u.* FROM {users} u WHERE $query u.status < 3");
- $params[] = 0;
- $params[] = 1;
- $result = call_user_func_array('db_query_range', $params);
+ $result = db_query_range("SELECT u.* FROM {users} u WHERE $query u.status < 3", $params, 0, 1);
if (db_num_rows($result)) {
$user = db_fetch_object($result);
@@ -1737,4 +1734,4 @@ function _user_forms(&$edit, $account, $category, $hook = 'form') {
return $output;
}
-?>
+?> \ No newline at end of file
diff --git a/modules/user/user.module b/modules/user/user.module
index 54364b3ed..cabb5b773 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -61,10 +61,7 @@ function user_load($array = array()) {
$params[] = strtolower($value);
}
}
- array_unshift($params, "SELECT u.* FROM {users} u WHERE $query u.status < 3");
- $params[] = 0;
- $params[] = 1;
- $result = call_user_func_array('db_query_range', $params);
+ $result = db_query_range("SELECT u.* FROM {users} u WHERE $query u.status < 3", $params, 0, 1);
if (db_num_rows($result)) {
$user = db_fetch_object($result);
@@ -1737,4 +1734,4 @@ function _user_forms(&$edit, $account, $category, $hook = 'form') {
return $output;
}
-?>
+?> \ No newline at end of file