summaryrefslogtreecommitdiff
path: root/init.php
diff options
context:
space:
mode:
authorMarkus Birth <github.com@birth-online.de>2013-06-20 03:01:22 -0700
committerMarkus Birth <github.com@birth-online.de>2013-06-20 03:01:22 -0700
commit8fe0bdd8431fa39c1e3e2b98459c6f0699081378 (patch)
treec2aba229c192bd03f66dfc2ac1b4bd50b5eef6d2 /init.php
parentff7ae3c171aa6562891e9defad88be60a22e20d4 (diff)
parent9c8da97a1ab8eca80c8b579816e4d287cff6f840 (diff)
downloadyafpp-8fe0bdd8431fa39c1e3e2b98459c6f0699081378.tar.gz
yafpp-8fe0bdd8431fa39c1e3e2b98459c6f0699081378.zip
Merge pull request #9 from rangerer/cleanup
added new cleanup feature by rangerer, thanks!
Diffstat (limited to 'init.php')
-rw-r--r--init.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/init.php b/init.php
index 3b65ce3..e99744a 100644
--- a/init.php
+++ b/init.php
@@ -116,6 +116,15 @@ class Af_Feedmod extends Plugin implements IHandler
if ($entries->length > 0) $basenode = $entries->item(0);
if ($basenode) {
+ // remove nodes from cleanup configuration
+ if (isset($config['cleanup'])) {
+ foreach ($config['cleanup'] as $cleanup) {
+ $nodelist = $xpath->query('//'.$cleanup, $basenode);
+ foreach ($nodelist as $node) {
+ $node->parentNode->removeChild($node);
+ }
+ }
+ }
$article['content'] = $doc->saveXML($basenode);
$article['plugin_data'] = "feedmod,$owner_uid:" . $article['plugin_data'];
}