| 2419 |
break; |
break; |
| 2420 |
|
|
| 2421 |
case 'rss item': |
case 'rss item': |
| 2422 |
|
// Only need help with RSS if they're using the core Upload module. |
| 2423 |
// Get the flash mime query. |
if (!module_exists('filefield') || flashvideo_variable_get(NULL, 'flashvideo_filefield', 0) == FALSE) { |
| 2424 |
$flashmime = flashvideo_get_flash_query(); |
// Get the flash mime query. |
| 2425 |
|
$flashmime = flashvideo_get_flash_query(); |
| 2426 |
// Find the filepath of the first video uploaded to this node. |
|
| 2427 |
$sql ="SELECT f.filepath FROM {flashvideo} fv LEFT JOIN {files} f ON f.fid = fv.fid WHERE (fv.nid = %d) AND $flashmime AND (fv.status = %d) AND (fv.video_index = 0)"; |
// Find the filepath of the first video uploaded to this node. |
| 2428 |
$filepath = db_result(db_query($sql, $node->nid, FLASHVIDEO_STATUS_CONVERTED)); |
$sql ="SELECT f.filepath FROM {flashvideo} fv LEFT JOIN {files} f ON f.fid = fv.fid WHERE (fv.nid = %d) AND $flashmime AND (fv.status = %d) AND (fv.video_index = 0)"; |
| 2429 |
|
$filepath = db_result(db_query($sql, $node->nid, FLASHVIDEO_STATUS_CONVERTED)); |
| 2430 |
// Set the URL attributes. |
|
| 2431 |
$attributes['url'] = check_url(file_create_url($filepath)); |
// Set the URL attributes. |
| 2432 |
|
$attributes['url'] = check_url(file_create_url($filepath)); |
| 2433 |
// Get the filesize and set that in the attributes. |
|
| 2434 |
$attributes['length'] = filesize(getcwd() .'/'. $filepath); |
// Get the filesize and set that in the attributes. |
| 2435 |
|
$attributes['length'] = filesize(getcwd() .'/'. $filepath); |
| 2436 |
// Get the mime type of this video. |
|
| 2437 |
$mime_type = _flashvideo_get_mime_type($filepath); |
// Get the mime type of this video. |
| 2438 |
|
$mime_type = _flashvideo_get_mime_type($filepath); |
| 2439 |
// If the mime type was found, then set the attributes. |
|
| 2440 |
if ($mime_type) { |
// If the mime type was found, then set the attributes. |
| 2441 |
$attributes['type'] = $mime_type; |
if ($mime_type) { |
| 2442 |
|
$attributes['type'] = $mime_type; |
| 2443 |
|
} |
| 2444 |
|
|
| 2445 |
|
// Set the URL for the media object. |
| 2446 |
|
$media['url'] = $attributes['url']; |
| 2447 |
|
|
| 2448 |
|
// Set the filesize for the media object. |
| 2449 |
|
$media['fileSize'] = $attributes['length']; |
| 2450 |
|
|
| 2451 |
|
// Set the mime type for the media attribute. |
| 2452 |
|
$media['type'] = $attributes['type']; |
| 2453 |
|
|
| 2454 |
|
// Return an array of what to contribute to this RSS feed. |
| 2455 |
|
return array(array('key' => 'enclosure', 'attributes' => $attributes), array('key' => 'media', 'value' => '', 'attributes' => $media)); |
| 2456 |
} |
} |
| 2457 |
|
break; |
|
// Set the URL for the media object. |
|
|
$media['url'] = $attributes['url']; |
|
|
|
|
|
// Set the filesize for the media object. |
|
|
$media['fileSize'] = $attributes['length']; |
|
|
|
|
|
// Set the mime type for the media attribute. |
|
|
$media['type'] = $attributes['type']; |
|
|
|
|
|
// Return an array of what to contribute to this RSS feed. |
|
|
return array(array('key' => 'enclosure', 'attributes' => $attributes), array('key' => 'media', 'value' => '', 'attributes' => $media)); |
|
|
|
|
| 2458 |
case 'delete': |
case 'delete': |
| 2459 |
case 'delete revision': |
case 'delete revision': |
| 2460 |
|
|