diff options
| author | Markus Birth <github.com@birth-online.de> | 2013-06-20 03:01:22 -0700 |
|---|---|---|
| committer | Markus Birth <github.com@birth-online.de> | 2013-06-20 03:01:22 -0700 |
| commit | 8fe0bdd8431fa39c1e3e2b98459c6f0699081378 (patch) | |
| tree | c2aba229c192bd03f66dfc2ac1b4bd50b5eef6d2 /init.php | |
| parent | ff7ae3c171aa6562891e9defad88be60a22e20d4 (diff) | |
| parent | 9c8da97a1ab8eca80c8b579816e4d287cff6f840 (diff) | |
| download | yafpp-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.php | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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']; } |
