Plugin Directory

Changeset 874574


Ignore:
Timestamp:
03/13/2014 07:25:12 AM (12 years ago)
Author:
amolv
Message:

media posting systemwide issue fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soundslides/trunk/soundslide.php

    r864004 r874574  
    66 * Plugin URI:
    77 * Author URI: http://www.wpoets.com
    8  * Version: 1.2.1
     8 * Version: 1.4.1
    99 * =======================================================================
    1010 */
    1111global $sslide_uploaded_filename;
    1212function 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    }
    5352    return $html;
    5453}
Note: See TracChangeset for help on using the changeset viewer.