Return items starting at the end, not the beginning when working with limits

This commit is contained in:
logmanoriginal 2016-01-19 21:41:14 +01:00
parent 2e4e0077a8
commit 0e1b84263e

View file

@ -96,7 +96,7 @@ class MangareaderBridge extends BridgeAbstract{
$query = "(.//*[@id='listing']//tr)[position() > 1]"; $query = "(.//*[@id='listing']//tr)[position() > 1]";
if($limit !== -1){ if($limit !== -1){
$query = "(.//*[@id='listing']//tr)[position() > 1][position() <= " . $limit . "]"; $query = "(.//*[@id='listing']//tr)[position() > 1][position() > last() - " . $limit . "]";
} }
$chapters = $xpath->query($query); $chapters = $xpath->query($query);