Skip to content

Commit

Permalink
[plugin:showrss] add conf (array) $this->conf['ng_sites']
Browse files Browse the repository at this point in the history
A config that exclude URL from results.
  • Loading branch information
nao-pon committed Jul 7, 2014
1 parent 9eec0b4 commit ecc547a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion xoops_trust_path/modules/xpwiki/plugin/showrss.inc.php
Expand Up @@ -20,6 +20,10 @@ function plugin_showrss_init () {
// URL of which it is effective is html is judged from an agreement forward.
// 'http://...',
);
$this->conf['ng_sites'] = array(
// Exclude URL from results.
// 'http://...',
);
}

// Show related extensions are found or not
Expand Down Expand Up @@ -205,8 +209,14 @@ function XpWikiShowRSS_html(& $xpwiki, $data, $show_description = '', $max = 10)
if ($count > $max) break;
foreach ($items as $item) {
if ($count > $max) break;
if ($link = @ $item['LINK']) {
foreach($conf['ng_sites'] as $ng_site) {
if ($ng_site && strpos($link, $ng_site) === 0) {
continue 2;
}
}
}
$count++;
$link = @ $item['LINK'];

$this->func->encode_numericentity($item['TITLE'], $this->cont['SOURCE_ENCODING'], 'UTF-8');
$linkstr = mb_convert_encoding($item['TITLE'], $this->cont['SOURCE_ENCODING'], 'UTF-8');
Expand Down

0 comments on commit ecc547a

Please sign in to comment.