Changeset 17488 for extensions/gvideo/include
- Timestamp:
- Aug 9, 2012, 2:12:23 PM (12 years ago)
- Location:
- extensions/gvideo/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/gvideo/include/functions.inc.php
r17383 r17488 193 193 194 194 return $video; 195 } 196 197 /** 198 * test if a download method is available 199 * @return: bool 200 */ 201 if (!function_exists('test_remote_download')) 202 { 203 function test_remote_download() 204 { 205 return function_exists('curl_init') || ini_get('allow_url_fopen'); 206 } 195 207 } 196 208 … … 224 236 225 237 curl_setopt($ch, CURLOPT_URL, $src); 226 curl_setopt($ch, CURLOPT_HEADER, 0);238 curl_setopt($ch, CURLOPT_HEADER, false); 227 239 curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-language: en")); 228 240 curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)'); … … 243 255 } 244 256 245 if (($out = curl_exec($ch)) === false) 257 $out = curl_exec($ch); 258 curl_close($ch); 259 260 if ($out === false) 246 261 { 247 262 return 'file_error'; 248 263 } 249 250 curl_close($ch); 251 252 if (!$return) 264 else if (!$return) 253 265 { 254 266 fclose($newf); -
extensions/gvideo/include/gvideo.inc.php
r17383 r17488 7 7 function gvideo_element_content($content, $element_info) 8 8 { 9 if (!$element_info['is_gvideo']) 10 { 11 return $content; 12 } 13 9 14 global $page, $picture, $template, $conf; 15 16 $conf['gvideo'] = unserialize($conf['gvideo']); 17 18 remove_event_handler('render_element_content', 'default_picture_content', EVENT_HANDLER_PRIORITY_NEUTRAL); 10 19 11 20 $query = ' … … 14 23 WHERE picture_id = '.$element_info['id'].' 15 24 ;'; 16 $ result = pwg_query($query);25 $video = pwg_db_fetch_assoc(pwg_query($query)); 17 26 18 if (!pwg_db_num_rows($result))19 {20 return $content;21 }22 23 remove_event_handler('render_element_content', 'default_picture_content', EVENT_HANDLER_PRIORITY_NEUTRAL);24 25 $conf['gvideo'] = unserialize($conf['gvideo']);26 27 $video = pwg_db_fetch_assoc($result);28 27 if (empty($video['width'])) 29 28 {
Note: See TracChangeset
for help on using the changeset viewer.