Changeset 874574
- Timestamp:
- 03/13/2014 07:25:12 AM (12 years ago)
- File:
-
- 1 edited
-
soundslides/trunk/soundslide.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
soundslides/trunk/soundslide.php
r864004 r874574 6 6 * Plugin URI: 7 7 * Author URI: http://www.wpoets.com 8 * Version: 1. 2.18 * Version: 1.4.1 9 9 * ======================================================================= 10 10 */ 11 11 global $sslide_uploaded_filename; 12 12 function sslide_add_to_editor($html, $id, $attachment){ 13 $url = $attachment['url']; 14 15 $url_path = explode('/', $url); 16 unset($url_path[count($url_path)-1]); 17 $url_path= implode('/', $url_path ); 18 19 $html = $url_path.'/'.$id.'/'.'soundslide.xml' ; 20 21 $found = true ; 22 $filename=''; 23 24 25 if($found) 26 { 27 $xml = simplexml_load_file( $html ); 28 //print_r( $sml ); 29 $width = '0'; 30 $height ='0'; 31 32 foreach($xml->meta->item as $item) 33 { 34 if($item->parameter == 'index_width') 35 $width = $item->value; 36 37 if($item->parameter == 'index_height') 38 $height = $item->value; 39 40 if($item->parameter == 'custom_width') 41 $width = $item->value; 42 43 if($item->parameter == 'custom_height') 44 $height = $item->value; 45 } 46 $html='[soundslides width="'.$width.'" height ="'.$height.'" id="'.$id.'"]'; 47 } 48 49 50 51 52 13 14 if( get_post_mime_type( $id ) == 'application/Soundslides' ){ 15 16 $url = $attachment['url']; 17 18 $url_path = explode('/', $url); 19 unset($url_path[count($url_path)-1]); 20 $url_path= implode('/', $url_path ); 21 22 $html = $url_path.'/'.$id.'/'.'soundslide.xml' ; 23 24 $found = true ; 25 $filename=''; 26 27 28 if($found) 29 { 30 $xml = simplexml_load_file( $html ); 31 //print_r( $sml ); 32 $width = '0'; 33 $height ='0'; 34 35 foreach($xml->meta->item as $item) 36 { 37 if($item->parameter == 'index_width') 38 $width = $item->value; 39 40 if($item->parameter == 'index_height') 41 $height = $item->value; 42 43 if($item->parameter == 'custom_width') 44 $width = $item->value; 45 46 if($item->parameter == 'custom_height') 47 $height = $item->value; 48 } 49 $html='[soundslides width="'.$width.'" height ="'.$height.'" id="'.$id.'"]'; 50 } 51 } 53 52 return $html; 54 53 }
Note: See TracChangeset
for help on using the changeset viewer.