]> git.wh0rd.org - tt-rss.git/commitdiff
small fixes
authorandre-hub <a.groetschel@inet-service.org>
Sat, 15 Jan 2011 21:40:47 +0000 (22:40 +0100)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 16 Jan 2011 08:04:05 +0000 (11:04 +0300)
functions.php
modules/pref-feeds.php

index 7c5a306afb1788aa17ab9256f177db921872fb88..4737e60ee8ec14a48a46bb88c2f6e69ed3086891 100644 (file)
                        <img src=\"".theme_image($link, "images/sign_excl.png")."\">$msg</div>";
        }
 
-       function format_notice($msg) {
+       function format_notice($msg, $id = "") {
                global $link;
                return "<div class=\"notice\" id=\"$id\"> 
                        <img src=\"".theme_image($link, "images/sign_info.png")."\">$msg</div>";
        }
 
-       function format_error($msg) {
+       function format_error($msg, $id = "") {
                global $link;
                return "<div class=\"error\" id=\"$id\"> 
                        <img src=\"".theme_image($link, "images/sign_excl.png")."\">$msg</div>";
index 66902d4412323d14e6f3a705f639e3c3448d022f..7f1b029a1953d70e9691ece60574625f774e4d81 100644 (file)
                        case 0:
                                print_warning(T_sprintf("Already subscribed to <b>%s</b>.", $feed_url));
                                break;
+                       case 5:
+                               print_error(T_sprintf("Could not subscribe to <b>%s</b>.<br>Can't download the Feed URL.", $feed_url));
+                               break;
                        }
 
                        if ($p_from != 'tt-rss') {
+                               if (!isset($_SERVER['HTTPS'])) $_SERVER['HTTPS'] = 'off';
                                $tt_uri = ($_SERVER['HTTPS'] != "on" ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . preg_replace('/backend\.php.*$/', 'tt-rss.php', $_SERVER["REQUEST_URI"]);
 
 
                                $tp_uri = ($_SERVER['HTTPS'] != "on" ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . preg_replace('/backend\.php.*$/', 'prefs.php', $_SERVER["REQUEST_URI"]);
 
-                               $result = db_query($link, "SELECT id FROM ttrss_feeds WHERE
-                                       feed_url = '$feed_url' AND owner_uid = " . $_SESSION["uid"]);
-
-                               $feed_id = db_fetch_result($result, 0, "id");
+                               if ($rc <= 2){
+                                       $result = db_query($link, "SELECT id FROM ttrss_feeds WHERE
+                                               feed_url = '$feed_url' AND owner_uid = " . $_SESSION["uid"]);
 
+                                       $feed_id = db_fetch_result($result, 0, "id");
+                               } else {
+                                       $feed_id = 0;
+                               }
                                print "<p>";
 
                                if ($feed_id) {