Update af_comics plugin to support GoComics.
Updates the af_comics plugin to support new GoComics site, which dropped native RSS feeds.
See merge request !42
<a title=\"".__('Edit tags for this article')."\"
href=\"#\" onclick=\"editArticleTags($id)\">(+)</a>";
- $num_comments = $line["num_comments"];
+ $num_comments = (int) $line["num_comments"];
$entry_comments = "";
if ($num_comments > 0) {
$cat['items'] = $this->get_category_items($line['id']);
$num_children = $this->calculate_children_count($cat);
- $cat['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', $num_children), $num_children);
+ $cat['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', (int) $num_children), $num_children);
if ($num_children > 0 || $show_empty_cats)
array_push($items, $cat);
$cat['items'] = $this->get_category_items($line['id']);
$num_children = $this->calculate_children_count($cat);
- $cat['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', $num_children), $num_children);
+ $cat['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', (int) $num_children), $num_children);
if ($num_children > 0 || $show_empty_cats)
array_push($root['items'], $cat);
array_push($root['items'], $cat);
$num_children = $this->calculate_children_count($root);
- $root['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', $num_children), $num_children);
+ $root['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', (int) $num_children), $num_children);
} else {
$feed_result = $this->dbh->query("SELECT id, title, last_error,
if (!$title) $title = __("[No caption]");
- $title = sprintf(_ngettext("%s (%d rule)", "%s (%d rules)", $num_rules), $title, $num_rules);
+ $title = sprintf(_ngettext("%s (%d rule)", "%s (%d rules)", (int) $num_rules), $title, $num_rules);
$result = $this->dbh->query(
if ($match_any_rule) $title .= " (" . __("matches any rule") . ")";
if ($num_actions > 0)
- $actions = sprintf(_ngettext("%s (+%d action)", "%s (+%d actions)", $num_actions), $actions, $num_actions);
+ $actions = sprintf(_ngettext("%s (+%d action)", "%s (+%d actions)", (int) $num_actions), $actions, $num_actions);
return array($title, $actions);
}
$class = ($feedctr % 2) ? "even" : "odd";
if ($line['articles_archived'] > 0) {
- $archived = sprintf(_ngettext("%d archived article", "%d archived articles", $line['articles_archived']), $line['articles_archived']);
+ $archived = sprintf(_ngettext("%d archived article", "%d archived articles", (int) $line['articles_archived']), $line['articles_archived']);
$archived = " <span class='subscribers'>($archived)</span>";
} else {
$archived = '';
$line = $p->hook_render_article($line);
}
- $num_comments = $line["num_comments"];
+ $num_comments = (int) $line["num_comments"];
$entry_comments = "";
if ($num_comments > 0) {
loading_set_progress(50);
document.onkeydown = hotkey_handler;
- setTimeout("hotkey_prefix_timeout()", 5*1000);
+ setTimeout(hotkey_prefix_timeout, 5*1000);
if (!getActiveFeedId()) {
viewfeed({feed: -3});
Element.hide('cmdline');
}
- setTimeout("hotkey_prefix_timeout()", 1000);
+ setTimeout(hotkey_prefix_timeout, 1000);
} catch (e) {
exception_error("hotkey_prefix_timeout", e);
updateFeedList();
} else {
if (feed_id == getActiveFeedId())
- setTimeout("viewfeed({feed:-5})", 100);
+ setTimeout(function() { viewfeed({feed:-5}) }, 100);
if (feed_id < 0) updateFeedList();
}
if (method == 'editFeed') {
var param = getURLParam('methodparam');
- window.setTimeout('editFeed(' + param + ')', 100);
+ window.setTimeout(function() { editFeed(param) }, 100);
}
- setTimeout("hotkey_prefix_timeout()", 5*1000);
+ setTimeout(hotkey_prefix_timeout, 5*1000);
} catch (e) {
exception_error("init_second_stage", e);
function timeout() {
if (getInitParam("bw_limit") != "1") {
request_counters();
- setTimeout("timeout()", 60*1000);
+ setTimeout(timeout, 60*1000);
}
}
if (getInitParam("simple_update")) {
console.log("scheduling simple feed updater...");
- window.setTimeout("update_random_feed()", 30*1000);
+ window.setTimeout(update_random_feed, 30*1000);
}
} catch (e) {
parameters: "op=rpc&method=updateRandomFeed",
onComplete: function(transport) {
handle_rpc_json(transport, true);
- window.setTimeout("update_random_feed()", 30*1000);
+ window.setTimeout(update_random_feed, 30*1000);
} });
} catch (e) {
function catchupCurrentBatchIfNeeded() {
if (catchup_id_batch.length > 0) {
window.clearTimeout(catchup_timeout_id);
- catchup_timeout_id = window.setTimeout('catchupBatchedArticles()', 1000);
+ catchup_timeout_id = window.setTimeout(catchupBatchedArticles, 1000);
if (catchup_id_batch.length >= 10) {
catchupBatchedArticles();