diff options
Diffstat (limited to 'classes')
| -rw-r--r-- | classes/api.php | 43 | ||||
| -rw-r--r-- | classes/article.php | 13 | ||||
| -rw-r--r-- | classes/dlg.php | 2 | ||||
| -rw-r--r-- | classes/feeds.php | 11 | ||||
| -rw-r--r-- | classes/handler/public.php | 10 | ||||
| -rw-r--r-- | classes/opml.php | 6 | ||||
| -rw-r--r-- | classes/pref/feeds.php | 20 | ||||
| -rw-r--r-- | classes/pref/filters.php | 42 | ||||
| -rw-r--r-- | classes/pref/prefs.php | 23 | ||||
| -rw-r--r-- | classes/pref/users.php | 6 | ||||
| -rw-r--r-- | classes/rpc.php | 31 |
11 files changed, 149 insertions, 58 deletions
diff --git a/classes/api.php b/classes/api.php index 3ec218671..ba0eebb36 100644 --- a/classes/api.php +++ b/classes/api.php @@ -2,7 +2,7 @@ class API extends Handler { - const API_LEVEL = 4; + const API_LEVEL = 5; const STATUS_OK = 0; const STATUS_ERR = 1; @@ -133,7 +133,10 @@ class API extends Handler { $result = db_query($this->link, "SELECT id, title, order_id, (SELECT COUNT(id) FROM ttrss_feeds WHERE - ttrss_feed_categories.id IS NOT NULL AND cat_id = ttrss_feed_categories.id) AS num_feeds + ttrss_feed_categories.id IS NOT NULL AND cat_id = ttrss_feed_categories.id) AS num_feeds, + (SELECT COUNT(id) FROM + ttrss_feed_categories AS c2 WHERE + c2.parent_cat = ttrss_feed_categories.id) AS num_cats FROM ttrss_feed_categories WHERE $nested_qpart AND owner_uid = " . $_SESSION["uid"]); @@ -141,7 +144,7 @@ class API extends Handler { $cats = array(); while ($line = db_fetch_assoc($result)) { - if ($line["num_feeds"] > 0) { + if ($line["num_feeds"] > 0 || $line["num_cats"] > 0) { $unread = getFeedUnread($this->link, $line["id"], true); if ($enable_nested) @@ -348,7 +351,9 @@ class API extends Handler { } function updateFeed() { - $feed_id = db_escape_string($this->link, $_REQUEST["feed_id"]); + require_once "include/rssfuncs.php"; + + $feed_id = (int) db_escape_string($this->link, $_REQUEST["feed_id"]); update_rss_feed($this->link, $feed_id, true); @@ -666,6 +671,36 @@ class API extends Handler { return $headlines; } + function unsubscribeFeed() { + $feed_id = (int) db_escape_string($this->link, $_REQUEST["feed_id"]); + + $result = db_query($this->link, "SELECT id FROM ttrss_feeds WHERE + id = '$feed_id' AND owner_uid = ".$_SESSION["uid"]); + + if (db_num_rows($result) != 0) { + Pref_Feeds::remove_feed($this->link, $feed_id, $_SESSION["uid"]); + print $this->wrap(self::STATUS_OK, array("status" => "OK")); + } else { + print $this->wrap(self::STATUS_ERR, array("error" => "FEED_NOT_FOUND")); + } + } + + function subscribeToFeed() { + $feed_url = db_escape_string($this->link, $_REQUEST["feed_url"]); + $category_id = (int) db_escape_string($this->link, $_REQUEST["category_id"]); + $login = db_escape_string($this->link, $_REQUEST["login"]); + $password = db_escape_string($this->link, $_REQUEST["password"]); + + if ($feed_url) { + $rc = subscribe_to_feed($this->link, $feed_url, $category_id, + $login, $password, false); + + print $this->wrap(self::STATUS_OK, array("status" => $rc)); + } else { + print $this->wrap(self::STATUS_ERR, array("error" => 'INCORRECT_USAGE')); + } + } + } ?> diff --git a/classes/article.php b/classes/article.php index 595c6c432..b10766bf5 100644 --- a/classes/article.php +++ b/classes/article.php @@ -122,14 +122,16 @@ class Article extends Handler_Protected { db_query($link, "UPDATE ttrss_entries SET content = '$content', content_hash = '$content_hash' WHERE id = '$ref_id'"); - db_query($link, "UPDATE ttrss_user_entries SET published = true WHERE + db_query($link, "UPDATE ttrss_user_entries SET published = true, + last_published = NOW() WHERE int_id = '$int_id' AND owner_uid = '$owner_uid'"); } else { db_query($link, "INSERT INTO ttrss_user_entries - (ref_id, uuid, feed_id, orig_feed_id, owner_uid, published, tag_cache, label_cache, last_read, note, unread) + (ref_id, uuid, feed_id, orig_feed_id, owner_uid, published, tag_cache, label_cache, + last_read, note, unread, last_published) VALUES - ('$ref_id', '', NULL, NULL, $owner_uid, true, '', '', NOW(), '', false)"); + ('$ref_id', '', NULL, NULL, $owner_uid, true, '', '', NOW(), '', false, NOW())"); } if (count($labels) != 0) { @@ -152,9 +154,10 @@ class Article extends Handler_Protected { $ref_id = db_fetch_result($result, 0, "id"); db_query($link, "INSERT INTO ttrss_user_entries - (ref_id, uuid, feed_id, orig_feed_id, owner_uid, published, tag_cache, label_cache, last_read, note, unread) + (ref_id, uuid, feed_id, orig_feed_id, owner_uid, published, tag_cache, label_cache, + last_read, note, unread, last_published) VALUES - ('$ref_id', '', NULL, NULL, $owner_uid, true, '', '', NOW(), '', false)"); + ('$ref_id', '', NULL, NULL, $owner_uid, true, '', '', NOW(), '', false, NOW())"); if (count($labels) != 0) { foreach ($labels as $label) { diff --git a/classes/dlg.php b/classes/dlg.php index 5789af684..23b9c78fa 100644 --- a/classes/dlg.php +++ b/classes/dlg.php @@ -598,7 +598,7 @@ class Dlg extends Handler_Protected { print "<div style='text-align : center'>"; print "<button dojoType=\"dijit.form.Button\" - onclick=\"return window.open('$details')\">".__("Details")."</button>"; + onclick=\"return window.open('$details')\">".__("See the release notes")."</button>"; print "<button dojoType=\"dijit.form.Button\" onclick=\"return window.open('$download')\">".__("Download")."</button>"; print "<button dojoType=\"dijit.form.Button\" diff --git a/classes/feeds.php b/classes/feeds.php index 3657a0564..2c45da2dd 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -413,7 +413,7 @@ class Feeds extends Handler_Protected { } } - $mouseover_attrs = "onmouseover='postMouseIn($id)' + $mouseover_attrs = "onmouseover='postMouseIn(event, $id)' onmouseout='postMouseOut($id)'"; $reply['content'] .= "<div class='$class' id='RROW-$id' $label_row_style $mouseover_attrs>"; @@ -512,7 +512,7 @@ class Feeds extends Handler_Protected { } } - $mouseover_attrs = "onmouseover='postMouseIn($id)' + $mouseover_attrs = "onmouseover='postMouseIn(event, $id)' onmouseout='postMouseOut($id)'"; $expanded_class = $expand_cdm ? "expanded" : ""; @@ -537,7 +537,6 @@ class Feeds extends Handler_Protected { onclick=\"return cdmClicked(event, $id);\" class=\"titleWrap$hlc_suffix\"> <a class=\"title\" - title=\"".htmlspecialchars($line['title'])."\" target=\"_blank\" href=\"". htmlspecialchars($line["link"])."\">". $line["title"] . @@ -701,7 +700,7 @@ class Feeds extends Handler_Protected { $message = __("No starred articles found to display."); break; default: - if ($feed < -10) { + if ($feed < LABEL_BASE_INDEX) { $message = __("No articles found to display. You can assign articles to labels manually (see the Actions menu above) or use a filter."); } else { $message = __("No articles found to display."); @@ -778,8 +777,8 @@ class Feeds extends Handler_Protected { $result = false; - if ($feed < -10) { - $label_feed = -11-$feed; + if ($feed < LABEL_BASE_INDEX) { + $label_feed = feed_to_label_id($feed); $result = db_query($this->link, "SELECT id FROM ttrss_labels2 WHERE id = '$label_feed' AND owner_uid = " . $_SESSION['uid']); } else if (!$cat_view && is_numeric($feed) && $feed > 0) { diff --git a/classes/handler/public.php b/classes/handler/public.php index 53051a1f8..1efaa0430 100644 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -537,9 +537,9 @@ class Handler_Public extends Handler { <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/> </head> <body> - <img class=\"floatingLogo\" src=\"images/logo_wide.png\" + <img class=\"floatingLogo\" src=\"images/logo_small.png\" alt=\"Tiny Tiny RSS\"/> - <h1>".__("Subscribe to feed...")."</h1>"; + <h1>".__("Subscribe to feed...")."</h1><div class='content'>"; $rc = subscribe_to_feed($this->link, $feed_url); @@ -612,7 +612,7 @@ class Handler_Public extends Handler { <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\"> </form></p>"; - print "</body></html>"; + print "</div></body></html>"; } else { render_login_form($this->link); @@ -720,8 +720,9 @@ class Handler_Public extends Handler { </head> <body id='forgotpass'>"; - print '<div class="floatingLogo"><img src="images/logo_wide.png"></div>'; + print '<div class="floatingLogo"><img src="images/logo_small.png"></div>'; print "<h1>".__("Reset password")."</h1>"; + print "<div class='content'>"; @$method = $_POST['method']; @@ -790,6 +791,7 @@ class Handler_Public extends Handler { } + print "</div>"; print "</body>"; print "</html>"; diff --git a/classes/opml.php b/classes/opml.php index d4a0e9875..4c188de5e 100644 --- a/classes/opml.php +++ b/classes/opml.php @@ -29,8 +29,8 @@ class Opml extends Handler_Protected { <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/> </head> <body> - <div class=\"floatingLogo\"><img src=\"images/logo_wide.png\"></div> - <h1>".__('OPML Utility')."</h1>"; + <div class=\"floatingLogo\"><img src=\"images/logo_small.png\"></div> + <h1>".__('OPML Utility')."</h1><div class='content'>"; add_feed_category($this->link, "Imported feeds"); @@ -41,7 +41,7 @@ class Opml extends Handler_Protected { <input type=\"submit\" value=\"".__("Return to preferences")."\"> </form>"; - print "</body></html>"; + print "</div></body></html>"; } diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index ceda13374..a6811f3fc 100644 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -55,7 +55,7 @@ class Pref_Feeds extends Handler_Protected { $cat['items'] = $this->get_category_items($line['id']); - $cat['param'] = T_sprintf('(%d feeds)', count($cat['items'])); + $cat['param'] = vsprintf(ngettext('(%d feed)', '(%d feeds)', count($cat['items'])), count($cat['items'])); if (count($cat['items']) > 0 || $show_empty_cats) array_push($items, $cat); @@ -134,7 +134,7 @@ class Pref_Feeds extends Handler_Protected { while ($line = db_fetch_assoc($result)) { - $label_id = -$line['id'] - 11; + $label_id = label_to_feed_id($line['id']); $feed = $this->feedlist_init_feed($label_id, false, 0); @@ -172,7 +172,7 @@ class Pref_Feeds extends Handler_Protected { $cat['items'] = $this->get_category_items($line['id']); - $cat['param'] = T_sprintf('(%d feeds)', count($cat['items'])); + $cat['param'] = vsprintf(ngettext('(%d feed)', '(%d feeds)', count($cat['items'])), count($cat['items'])); if (count($cat['items']) > 0 || $show_empty_cats) array_push($root['items'], $cat); @@ -214,13 +214,13 @@ class Pref_Feeds extends Handler_Protected { array_push($cat['items'], $feed); } - $cat['param'] = T_sprintf('(%d feeds)', count($cat['items'])); + $cat['param'] = vsprintf(ngettext('(%d feed)', '(%d feeds)', count($cat['items'])), count($cat['items'])); if (count($cat['items']) > 0 || $show_empty_cats) array_push($root['items'], $cat); $root['param'] += count($cat['items']); - $root['param'] = T_sprintf('(%d feeds)', $root['param']); + $root['param'] = vsprintf(ngettext('(%d feed)', '(%d feeds)', count($cat['items'])), count($cat['items'])); } else { $feed_result = db_query($this->link, "SELECT id, title, last_error, @@ -245,7 +245,7 @@ class Pref_Feeds extends Handler_Protected { array_push($root['items'], $feed); } - $root['param'] = T_sprintf('(%d feeds)', count($root['items'])); + $root['param'] = vsprintf(ngettext('(%d feed)', '(%d feeds)', count($cat['items'])), count($cat['items'])); } $fl = array(); @@ -1012,7 +1012,7 @@ class Pref_Feeds extends Handler_Protected { $ids = split(",", db_escape_string($this->link, $_REQUEST["ids"])); foreach ($ids as $id) { - $this->remove_feed($this->link, $id, $_SESSION["uid"]); + Pref_Feeds::remove_feed($this->link, $id, $_SESSION["uid"]); } return; @@ -1657,7 +1657,7 @@ class Pref_Feeds extends Handler_Protected { ccache_remove($link, $id, $owner_uid, true); } - private function remove_feed($link, $id, $owner_uid) { + static function remove_feed($link, $id, $owner_uid) { if ($id > 0) { @@ -1700,8 +1700,8 @@ class Pref_Feeds extends Handler_Protected { ccache_remove($link, $id, $owner_uid); } else { - label_remove($link, -11-$id, $owner_uid); - ccache_remove($link, -11-$id, $owner_uid); + label_remove($link, feed_to_label_id($id), $owner_uid); + //ccache_remove($link, $id, $owner_uid); don't think labels are cached } } diff --git a/classes/pref/filters.php b/classes/pref/filters.php index c97628e51..883ff0ebd 100644 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -14,6 +14,9 @@ class Pref_Filters extends Handler_Protected { $filter["enabled"] = true; $filter["match_any_rule"] = sql_bool_to_bool( checkbox_to_sql_bool(db_escape_string($this->link, $_REQUEST["match_any_rule"]))); + $filter["inverse"] = sql_bool_to_bool( + checkbox_to_sql_bool(db_escape_string($this->link, $_REQUEST["inverse"]))); + $filter["rules"] = array(); $result = db_query($this->link, "SELECT id,name FROM ttrss_filter_types"); @@ -214,6 +217,7 @@ class Pref_Filters extends Handler_Protected { $enabled = sql_bool_to_bool(db_fetch_result($result, 0, "enabled")); $match_any_rule = sql_bool_to_bool(db_fetch_result($result, 0, "match_any_rule")); + $inverse = sql_bool_to_bool(db_fetch_result($result, 0, "inverse")); print "<form id=\"filter_edit_form\" onsubmit='return false'>"; @@ -257,6 +261,7 @@ class Pref_Filters extends Handler_Protected { unset($line["cat_id"]); unset($line["filter_id"]); unset($line["id"]); + if (!sql_bool_to_bool($line["inverse"])) unset($line["inverse"]); $data = htmlspecialchars(json_encode($line)); @@ -330,6 +335,15 @@ class Pref_Filters extends Handler_Protected { print "<br/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"match_any_rule\" id=\"match_any_rule\" $checked> <label for=\"match_any_rule\">".__('Match any rule')."</label>"; + if ($inverse) { + $checked = "checked=\"1\""; + } else { + $checked = ""; + } + + print "<br/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"inverse\" id=\"inverse\" $checked> + <label for=\"inverse\">".__('Inverse matching')."</label>"; + print "<p/>"; print "<div class=\"dlgButtons\">"; @@ -372,7 +386,8 @@ class Pref_Filters extends Handler_Protected { WHERE id = ".(int)$rule["filter_type"]); $filter_type = db_fetch_result($result, 0, "description"); - return T_sprintf("%s on %s in %s", strip_tags($rule["reg_exp"]), $filter_type, $feed); + return T_sprintf("%s on %s in %s %s", strip_tags($rule["reg_exp"]), + $filter_type, $feed, isset($rule["inverse"]) ? __("(inverse)") : ""); } function printRuleName() { @@ -406,9 +421,11 @@ class Pref_Filters extends Handler_Protected { $filter_id = db_escape_string($this->link, $_REQUEST["id"]); $enabled = checkbox_to_sql_bool(db_escape_string($this->link, $_REQUEST["enabled"])); $match_any_rule = checkbox_to_sql_bool(db_escape_string($this->link, $_REQUEST["match_any_rule"])); + $inverse = checkbox_to_sql_bool(db_escape_string($this->link, $_REQUEST["inverse"])); $result = db_query($this->link, "UPDATE ttrss_filters2 SET enabled = $enabled, - match_any_rule = $match_any_rule + match_any_rule = $match_any_rule, + inverse = $inverse WHERE id = '$filter_id' AND owner_uid = ". $_SESSION["uid"]); @@ -458,6 +475,8 @@ class Pref_Filters extends Handler_Protected { if ($rule) { $reg_exp = strip_tags(db_escape_string($this->link, trim($rule["reg_exp"]))); + $inverse = isset($rule["inverse"]) ? "true" : "false"; + $filter_type = (int) db_escape_string($this->link, trim($rule["filter_type"])); $feed_id = db_escape_string($this->link, trim($rule["feed_id"])); @@ -477,8 +496,8 @@ class Pref_Filters extends Handler_Protected { } $query = "INSERT INTO ttrss_filters2_rules - (filter_id, reg_exp,filter_type,feed_id,cat_id,cat_filter) VALUES - ('$filter_id', '$reg_exp', '$filter_type', $feed_id, $cat_id, $cat_filter)"; + (filter_id, reg_exp,filter_type,feed_id,cat_id,cat_filter,inverse) VALUES + ('$filter_id', '$reg_exp', '$filter_type', $feed_id, $cat_id, $cat_filter, $inverse)"; db_query($this->link, $query); } @@ -710,10 +729,8 @@ class Pref_Filters extends Handler_Protected { print "<br/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"match_any_rule\" id=\"match_any_rule\"> <label for=\"match_any_rule\">".__('Match any rule')."</label>"; - print "<p/>"; - -/* print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"inverse\" id=\"inverse\"> - <label for=\"inverse\">".__('Inverse match')."</label><hr/>"; */ + print "<br/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"inverse\" id=\"inverse\"> + <label for=\"inverse\">".__('Inverse matching')."</label>"; // print "</div>"; @@ -739,10 +756,12 @@ class Pref_Filters extends Handler_Protected { $reg_exp = htmlspecialchars($rule["reg_exp"]); $filter_type = $rule["filter_type"]; $feed_id = $rule["feed_id"]; + $inverse_checked = isset($rule["inverse"]) ? "checked" : ""; } else { $reg_exp = ""; $filter_type = 1; $feed_id = 0; + $inverse_checked = ""; } if (strpos($feed_id, "CAT:") === 0) { @@ -773,6 +792,11 @@ class Pref_Filters extends Handler_Protected { style=\"font-size : 16px; width : 20em;\" name=\"reg_exp\" value=\"$reg_exp\"/>"; + print "<hr/>"; + print "<input id=\"filterDlg_inverse\" dojoType=\"dijit.form.CheckBox\" + name=\"inverse\" $inverse_checked/>"; + print "<label for=\"filterDlg_inverse\">".__("Inverse regular expression matching")."</label>"; + print "<hr/>" . __("on field") . " "; print_select_hash("filter_type", $filter_type, $filter_types, 'dojoType="dijit.form.Select"'); @@ -885,6 +909,8 @@ class Pref_Filters extends Handler_Protected { unset($line["cat_id"]); } + if (!sql_bool_to_bool($line["inverse"])) unset($line["inverse"]); + if ($count < 2) { array_push($titles, $this->getRuleName($line)); } else { diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index 4fb8650a2..45bbba424 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -121,8 +121,9 @@ class Pref_Prefs extends Handler_Protected { global $access_level_names; - $prefs_blacklist = array("HIDE_READ_FEEDS", "FEEDS_SORT_BY_UNREAD", - "STRIP_UNSAFE_TAGS"); + $prefs_blacklist = array("STRIP_UNSAFE_TAGS"); + + /* "FEEDS_SORT_BY_UNREAD", "HIDE_READ_FEEDS", "REVERSE_HEADLINES" */ $profile_blacklist = array("ALLOW_DUPLICATE_POSTS", "PURGE_OLD_DAYS", "PURGE_UNREAD_ARTICLES", "DIGEST_ENABLE", "DIGEST_CATCHUP", @@ -233,7 +234,7 @@ class Pref_Prefs extends Handler_Protected { </script>"; if ($otp_enabled) { - print_notice("Changing your current password will disable OTP."); + print_notice(__("Changing your current password will disable OTP.")); } print "<table width=\"100%\" class=\"prefPrefsList\">"; @@ -266,7 +267,7 @@ class Pref_Prefs extends Handler_Protected { if ($otp_enabled) { - print_notice("One time passwords are currently enabled. Enter your current password below to disable."); + print_notice(__("One time passwords are currently enabled. Enter your current password below to disable.")); print "<form dojoType=\"dijit.form.Form\">"; @@ -401,7 +402,7 @@ class Pref_Prefs extends Handler_Protected { print '<div dojoType="dijit.layout.ContentPane" region="center" style="overflow-y : auto">'; if ($_SESSION["profile"]) { - print_notice("Some preferences are only available in default profile."); + print_notice(__("Some preferences are only available in default profile.")); } if ($_SESSION["profile"]) { @@ -412,10 +413,12 @@ class Pref_Prefs extends Handler_Protected { $profile_qpart = "profile IS NULL"; } - if ($_SESSION["prefs_show_advanced"]) + /* if ($_SESSION["prefs_show_advanced"]) $access_query = "true"; else - $access_query = "(access_level = 0 AND section_id != 3)"; + $access_query = "(access_level = 0 AND section_id != 3)"; */ + + $access_query = 'true'; $result = db_query($this->link, "SELECT DISTINCT ttrss_user_prefs.pref_name,short_desc,help_text,value,type_name, @@ -602,7 +605,7 @@ class Pref_Prefs extends Handler_Protected { print " "; - $checked = $_SESSION["prefs_show_advanced"] ? "checked='1'" : ""; + /* $checked = $_SESSION["prefs_show_advanced"] ? "checked='1'" : ""; print "<input onclick='toggleAdvancedPrefs()' id='prefs_show_advanced' @@ -610,7 +613,7 @@ class Pref_Prefs extends Handler_Protected { $checked type=\"checkbox\"></input> <label for='prefs_show_advanced'>" . - __("Show additional preferences") . "</label>"; + __("Show additional preferences") . "</label>"; */ global $pluginhost; $pluginhost->run_hooks($pluginhost::HOOK_PREFS_TAB_SECTION, @@ -626,7 +629,7 @@ class Pref_Prefs extends Handler_Protected { print "<h2>".__("Plugins")."</h2>"; - print_notice("You will need to reload Tiny Tiny RSS for plugin changes to take effect."); + print_notice(__("You will need to reload Tiny Tiny RSS for plugin changes to take effect.")); print "<form dojoType=\"dijit.form.Form\" id=\"changePluginsForm\">"; diff --git a/classes/pref/users.php b/classes/pref/users.php index 51493a273..4055bca45 100644 --- a/classes/pref/users.php +++ b/classes/pref/users.php @@ -288,11 +288,9 @@ class Pref_Users extends Handler_Protected { WHERE id = '$uid'"); if ($show_password) { - print T_sprintf("Changed password of user <b>%s</b> - to <b>%s</b>", $login, $tmp_user_pwd); + print T_sprintf("Changed password of user <b>%s</b> to <b>%s</b>", $login, $tmp_user_pwd); } else { - print T_sprintf("Sending new password of user <b>%s</b> - to <b>%s</b>", $login, $email); + print T_sprintf("Sending new password of user <b>%s</b> to <b>%s</b>", $login, $email); } require_once 'classes/ttrssmailer.php'; diff --git a/classes/rpc.php b/classes/rpc.php index ee5a9e68a..eb241591b 100644 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -105,9 +105,8 @@ class RPC extends Handler_Protected { $cat = db_escape_string($this->link, $_REQUEST['cat']); $login = db_escape_string($this->link, $_REQUEST['login']); $pass = db_escape_string($this->link, $_REQUEST['pass']); - $need_auth = db_escape_string($this->link, $_REQUEST['need_auth']) != ""; - $rc = subscribe_to_feed($this->link, $feed, $cat, $login, $pass, $need_auth); + $rc = subscribe_to_feed($this->link, $feed, $cat, $login, $pass); print json_encode(array("result" => $rc)); } @@ -623,7 +622,6 @@ class RPC extends Handler_Protected { $feeds = explode("\n", db_escape_string($this->link, $_REQUEST['feeds'])); $login = db_escape_string($this->link, $_REQUEST['login']); $pass = db_escape_string($this->link, $_REQUEST['pass']); - $need_auth = db_escape_string($this->link, $_REQUEST['need_auth']) != ""; foreach ($feeds as $feed) { $feed = trim($feed); @@ -845,5 +843,32 @@ class RPC extends Handler_Protected { } } + function cdmArticlePreview() { + $id = db_escape_string($this->link, $_REQUEST['id']); + + $result = db_query($this->link, "SELECT link, + ttrss_entries.title, content, feed_url + FROM + ttrss_entries, ttrss_user_entries + LEFT JOIN ttrss_feeds ON (ttrss_user_entries.feed_id = ttrss_feeds.id) + WHERE ref_id = '$id' AND ref_id = ttrss_entries.id AND + ttrss_user_entries.owner_uid = ". $_SESSION["uid"]); + + if (db_num_rows($result) != 0) { + $link = db_fetch_result($result, 0, "link"); + $title = db_fetch_result($result, 0, "title"); + $feed_url = db_fetch_result($result, 0, "feed_url"); + + $content = sanitize($this->link, + db_fetch_result($result, 0, "content"), false, false, $feed_url); + + print "<div class='content'>".$content."</content>"; + + } else { + print "Article not found."; + } + + } + } ?> |