Filter results by user status (VIP/Trusted/None)

Took into account LogMANOriginal comment and tested it, everything's working.
This commit is contained in:
niawag 2016-12-16 10:41:40 +01:00 committed by GitHub
parent 8bb002c7b6
commit 8b52b3858e

View file

@ -108,16 +108,8 @@ class ThePirateBayBridge extends BridgeAbstract{
foreach($html->find('tr') as $element) { foreach($html->find('tr') as $element) {
$skip = FALSE;
if ($trustedBool) if ( !$trustedBool or !is_null($element->find('img[alt=VIP]', 0)) or !is_null($element->find('img[alt=Trusted]', 0)) )
{
$element_str = (string)$element;
if (strpos($element_str, 'VIP') == FALSE and strpos($element_str, 'Trusted') == FALSE )
$skip = TRUE;
}
if ( $skip == FALSE )
{ {
$item = array(); $item = array();
$item['uri'] = $element->find('a',3)->href; $item['uri'] = $element->find('a',3)->href;