diff options
author | Andrew Dolgov <[email protected]> | 2005-11-26 07:48:37 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2005-11-26 07:48:37 +0100 |
commit | 503eb3498a037c8772289d4baf6044261b4f9f31 (patch) | |
tree | a31abdcce82c206dab96da096af7978947fcf715 | |
parent | 54a60e1a0001da296b73eee86c27babdb9abd4c3 (diff) |
generic theme support, misc compact stylesheet iframe fixes
-rw-r--r-- | backend.php | 34 | ||||
-rw-r--r-- | functions.php | 4 | ||||
-rw-r--r-- | prefs.php | 5 | ||||
-rw-r--r-- | tt-rss.php | 5 |
4 files changed, 46 insertions, 2 deletions
diff --git a/backend.php b/backend.php index fa3be8dc6..98c77e37c 100644 --- a/backend.php +++ b/backend.php @@ -160,6 +160,12 @@ <title>Tiny Tiny RSS : Feedlist</title> <link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">"; + $user_theme = $_SESSION["theme"]; + if ($user_theme) { + print "<link rel=\"stylesheet\" type=\"text/css\" + href=\"themes/$user_theme/theme.css\">"; + } + if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { print "<link rel=\"stylesheet\" type=\"text/css\" href=\"tt-rss_compact.css\"/>"; @@ -533,8 +539,23 @@ if ($addheader) { print "<html><head> <title>Tiny Tiny RSS : Article $id</title> - <link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\"> - <script type=\"text/javascript\" src=\"functions.js\"></script> + <link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">"; + + $user_theme = $_SESSION["theme"]; + if ($user_theme) { + print "<link rel=\"stylesheet\" type=\"text/css\" + href=\"themes/$user_theme/theme.css\">"; + } + + if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { + print "<link rel=\"stylesheet\" type=\"text/css\" + href=\"tt-rss_compact.css\"/>"; + } else { + print "<link title=\"Compact Stylesheet\" rel=\"alternate stylesheet\" + type=\"text/css\" href=\"tt-rss_compact.css\"/>"; + } + + print "<script type=\"text/javascript\" src=\"functions.js\"></script> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"> </head><body>"; } @@ -623,6 +644,12 @@ <title>Tiny Tiny RSS : Feed $feed</title> <link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">"; + $user_theme = $_SESSION["theme"]; + if ($user_theme) { + print "<link rel=\"stylesheet\" type=\"text/css\" + href=\"themes/$user_theme/theme.css\">"; + } + if (get_pref($link, 'USE_COMPACT_STYLESHEET')) { print "<link rel=\"stylesheet\" type=\"text/css\" href=\"tt-rss_compact.css\"/>"; @@ -631,6 +658,7 @@ print "<link title=\"Compact Stylesheet\" rel=\"alternate stylesheet\" type=\"text/css\" href=\"tt-rss_compact.css\"/>"; } + print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"> <script type=\"text/javascript\" src=\"functions.js\"></script> <script type=\"text/javascript\" src=\"viewfeed.js\"></script> @@ -2263,6 +2291,8 @@ theme_id = (SELECT id FROM ttrss_themes WHERE theme_name = '$theme') WHERE id = " . $_SESSION["uid"]); + $_SESSION["theme"] = $theme; + header("Location: prefs.php"); } else { diff --git a/functions.php b/functions.php index 89bc07d8e..2dc70a161 100644 --- a/functions.php +++ b/functions.php @@ -617,6 +617,10 @@ db_query($link, "UPDATE ttrss_users SET last_login = NOW() WHERE id = " . $_SESSION["uid"]); + $user_theme = get_user_theme_path($link); + + $_SESSION["theme"] = $user_theme; + initialize_user_prefs($link, $_SESSION["uid"]); return true; @@ -16,6 +16,11 @@ <title>Tiny Tiny RSS : Preferences</title> <link rel="stylesheet" href="tt-rss.css" type="text/css"> + <? $user_theme = $_SESSION["theme"]; + if ($user_theme) { ?> + <link rel="stylesheet" type="text/css" href="themes/<?= $user_theme ?>/theme.css"> + <? } ?> + <? $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?> <? if ($user_css_url) { ?> <link type="text/css" href="<?= $user_css_url ?>"/> diff --git a/tt-rss.php b/tt-rss.php index 7983afca0..9d1dadbb6 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -18,6 +18,11 @@ <link rel="stylesheet" type="text/css" href="tt-rss.css"> + <? $user_theme = $_SESSION["theme"]; + if ($user_theme) { ?> + <link rel="stylesheet" type="text/css" href="themes/<?= $user_theme ?>/theme.css"> + <? } ?> + <? $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?> <? if ($user_css_url) { ?> <link type="text/css" href="<?= $user_css_url ?>"/> |