From 8b52b3858eed04d9bacb3bfb7e49c1772e56bf74 Mon Sep 17 00:00:00 2001 From: niawag Date: Fri, 16 Dec 2016 10:41:40 +0100 Subject: [PATCH] Filter results by user status (VIP/Trusted/None) Took into account LogMANOriginal comment and tested it, everything's working. --- bridges/ThePirateBayBridge.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/bridges/ThePirateBayBridge.php b/bridges/ThePirateBayBridge.php index 7b3edd6..4c606c9 100644 --- a/bridges/ThePirateBayBridge.php +++ b/bridges/ThePirateBayBridge.php @@ -108,16 +108,8 @@ class ThePirateBayBridge extends BridgeAbstract{ foreach($html->find('tr') as $element) { - $skip = FALSE; - - if ($trustedBool) - { - $element_str = (string)$element; - if (strpos($element_str, 'VIP') == FALSE and strpos($element_str, 'Trusted') == FALSE ) - $skip = TRUE; - } - - if ( $skip == FALSE ) + + if ( !$trustedBool or !is_null($element->find('img[alt=VIP]', 0)) or !is_null($element->find('img[alt=Trusted]', 0)) ) { $item = array(); $item['uri'] = $element->find('a',3)->href;