]> git.wh0rd.org Git - tt-rss.git/commitdiff
generic theme support, misc compact stylesheet iframe fixes
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 26 Nov 2005 06:48:37 +0000 (07:48 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 26 Nov 2005 06:48:37 +0000 (07:48 +0100)
backend.php
functions.php
prefs.php
tt-rss.php

index fa3be8dc669c796542ca58dc58dc26db0e36fe4f..98c77e37c19f144b59894cecd6b1c6121b8e7363 100644 (file)
                        <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\"/>";
                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>";
                }
                                <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\"/>";
                                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>
                                theme_id = (SELECT id FROM ttrss_themes WHERE
                                        theme_name = '$theme') WHERE id = " . $_SESSION["uid"]);
 
+                       $_SESSION["theme"] = $theme;
+
                        header("Location: prefs.php");
 
                } else {
index 89bc07d8e4bd75a28d4cf34d0f5a8ec4fa8af596..2dc70a1612c9f26b3f637db7f997fba42caaf78c 100644 (file)
                        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;
index 75cf932c1a3cb480645cf3cdf168f6381619566a..559f851097a9b2a681e241709722d44d3bfb2f1b 100644 (file)
--- a/prefs.php
+++ b/prefs.php
        <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 ?>"/> 
index 7983afca0cf2e3ee5f6c573c4b4f5d3d8992d1aa..9d1dadbb6920a415ecb7ce5b98fbc8eb8ef847b5 100644 (file)
 
        <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 ?>"/>