Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -56,7 +56,8 @@ class _pixabay extends \IPS\Dispatcher\Controller
|
||||
'key' => \IPS\Settings::i()->pixabay_apikey,
|
||||
'image_type' => 'photo',
|
||||
'per_page' => 20,
|
||||
'page' => ( $offset ) ? ceil( $offset / 20 ) + 1 : 1
|
||||
'page' => ( $offset ) ? ceil( $offset / 20 ) + 1 : 1,
|
||||
'safesearch' => ( \IPS\Settings::i()->pixabay_safesearch ) ? 'true' : 'false',
|
||||
);
|
||||
|
||||
$parameters['q'] = urlencode( $query );
|
||||
@@ -79,6 +80,7 @@ class _pixabay extends \IPS\Dispatcher\Controller
|
||||
\IPS\Output::i()->json( array('error' => $request['message'] ) );
|
||||
}
|
||||
|
||||
|
||||
$results = array( 'pagination' => array( 'total_count' => $request['total'] ) );
|
||||
foreach ( $request['hits'] as $row )
|
||||
{
|
||||
@@ -89,6 +91,11 @@ class _pixabay extends \IPS\Dispatcher\Controller
|
||||
);
|
||||
}
|
||||
|
||||
if ( empty( $results['images'] ) )
|
||||
{
|
||||
\IPS\Output::i()->json( array( 'error' => \IPS\Theme::i()->getTemplate( 'system', 'core' )->noResults() ) );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->json( $results );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user