3
1
Back

$aftercomic = $this->get_img_tags($xpath, "//div[@id='comic-1']//img", $article); // $article['content'] = $img_tag . $article['content']; } Various updates, additions $alt_element = $doc->createElement("i", $title_text); } elseif (strpos($article['link'], 'paintraincomic.com/comic/') !== FALSE) { // Dead Philosophers Dead Philosophers Added BCN, Something Positive if (!$alt_text){ Added BCN, Something Positive } if ($alt_text && !$title_text){ $text_element = $doc->createElement("i", $alt_text); $para_element->appendChild($alt_element); $para_element->appendChild($doc->createElement("br")); $title_element = $doc->createElement("i", $title_text); $para_element->appendChild($title_element); } $img->parentNode->replaceChild($new_element, $img); } function hook_render_article($article) { $article['content'] .= $aftercomic; } } return $article; } function mangle_article($article) { if (strpos($article["content"], "bonus panel!") !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='content']/img", $article); } // Invisible Bread (make the bread visible if (preg_match("@.*(get_img_tags($xpath, '//p[@class="Maintext"]//img[contains(@src, "joyimages")]', $article); } Some comics supported elseif (strpos($article['link'], 'twolumps.net/d/') !== FALSE) { elseif (strpos($article['link'], 'cad-comic.com/cad/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='cc-comicbody']/img", $article); $article['content'] = $this->get_img_tags($xpath, "//img[starts-with(@src, '/comics/') and @class='comic_image']", $article); } Added The Trenches; yet more code style tweaking Added The Trenches; yet more code style tweaking Gunnerkrigg and cleanup of alt-tag-only sites elseif (strpos($article['content'], 'imgs.xkcd.com/comics/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='content']/img", $article); .