diff options
author | Andrew Dolgov <[email protected]> | 2005-11-26 07:56:22 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2005-11-26 07:56:22 +0100 |
commit | 6752e33006437d98cd4995f911aa1e344e273809 (patch) | |
tree | 16621d60a3f3d1769a9950937f9b249ffd7d6553 | |
parent | 503eb3498a037c8772289d4baf6044261b4f9f31 (diff) |
change theme interface tweaks
-rw-r--r-- | backend.php | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/backend.php b/backend.php index 98c77e37c..79b016f37 100644 --- a/backend.php +++ b/backend.php @@ -2287,11 +2287,21 @@ $theme_qpart = "'$theme'"; } + $result = db_query($link, "SELECT id,theme_path FROM ttrss_themes + WHERE theme_name = '$theme'"); + + if (db_num_rows($result) == 1) { + $theme_id = db_fetch_result($result, 0, "id"); + $theme_path = db_fetch_result($result, 0, "theme_path"); + } else { + $theme_id = "NULL"; + $theme_path = ""; + } + db_query($link, "UPDATE ttrss_users SET - theme_id = (SELECT id FROM ttrss_themes WHERE - theme_name = '$theme') WHERE id = " . $_SESSION["uid"]); + theme_id = $theme_id WHERE id = " . $_SESSION["uid"]); - $_SESSION["theme"] = $theme; + $_SESSION["theme"] = $theme_path; header("Location: prefs.php"); @@ -2362,17 +2372,6 @@ } - print "<form action=\"backend.php\" method=\"POST\">"; - - print "<table width=\"100%\" class=\"prefPrefsList\">"; - print "<tr><td colspan='3'><h3>Themes</h3></tr></td>"; - - print "<tr><td width=\"40%\">Select theme</td>"; - - print "<td><select name=\"theme\">"; - - print "<option>Default</option>"; - $result = db_query($link, "SELECT theme_id FROM ttrss_users WHERE id = " . $_SESSION["uid"]); @@ -2382,7 +2381,15 @@ id,theme_name FROM ttrss_themes ORDER BY theme_name"); if (db_num_rows($result) > 0) { + + print "<form action=\"backend.php\" method=\"POST\">"; + print "<table width=\"100%\" class=\"prefPrefsList\">"; + print "<tr><td colspan='3'><h3>Themes</h3></tr></td>"; + print "<tr><td width=\"40%\">Select theme</td>"; + print "<td><select name=\"theme\">"; + print "<option>Default</option>"; print "<option disabled>--------</option>"; + while ($line = db_fetch_assoc($result)) { if ($line["id"] == $user_theme_id) { $selected = "selected"; @@ -2391,15 +2398,14 @@ } print "<option $selected>" . $line["theme_name"] . "</option>"; } + print "</select></td></tr>"; + print "</table>"; + print "<input type=\"hidden\" name=\"op\" value=\"pref-prefs\">"; + print "<p><input class=\"button\" type=\"submit\" + value=\"Change theme\" name=\"subop\">"; + print "</form>"; } - print "</select></td></tr>"; - print "</table>"; - print "<input type=\"hidden\" name=\"op\" value=\"pref-prefs\">"; - print "<p><input class=\"button\" type=\"submit\" - value=\"Change theme\" name=\"subop\">"; - print "</form>"; - $result = db_query($link, "SELECT ttrss_user_prefs.pref_name,short_desc,help_text,value,type_name, section_name,def_value |