diff options
Diffstat (limited to 'classes/pref')
-rw-r--r-- | classes/pref/feeds.php | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | classes/pref/filters.php | 74 | ||||
-rw-r--r-- | classes/pref/prefs.php | 2 |
3 files changed, 47 insertions, 33 deletions
diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index a29b2acca..e839af34e 100644 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -1461,8 +1461,10 @@ class Pref_Feeds extends Handler_Protected { print "<hr>"; + $opml_export_filename = "TinyTinyRSS_".date("Y-m-d").".opml"; + print "<p>" . __('Filename:') . - " <input type=\"text\" id=\"filename\" value=\"TinyTinyRSS.opml\" /> " . + " <input type=\"text\" id=\"filename\" value=\"$opml_export_filename\" /> " . __('Include settings') . "<input type=\"checkbox\" id=\"settings\" checked=\"1\"/>"; print "</p><button dojoType=\"dijit.form.Button\" diff --git a/classes/pref/filters.php b/classes/pref/filters.php index a371fcff4..d768a136f 100644..100755 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -43,8 +43,12 @@ class Pref_Filters extends Handler_Protected { return; } + function testFilterDo() { + require_once "include/rssfuncs.php"; + + $offset = (int) db_escape_string($_REQUEST["offset"]); + $limit = (int) db_escape_string($_REQUEST["limit"]); - function testFilter() { $filter = array(); $filter["enabled"] = true; @@ -94,24 +98,14 @@ class Pref_Filters extends Handler_Protected { } } - $found = 0; - $offset = 0; - $limit = 30; - $started = time(); - - print __("Articles matching this filter:"); - - require_once "include/rssfuncs.php"; - - print "<div class=\"filterTestHolder\">"; - print "<table width=\"100%\" cellspacing=\"0\" id=\"prefErrorFeedList\">"; - $glue = $filter['match_any_rule'] ? " OR " : " AND "; $scope_qpart = join($glue, $scope_qparts); if (!$scope_qpart) $scope_qpart = "true"; - while ($found < $limit && $offset < $limit * 10 && time() - $started < ini_get("max_execution_time") * 0.7) { + $rv = array(); + + //while ($found < $limit && $offset < $limit * 1000 && time() - $started < ini_get("max_execution_time") * 0.7) { $result = db_query("SELECT ttrss_entries.id, ttrss_entries.title, @@ -119,6 +113,7 @@ class Pref_Filters extends Handler_Protected { ttrss_feeds.title AS feed_title, ttrss_feed_categories.id AS cat_id, content, + date_entered, link, author, tag_cache @@ -139,7 +134,7 @@ class Pref_Filters extends Handler_Protected { if (count($rc) > 0) { - $line["content_preview"] = truncate_string(strip_tags($line["content"]), 100, '...'); + $line["content_preview"] = truncate_string(strip_tags($line["content"]), 200, '…'); foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { $line = $p->hook_query_headlines($line, 100); @@ -147,16 +142,16 @@ class Pref_Filters extends Handler_Protected { $content_preview = $line["content_preview"]; - if ($line["feed_title"]) $feed_title = "(" . $line["feed_title"] . ")"; + $tmp = "<tr style='margin-top : 5px'>"; - print "<tr>"; + #$tmp .= "<td width='5%' align='center'><input dojoType=\"dijit.form.CheckBox\" + # checked=\"1\" disabled=\"1\" type=\"checkbox\"></td>"; - print "<td width='5%' align='center'><input dojoType=\"dijit.form.CheckBox\" - checked=\"1\" disabled=\"1\" type=\"checkbox\"></td>"; - print "<td>"; + $id = $line['id']; + $tmp .= "<td width='5%' align='center'><img style='cursor : pointer' title='".__("Preview article")."' + src='images/information.png' onclick='openArticlePopup($id)'></td><td>"; /*foreach ($filter['rules'] as $rule) { - $reg_exp = $rule['reg_exp']; $reg_exp = str_replace('/', '\/', $rule["reg_exp"]); $line["title"] = preg_replace("/($reg_exp)/i", @@ -166,25 +161,42 @@ class Pref_Filters extends Handler_Protected { "<span class=\"highlight\">$1</span>", $content_preview); }*/ - print $line["title"]; - print "<div class='small' style='float : right'>" . $feed_title . "</div>"; - print "<div class=\"insensitive\">" . $content_preview . "</div>"; - print " " . mb_substr($line["date_entered"], 0, 16); + $tmp .= "<strong>" . $line["title"] . "</strong><br/>"; + $tmp .= $line['feed_title'] . ", " . mb_substr($line["date_entered"], 0, 16); + $tmp .= "<div class='insensitive'>" . $content_preview . "</div>"; + $tmp .= "</td></tr>"; + + array_push($rv, $tmp); - print "</td></tr>"; + /*array_push($rv, array("title" => $line["title"], + "content" => $content_preview, + "date" => $line["date_entered"], + "feed" => $line["feed_title"])); */ - $found++; } } - $offset += $limit; - } + //$offset += $limit; + //} - if ($found == 0) { + /*if ($found == 0) { print "<tr><td align='center'>" . __("No recent articles matching this filter have been found."); - } + }*/ + + print json_encode($rv); + } + + function testFilter() { + + if (isset($_REQUEST["offset"])) return $this->testFilterDo(); + + //print __("Articles matching this filter:"); + + print "<div><img id='prefFilterLoadingIndicator' src='images/indicator_tiny.gif'> <span id='prefFilterProgressMsg'>Looking for articles...</span></div>"; + print "<br/><div class=\"filterTestHolder\">"; + print "<table width=\"100%\" cellspacing=\"0\" id=\"prefFilterTestResultList\">"; print "</table></div>"; print "<div style='text-align : center'>"; diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index 41dc536f5..9cbc425c6 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -746,7 +746,7 @@ class Pref_Prefs extends Handler_Protected { $user_enabled = array_map("trim", explode(",", get_pref("_ENABLED_PLUGINS"))); $tmppluginhost = new PluginHost(); - $tmppluginhost->load_all($tmppluginhost::KIND_ALL, $_SESSION["uid"]); + $tmppluginhost->load_all($tmppluginhost::KIND_ALL, $_SESSION["uid"], true); $tmppluginhost->load_data(true); foreach ($tmppluginhost->get_plugins() as $name => $plugin) { |