summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/node/node.admin.inc2
-rw-r--r--modules/profile/profile.module4
-rw-r--r--modules/profile/profile.pages.inc6
-rw-r--r--modules/system/system.install2
-rw-r--r--modules/user/user.admin.inc2
-rw-r--r--modules/user/user.module6
6 files changed, 12 insertions, 10 deletions
diff --git a/modules/node/node.admin.inc b/modules/node/node.admin.inc
index 7b2fa4a17..f40d355d6 100644
--- a/modules/node/node.admin.inc
+++ b/modules/node/node.admin.inc
@@ -457,7 +457,7 @@ function node_admin_content($form_state) {
function node_admin_nodes() {
// Enable language column if translation module is enabled
// or if we have any node with language.
- $multilanguage = (module_exists('translation') || db_query("SELECT COUNT(*) FROM {node} WHERE language != ''")->fetchField());
+ $multilanguage = (module_exists('translation') || db_query("SELECT COUNT(*) FROM {node} WHERE language <> ''")->fetchField());
// Build the sortable table header.
$header = array();
diff --git a/modules/profile/profile.module b/modules/profile/profile.module
index 0e97ef2bc..f1b4d0c8a 100644
--- a/modules/profile/profile.module
+++ b/modules/profile/profile.module
@@ -341,10 +341,10 @@ function profile_view_profile(&$user) {
// Show private fields to administrators and people viewing their own account.
if (user_access('administer users') || $GLOBALS['user']->uid == $user->uid) {
- $result = db_query('SELECT * FROM {profile_field} WHERE visibility != %d ORDER BY category, weight', PROFILE_HIDDEN);
+ $result = db_query('SELECT * FROM {profile_field} WHERE visibility <> %d ORDER BY category, weight', PROFILE_HIDDEN);
}
else {
- $result = db_query('SELECT * FROM {profile_field} WHERE visibility != %d AND visibility != %d ORDER BY category, weight', PROFILE_PRIVATE, PROFILE_HIDDEN);
+ $result = db_query('SELECT * FROM {profile_field} WHERE visibility <> %d AND visibility <> %d ORDER BY category, weight', PROFILE_PRIVATE, PROFILE_HIDDEN);
}
$fields = array();
diff --git a/modules/profile/profile.pages.inc b/modules/profile/profile.pages.inc
index 7d1bd4a76..572d2365c 100644
--- a/modules/profile/profile.pages.inc
+++ b/modules/profile/profile.pages.inc
@@ -29,7 +29,7 @@ function profile_browse() {
// Compile a list of fields to show.
$fields = array();
- $result = db_query('SELECT name, title, type, weight, page FROM {profile_field} WHERE fid != %d AND visibility = %d ORDER BY weight', $field->fid, PROFILE_PUBLIC_LISTINGS);
+ $result = db_query('SELECT name, title, type, weight, page FROM {profile_field} WHERE fid <> %d AND visibility = %d ORDER BY weight', $field->fid, PROFILE_PUBLIC_LISTINGS);
while ($record = db_fetch_object($result)) {
$fields[] = $record;
}
@@ -55,7 +55,7 @@ function profile_browse() {
}
// Extract the affected users:
- $result = pager_query("SELECT u.uid, u.access FROM {users} u INNER JOIN {profile_value} v ON u.uid = v.uid WHERE v.fid = %d AND $query AND u.access != 0 AND u.status != 0 ORDER BY u.access DESC", 20, 0, NULL, $arguments)->fetchAllAssoc('uid');
+ $result = pager_query("SELECT u.uid, u.access FROM {users} u INNER JOIN {profile_value} v ON u.uid = v.uid WHERE v.fid = %d AND $query AND u.access <> 0 AND u.status <> 0 ORDER BY u.access DESC", 20, 0, NULL, $arguments)->fetchAllAssoc('uid');
// Load the users.
$users = user_load_multiple(array_keys($result));
@@ -90,7 +90,7 @@ function profile_browse() {
}
// Extract the affected users:
- $result = pager_query('SELECT uid, access FROM {users} WHERE uid > 0 AND status != 0 AND access != 0 ORDER BY access DESC', 20, 0, NULL)->fetchAllAssoc('uid');
+ $result = pager_query('SELECT uid, access FROM {users} WHERE uid > 0 AND status <> 0 AND access <> 0 ORDER BY access DESC', 20, 0, NULL)->fetchAllAssoc('uid');
$users = user_load_multiple(array_keys($result));
$content = '';
foreach ($users as $account) {
diff --git a/modules/system/system.install b/modules/system/system.install
index 483d6098a..8407e213b 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -316,6 +316,7 @@ function system_install() {
\'SELECT greatest($1, greatest($2, $3));\'
LANGUAGE \'sql\''
);
+ // Don't use {} around pg_proc table.
if (!db_query("SELECT COUNT(*) FROM pg_proc WHERE proname = 'rand'")->fetchField()) {
db_query('CREATE OR REPLACE FUNCTION "rand"() RETURNS float AS
\'SELECT random();\'
@@ -323,6 +324,7 @@ function system_install() {
);
}
+ // Don't use {} around pg_proc table.
if (!db_query("SELECT COUNT(*) FROM pg_proc WHERE proname = 'concat'")->fetchField()) {
db_query('CREATE OR REPLACE FUNCTION "concat"(text, text) RETURNS text AS
\'SELECT $1 || $2;\'
diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc
index b3421cb71..d14de3b85 100644
--- a/modules/user/user.admin.inc
+++ b/modules/user/user.admin.inc
@@ -754,7 +754,7 @@ function user_admin_role() {
function user_admin_role_validate($form, &$form_state) {
if ($form_state['values']['name']) {
if ($form_state['values']['op'] == t('Save role')) {
- $existing_role = (bool) db_query_range("SELECT 1 FROM {role} WHERE name = :name AND rid != :rid", array(':name' => $form_state['values']['name'], ':rid' => $form_state['values']['rid']), 0, 1)->fetchField();
+ $existing_role = (bool) db_query_range("SELECT 1 FROM {role} WHERE name = :name AND rid <> :rid", array(':name' => $form_state['values']['name'], ':rid' => $form_state['values']['rid']), 0, 1)->fetchField();
if ($existing_role) {
form_set_error('name', t('The role name %name already exists. Please choose another role name.', array('%name' => $form_state['values']['name'])));
}
diff --git a/modules/user/user.module b/modules/user/user.module
index c57f6ea54..3a23cd772 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -945,7 +945,7 @@ function user_user_validate(&$edit, &$account, $category = NULL) {
if ($error = user_validate_name($edit['name'])) {
form_set_error('name', $error);
}
- elseif ((bool) db_query_range("SELECT 1 FROM {users} WHERE uid != :uid AND LOWER(name) = LOWER(:name)", array(':uid' => $uid, ':name' => $edit['name']), 0, 1)->fetchField()) {
+ elseif ((bool) db_query_range("SELECT 1 FROM {users} WHERE uid <> :uid AND LOWER(name) = LOWER(:name)", array(':uid' => $uid, ':name' => $edit['name']), 0, 1)->fetchField()) {
form_set_error('name', t('The name %name is already taken.', array('%name' => $edit['name'])));
}
}
@@ -954,7 +954,7 @@ function user_user_validate(&$edit, &$account, $category = NULL) {
if ($error = user_validate_mail($edit['mail'])) {
form_set_error('mail', $error);
}
- elseif ((bool) db_query_range("SELECT 1 FROM {users} WHERE uid != :uid AND LOWER(mail) = LOWER(:mail)", array(':uid' => $uid, ':mail' => $edit['mail']), 0, 1)->fetchField()) {
+ elseif ((bool) db_query_range("SELECT 1 FROM {users} WHERE uid <> :uid AND LOWER(mail) = LOWER(:mail)", array(':uid' => $uid, ':mail' => $edit['mail']), 0, 1)->fetchField()) {
// Format error message dependent on whether the user is logged in or not.
if ($GLOBALS['user']->uid) {
form_set_error('mail', t('The e-mail address %email is already taken.', array('%email' => $edit['mail'])));
@@ -1117,7 +1117,7 @@ function user_block_view($delta = '') {
case 'new':
if (user_access('access content')) {
// Retrieve a list of new users who have subsequently accessed the site successfully.
- $items = db_query_range('SELECT uid, name FROM {users} WHERE status != 0 AND access != 0 ORDER BY created DESC', array(), 0, variable_get('user_block_whois_new_count', 5))->fetchAll();
+ $items = db_query_range('SELECT uid, name FROM {users} WHERE status <> 0 AND access <> 0 ORDER BY created DESC', array(), 0, variable_get('user_block_whois_new_count', 5))->fetchAll();
$output = theme('user_list', $items);
$block['subject'] = t('Who\'s new');