rework OPML display in pref-feeds; hide authenticated feeds from public OPML

This commit is contained in:
Andrew Dolgov 2010-06-30 13:13:57 +04:00
parent 78a5c296ae
commit c107797cf7
2 changed files with 24 additions and 16 deletions

View file

@ -1458,6 +1458,8 @@
print "<p>" . __("Using OPML you can export and import your feeds and Tiny Tiny RSS settings."); print "<p>" . __("Using OPML you can export and import your feeds and Tiny Tiny RSS settings.");
print "<div class=\"insensitive\">" . __("Note: only main settings profile can be migrated using OPML.") . "</div>";
print "</p>"; print "</p>";
print "<iframe name=\"upload_iframe\" print "<iframe name=\"upload_iframe\"
@ -1478,20 +1480,34 @@
print "<button onclick=\"gotoExportOpml()\">". print "<button onclick=\"gotoExportOpml()\">".
__('Export OPML')."</button>"; __('Export OPML')."</button>";
if (!get_pref($link, "_PREFS_OPML_PUBLISH_KEY")){
set_pref($link, "_PREFS_OPML_PUBLISH_KEY", generate_publish_key());
}
print "<h3>" . __("Firefox Integration") . "</h3>"; print "<p>".__('Your OPML can be published publicly and can be subscribed by anyone who knows the URL below.');
print "<p>" . __('This Tiny Tiny RSS site can be used as a Firefox Feed Reader by clicking the link below.') . "</p>"; print "<div class=\"insensitive\">" . __("Note: Published OPML does not include your Tiny Tiny RSS settings, feeds that require authentication or feeds hidden from Popular feeds.") . "</div>" . "</p>";
print "<p"; print "<button onclick=\"return displayDlg('pubOPMLUrl')\">".
__('Display URL')."</button> ";
print "<button onclick='window.navigator.registerContentHandler(" .
if (strpos($_SERVER['HTTP_USER_AGENT'], "Firefox") !== false) {
print "<h3>" . __("Firefox Integration") . "</h3>";
print "<p>" . __('This Tiny Tiny RSS site can be used as a Firefox Feed Reader by clicking the link below.') . "</p>";
print "<p";
print "<button onclick='window.navigator.registerContentHandler(" .
"\"application/vnd.mozilla.maybe.feed\", " . "\"application/vnd.mozilla.maybe.feed\", " .
"\"" . add_feed_url() . "\", " . " \"Tiny Tiny RSS\")'>" . "\"" . add_feed_url() . "\", " . " \"Tiny Tiny RSS\")'>" .
__('Click here to register this site as a feed reader.') . __('Click here to register this site as a feed reader.') .
"</button>"; "</button>";
print "</p>"; print "</p>";
}
print "<h3>".__("Published articles")."</h3>"; print "<h3>".__("Published articles")."</h3>";
@ -1499,20 +1515,11 @@
set_pref($link, "_PREFS_PUBLISH_KEY", generate_publish_key()); set_pref($link, "_PREFS_PUBLISH_KEY", generate_publish_key());
} }
if (!get_pref($link, "_PREFS_OPML_PUBLISH_KEY")){
set_pref($link, "_PREFS_OPML_PUBLISH_KEY", generate_publish_key());
}
print "<p>".__('Published articles are exported as a public RSS feed and can be subscribed by anyone who knows the URL specified below.')."</p>"; print "<p>".__('Published articles are exported as a public RSS feed and can be subscribed by anyone who knows the URL specified below.')."</p>";
print "<button onclick=\"return displayDlg('pubUrl')\">". print "<button onclick=\"return displayDlg('pubUrl')\">".
__('Display URL')."</button> "; __('Display URL')."</button> ";
print "<p>".__('Your OPML can be published publicly and can be subscribed by anyone who knows the URL below.')."</p>";
print "<button onclick=\"return displayDlg('pubOPMLUrl')\">".
__('Display URL')."</button> ";
} }

View file

@ -33,7 +33,8 @@
$where = "WHERE owner_uid = '$owner_uid'"; $where = "WHERE owner_uid = '$owner_uid'";
$orderby = "ORDER BY title"; $orderby = "ORDER BY title";
if ($hide_private_feeds){ if ($hide_private_feeds){
$where = "WHERE owner_uid = '$owner_uid' AND private IS false"; $where = "WHERE owner_uid = '$owner_uid' AND private IS false AND
auth_login = '' AND auth_pass = ''";
} }