[Plugin: NextGEN Gallery] Bug in Album Permalink structure
-
Normal URL works fine.
https://www.domain.com/test-page/?album=1&gallery=1&pid=1If Permalink is enabled and post with Album inserted does not work. Following URL structure gives 404 error.
https://www.domain.com/nggallery/page-37/album-1/gallery-1/image/1Same URL if word “page” is added insisted of word “image” then URL works fine.
https://www.domain.com/nggallery/page-37/album-1/gallery-1/page/1/I have checked the rewrite code in rewrite.php and noticed 4 rules with word “/image/” and 2 rules with word “/page/”
$this->slug.’/page-([0-9]+)/image/([0-9]+)/?$’ => ‘index.php?page_id=$matches[1]&pid=$matches[2]’,
$this->slug.’/page-([0-9]+)/image/([0-9]+)/page-([0-9]+)/?$’ => ‘index.php?page_id=$matches[1]&pid=$matches[2]&nggpage=$matches[3]’,$this->slug.’/post/([^/]+)/image/([0-9]+)/?$’ => ‘index.php?name=$matches[1]&pid=$matches[2]’,
$this->slug.’/post/([^/]+)/image/([0-9]+)/page-([0-9]+)/?$’ => ‘index.php?name=$matches[1]&pid=$matches[2]&nggpage=$matches[3]’,$this->slug.’/page-([0-9]+)/album-([^/]+)/gallery-([0-9]+)/page/([0-9]+)/?$’ => ‘index.php?page_id=$matches[1]&album=$matches[2]&gallery=$matches[3]&pid=$matches[4]’,
$this->slug.’/post/([^/]+)/album-([^/]+)/gallery-([0-9]+)/page/([0-9]+)/?$’ => ‘index.php?name=$matches[1]&album=$matches[2]&gallery=$matches[3]&pid=$matches[4]’,
// 3. Album, pid or tags
if (isset ($args[‘album’]) && ($args[‘gallery’] == false) )
$url .= ‘/album-‘ . $args[‘album’];
elseif (isset ($args[‘album’]) && isset ($args[‘gallery’]) )
$url .= ‘/album-‘ . $args[‘album’] . ‘/gallery-‘ . $args[‘gallery’];if (isset ($args[‘gallerytag’]))
$url .= ‘/tags/’ . $args[‘gallerytag’];if (isset ($args[‘pid’]))
$url .= ‘/image/’ . $args[‘pid’];In section // 3. Album, pid or tags if i replace word “/image/” with “/page/” URL which i mentioned 404 works fine. However, this is not the solution it will replace even in this URL.
https://www.domain.com/nggallery/post/test-new-post/image/1/
https://www.domain.com/nggallery/page-56/image/1/Also, another method if i add following code in rewrite.php url worked fine.
$this->slug.’/page-([0-9]+)/album-([^/]+)/gallery-([0-9]+)/image/([0-9]+)/?$’ => ‘index.php?page_id=$matches[1]&album=$matches[2]&gallery=$matches[3]&pid=$matches[4]’,
$this->slug.’/post/([^/]+)/album-([^/]+)/gallery-([0-9]+)/image/([0-9]+)/?$’ => ‘index.php?name=$matches[1]&album=$matches[2]&gallery=$matches[3]&pid=$matches[4]’,
Please provide solution for this issue.
Thanks!
Shodan
- The topic ‘[Plugin: NextGEN Gallery] Bug in Album Permalink structure’ is closed to new replies.