Skip to content

Commit ecc547a

Browse files
committed
[plugin:showrss] add conf (array) $this->conf['ng_sites']
A config that exclude URL from results.
1 parent 9eec0b4 commit ecc547a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

xoops_trust_path/modules/xpwiki/plugin/showrss.inc.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ function plugin_showrss_init () {
2020
// URL of which it is effective is html is judged from an agreement forward.
2121
// 'http://...',
2222
);
23+
$this->conf['ng_sites'] = array(
24+
// Exclude URL from results.
25+
// 'http://...',
26+
);
2327
}
2428

2529
// Show related extensions are found or not
@@ -205,8 +209,14 @@ function XpWikiShowRSS_html(& $xpwiki, $data, $show_description = '', $max = 10)
205209
if ($count > $max) break;
206210
foreach ($items as $item) {
207211
if ($count > $max) break;
212+
if ($link = @ $item['LINK']) {
213+
foreach($conf['ng_sites'] as $ng_site) {
214+
if ($ng_site && strpos($link, $ng_site) === 0) {
215+
continue 2;
216+
}
217+
}
218+
}
208219
$count++;
209-
$link = @ $item['LINK'];
210220

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

0 commit comments

Comments
 (0)