WordPress.org

Ready to get started?Download WordPress

Forums

Eazyest Gallery
Eazyest_Gallery::set_gallery_folder() (1 post)

  1. n0ll
    Member
    Posted 8 months ago #

    WP 3.7.1 + EG 0.1.3

    If a site is available under multiple server names, e.g. my http://photo.mjsb.eu/blog = http://www.mjsb.eu/blog, then easyest-gallery won't find the image attachment when invoked under the alias URL. The problem is that the GUIDs for the "attachment" posts contain the canonical server name, but set_gallery_folder() uses HTTP_HOST which is different.

    As a quick fix this function to use get_option('siteurl'):

    --- _ORIG_eazyest-gallery.php	2013-11-01 23:43:42.000000000 +0100
    +++ eazyest-gallery.php	2013-11-01 23:53:11.000000000 +0100
    @@ -396,6 +396,10 @@
         $port = ( $_SERVER["SERVER_PORT"] == '80' ) ? '' : ( ':' . $_SERVER['SERVER_PORT'] );
    
       	$this->address = trailingslashit( $this->_resolve_href( trailingslashit( $http . $_SERVER['HTTP_HOST'] . $port ), substr( $this->root, strlen( $this->home_dir() ) ) ) );
    +
    +	/**MJ: use WordPress config**/
    +	$this->address = get_option('siteurl') . "/" . $gallery_folder;
    +	/**MJ**/
     	}
    
     	/**

    http://wordpress.org/plugins/eazyest-gallery/

Reply

You must log in to post.

About this Plugin

About this Topic