NextGEN Gallery
fix to support external wp-content location (2 posts)

  1. jimhu
    Posted 2 years ago #

    I patched my copy of nextGen gallery to allow it to use a wp-content folder on a different virtual host than the WordPress using it.

    First, in wp-config set

    define ('WP_CONTENT_URL','http://example.com/wp-conf-dirs/sitename/wp-content');
    define ('WP_PLUGIN_DIR',WP_CONTENT_DIR.'/plugins');
    define ('WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins');

    Modify lib/image.php on lines 67-68 replace site_url() with WP_CONTENT_URL

    // set urls and paths
                    $this->imageURL         = WP_CONTENT_URL . '/' . $this->path . '/' . $this->filename;
                    $this->thumbURL         = WP_CONTENT_URL . '/' . $this->path . '/thumbs/thumbs_' . $this->filename;

    I also modified nggallery.php to change line 288 to

    define('WINABSPATH', str_replace("\\", "/", WP_CONTENT_DIR) );


  2. jimhu
    Posted 2 years ago #

    Also had to edit some other places where site_url was used...

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • NextGEN Gallery
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic