From 545bcc3e4b65bb1f0914fd2b548fb62504ecf8c6 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 20 Feb 2021 08:49:40 +0300 Subject: bookmarklets: cleanup some more markup --- plugins/bookmarklets/init.php | 92 ++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 49 deletions(-) (limited to 'plugins/bookmarklets') diff --git a/plugins/bookmarklets/init.php b/plugins/bookmarklets/init.php index 4c3bbf4cc..caa8b39df 100644 --- a/plugins/bookmarklets/init.php +++ b/plugins/bookmarklets/init.php @@ -118,56 +118,54 @@ class Bookmarklets extends Plugin { } if ($feed_urls) { + ?> +
+ + - print ""; - print \Controls\public_method_tags($this, "subscribe"); - print \Controls\hidden_tag("csrf_token", $_SESSION["csrf_token"]); - - print "
"; - print ""; - print ""; - print "
"; - - print ""; - print "".__("Return to Tiny Tiny RSS").""; +
+ + +
- print "
"; + + + + pdo->prepare("SELECT id FROM ttrss_feeds WHERE - feed_url = ? AND owner_uid = ?"); - $sth->execute([$feed_url, $_SESSION['uid']]); - $row = $sth->fetch(); - - $feed_id = $row["id"]; + if ($rc['code'] <= 2) { + $feed_id = Feeds::_find_by_url($feed_url, $_SESSION["uid"]); } else { $feed_id = 0; } if ($feed_id) { - print "
- - - - - ".__("Return to Tiny Tiny RSS")." -
"; + ?> +
"> + + + + + +
+ + + "; + ?> + + + + + "; - print "window.close();"; - print ""; + ?> + + - "; + subscribe_to_feed_url()); - //$confirm_str = str_replace("'", "\'", __('Subscribe to %s in Tiny Tiny RSS?')); - //$bm_subscribe_url = htmlspecialchars("javascript:{if(confirm('$confirm_str'.replace('%s',window.location.href)))window.location.href='$bm_subscribe_url'+encodeURIComponent(window.location.href)}"); - - //$bm_share_url = htmlspecialchars("javascript:(function(){var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='".get_self_url_prefix()."/public.php?op=sharepopup',l=d.location,e=encodeURIComponent,g=f+'&title='+((e(s))?e(s):e(document.title))+'&url='+e(l.href);function a(){if(!w.open(g,'t','toolbar=0,resizable=0,scrollbars=1,status=1,width=500,height=250')){l.href=g;}}a();})()"); ?>