Ignore:
Timestamp:
Nov 6, 2012, 3:30:32 PM (11 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4 (charlie's)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/autosize.inc.php

    r18936 r18949  
    9191    $imgSizeWH = $derivative->get_size();
    9292    $SRC_IMG    = $derivative->get_url();
     93
    9394    $picture['current']['scaled_width']=$imgSizeWH[0];
    9495    $picture['current']['scaled_height']= $imgSizeWH[1];
    9596    $picture['current']['high_url']= $SRC_IMG;   
    9697    $picture['current']['image_url']=$SRC_IMG; 
     98    $picture['current']['thumbnail']=$SRC_IMG;
     99
    97100//==============================================================
    98101    $autosize_parametres = cl_autosize_Get_Options();
     
    240243 $pattern[3] = '/height=\"(\d+)\"/';$replacement[3] = ' ';
    241244
    242 if ( preg_match("|charlie|", $content, $val) ){   
     245if ( strstr( $content,"iframe")||strstr($content,"charlie" )){ 
     246 
     247$pictureSelType="Autosize";
     248$pictureDeriv=$conf['derivative_default_size'];
     249
     250$_COOKIE['picture_sel_type']=$pictureSelType;
     251$_COOKIE['picture_deriv']=$pictureDeriv;
     252
    243253  $ncount=1;   
    244   $content=str_replace( "<object" ,  "<object id='theMainImage_obj' name='theMainImage' "  ,$content,$ncount);
    245   $content=str_replace( "<embed" ,  "<embed id='theMainImage_emb' name='theMainImage' "  ,$content,$ncount);
     254  if (strstr($content,"charlie" )){   
     255      $content=str_replace( "<object" , "<object id='theMainImage_obj' name='theMainImage' "  ,$content,$ncount);
     256      $content=str_replace( "<embed" ,  "<embed id='theMainImage_emb' name='theMainImage' "  ,$content,$ncount);
     257      $content=str_replace( 'id="video"',"id='theMainImage_obj'  name='theMainImage' " ,$content,$ncount);
     258  }else{
     259      $content=str_replace( "<iframe" ,  "<iframe id='iframe' name='theMainImage' "  ,$content,$ncount);
     260  }
    246261  $content=  preg_replace($pattern, "", $content);
    247   $content= "<div id='theMainImage' style='height:".$theImageHeight."px  ;width:".$theImageWidth."px' >". $content . "<img src='".AUTOSIZE_PATH . "images/transparent.gif' /></div>";
     262
     263  $content= "<div id='theMainImage' style='height:".$theImageHeight."px  ;width:".$theImageWidth."px '>". $content . "<img src='".AUTOSIZE_PATH . "images/transparent.gif' /></div>";
    248264 $content= "<style>#theImageAndInfos{height:auto;width:auto;position:relative}
    249265  #theImage{height:auto;align:center;text-align:center;width:100%;position:relative}
    250   #theMainImage{height:auto;align:center;text-align:center;position:static}   
     266  #theMainImage{height:auto;align:center;text-align:center;position:static} 
     267  #charlie{display:none }
     268  #iframe{display:none }
    251269 </style>".$content;
    252270return  $content;
     
    591609     //   return ;
    592610     }
     611         if (defined('GMAPS_VERSION')) $gmaps_function="true";
     612          else $gmaps_function="false" ;
     613
    593614        $template->set_filenames(array('autosize_content_header'=> $file ));
    594615        $template->assign(      array( AUTOSIZE_PATH,$AUTOSIZE_PATH,
    595616                                  'file_css' =>$file_css,
    596617                                  'css_display' => $css_display,                                 
    597                                   'theme' =>$theme
     618                                  'theme' =>$theme,
     619                                   'gmaps_function' => $gmaps_function
    598620                          ));
    599621        $template->concat('autosize_content', $template->parse('autosize_content_header', true));
Note: See TracChangeset for help on using the changeset viewer.