From 7624aa6e4042a66a60ca2ffb0035efcc3d8d51c5 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 12 Jun 2015 12:19:50 +0300 Subject: [PATCH] add a generic af_comics filter for .comic class sites (much like comicpress handles id comic, i guess) --- .../filters/af_comics_comicclass.php | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 plugins/af_comics/filters/af_comics_comicclass.php diff --git a/plugins/af_comics/filters/af_comics_comicclass.php b/plugins/af_comics/filters/af_comics_comicclass.php new file mode 100644 index 00000000..45698751 --- /dev/null +++ b/plugins/af_comics/filters/af_comics_comicclass.php @@ -0,0 +1,40 @@ +loadHTML($res); + + $basenode = false; + + if ($doc) { + $xpath = new DOMXPath($doc); + $basenode = $xpath->query('//div[@class="comic"]')->item(0); + + if ($basenode) { + $article["content"] = $doc->saveXML($basenode); + } + } + + return true; + } + + return false; + } +} +?> -- 2.39.5