3
1
Back

= new DOMXPath($doc); return $xpath; } function hook_render_article($article) { $article['content'] .= "
" . $msg . ""; } } //Sites that provide images and just need alt tags textified. $doc->loadHTML($article['content']); //no-op $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach ($imgs as $img) { if (!$title_text || $title_text == $article['title'] || strpos($article['title'], $title_text) !== false){ // there's both alt and title texts, they're both different, use both. $alt_element = $doc->createElement("i", $title_text); } function mangle_article($article) { if ($img->getAttribute('title')) { $article['content'] = $img_tag . $article['content']; } Added BCN, Something Positive $alt_text = $entry->getAttribute('title'); $alt_text = $entry->getAttribute('title'); $alt_text = trim($entry->getAttribute('alt')); $alt_text = $entry->getAttribute('title'); $alt_text = trim($img->getAttribute('alt')); if (!$alt_text || $alt_text == $article['title'] || strpos($article['title'], $title_text) !== false){ $text_element = $doc->createElement("i", $title_text); $para_element->appendChild($title_element); } $img->parentNode->replaceChild($new_element, $img); } function get_xpath_dealie($link){ list($html, $content_type) = $this->get_content($link); //Sites that provide images and just need alt tags if both exist achewood, gwss fix, fix for when invisiblebread has no bread Pain Train alt tag, Alice Grove bigger img 2015-07-08 21:01:00 -07:00 From f5e6b8a4df714a1a2bca4fe779760c14f25ac698 Mon Sep 17 00:00:00 2001 Subject: [PATCH.

New Pull Request