summaryrefslogtreecommitdiff
path: root/db-prefs.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-01-13 21:30:17 +0300
committerAndrew Dolgov <[email protected]>2010-01-13 21:30:17 +0300
commitf9aa6a898f67b7ce259ec942c8effd8ae2ada1df (patch)
tree7f63960acdba09d07c32623463505bc6f7f681b4 /db-prefs.php
parente4c51a6ce960a7772065be14fd787a4213831789 (diff)
updating issue fix for schema 63 (2)
Diffstat (limited to 'db-prefs.php')
-rw-r--r--db-prefs.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/db-prefs.php b/db-prefs.php
index 15f03c094..5c54427b7 100644
--- a/db-prefs.php
+++ b/db-prefs.php
@@ -21,11 +21,12 @@
}
if ($profile) {
- $profile_qpart = "profile = '$profile'";
+ $profile_qpart = "profile = '$profile' AND";
} else {
- $profile_qpart = "profile IS NULL";
+ $profile_qpart = "profile IS NULL AND";
}
+ if (get_schema_version($link) < 63) $profile_qpart = "";
if ($prefs_cache && !defined('DISABLE_SESSIONS') && !SINGLE_USER_MODE) {
if ($_SESSION["prefs_cache"] && $_SESSION["prefs_cache"][$pref_name]) {
@@ -39,7 +40,7 @@
FROM
ttrss_user_prefs,ttrss_prefs,ttrss_prefs_types
WHERE
- $profile_qpart AND
+ $profile_qpart
ttrss_user_prefs.pref_name = '$pref_name' AND
ttrss_prefs_types.id = type_id AND
owner_uid = '$user_id' AND
@@ -90,11 +91,13 @@
}
if ($profile) {
- $profile_qpart = "profile = '$profile'";
+ $profile_qpart = "AND profile = '$profile'";
} else {
- $profile_qpart = "profile IS NULL";
+ $profile_qpart = "AND profile IS NULL AND";
}
+ if (get_schema_version($link) < 63) $profile_qpart = "";
+
$result = db_query($link, "SELECT type_name
FROM ttrss_prefs,ttrss_prefs_types
WHERE pref_name = '$key' AND type_id = ttrss_prefs_types.id");
@@ -119,7 +122,7 @@
db_query($link, "UPDATE ttrss_user_prefs SET
value = '$value' WHERE pref_name = '$key'
- AND $profile_qpart
+ $profile_qpart
AND owner_uid = " . $_SESSION["uid"]);
$_SESSION["prefs_cache"] = array();