Plugin Directory

Changeset 394409


Ignore:
Timestamp:
06/08/2011 01:52:45 AM (15 years ago)
Author:
sivel
Message:

Missed merge

File:
1 edited

Legend:

Unmodified
Added
Removed
  • shadowbox-js/tags/3.0.3.6/inc/frontend.php

    r391939 r394409  
    4040            // Automatically add Shadowbox to links
    4141            if ( $this->is_automatic ( 'any' ) ) {
    42                 add_filter ( 'the_posts' , array ( &$this , 'process_posts_early' ) , 10 , 2 );
     42                if ( $this->get_option ( 'smartLoad' ) == 'false' )
     43                    add_filter ( 'the_content', array ( &$this, 'add_attr_to_link' ) , 12 , 2 );
     44                else
     45                    add_filter ( 'the_posts' , array ( &$this , 'process_posts_early' ) , 10 , 2 );
    4346                add_filter ( 'wp_get_attachment_link' , array ( &$this , 'add_attr_to_link' ) , 12 , 2 );
    4447            }
     
    187190        $plugin_url = $this->plugin_url();
    188191        $library = $this->get_option ( 'library' );
    189         $start =  "\n<!-- Begin Shadowbox JS -->\n";
     192        $start =  "\n<!-- Begin Shadowbox JS v{$this->version} -->\n";
    190193        $start .= "<!-- Selected Players: " . implode ( ', ', (array) $this->get_option ( 'players' ) ) . " -->\n";
    191194        $end = "<!-- End Shadowbox JS -->\n\n";
     
    211214        // The full Shadowbox configuration
    212215        $init  = "<script type=\"text/javascript\">\n";
    213         $init .= "//<![CDATA[\n";
     216        $init .= "/* <![CDATA[ */\n";
    214217        $init .= "  var shadowbox_conf = {\n";
    215218        $init .= rtrim ( $init_opts , " ,\n" ) . "\n";
    216219        $init .= "  };\n";
    217220        $init .= "  Shadowbox.init(shadowbox_conf);\n";
    218         $init .= "//]]>\n";
     221        $init .= "/* ]]> */\n";
    219222        $init .= "</script>\n";
    220223
     
    254257
    255258        // Set the album ID, if the image is coming from a gallery use the gallery ID, otherwise use the ID of the post
    256         if ( is_object( $post_or_id ) ) {
     259        if ( is_object ( $post_or_id ) ) {
    257260            $albumid = "sbpost-{$post_or_id->ID}";
    258         } elseif ( is_int( $post_or_id ) && $post_or_id != 0 ) {
     261        } elseif ( is_int ( $post_or_id ) && $post_or_id != 0 ) {
    259262            $p = get_post ( $post_or_id );
    260263            $albumid = "sbalbum-{$p->post_parent}";
    261264        } else {
    262             $albumid = "sbgroup-" . time();
     265            global $post;
     266            if ( isset ( $post) && is_object ( $post ) && is_int ( $post->ID ) )
     267                $albumid = "sbpost-{$post->ID}";
     268            else
     269                $albumid = "sbgroup-" . time();
    263270        }
    264271
Note: See TracChangeset for help on using the changeset viewer.