3 function batch_edit_cbox($elem, $label = false) {
4 print "<input type=\"checkbox\" title=\"".__("Check to enable field")."\"
5 onchange=\"batchFeedsToggleField(this, '$elem', '$label')\">";
8 function module_pref_feeds($link) {
10 global $update_intervals;
11 global $purge_intervals;
12 global $update_methods;
14 $subop = $_REQUEST["subop"];
15 $quiet = $_REQUEST["quiet"];
16 $mode = $_REQUEST["mode"];
18 if ($subop == "removeicon") {
19 $feed_id = db_escape_string($_REQUEST["feed_id"]);
21 $result = db_query($link, "SELECT id FROM ttrss_feeds
22 WHERE id = '$feed_id' AND owner_uid = ". $_SESSION["uid"]);
24 if (db_num_rows($result) != 0) {
25 unlink(ICONS_DIR
. "/$feed_id.ico");
31 if ($subop == "uploadicon") {
32 $icon_file = $_FILES['icon_file']['tmp_name'];
33 $feed_id = db_escape_string($_REQUEST["feed_id"]);
35 if (is_file($icon_file) && $feed_id) {
36 if (filesize($icon_file) < 20000) {
38 $result = db_query($link, "SELECT id FROM ttrss_feeds
39 WHERE id = '$feed_id' AND owner_uid = ". $_SESSION["uid"]);
41 if (db_num_rows($result) != 0) {
42 unlink(ICONS_DIR
. "/$feed_id.ico");
43 move_uploaded_file($icon_file, ICONS_DIR
. "/$feed_id.ico");
55 print "<script type=\"text/javascript\">";
56 print "parent.uploadIconHandler($rc);";
61 /* if ($subop == "massSubscribe") {
62 $ids = split(",", db_escape_string($_REQUEST["ids"]));
64 $subscribed = array();
66 foreach ($ids as $id) {
69 $result = db_query($link, "SELECT feed_url,title FROM ttrss_feeds
71 } else if ($mode == 2) {
72 $result = db_query($link, "SELECT * FROM ttrss_archived_feeds
73 WHERE id = '$id' AND owner_uid = " . $_SESSION["uid"]);
74 $orig_id = db_escape_string(db_fetch_result($result, 0, "id"));
75 $site_url = db_escape_string(db_fetch_result($result, 0, "site_url"));
78 $feed_url = db_escape_string(db_fetch_result($result, 0, "feed_url"));
79 $title = db_escape_string(db_fetch_result($result, 0, "title"));
81 $title_orig = db_fetch_result($result, 0, "title");
83 $result = db_query($link, "SELECT id FROM ttrss_feeds WHERE
84 feed_url = '$feed_url' AND owner_uid = " . $_SESSION["uid"]);
86 if (db_num_rows($result) == 0) {
88 $result = db_query($link,
89 "INSERT INTO ttrss_feeds (owner_uid,feed_url,title,cat_id)
90 VALUES ('".$_SESSION["uid"]."', '$feed_url', '$title', NULL)");
91 } else if ($mode == 2) {
92 $result = db_query($link,
93 "INSERT INTO ttrss_feeds (id,owner_uid,feed_url,title,cat_id,site_url)
94 VALUES ('$orig_id','".$_SESSION["uid"]."', '$feed_url', '$title', NULL, '$site_url')");
96 array_push($subscribed, $title_orig);
100 if (count($subscribed) > 0) {
101 $msg = "<b>".__('Subscribed to feeds:')."</b>".
102 "<ul class=\"nomarks\">";
104 foreach ($subscribed as $title) {
105 $msg .= "<li>$title</li>";
109 print format_notice($msg);
115 /* if ($subop == "browse") {
117 print "<div id=\"infoBoxTitle\">".__('Feed Browser')."</div>";
119 print "<div class=\"infoBoxContents\">";
121 $browser_search = db_escape_string($_REQUEST["search"]);
123 //print "<p>".__("Showing top 25 registered feeds, sorted by popularity:")."</p>";
125 print "<form onsubmit='return false;' display='inline' name='feed_browser' id='feed_browser'>";
128 <div style='float : right'>
129 <img style='display : none'
130 id='feed_browser_spinner' src='images/indicator_white.gif'>
131 <input name=\"search\" size=\"20\" type=\"search\"
132 onchange=\"javascript:updateFeedBrowser()\" value=\"$browser_search\">
133 <button onclick=\"javascript:updateFeedBrowser()\">".__('Search')."</button>
136 print " <select name=\"mode\" onchange=\"updateFeedBrowser()\">
137 <option value='1'>" . __('Popular feeds') . "</option>
138 <option value='2'>" . __('Feed archive') . "</option>
143 print " <select name=\"limit\" onchange='updateFeedBrowser()'>";
145 foreach (array(25, 50, 100, 200) as $l) {
146 $issel = ($l == $limit) ? "selected" : "";
147 print "<option $issel>$l</option>";
154 $owner_uid = $_SESSION["uid"];
156 print "<ul class='browseFeedList' id='browseFeedList'>";
157 print_feed_browser($link, $search, 25);
160 print "<div align='center'>
161 <button onclick=\"feedBrowserSubscribe()\">".__('Subscribe')."</button>
162 <button onclick=\"closeInfoBox()\" >".__('Cancel')."</button></div>";
168 if ($subop == "editfeed") {
169 $feed_id = db_escape_string($_REQUEST["id"]);
171 $result = db_query($link,
172 "SELECT * FROM ttrss_feeds WHERE id = '$feed_id' AND
173 owner_uid = " . $_SESSION["uid"]);
175 $title = htmlspecialchars(db_fetch_result($result,
178 $icon_file = ICONS_DIR
. "/$feed_id.ico";
180 if (file_exists($icon_file) && filesize($icon_file) > 0) {
181 $feed_icon = "<img width=\"16\" height=\"16\"
182 src=\"" . ICONS_URL
. "/$feed_id.ico\">";
187 print "<div id=\"infoBoxTitle\">".__('Feed Editor')."</div>";
189 print "<div class=\"infoBoxContents\">";
191 print "<form id=\"edit_feed_form\" onsubmit=\"return false\">";
193 print "<input type=\"hidden\" name=\"id\" value=\"$feed_id\">";
194 print "<input type=\"hidden\" name=\"op\" value=\"pref-feeds\">";
195 print "<input type=\"hidden\" name=\"subop\" value=\"editSave\">";
197 print "<div class=\"dlgSec\">".__("Feed")."</div>";
198 print "<div class=\"dlgSecCont\">";
202 print "<input style=\"font-size : 16px\" size=\"40\" onkeypress=\"return filterCR(event, feedEditSave)\"
203 name=\"title\" value=\"$title\">";
207 $feed_url = db_fetch_result($result, 0, "feed_url");
208 $feed_url = htmlspecialchars(db_fetch_result($result,
213 print __('URL:') . " ";
214 print "<input size=\"40\" onkeypress=\"return filterCR(event, feedEditSave)\"
215 name=\"feed_url\" value=\"$feed_url\">";
219 if (get_pref($link, 'ENABLE_FEED_CATS')) {
221 $cat_id = db_fetch_result($result, 0, "cat_id");
225 print __('Place in category:') . " ";
227 $parent_feed = db_fetch_result($result, 0, "parent_feed");
229 if (sprintf("%d", $parent_feed) > 0) {
230 $disabled = "disabled";
235 print_feed_cat_select($link, "cat_id", $cat_id, $disabled);
242 print __('Link to feed:') . " ";
244 $tmp_result = db_query($link, "SELECT COUNT(id) AS count
245 FROM ttrss_feeds WHERE parent_feed = '$feed_id'");
247 $linked_count = db_fetch_result($tmp_result, 0, "count");
249 $parent_feed = db_fetch_result($result, 0, "parent_feed");
251 if ($linked_count > 0) {
252 $disabled = "disabled";
257 print "<select $disabled name=\"parent_feed\">";
259 print "<option value=\"0\">".__('Not linked')."</option>";
261 if (get_pref($link, 'ENABLE_FEED_CATS')) {
263 $cat_qpart = "AND cat_id = '$cat_id'";
265 $cat_qpart = "AND cat_id IS NULL";
269 $tmp_result = db_query($link, "SELECT id,title FROM ttrss_feeds
270 WHERE id != '$feed_id' AND owner_uid = ".$_SESSION["uid"]." AND
271 (SELECT COUNT(id) FROM ttrss_feeds AS T2 WHERE T2.id = ttrss_feeds.parent_feed) = 0
272 $cat_qpart ORDER BY title");
274 if (db_num_rows($tmp_result) > 0) {
275 print "<option disabled>--------</option>";
278 while ($tmp_line = db_fetch_assoc($tmp_result)) {
279 if ($tmp_line["id"] == $parent_feed) {
280 $is_selected = "selected";
285 $linked_title = truncate_string(htmlspecialchars($tmp_line["title"]), 40);
287 printf("<option $is_selected value='%d'>%s</option>",
288 $tmp_line["id"], $linked_title);
296 print "<div class=\"dlgSec\">".__("Update")."</div>";
297 print "<div class=\"dlgSecCont\">";
299 /* Update Interval */
301 $update_interval = db_fetch_result($result, 0, "update_interval");
303 print_select_hash("update_interval", $update_interval, $update_intervals);
307 if (ALLOW_SELECT_UPDATE_METHOD
) {
308 $update_method = db_fetch_result($result, 0, "update_method");
310 print " " . __('using') . " ";
311 print_select_hash("update_method", $update_method, $update_methods);
314 $purge_interval = db_fetch_result($result, 0, "purge_interval");
316 if (FORCE_ARTICLE_PURGE
== 0) {
322 print __('Article purging:') . " ";
324 print_select_hash("purge_interval", $purge_interval, $purge_intervals);
327 print "<input type='hidden' name='purge_interval' value='$purge_interval'>";
332 print "<div class=\"dlgSec\">".__("Authentication")."</div>";
333 print "<div class=\"dlgSecCont\">";
335 $auth_login = htmlspecialchars(db_fetch_result($result, 0, "auth_login"));
339 print "<tr><td>" . __('Login:') . "</td><td>";
341 print "<input size=\"20\" onkeypress=\"return filterCR(event, feedEditSave)\"
342 name=\"auth_login\" value=\"$auth_login\">";
344 print "</tr><tr><td>" . __("Password:") . "</td><td>";
346 $auth_pass = htmlspecialchars(db_fetch_result($result, 0, "auth_pass"));
348 print "<input size=\"20\" type=\"password\" name=\"auth_pass\"
349 onkeypress=\"return filterCR(event, feedEditSave)\"
350 value=\"$auth_pass\">";
352 print "</td></tr></table>";
355 print "<div class=\"dlgSec\">".__("Options")."</div>";
356 print "<div class=\"dlgSecCont\">";
358 print "<div style=\"line-height : 100%\">";
360 $private = sql_bool_to_bool(db_fetch_result($result, 0, "private"));
363 $checked = "checked";
368 print "<input type=\"checkbox\" name=\"private\" id=\"private\"
369 $checked> <label for=\"private\">".__('Hide from Popular feeds')."</label>";
371 $rtl_content = sql_bool_to_bool(db_fetch_result($result, 0, "rtl_content"));
374 $checked = "checked";
379 print "<br/><input type=\"checkbox\" id=\"rtl_content\" name=\"rtl_content\"
380 $checked> <label for=\"rtl_content\">".__('Right-to-left content')."</label>";
382 $include_in_digest = sql_bool_to_bool(db_fetch_result($result, 0, "include_in_digest"));
384 if ($include_in_digest) {
385 $checked = "checked";
390 print "<br/><input type=\"checkbox\" id=\"include_in_digest\"
391 name=\"include_in_digest\"
392 $checked> <label for=\"include_in_digest\">".__('Include in e-mail digest')."</label>";
395 $always_display_enclosures = sql_bool_to_bool(db_fetch_result($result, 0, "always_display_enclosures"));
397 if ($always_display_enclosures) {
398 $checked = "checked";
403 print "<br/><input type=\"checkbox\" id=\"always_display_enclosures\"
404 name=\"always_display_enclosures\"
405 $checked> <label for=\"always_display_enclosures\">".__('Always display image attachments')."</label>";
408 $cache_images = sql_bool_to_bool(db_fetch_result($result, 0, "cache_images"));
411 $checked = "checked";
416 if (SIMPLEPIE_CACHE_IMAGES
) {
420 $disabled = "disabled";
421 $label_class = "class='insensitive'";
424 print "<br/><input type=\"checkbox\" id=\"cache_images\"
425 name=\"cache_images\" $disabled
426 $checked> <label $label_class for=\"cache_images\">".
427 __('Cache images locally')."</label>";
439 print "<div class=\"dlgSec\">".__("Icon")."</div>";
440 print "<div class=\"dlgSecCont\">";
442 print "<iframe name=\"icon_upload_iframe\"
443 style=\"width: 400px; height: 100px; display: none;\"></iframe>";
445 print "<form style='display : block' target=\"icon_upload_iframe\"
446 enctype=\"multipart/form-data\" method=\"POST\"
447 action=\"backend.php\">
448 <input id=\"icon_file\" size=\"10\" name=\"icon_file\" type=\"file\">
449 <input type=\"hidden\" name=\"op\" value=\"pref-feeds\">
450 <input type=\"hidden\" name=\"feed_id\" value=\"$feed_id\">
451 <input type=\"hidden\" name=\"subop\" value=\"uploadicon\">
452 <button onclick=\"return uploadFeedIcon();\"
453 type=\"submit\">".__('Replace')."</button>
454 <button onclick=\"return removeFeedIcon($feed_id);\"
455 type=\"submit\">".__('Remove')."</button>
460 $title = htmlspecialchars($title, ENT_QUOTES
);
462 print "<div class='dlgButtons'>
463 <div style=\"float : left\">
464 <button onclick='return unsubscribeFeed($feed_id, \"$title\")'>".
465 __('Unsubscribe')."</button>
467 <button onclick=\"return feedEditSave()\">".__('Save')."</button>
468 <button onclick=\"return feedEditCancel()\">".__('Cancel')."</button>
474 if ($subop == "editfeeds") {
476 $feed_ids = db_escape_string($_REQUEST["ids"]);
478 print "<div id=\"infoBoxTitle\">".__('Multiple Feed Editor')."</div>";
480 print "<div class=\"infoBoxContents\">";
482 print "<form id=\"batch_edit_feed_form\" onsubmit=\"return false\">";
484 print "<input type=\"hidden\" name=\"ids\" value=\"$feed_ids\">";
485 print "<input type=\"hidden\" name=\"op\" value=\"pref-feeds\">";
486 print "<input type=\"hidden\" name=\"subop\" value=\"batchEditSave\">";
488 print "<div class=\"dlgSec\">".__("Feed")."</div>";
489 print "<div class=\"dlgSecCont\">";
493 print "<input disabled style=\"font-size : 16px\" size=\"35\" onkeypress=\"return filterCR(event, feedEditSave)\"
494 name=\"title\" value=\"$title\">";
496 batch_edit_cbox("title");
502 print __('URL:') . " ";
503 print "<input disabled size=\"40\" onkeypress=\"return filterCR(event, feedEditSave)\"
504 name=\"feed_url\" value=\"$feed_url\">";
506 batch_edit_cbox("feed_url");
510 if (get_pref($link, 'ENABLE_FEED_CATS')) {
514 print __('Place in category:') . " ";
516 print_feed_cat_select($link, "cat_id", $cat_id, "disabled");
518 batch_edit_cbox("cat_id");
524 print "<div class=\"dlgSec\">".__("Update")."</div>";
525 print "<div class=\"dlgSecCont\">";
527 /* Update Interval */
529 print_select_hash("update_interval", $update_interval, $update_intervals,
532 batch_edit_cbox("update_interval");
536 if (ALLOW_SELECT_UPDATE_METHOD
) {
537 print " " . __('using') . " ";
538 print_select_hash("update_method", $update_method, $update_methods,
540 batch_edit_cbox("update_method");
545 if (FORCE_ARTICLE_PURGE
!= 0) {
549 print __('Article purging:') . " ";
551 print_select_hash("purge_interval", $purge_interval, $purge_intervals,
554 batch_edit_cbox("purge_interval");
558 print "<div class=\"dlgSec\">".__("Authentication")."</div>";
559 print "<div class=\"dlgSecCont\">";
561 print __('Login:') . " ";
562 print "<input disabled size=\"15\" onkeypress=\"return filterCR(event, feedEditSave)\"
563 name=\"auth_login\" value=\"$auth_login\">";
565 batch_edit_cbox("auth_login");
567 print " " . __("Password:") . " ";
569 print "<input disabled size=\"15\" type=\"password\" name=\"auth_pass\"
570 onkeypress=\"return filterCR(event, feedEditSave)\"
571 value=\"$auth_pass\">";
573 batch_edit_cbox("auth_pass");
576 print "<div class=\"dlgSec\">".__("Options")."</div>";
577 print "<div class=\"dlgSecCont\">";
579 print "<div style=\"line-height : 100%\">";
581 print "<input disabled type=\"checkbox\" name=\"private\" id=\"private\"
582 $checked> <label id=\"private_l\" class='insensitive' for=\"private\">".__('Hide from Popular feeds')."</label>";
584 print " "; batch_edit_cbox("private", "private_l");
586 print "<br/><input disabled type=\"checkbox\" id=\"rtl_content\" name=\"rtl_content\"
587 $checked> <label class='insensitive' id=\"rtl_content_l\" for=\"rtl_content\">".__('Right-to-left content')."</label>";
589 print " "; batch_edit_cbox("rtl_content", "rtl_content_l");
591 print "<br/><input disabled type=\"checkbox\" id=\"include_in_digest\"
592 name=\"include_in_digest\"
593 $checked> <label id=\"include_in_digest_l\" class='insensitive' for=\"include_in_digest\">".__('Include in e-mail digest')."</label>";
595 print " "; batch_edit_cbox("include_in_digest", "include_in_digest_l");
597 print "<br/><input disabled type=\"checkbox\" id=\"always_display_enclosures\"
598 name=\"always_display_enclosures\"
599 $checked> <label id=\"always_display_enclosures_l\" class='insensitive' for=\"always_display_enclosures\">".__('Always display image attachments')."</label>";
601 print " "; batch_edit_cbox("always_display_enclosures", "always_display_enclosures_l");
603 print "<br/><input disabled type=\"checkbox\" id=\"cache_images\"
604 name=\"cache_images\"
605 $checked> <label class='insensitive' id=\"cache_images_l\"
606 for=\"cache_images\">".
607 __('Cache images locally')."</label>";
610 if (SIMPLEPIE_CACHE_IMAGES
) {
611 print " "; batch_edit_cbox("cache_images", "cache_images_l");
619 print "<div class='dlgButtons'>
620 <input type=\"submit\" class=\"button\"
621 onclick=\"return feedsEditSave()\" value=\"".__('Save')."\">
622 <input type='submit' class='button'
623 onclick=\"return feedEditCancel()\" value=\"".__('Cancel')."\">
629 if ($subop == "editSave" ||
$subop == "batchEditSave") {
631 $feed_title = db_escape_string(trim($_POST["title"]));
632 $feed_link = db_escape_string(trim($_POST["feed_url"]));
633 $upd_intl = db_escape_string($_POST["update_interval"]);
634 $purge_intl = db_escape_string($_POST["purge_interval"]);
635 $feed_id = db_escape_string($_POST["id"]); /* editSave */
636 $feed_ids = db_escape_string($_POST["ids"]); /* batchEditSave */
637 $cat_id = db_escape_string($_POST["cat_id"]);
638 $auth_login = db_escape_string(trim($_POST["auth_login"]));
639 $auth_pass = db_escape_string(trim($_POST["auth_pass"]));
640 $parent_feed = db_escape_string($_POST["parent_feed"]);
641 $private = checkbox_to_sql_bool(db_escape_string($_POST["private"]));
642 $rtl_content = checkbox_to_sql_bool(db_escape_string($_POST["rtl_content"]));
643 $include_in_digest = checkbox_to_sql_bool(
644 db_escape_string($_POST["include_in_digest"]));
645 $cache_images = checkbox_to_sql_bool(
646 db_escape_string($_POST["cache_images"]));
647 $update_method = (int) db_escape_string($_POST["update_method"]);
649 $always_display_enclosures = checkbox_to_sql_bool(
650 db_escape_string($_POST["always_display_enclosures"]));
652 if (get_pref($link, 'ENABLE_FEED_CATS')) {
653 if ($cat_id && $cat_id != 0) {
654 $category_qpart = "cat_id = '$cat_id',";
655 $category_qpart_nocomma = "cat_id = '$cat_id'";
657 $category_qpart = 'cat_id = NULL,';
658 $category_qpart_nocomma = 'cat_id = NULL';
661 $category_qpart = "";
662 $category_qpart_nocomma = "";
665 if ($parent_feed && $parent_feed != 0) {
666 $parent_qpart = "parent_feed = '$parent_feed'";
668 $parent_qpart = 'parent_feed = NULL';
671 if (SIMPLEPIE_CACHE_IMAGES
) {
672 $cache_images_qpart = "cache_images = $cache_images,";
674 $cache_images_qpart = "";
677 if ($subop == "editSave") {
679 $result = db_query($link, "UPDATE ttrss_feeds SET
680 $category_qpart $parent_qpart,
681 title = '$feed_title', feed_url = '$feed_link',
682 update_interval = '$upd_intl',
683 purge_interval = '$purge_intl',
684 auth_login = '$auth_login',
685 auth_pass = '$auth_pass',
687 rtl_content = $rtl_content,
689 include_in_digest = $include_in_digest,
690 always_display_enclosures = $always_display_enclosures,
691 update_method = '$update_method'
692 WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]);
694 if (get_pref($link, 'ENABLE_FEED_CATS')) {
695 # update linked feed categories
696 $result = db_query($link, "UPDATE ttrss_feeds SET
697 $category_qpart_nocomma WHERE parent_feed = '$feed_id' AND
698 owner_uid = " . $_SESSION["uid"]);
700 } else if ($subop == "batchEditSave") {
701 $feed_data = array();
703 foreach (array_keys($_POST) as $k) {
704 if ($k != "op" && $k != "subop" && $k != "ids") {
705 $feed_data[$k] = $_POST[$k];
709 db_query($link, "BEGIN");
711 foreach (array_keys($feed_data) as $k) {
717 $qpart = "title = '$feed_title'";
721 $qpart = "feed_url = '$feed_link'";
724 case "update_interval":
725 $qpart = "update_interval = '$upd_intl'";
728 case "purge_interval":
729 $qpart = "purge_interval = '$purge_intl'";
733 $qpart = "auth_login = '$auth_login'";
737 $qpart = "auth_pass = '$auth_pass'";
741 $qpart = "private = '$private'";
744 case "include_in_digest":
745 $qpart = "include_in_digest = '$include_in_digest'";
748 case "always_display_enclosures":
749 $qpart = "always_display_enclosures = '$always_display_enclosures'";
753 $qpart = "cache_images = '$cache_images'";
757 $qpart = "rtl_content = '$rtl_content'";
760 case "update_method":
761 $qpart = "update_method = '$update_method'";
765 $qpart = $category_qpart_nocomma;
772 "UPDATE ttrss_feeds SET $qpart WHERE id IN ($feed_ids)
773 AND owner_uid = " . $_SESSION["uid"]);
778 db_query($link, "COMMIT");
783 if ($subop == "remove") {
785 $ids = split(",", db_escape_string($_REQUEST["ids"]));
787 foreach ($ids as $id) {
788 remove_feed($link, $id, $_SESSION["uid"]);
794 if ($subop == "clear") {
795 $id = db_escape_string($_REQUEST["id"]);
796 clear_feed_articles($link, $id);
799 if ($subop == "rescore") {
800 $ids = split(",", db_escape_string($_REQUEST["ids"]));
802 foreach ($ids as $id) {
804 $filters = load_filters($link, $id, $_SESSION["uid"], 6);
806 $result = db_query($link, "SELECT title, content, link, ref_id FROM
807 ttrss_user_entries, ttrss_entries
808 WHERE ref_id = id AND feed_id = '$id' AND
809 owner_uid = " .$_SESSION['uid']."
814 while ($line = db_fetch_assoc($result)) {
816 $article_filters = get_article_filters($filters, $line['title'],
817 $line['content'], $line['link']);
819 $new_score = calculate_article_score($article_filters);
821 if (!$scores[$new_score]) $scores[$new_score] = array();
823 array_push($scores[$new_score], $line['ref_id']);
826 foreach (array_keys($scores) as $s) {
828 db_query($link, "UPDATE ttrss_user_entries SET score = '$s',
830 ref_id IN (" . join(',', $scores[$s]) . ")");
831 } else if ($s < -500) {
832 db_query($link, "UPDATE ttrss_user_entries SET score = '$s',
834 ref_id IN (" . join(',', $scores[$s]) . ")");
836 db_query($link, "UPDATE ttrss_user_entries SET score = '$s' WHERE
837 ref_id IN (" . join(',', $scores[$s]) . ")");
842 print __("All done.");
846 if ($subop == "rescoreAll") {
848 $result = db_query($link,
849 "SELECT id FROM ttrss_feeds WHERE owner_uid = " . $_SESSION['uid']);
851 while ($feed_line = db_fetch_assoc($result)) {
853 $id = $feed_line["id"];
855 $filters = load_filters($link, $id, $_SESSION["uid"], 6);
857 $tmp_result = db_query($link, "SELECT title, content, link, ref_id FROM
858 ttrss_user_entries, ttrss_entries
859 WHERE ref_id = id AND feed_id = '$id' AND
860 owner_uid = " .$_SESSION['uid']."
865 while ($line = db_fetch_assoc($tmp_result)) {
867 $article_filters = get_article_filters($filters, $line['title'],
868 $line['content'], $line['link']);
870 $new_score = calculate_article_score($article_filters);
872 if (!$scores[$new_score]) $scores[$new_score] = array();
874 array_push($scores[$new_score], $line['ref_id']);
877 foreach (array_keys($scores) as $s) {
879 db_query($link, "UPDATE ttrss_user_entries SET score = '$s',
881 ref_id IN (" . join(',', $scores[$s]) . ")");
883 db_query($link, "UPDATE ttrss_user_entries SET score = '$s' WHERE
884 ref_id IN (" . join(',', $scores[$s]) . ")");
889 print __("All done.");
893 if ($subop == "add") {
895 $feed_url = db_escape_string(trim($_REQUEST["feed_url"]));
896 $cat_id = db_escape_string($_REQUEST["cat_id"]);
897 $p_from = db_escape_string($_REQUEST["from"]);
899 /* only read authentication information from POST */
901 $auth_login = db_escape_string(trim($_POST["auth_login"]));
902 $auth_pass = db_escape_string(trim($_POST["auth_pass"]));
904 if ($p_from != 'tt-rss') {
907 <title>Tiny Tiny RSS</title>
908 <link rel=\"stylesheet\" type=\"text/css\" href=\"utility.css\">
911 <img class=\"floatingLogo\" src=\"images/ttrss_logo.png\"
912 alt=\"Tiny Tiny RSS\"/>
913 <h1>Subscribe to feed...</h1>";
916 $rc = subscribe_to_feed($link, $feed_url, $cat_id, $auth_login, $auth_pass);
920 print_notice(T_sprintf("Subscribed to <b>%s</b>.", $feed_url));
923 print_error(T_sprintf("Could not subscribe to <b>%s</b>.", $feed_url));
926 print_warning(T_sprintf("Already subscribed to <b>%s</b>.", $feed_url));
930 if ($p_from != 'tt-rss') {
931 $tt_uri = ($_SERVER['HTTPS'] != "on" ?
'http://' : 'https://') . $_SERVER['HTTP_HOST'] . preg_replace('/backend\.php.*$/', 'tt-rss.php', $_SERVER["REQUEST_URI"]);
934 $tp_uri = ($_SERVER['HTTPS'] != "on" ?
'http://' : 'https://') . $_SERVER['HTTP_HOST'] . preg_replace('/backend\.php.*$/', 'prefs.php', $_SERVER["REQUEST_URI"]);
936 $result = db_query($link, "SELECT id FROM ttrss_feeds WHERE
937 feed_url = '$feed_url' AND owner_uid = " . $_SESSION["uid"]);
939 $feed_id = db_fetch_result($result, 0, "id");
944 print "<form method=\"GET\" style='display: inline'
946 <input type=\"hidden\" name=\"tab\" value=\"feedConfig\">
947 <input type=\"hidden\" name=\"subop\" value=\"editFeed\">
948 <input type=\"hidden\" name=\"subopparam\" value=\"$feed_id\">
949 <input type=\"submit\" value=\"".__("Edit subscription options")."\">
953 print "<form style='display: inline' method=\"GET\" action=\"$tt_uri\">
954 <input type=\"submit\" value=\"".__("Return to Tiny Tiny RSS")."\">
957 print "</body></html>";
962 if ($subop == "categorize") {
964 if (!WEB_DEMO_MODE
) {
966 $ids = split(",", db_escape_string($_REQUEST["ids"]));
968 $cat_id = db_escape_string($_REQUEST["cat_id"]);
971 $cat_id_qpart = 'NULL';
973 $cat_id_qpart = "'$cat_id'";
976 db_query($link, "BEGIN");
978 foreach ($ids as $id) {
980 db_query($link, "UPDATE ttrss_feeds SET cat_id = $cat_id_qpart
981 WHERE id = '$id' AND parent_feed IS NULL
982 AND owner_uid = " . $_SESSION["uid"]);
984 # update linked feed categories
985 db_query($link, "UPDATE ttrss_feeds SET
986 cat_id = $cat_id_qpart WHERE parent_feed = '$id' AND
987 owner_uid = " . $_SESSION["uid"]);
991 db_query($link, "COMMIT");
996 if ($subop == "editCats") {
998 $action = $_REQUEST["action"];
1000 if ($action == "save") {
1002 $cat_title = db_escape_string(trim($_REQUEST["value"]));
1003 $cat_id = db_escape_string($_REQUEST["cid"]);
1005 db_query($link, "BEGIN");
1007 $result = db_query($link, "SELECT title FROM ttrss_feed_categories
1008 WHERE id = '$cat_id' AND owner_uid = ".$_SESSION["uid"]);
1010 if (db_num_rows($result) == 1) {
1012 $old_title = db_fetch_result($result, 0, "title");
1014 if ($cat_title != "") {
1015 $result = db_query($link, "UPDATE ttrss_feed_categories SET
1016 title = '$cat_title' WHERE id = '$cat_id' AND
1017 owner_uid = ".$_SESSION["uid"]);
1024 print $_REQUEST["value"];
1027 db_query($link, "COMMIT");
1033 print "<div id=\"infoBoxTitle\">".__('Category editor')."</div>";
1035 print "<div class=\"infoBoxContents\">";
1038 if ($action == "add") {
1040 if (!WEB_DEMO_MODE
) {
1042 $feed_cat = db_escape_string(trim($_REQUEST["cat"]));
1044 $result = db_query($link,
1045 "SELECT id FROM ttrss_feed_categories
1046 WHERE title = '$feed_cat' AND owner_uid = ".$_SESSION["uid"]);
1048 if (db_num_rows($result) == 0) {
1050 $result = db_query($link,
1051 "INSERT INTO ttrss_feed_categories (owner_uid,title)
1052 VALUES ('".$_SESSION["uid"]."', '$feed_cat')");
1056 print_warning(T_sprintf("Category <b>$%s</b> already exists in the database.",
1063 if ($action == "remove") {
1065 $ids = split(",", db_escape_string($_REQUEST["ids"]));
1067 foreach ($ids as $id) {
1068 remove_feed_category($link, $id, $_SESSION["uid"]);
1073 <input id=\"fadd_cat\"
1074 onkeypress=\"return filterCR(event, addFeedCat)\"
1076 <button onclick=\"javascript:addFeedCat()\">".
1077 __('Create category')."</button></div>";
1079 $result = db_query($link, "SELECT title,id FROM ttrss_feed_categories
1080 WHERE owner_uid = ".$_SESSION["uid"]."
1085 if (db_num_rows($result) != 0) {
1087 print __('Select:')."
1088 <a href=\"javascript:selectPrefRows('fcat', true)\">".__('All')."</a>,
1089 <a href=\"javascript:selectPrefRows('fcat', false)\">".__('None')."</a>";
1091 print "<div class=\"prefFeedCatHolder\">";
1093 print "<form id=\"feed_cat_edit_form\" onsubmit=\"return false\">";
1095 print "<table width=\"100%\" class=\"prefFeedCatList\"
1096 cellspacing=\"0\" id=\"prefFeedCatList\">";
1100 while ($line = db_fetch_assoc($result)) {
1102 $class = ($lnum %
2) ?
"even" : "odd";
1104 $cat_id = $line["id"];
1105 $this_row_id = "id=\"FCATR-$cat_id\"";
1107 print "<tr class=\"$class\" $this_row_id>";
1109 $edit_title = htmlspecialchars($line["title"]);
1111 print "<td width='5%' align='center'><input
1112 onclick='toggleSelectPrefRow(this, \"fcat\");'
1113 type=\"checkbox\" id=\"FCCHK-$cat_id\"></td>";
1115 print "<td><span id=\"FCATT-$cat_id\">" .
1116 $edit_title . "</span></td>";
1130 print "<p>".__('No feed categories defined.')."</p>";
1133 print "<div class='dlgButtons'>
1134 <div style='float : left'>
1135 <button onclick=\"return removeSelectedFeedCats()\">".
1136 __('Remove')."</button>
1139 print "<button onclick=\"selectTab('feedConfig')\">".
1140 __('Close this window')."</button></div>";
1150 set_pref($link, "_PREFS_ACTIVE_TAB", "feedConfig");
1152 $result = db_query($link, "SELECT COUNT(id) AS num_errors
1153 FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]);
1155 $num_errors = db_fetch_result($result, 0, "num_errors");
1157 if ($num_errors > 0) {
1159 print format_notice("<a href=\"javascript:showFeedsWithErrors()\">".
1160 __('Some feeds have update errors (click for details)')."</a>");
1163 $feed_search = db_escape_string($_REQUEST["search"]);
1165 if (array_key_exists("search", $_REQUEST)) {
1166 $_SESSION["prefs_feed_search"] = $feed_search;
1168 $feed_search = $_SESSION["prefs_feed_search"];
1171 print "<div style='float : right'>
1172 <input id=\"feed_search\" size=\"20\" type=\"search\"
1173 onfocus=\"javascript:disableHotkeys();\"
1174 onblur=\"javascript:enableHotkeys();\"
1175 onchange=\"javascript:updateFeedList()\" value=\"$feed_search\">
1176 <button onclick=\"javascript:updateFeedList()\">".
1177 __('Search')."</button>
1180 print "<button onclick=\"quickAddFeed()\">"
1181 .__('Subscribe to feed')."</button> ";
1183 print "<button onclick=\"editSelectedFeed()\">".
1184 __('Edit feeds')."</button> ";
1186 if (get_pref($link, 'ENABLE_FEED_CATS')) {
1188 print "<button onclick=\"javascript:editFeedCats()\">".
1189 __('Edit categories')."</button> ";
1192 print "<button onclick=\"javascript:removeSelectedFeeds()\">"
1193 .__('Unsubscribe')."</button> ";
1195 if (defined('_ENABLE_FEED_DEBUGGING')) {
1197 print "<select id=\"feedActionChooser\" onchange=\"feedActionChange()\">
1198 <option value=\"facDefault\" selected>".__('More actions...')."</option>";
1200 if (FORCE_ARTICLE_PURGE
== 0) {
1202 "<option value=\"facPurge\">".__('Manual purge')."</option>";
1206 <option value=\"facClear\">".__('Clear feed data')."</option>
1207 <option value=\"facRescore\">".__('Rescore articles')."</option>";
1213 $feeds_sort = db_escape_string($_REQUEST["sort"]);
1215 if (!$feeds_sort ||
$feeds_sort == "undefined") {
1216 $feeds_sort = $_SESSION["pref_sort_feeds"];
1217 if (!$feeds_sort) $feeds_sort = "title";
1220 $_SESSION["pref_sort_feeds"] = $feeds_sort;
1224 $feed_search = split(" ", $feed_search);
1227 foreach ($feed_search as $token) {
1229 $token = trim($token);
1231 array_push($tokens, "(UPPER(F1.title) LIKE UPPER('%$token%') OR
1232 UPPER(C1.title) LIKE UPPER('%$token%') OR
1233 UPPER(F1.feed_url) LIKE UPPER('%$token%'))");
1236 $search_qpart = "(" . join($tokens, " AND ") . ") AND ";
1242 $show_last_article_info = false;
1243 $show_last_article_checked = "";
1244 $show_last_article_qpart = "";
1246 if ($_REQUEST["slat"] == "true") {
1247 $show_last_article_info = true;
1248 $show_last_article_checked = "checked";
1249 $show_last_article_qpart = ", (SELECT ".SUBSTRING_FOR_DATE
."(MAX(updated),1,16) FROM ttrss_user_entries,
1250 ttrss_entries WHERE ref_id = ttrss_entries.id
1251 AND feed_id = F1.id) AS last_article";
1252 } else if ($feeds_sort == "last_article") {
1253 $feeds_sort = "title";
1256 if (get_pref($link, 'ENABLE_FEED_CATS')) {
1257 $order_by_qpart = "category,$feeds_sort,title";
1259 $order_by_qpart = "$feeds_sort,title";
1262 $result = db_query($link, "SELECT
1266 ".SUBSTRING_FOR_DATE
."(F1.last_updated,1,16) AS last_updated,
1272 F2.title AS parent_title,
1273 C1.title AS category,
1274 F1.include_in_digest
1275 $show_last_article_qpart
1278 LEFT JOIN ttrss_feeds AS F2
1279 ON (F1.parent_feed = F2.id)
1280 LEFT JOIN ttrss_feed_categories AS C1
1281 ON (F1.cat_id = C1.id)
1283 $search_qpart F1.owner_uid = '".$_SESSION["uid"]."'
1284 ORDER by $order_by_qpart");
1286 if (db_num_rows($result) != 0) {
1288 // print "<div id=\"infoBoxShadow\"><div id=\"infoBox\">PLACEHOLDER</div></div>";
1290 print "<p><table width=\"100%\" cellspacing=\"0\"
1291 class=\"prefFeedList\" id=\"prefFeedList\">";
1292 print "<tr><td class=\"selectPrompt\" colspan=\"8\">".
1293 "<div style='float : right'>".
1294 "<input id='show_last_article_times' type='checkbox' onchange='feedlistToggleSLAT()'
1295 $show_last_article_checked><label
1296 for='show_last_article_times'>".__('Show last article times')."</label></div>".
1298 <a href=\"javascript:selectPrefRows('feed', true)\">".__('All')."</a>,
1299 <a href=\"javascript:selectPrefRows('feed', false)\">".__('None')."</a>
1302 if (!get_pref($link, 'ENABLE_FEED_CATS')) {
1303 print "<tr class=\"title\">
1304 <td width='5%' align='center'> </td>";
1306 if (get_pref($link, 'ENABLE_FEED_ICONS')) {
1307 print "<td width='3%'> </td>";
1310 print "<td width='60%'><a href=\"javascript:updateFeedList('title')\">".__('Title')."</a></td>";
1312 if ($show_last_article_info) {
1313 print "<td width='20%' align='right'><a href=\"javascript:updateFeedList('last_article')\">".__('Last Article')."</a></td>";
1316 print "<td width='20%' align='right'><a href=\"javascript:updateFeedList('last_updated')\">".__('Updated')."</a></td>";
1323 while ($line = db_fetch_assoc($result)) {
1325 $feed_id = $line["id"];
1326 $cat_id = $line["cat_id"];
1328 $edit_title = htmlspecialchars($line["title"]);
1329 $edit_cat = htmlspecialchars($line["category"]);
1331 $last_error = $line["last_error"];
1333 if (!$edit_cat) $edit_cat = __("Uncategorized");
1335 $last_updated = $line["last_updated"];
1337 if (!$last_updated) {
1338 $last_updated = "—";
1339 } else if (get_pref($link, 'HEADLINES_SMART_DATE')) {
1340 $last_updated = smart_date_time(strtotime($last_updated));
1342 $short_date = get_pref($link, 'SHORT_DATE_FORMAT');
1343 $last_updated = date($short_date, strtotime($last_updated));
1346 $last_article = $line["last_article"];
1348 if (!$last_article) {
1349 $last_article = "—";
1350 } else if (get_pref($link, 'HEADLINES_SMART_DATE')) {
1351 $last_article = smart_date_time(strtotime($last_article));
1353 $short_date = get_pref($link, 'SHORT_DATE_FORMAT');
1354 $last_article = date($short_date, strtotime($last_article));
1357 if (get_pref($link, 'ENABLE_FEED_CATS') && $cur_cat_id != $cat_id) {
1360 print "<tr><td colspan=\"6\" class=\"feedEditCat\">$edit_cat</td></tr>";
1362 print "<tr class=\"title\">
1363 <td width='5%'> </td>";
1365 if (get_pref($link, 'ENABLE_FEED_ICONS')) {
1366 print "<td width='3%'> </td>";
1369 print "<td width='60%'><a href=\"javascript:updateFeedList('title')\">".__('Title')."</a></td>";
1371 if ($show_last_article_info) {
1372 print "<td width='20%' align='right'>
1373 <a href=\"javascript:updateFeedList('last_article')\">".__('Last Article')."</a></td>";
1376 print "<td width='20%' align='right'>
1377 <a href=\"javascript:updateFeedList('last_updated')\">".__('Updated')."</a></td>";
1379 $cur_cat_id = $cat_id;
1382 $class = ($lnum %
2) ?
"even" : "odd";
1383 $this_row_id = "id=\"FEEDR-$feed_id\"";
1385 print "<tr class=\"$class\" $this_row_id>";
1387 $icon_file = ICONS_DIR
. "/$feed_id.ico";
1389 if (file_exists($icon_file) && filesize($icon_file) > 0) {
1390 $feed_icon = "<img class=\"tinyFeedIcon\" src=\"" . ICONS_URL
. "/$feed_id.ico\">";
1392 $feed_icon = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\">";
1395 print "<td class='feedSelect'><input onclick='toggleSelectPrefRow(this, \"feed\");'
1396 type=\"checkbox\" id=\"FRCHK-".$line["id"]."\"></td>";
1398 $onclick = "onclick='editFeed($feed_id)' title='".__('Click to edit')."'";
1400 if (get_pref($link, 'ENABLE_FEED_ICONS')) {
1401 print "<td $onclick class='feedIcon'>$feed_icon</td>";
1405 $edit_title = "<span class=\"feed_error\">$edit_title</span>";
1406 $last_updated = "<span class=\"feed_error\">$last_updated</span>";
1407 $last_article = "<span class=\"feed_error\">$last_article</span>";
1410 $parent_title = $line["parent_title"];
1411 if ($parent_title) {
1412 $linked_to = sprintf(__("(linked to %s)"), $parent_title);
1413 $parent_title = "<span class='groupPrompt'>$linked_to</span>";
1416 print "<td $onclick>" . "$edit_title $parent_title" . "</td>";
1418 if ($show_last_article_info) {
1419 print "<td align='right' $onclick>" .
1420 "$last_article</td>";
1423 print "<td $onclick align='right'>$last_updated</td>";
1438 if (!$feed_search) {
1439 print_warning(__("You don't have any subscribed feeds."));
1441 print_warning(__('No matching feeds found.'));
1447 print "<h3>".__('OPML')."</h3>";
1449 /* print "<div style='float : left'>
1450 <form enctype=\"multipart/form-data\" method=\"POST\" action=\"opml.php\">
1451 ".__('File:')." <input id=\"opml_file\" name=\"opml_file\" type=\"file\">
1452 <input type=\"hidden\" name=\"op\" value=\"Import\">
1453 <button onclick=\"return validateOpmlImport();\"
1454 type=\"submit\">".__('Import')."</button>
1459 print "<p>" . __("Using OPML you can export and import your feeds and Tiny Tiny RSS settings.");
1461 print "<div class=\"insensitive\">" . __("Note: only main settings profile can be migrated using OPML.") . "</div>";
1465 print "<iframe name=\"upload_iframe\"
1466 style=\"width: 400px; height: 100px; display: none;\"></iframe>";
1468 print "<div style='float : left'>";
1469 print "<form style='display : block' target=\"upload_iframe\"
1470 enctype=\"multipart/form-data\" method=\"POST\"
1471 action=\"backend.php\">
1472 <input id=\"opml_file\" name=\"opml_file\" type=\"file\">
1473 <input type=\"hidden\" name=\"op\" value=\"dlg\">
1474 <input type=\"hidden\" name=\"id\" value=\"importOpml\">
1475 <button onclick=\"return opmlImport();\"
1476 type=\"submit\">".__('Import')."</button>
1478 print "</div> ";
1480 print "<button onclick=\"gotoExportOpml()\">".
1481 __('Export OPML')."</button>";
1483 if (!get_pref($link, "_PREFS_OPML_PUBLISH_KEY")){
1484 set_pref($link, "_PREFS_OPML_PUBLISH_KEY", generate_publish_key());
1487 print "<p>".__('Your OPML can be published publicly and can be subscribed by anyone who knows the URL below.');
1489 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>";
1491 print "<button onclick=\"return displayDlg('pubOPMLUrl')\">".
1492 __('Display URL')."</button> ";
1495 if (strpos($_SERVER['HTTP_USER_AGENT'], "Firefox") !== false) {
1497 print "<h3>" . __("Firefox Integration") . "</h3>";
1499 print "<p>" . __('This Tiny Tiny RSS site can be used as a Firefox Feed Reader by clicking the link below.') . "</p>";
1503 print "<button onclick='window.navigator.registerContentHandler(" .
1504 "\"application/vnd.mozilla.maybe.feed\", " .
1505 "\"" . add_feed_url() . "\", " . " \"Tiny Tiny RSS\")'>" .
1506 __('Click here to register this site as a feed reader.') .
1512 print "<h3>".__("Published articles")."</h3>";
1514 if (!get_pref($link, "_PREFS_PUBLISH_KEY")) {
1515 set_pref($link, "_PREFS_PUBLISH_KEY", generate_publish_key());
1518 print "<p>".__('Published articles are exported as a public RSS feed and can be subscribed by anyone who knows the URL specified below.')."</p>";
1520 print "<button onclick=\"return displayDlg('pubUrl')\">".
1521 __('Display URL')."</button> ";
1526 function print_feed_browser($link, $search, $limit, $mode = 1) {
1528 $owner_uid = $_SESSION["uid"];
1531 $search_qpart = "AND (UPPER(feed_url) LIKE UPPER('%$search%') OR
1532 UPPER(title) LIKE UPPER('%$search%'))";
1538 $result = db_query($link, "SELECT feed_url, subscribers FROM
1539 ttrss_feedbrowser_cache WHERE (SELECT COUNT(id) = 0 FROM ttrss_feeds AS tf
1540 WHERE tf.feed_url = ttrss_feedbrowser_cache.feed_url
1541 AND owner_uid = '$owner_uid') $search_qpart
1542 ORDER BY subscribers DESC LIMIT $limit");
1543 } else if ($mode == 2) {
1544 $result = db_query($link, "SELECT *,
1545 (SELECT COUNT(*) FROM ttrss_user_entries WHERE
1546 orig_feed_id = ttrss_archived_feeds.id) AS articles_archived
1548 ttrss_archived_feeds
1550 (SELECT COUNT(*) FROM ttrss_feeds
1551 WHERE ttrss_feeds.feed_url = ttrss_archived_feeds.feed_url AND
1552 owner_uid = '$owner_uid') = 0 AND
1553 owner_uid = '$owner_uid' $search_qpart
1554 ORDER BY id DESC LIMIT $limit");
1559 while ($line = db_fetch_assoc($result)) {
1563 $feed_url = htmlspecialchars($line["feed_url"]);
1564 $subscribers = $line["subscribers"];
1566 $det_result = db_query($link, "SELECT site_url,title,id
1567 FROM ttrss_feeds WHERE feed_url = '$feed_url' LIMIT 1");
1569 $details = db_fetch_assoc($det_result);
1571 $icon_file = ICONS_DIR
. "/" . $details["id"] . ".ico";
1573 if (file_exists($icon_file) && filesize($icon_file) > 0) {
1574 $feed_icon = "<img class=\"tinyFeedIcon\" src=\"" . ICONS_URL
.
1575 "/".$details["id"].".ico\">";
1577 $feed_icon = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\">";
1580 $check_box = "<input onclick='toggleSelectListRow(this)'
1581 class='feedBrowseCB'
1582 type=\"checkbox\" id=\"FBCHK-" . $details["id"] . "\">";
1584 $class = ($feedctr %
2) ?
"even" : "odd";
1586 if ($details["site_url"]) {
1587 $site_url = "<a target=\"_blank\" href=\"".
1588 htmlspecialchars($details["site_url"])."\">
1589 <img style='border-width : 0px' src='images/www.png' alt='www'></a>";
1594 $feed_url = "<a target=\"_blank\" href=\"$feed_url\"><img
1595 style='border-width : 0px; vertical-align : middle'
1596 src='images/feed-icon-12x12.png'></a>";
1598 print "<li title=\"".htmlspecialchars($details["site_url"])."\"
1599 class='$class' id=\"FBROW-".$details["id"]."\">$check_box".
1600 "$feed_icon $feed_url " . htmlspecialchars($details["title"]) .
1601 " <span class='subscribers'>($subscribers)</span>
1604 } else if ($mode == 2) {
1605 $feed_url = htmlspecialchars($line["feed_url"]);
1606 $site_url = htmlspecialchars($line["site_url"]);
1607 $title = htmlspecialchars($line["title"]);
1609 $icon_file = ICONS_DIR
. "/" . $line["id"] . ".ico";
1611 if (file_exists($icon_file) && filesize($icon_file) > 0) {
1612 $feed_icon = "<img class=\"tinyFeedIcon\" src=\"" . ICONS_URL
.
1613 "/".$line["id"].".ico\">";
1615 $feed_icon = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\">";
1618 $check_box = "<input onclick='toggleSelectListRow(this)' class='feedBrowseCB'
1619 type=\"checkbox\" id=\"FBCHK-" . $line["id"] . "\">";
1621 $class = ($feedctr %
2) ?
"even" : "odd";
1623 if ($line['articles_archived'] > 0) {
1624 $archived = sprintf(__("%d archived articles"), $line['articles_archived']);
1625 $archived = " <span class='subscribers'>($archived)</span>";
1630 if ($line["site_url"]) {
1631 $site_url = "<a target=\"_blank\" href=\"$site_url\">
1632 <img style='border-width : 0px' src='images/www.png' alt='www'></a>";
1637 $feed_url = "<a target=\"_blank\" href=\"$feed_url\"><img
1638 style='border-width : 0px; vertical-align : middle'
1639 src='images/feed-icon-12x12.png'></a>";
1641 print "<li title='".$line['site_url']."' class='$class'
1642 id=\"FBROW-".$line["id"]."\">".
1643 $check_box . "$feed_icon $feed_url " . $title .
1644 $archived . $site_url . "</li>";
1652 if ($feedctr == 0) {
1653 print "<li style=\"text-align : center\"><p>".__('No feeds found.')."</p></li>";