]> git.wh0rd.org Git - tt-rss.git/commitdiff
add nicer interface when subscribing from external source (for ff 2.0)
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 31 Oct 2006 08:37:40 +0000 (09:37 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 31 Oct 2006 08:37:40 +0000 (09:37 +0100)
modules/pref-feeds.php
quicksub.css [new file with mode: 0644]

index 4070f43154b3d3fb366d2f66f900eba3c6ef27c5..af8fd09362028c9305f6f64b67295489ff89f99d 100644 (file)
 
                                $feed_url = db_escape_string(trim($_GET["feed_url"]));
                                $cat_id = db_escape_string($_GET["cat_id"]);
+                               $p_from = db_escape_string($_GET["from"]);
+
+                               if ($p_from) {
+                                       print "<html>
+                                               <head>
+                                                       <title>Tiny Tiny RSS - Subscribe to feed...</title>
+                                                       <link rel=\"stylesheet\" type=\"text/css\" href=\"quicksub.css\">
+                                               </head>
+                                               <body>
+                                               <img class=\"logo\" src=\"images/ttrss_logo.png\"
+                                                       alt=\"Tiny Tiny RSS\"/> 
+                                               <h1>Subscribe to feed...</h1>";
+                               }
 
                                if (subscribe_to_feed($link, $feed_url, $cat_id)) {
                                        print "Added feed.";
                                                Feed <b>$feed_url</b> already exists in the database.
                                        </div>";
                                }
+
+                               if ($p_from) {
+                                       $tt_uri = 'http://' . $_SERVER['SERVER_NAME'] . 
+                                               preg_replace('/backend\.php.*$/', 
+                                                       'tt-rss.php', $_SERVER["REQUEST_URI"]);
+
+                                       print "<p><a href='$tt_uri'>Return to Tiny Tiny RSS</a> or
+                                               <a href='javascript:window.close()'>close this window</a>.</p>";
+
+                                       print "</body></html>";
+                                       return;
+                               }
                        }
                }
 
diff --git a/quicksub.css b/quicksub.css
new file mode 100644 (file)
index 0000000..931371d
--- /dev/null
@@ -0,0 +1,21 @@
+body {
+       margin : 1em;
+}
+
+h1 {
+       font-size : 14pt;
+       font-weight : bold;
+}
+
+a {
+       color : #4684ff;
+       text-decoration : none;
+}
+
+a:hover {
+       color : black;
+}
+
+img.logo {
+       float : right;
+}