From e4f4b46f9d5d42dc53c4e2c5489da31a8ce10c26 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 9 Aug 2007 13:45:30 +0100 Subject: [PATCH] published feeds work --- backend.php | 6 +- functions.php | 90 ++++++++++++++++++++++++++-- images/feed-icon-12x12.png | Bin 552 -> 551 bytes images/pub_set.png | Bin 0 -> 3267 bytes images/pub_unset.png | Bin 0 -> 447 bytes modules/backend-rpc.php | 31 ++++++++++ modules/pref-feeds.php | 19 ++++++ prefs.js | 57 ++++++++++-------- prefs.php | 4 +- viewfeed.js | 118 ++++++++++++++++++++++++++++++++++++- 10 files changed, 293 insertions(+), 32 deletions(-) create mode 100644 images/pub_set.png create mode 100644 images/pub_unset.png diff --git a/backend.php b/backend.php index 1bf37f66..d5272dda 100644 --- a/backend.php +++ b/backend.php @@ -124,7 +124,6 @@ require_once "modules/pref-users.php"; require_once "modules/pref-feed-browser.php"; - if (!sanity_check($link)) { return; } if ($op == "rpc") { @@ -269,6 +268,11 @@ module_popup_dialog($link); } + if ($op == "pref-pub-items") { + module_pref_pub_items($link); + } + + // update feeds of all users, may be used anonymously if ($op == "globalUpdateFeeds") { diff --git a/functions.php b/functions.php index 6a55bdc8..a77d2f85 100644 --- a/functions.php +++ b/functions.php @@ -1607,7 +1607,13 @@ SET unread = false,last_read = NOW() WHERE marked = true AND owner_uid = ".$_SESSION["uid"]); } - + + if ($feed == -2) { + db_query($link, "UPDATE ttrss_user_entries + SET unread = false,last_read = NOW() + WHERE published = true AND owner_uid = ".$_SESSION["uid"]); + } + } else if ($feed < -10) { // label // TODO make this more efficient @@ -1773,6 +1779,8 @@ return getCategoryUnread($link, $n_feed); } else if ($n_feed == -1) { $match_part = "marked = true"; + } else if ($n_feed == -2) { + $match_part = "published = true"; } else if ($n_feed > 0) { $result = db_query($link, "SELECT id FROM ttrss_feeds @@ -1942,7 +1950,7 @@ $result = db_query($link, "SELECT count(ttrss_entries.id) as count FROM ttrss_entries,ttrss_user_entries,ttrss_feeds WHERE marked = true AND ttrss_user_entries.ref_id = ttrss_entries.id AND ttrss_user_entries.feed_id = ttrss_feeds.id AND - unread = true AND ttrss_user_entries.owner_uid = ".$_SESSION["uid"]); + hidden = false AND unread = true AND ttrss_user_entries.owner_uid = ".$_SESSION["uid"]); $count = db_fetch_result($result, 0, "count"); @@ -1953,6 +1961,21 @@ $ret_arr["-1"]["description"] = "Starred"; } + $result = db_query($link, "SELECT count(ttrss_entries.id) as count FROM ttrss_entries,ttrss_user_entries,ttrss_feeds + WHERE published = true AND ttrss_user_entries.ref_id = ttrss_entries.id AND + ttrss_user_entries.feed_id = ttrss_feeds.id AND + hidden = false AND unread = true AND ttrss_user_entries.owner_uid = ".$_SESSION["uid"]); + + $count = db_fetch_result($result, 0, "count"); + + if (!$ret_mode) { + print ""; + } else { + $ret_arr["-2"]["counter"] = $count; + $ret_arr["-2"]["description"] = "Published"; + } + + $result = db_query($link, "SELECT owner_uid,id,sql_exp,description FROM ttrss_labels WHERE owner_uid = ".$_SESSION["uid"]." ORDER by description"); @@ -2518,6 +2541,9 @@ } else if ($feed == -1) { // starred virtual feed $query_strategy_part = "marked = true"; $vfeed_query_part = "ttrss_feeds.title AS feed_title,"; + } else if ($feed == -2) { // published virtual feed + $query_strategy_part = "published = true"; + $vfeed_query_part = "ttrss_feeds.title AS feed_title,"; } else if ($feed <= -10) { // labels $label_id = -$feed - 11; @@ -2585,6 +2611,8 @@ } else if ($feed == -1) { $feed_title = __("Starred articles"); + } else if ($feed == -2) { + $feed_title = __("Published articles"); } else if ($feed < -10) { $label_id = -$feed - 11; $result = db_query($link, "SELECT description FROM ttrss_labels @@ -2618,7 +2646,7 @@ guid, ttrss_entries.id,ttrss_entries.title, updated, - unread,feed_id,marked,link,last_read, + unread,feed_id,marked,published,link,last_read, SUBSTRING(last_read,1,19) as last_read_noms, $vfeed_query_part $content_query_part @@ -2936,6 +2964,31 @@ } } + function publishArticlesById($link, $ids, $cmode) { + + $tmp_ids = array(); + + foreach ($ids as $id) { + array_push($tmp_ids, "ref_id = '$id'"); + } + + $ids_qpart = join(" OR ", $tmp_ids); + + if ($cmode == 0) { + db_query($link, "UPDATE ttrss_user_entries SET + published = false,last_read = NOW() + WHERE ($ids_qpart) AND owner_uid = " . $_SESSION["uid"]); + } else if ($cmode == 1) { + db_query($link, "UPDATE ttrss_user_entries SET + published = true + WHERE ($ids_qpart) AND owner_uid = " . $_SESSION["uid"]); + } else { + db_query($link, "UPDATE ttrss_user_entries SET + published = NOT published,last_read = NOW() + WHERE ($ids_qpart) AND owner_uid = " . $_SESSION["uid"]); + } + } + function catchupArticlesById($link, $ids, $cmode) { $tmp_ids = array(); @@ -3022,6 +3075,7 @@ $tog_unread_link = "javascript:selectionToggleUnread()"; $tog_marked_link = "javascript:selectionToggleMarked()"; + $tog_published_link = "javascript:selectionTogglePublished()"; } else { @@ -3031,6 +3085,7 @@ $tog_unread_link = "javascript:selectionToggleUnread(true)"; $tog_marked_link = "javascript:selectionToggleMarked(true)"; + $tog_published_link = "javascript:selectionTogglePublished(true)"; } @@ -3046,7 +3101,9 @@
  •  
  • Toggle
    • ".__('Unread')."
    • -
    • ".__('Starred')."
  • +
  • ".__('Starred')."
  • +
  • ".__('Published')."
  • +
  •  
  • ".__('Mark as read')."
    • ".__('This page')."
    • @@ -3157,6 +3214,7 @@ } $num_starred = getFeedUnread($link, -1); + $num_published = getFeedUnread($link, -2); $class = "virt"; @@ -3165,6 +3223,13 @@ printFeedEntry(-1, $class, __("Starred articles"), $num_starred, "images/mark_set.png", $link); + $class = "virt"; + + if ($num_published > 0) $class .= "Unread"; + + printFeedEntry(-2, $class, __("Published articles"), $num_published, + "images/pub_set.png", $link); + if (get_pref($link, 'ENABLE_FEED_CATS')) { print "
    "; } @@ -3848,6 +3913,16 @@ alt=\"Set mark\" onclick='javascript:tMark($id)'>"; } + if ($line["published"] == "t" || $line["published"] == "1") { + $published_pic = "\"Unpublish\""; + } else { + $published_pic = "\"Publish\""; + } + # $content_link = "" . # $line["title"] . ""; @@ -3887,6 +3962,7 @@ "; print "$marked_pic"; + print "$published_pic"; if ($line["feed_title"]) { print "$content_link"; @@ -3952,6 +4028,7 @@ 'RROW-$id')\" class=\"feedCheckBox\" id=\"RCHK-$id\">"; print "$marked_pic "; + print "$published_pic "; $tags = get_article_tags($link, $id); @@ -4094,4 +4171,9 @@ return $tag; } + + function generate_publish_key() { + return sha1(uniqid(rand(), true)); + } + ?> diff --git a/images/feed-icon-12x12.png b/images/feed-icon-12x12.png index 291000eab2b97c9a5a6f76e77afd6837ec10ac5f..10faf2548a5336c1f1a1645346e3a4ed0a6194bf 100644 GIT binary patch literal 551 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8lL0;{Qm37 zwSTW~{C;-*-^VBaK0W*U;`-m0H~zl5@$dEZf3L3pe025S`}@D1T>t&_+OMbAe?GkW z=jDx`kFWpx{QBoJpb6K0KDqJt<@LX>Z~c0F_3zsU|K8sE{rbWGzrX%~1n>N~f93bn z>wiBy{`24))(iFTPFZ#D%;g!`7&xmmJpF8U0o}{M;OXk;vd$@?2>^;XWU2rF delta 525 zcmV+o0`mQ*1gHctiBL{Q4GJ0x0000DNk~Le0000C0000C2nGNE09JKe=Kufz1ZP1_ zK>z@+$TtOw>5(BPe*wBlL_t(|+DwtXOB_)Y#n1bgx3gg*gUBwil7vJAAqol-5wS1? zBwZk#q*>CW2sSoWBB*~ru+U1du~AS0TdkEgY9)lAU=<|>%_O^FcfQ`seQ#78xWgOf zocn(FT=spYZ@^c6-B&8$9*2+&{6R6n0F$BlHx9#J%?WA6e=^Ae`LrMA`V`Rrzzhk& z!5O_d6`4BAUSLeAEYp{?0bBXlZF0zwN@T}>?j7({)Q7ZXFQB)8GhUUgc zMEk2i+<+RX!hgRGQGRhRPFosTY^VWo3S#$qhM+Hw5p7N*sm+2F9z#xjf$n(b#A(|a zG$A?zLt(Uvf8x6p_|sc?*RP)(qI|uK%sjd^nA~8~X{}8n-CF=n3pu$2<5$qG&4YJ5 zf#{pc4atKW950Ep?GG@GONdvW(LSj|hZiWke2X-)2D-uKY)$ITGQ{{CO!pY#gH_j= zRR+;I+JV>I>-cqQkwl)exjBW28i>yi5uF`6e%AFIQ}NXgcNUdi!b-q?E)M^;OSy~A zvffveCu4`zgd@6CDDArK28%@*Kr7HMfEzH62Ba?tdp5{q8YYM){tGYwCA7)VQMw|{ P00000NkvXXu0mjfdCTQS diff --git a/images/pub_set.png b/images/pub_set.png new file mode 100644 index 0000000000000000000000000000000000000000..fa0f5863cf51736ff4691acc92d11ae9bc6a89f9 GIT binary patch literal 3267 zcmV;!3_SCRP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJ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>G^7Q-L_MbQrg65{Sw zcXx01zo};S2KPK@<;)Oj=D04`Q1*sjRyEZ3bPg#2@@%`N4vcNTxPgQ^wN(gKtf{Fe zE1LjK9Mc=u$n p4AR52hQ`OLFp?;L*V"; } + if ($subop == "publishSelected") { + + $ids = split(",", db_escape_string($_GET["ids"])); + $cmode = sprintf("%d", $_GET["cmode"]); + + publishArticlesById($link, $ids, $cmode); + + print ""; + print ""; + getAllCounters($link); + print ""; + print_runtime_info($link); + print ""; + } + if ($subop == "sanityCheck") { print ""; if (sanity_check($link)) { diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index 9ef88e8f..b5070c7e 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -1043,5 +1043,24 @@ class=\"button\" onclick=\"gotoExportOpml()\" value=\"".__('Export OPML')."\">"; + + print "

    Published articles

    "; + + if (!get_pref($link, "_PREFS_PUBLISH_KEY")) { + set_pref($link, "_PREFS_PUBLISH_KEY", generate_publish_key()); + } + + print "

    ".__('Published articles are exported as a public RSS feed and can be subscribed by anyone who knows the address specified below.')."

    "; + + $url_path = 'http://' . $_SERVER["HTTP_HOST"] . \ + parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); + + $url_path .= "?op=publish&key=" . get_pref($link, "_PREFS_PUBLISH_KEY"); + + print "

    $url_path

    "; + + print "

    "; + } ?> diff --git a/prefs.js b/prefs.js index e9f52476..a662aeef 100644 --- a/prefs.js +++ b/prefs.js @@ -16,32 +16,33 @@ var caller_subop = false; var sanity_check_done = false; -function expand_feed_callback() { +/* +function replace_pubkey_callback() { if (xmlhttp.readyState == 4) { try { - var container = document.getElementById("BRDET-" + feed_to_expand); - container.innerHTML=xmlhttp.responseText; - container.style.display = "block"; -// p_notify(""); + var link = document.getElementById("pubGenAddress"); + + if (xmlhttp.responseXML) { + + + } else { + notify_error("Error while changing adress"); + } } catch (e) { - exception_error("expand_feed_callback", e); + exception_error("replace_pubkey_callback", e); } } -} +} */ -function pubitems_callback() { +function expand_feed_callback() { if (xmlhttp.readyState == 4) { try { - var container = document.getElementById('prefContent'); + var container = document.getElementById("BRDET-" + feed_to_expand); container.innerHTML=xmlhttp.responseText; - selectTab("pubItems", true); - - if (typeof correctPNG != 'undefined') { - correctPNG(); - } - notify(""); + container.style.display = "block"; +// p_notify(""); } catch (e) { - exception_error("feedlist_callback", e); + exception_error("expand_feed_callback", e); } } } @@ -1285,8 +1286,6 @@ function selectTab(id, noupdate, subop) { updateUsersList(); } else if (id == "feedBrowser") { updateBigFeedBrowser(); - } else if (id == "pubItems") { - updatePublishedItems(); } } @@ -1749,14 +1748,24 @@ function feedlistToggleSLAT() { updateFeedList() } -function updatePublishedItems() { +/* +function pubRegenKey() { + if (!xmlhttp_ready(xmlhttp)) { printLockingError(); - return + return false; } - xmlhttp.open("GET", "backend.php?op=pref-pubitems"); - xmlhttp.onreadystatechange=pubitems_callback; - xmlhttp.send(null); + var ok = confirm("Replace current publishing address with a new one?"); -} + if (ok) { + + notify_progress("Trying to change address..."); + + xmlhttp.open("GET", "backend.php?op=backend-rpc&subop=regen-pub-key"); + xmlhttp.onreadystatechange=replace_pubkey_callback; + xmlhttp.send(null); + } + + return false; +} */ diff --git a/prefs.php b/prefs.php index 8efe8288..8bf283f1 100644 --- a/prefs.php +++ b/prefs.php @@ -108,8 +108,8 @@ window.onload = init;
    -
    +
    diff --git a/viewfeed.js b/viewfeed.js index 72562974..74dad5ed 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -334,6 +334,11 @@ function tMark(id) { return toggleMark(id); } +function tPub(id) { + return togglePub(id); +} + + function toggleMark(id) { if (!xmlhttp_ready(xmlhttp_rpc)) { @@ -388,6 +393,60 @@ function toggleMark(id) { } +function togglePub(id) { + + if (!xmlhttp_ready(xmlhttp_rpc)) { + printLockingError(); + return; + } + + var query = "backend.php?op=rpc&id=" + id + "&subop=publ"; + + var mark_img = document.getElementById("FPPIC-" + id); + var vfeedu = document.getElementById("FEEDU--2"); + var crow = document.getElementById("RROW-" + id); + + if (mark_img.alt != "Unpublish") { + mark_img.src = "images/pub_set.png"; + mark_img.alt = "Unpublish"; + query = query + "&pub=1"; + + if (vfeedu && crow.className.match("Unread")) { + vfeedu.innerHTML = (+vfeedu.innerHTML) + 1; + } + + } else { + mark_img.src = "images/pub_unset.png"; + mark_img.alt = "Publish"; + query = query + "&pub=0"; + + if (vfeedu && crow.className.match("Unread")) { + vfeedu.innerHTML = (+vfeedu.innerHTML) - 1; + } + + } + + var vfeedctr = document.getElementById("FEEDCTR--2"); + var vfeedr = document.getElementById("FEEDR--2"); + + if (vfeedu && vfeedctr) { + if ((+vfeedu.innerHTML) > 0) { + if (crow.className.match("Unread") && !vfeedr.className.match("Unread")) { + vfeedr.className = vfeedr.className + "Unread"; + vfeedctr.className = "odd"; + } + } else { + vfeedctr.className = "invisible"; + vfeedr.className = vfeedr.className.replace("Unread", ""); + } + } + + debug("toggle published for aid " + id); + + new Ajax.Request(query); + +} + function correctHeadlinesOffset(id) { try { @@ -587,7 +646,7 @@ function selectionToggleMarked(cdm_mode) { for (i = 0; i < rows.length; i++) { var row = document.getElementById("RROW-" + rows[i]); - var mark_img = document.getElementById("FMARKPIC-" + rows[i]); + var mark_img = document.getElementById("FMPIC-" + rows[i]); if (row && mark_img) { @@ -622,6 +681,63 @@ function selectionToggleMarked(cdm_mode) { } } +function selectionTogglePublished(cdm_mode) { + try { + if (!xmlhttp_ready(xmlhttp_rpc)) { + printLockingError(); + return; + } + + var rows; + + if (cdm_mode) { + rows = cdmGetSelectedArticles(); + } else { + rows = getSelectedTableRowIds("headlinesList", "RROW", "RCHK"); + } + + if (rows.length == 0) { + alert(__("No articles are selected.")); + return; + } + + for (i = 0; i < rows.length; i++) { + var row = document.getElementById("RROW-" + rows[i]); + var mark_img = document.getElementById("FPPIC-" + rows[i]); + + if (row && mark_img) { + + if (mark_img.alt == "Publish") { + mark_img.src = "images/pub_set.png"; + mark_img.alt = "Unpublish"; + mark_img.setAttribute('onclick', + 'javascript:togglePub('+rows[i]+', false)'); + + } else { + mark_img.src = "images/pub_unset.png"; + mark_img.alt = "Publish"; + mark_img.setAttribute('onclick', + 'javascript:togglePub('+rows[i]+', true)'); + } + } + } + + if (rows.length > 0) { + + var query = "backend.php?op=rpc&subop=publishSelected&ids=" + + param_escape(rows.toString()) + "&cmode=2"; + + xmlhttp_rpc.open("GET", query, true); + xmlhttp_rpc.onreadystatechange=all_counters_callback; + xmlhttp_rpc.send(null); + + } + + } catch (e) { + exception_error("selectionToggleMarked", e); + } +} + function cdmGetSelectedArticles() { var sel_articles = new Array(); var container = document.getElementById("headlinesInnerContainer"); -- 2.39.5