Plugin Directory


Ignore:
Timestamp:
04/10/2012 03:25:36 PM (14 years ago)
Author:
sivel
Message:

Fix issue with 3.0.3.10 where the FLV player could not be found due to a URL change, and make sure we get rid of the missing file nag if the source files were manually downloaded. Bump to 3.0.3.10.1 and tag for release.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • shadowbox-js/trunk/inc/admin.php

    r496740 r529508  
    418418        }
    419419        //$this->build_shadowbox ( true ); // Attempt to build and cache shadowbox.js
    420         if ( ! $this->check_for_src_file () )
    421             update_option ( 'shadowbox-js-missing-src', true );
     420        $this->check_for_src_file ();
    422421    }
    423422
     
    493492            $status = false;
    494493
    495         if ( $status === false )
     494        $option = get_option( 'shadowbox-js-missing-src' );
     495
     496        if ( $status === false && ! $option )
    496497            update_option ( 'shadowbox-js-missing-src', true );
     498        else if ( $status === true && $option )
     499            update_option ( 'shadowbox-js-missing-src', false );
    497500
    498501        return $status;
     
    601604
    602605        $uploads = wp_upload_dir ();
    603         if ( empty( $uploads['error'] ) && ! empty( $uploads['basedir'] ) )
     606        if ( empty( $uploads['error'] ) && ! empty( $uploads['basedir'] ) ) {
     607            $baseurl = $uploads['baseurl'];
    604608            $basedir = $uploads['basedir'];
    605         else
     609        } else {
     610            $baseurl = WP_CONTENT_URL . '/uploads';
    606611            $basedir = WP_CONTENT_DIR . '/uploads';
     612        }
    607613
    608614        $shadowbox_dir = "$basedir/shadowbox-js/";
    609615        $shadowbox_src_dir = "{$shadowbox_dir}src";
     616        $shadowbox_src_url = "{$baseurl}/shadowbox-js/src";
    610617
    611618        // Ouput correct content-type, and caching headers
     
    623630                // Replace S.path with the correct path, so we don't have to rely on autodetection which is broken with this method
    624631                if ( $include == 'core' )
    625                     $output .= str_replace ( 'S.path=null;' , "S.path='$plugin_url/shadowbox/';" , file_get_contents ( "$shadowbox_src_dir/$include.js" ) );
     632                    $output .= str_replace ( 'S.path=null;' , "S.path='{$shadowbox_src_url}/';" , file_get_contents ( "$shadowbox_src_dir/$include.js" ) );
    626633                else
    627                     $output .= file_get_contents ( "$shadowbox_src_dir/$include.js" );
     634                    $output .= file_get_contents ( "{$shadowbox_src_dir}/{$include}.js" );
    628635            }
    629636
    630637            $library = $this->get_option ( 'library' );
    631             $output .= file_get_contents ( "$shadowbox_src_dir/adapters/$library.js" );
     638            $output .= file_get_contents ( "{$shadowbox_src_dir}/adapters/{$library}.js" );
    632639
    633640            foreach ( array ( 'load' , 'plugins' , 'cache' ) as $include )
    634                 $output .= file_get_contents ( "$shadowbox_src_dir/$include.js" );
     641                $output .= file_get_contents ( "{$shadowbox_src_dir}/{$include}.js" );
    635642
    636643            if ( $this->get_option ( 'useSizzle' ) == 'true' && $this->get_option ( 'library' ) != 'jquery' )
    637                 $output .= file_get_contents ( "$shadowbox_src_dir/find.js" );
     644                $output .= file_get_contents ( "{$shadowbox_src_dir}/find.js" );
    638645
    639646            $players = (array) $this->get_option ( 'players' );
    640647            if ( in_array ( 'flv' , $players ) || in_array ( 'swf' , $players ) )
    641                 $output .= file_get_contents ( "$shadowbox_src_dir/flash.js" );
     648                $output .= file_get_contents ( "{$shadowbox_src_dir}/flash.js" );
    642649
    643650            $language = $this->get_option ( 'language' );
    644             $output .= file_get_contents ( "$shadowbox_src_dir/languages/$language.js" );
     651            $output .= file_get_contents ( "{$shadowbox_src_dir}/languages/{$language}.js" );
    645652
    646653            foreach ( $players as $player )
    647                 $output .= file_get_contents ( "$shadowbox_src_dir/players/$player.js" );
     654                $output .= file_get_contents ( "{$shadowbox_src_dir}/players/{$player}.js" );
    648655
    649656            foreach ( array ( 'skin' , 'outro' ) as $include )
    650                 $output .= file_get_contents ( "$shadowbox_src_dir/$include.js" );
     657                $output .= file_get_contents ( "{$shadowbox_src_dir}/{$include}.js" );
    651658
    652659            wp_cache_set ( $this->md5 () , 'shadowbox-js' );
Note: See TracChangeset for help on using the changeset viewer.