| | |
| | | } |
| | | |
| | | static function librarything($ISBN, $dir = 'covers') { |
| | | if(!function_exists('curl_init') || !ksiazki::$LT_API) { |
| | | if(!function_exists('curl_init') || !config::$lt_api) { |
| | | return FALSE; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | $get = 'http://www.librarything.com/devkey/'.ksiazki::$LT_API.'/'.($dir=='covers_big' ? 'large' : 'small').'/isbn/'.$ISBN10; |
| | | $get = 'http://www.librarything.com/devkey/'.config::$lt_api.'/'.($dir=='covers_big' ? 'large' : 'small').'/isbn/'.$ISBN10; |
| | | $curl = curl_init($get); |
| | | curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE); |
| | | curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); |
| | |
| | | $image = imagecreatefromxpm($file); |
| | | break; |
| | | default: |
| | | error::add('Nieznany format obrazka: '.$type.'!'); |
| | | errorclass::add('Nieznany format obrazka: '.$type.'!'); |
| | | return FALSE; |
| | | break; |
| | | } |