' . $item['genre'] . '
' . $item['chaptercount'] . '
'; + $item['title'] = htmlspecialchars($xpath->query(".//*[@class='manga_name']//a", $manga) + ->item(0) + ->nodeValue); + $item['uri'] = self::URI . $xpath->query(".//*[@class='manga_name']//a", $manga) + ->item(0) + ->getAttribute('href'); + $item['author'] = htmlspecialchars($xpath->query("//*[@class='author_name']", $manga) + ->item(0) + ->nodeValue); + $item['chaptercount'] = $xpath->query(".//*[@class='chapter_count']", $manga) + ->item(0) + ->nodeValue; + $item['genre'] = htmlspecialchars($xpath->query(".//*[@class='manga_genre']", $manga) + ->item(0) + ->nodeValue); + $item['content'] = <<{$item['genre']}
+{$item['chaptercount']}
+EOD; $this->items[] = $item; } break; @@ -156,21 +180,30 @@ class MangareaderBridge extends BridgeAbstract { $limit = self::PARAMETERS[$this->queriedContext]['limit']['defaultValue']; } - $this->request = $xpath->query(".//*[@id='mangaproperties']//*[@class='aname']")->item(0)->nodeValue; + $this->request = $xpath->query(".//*[@id='mangaproperties']//*[@class='aname']") + ->item(0) + ->nodeValue; $query = "(.//*[@id='listing']//tr)[position() > 1]"; if($limit !== -1){ - $query = "(.//*[@id='listing']//tr)[position() > 1][position() > last() - " . $limit . "]"; + $query = + "(.//*[@id='listing']//tr)[position() > 1][position() > last() - {$limit}]"; } $chapters = $xpath->query($query); foreach ($chapters as $chapter){ $item = array(); - $item['title'] = htmlspecialchars($xpath->query("td[1]", $chapter)->item(0)->nodeValue); - $item['uri'] = self::URI . $xpath->query("td[1]/a", $chapter)->item(0)->getAttribute('href'); - $item['timestamp'] = strtotime($xpath->query("td[2]", $chapter)->item(0)->nodeValue); + $item['title'] = htmlspecialchars($xpath->query("td[1]", $chapter) + ->item(0) + ->nodeValue); + $item['uri'] = self::URI . $xpath->query("td[1]/a", $chapter) + ->item(0) + ->getAttribute('href'); + $item['timestamp'] = strtotime($xpath->query("td[2]", $chapter) + ->item(0) + ->nodeValue); array_unshift($this->items, $item); } break;