WordPress.org

Support

Support » Plugins and Hacks » NextGEN Gallery - WordPress Gallery Plugin » [Resolved] Activate permalinks in NextGEN Gallery 1.8 and qTranslate 2.5.21 incompatibility

[Resolved] Activate permalinks in NextGEN Gallery 1.8 and qTranslate 2.5.21 incompatibility

  • Activate permalinks in NextGEN Gallery 1.8 produces this url:

    http://site/nggallery?lang=en/galleryname.

    I modified nextgen-gallery/lib/rewrite.php as shown below and it works for me. Maybe there is another way. Changing qtranslate is not an option for me.

    // 1. Post / Page url + main slug
                //$url = trailingslashit ( get_permalink ($post->ID) ) . $this->slug;
                $url = trailingslashit ( $_SERVER['REQUEST_URI'] ) . $this->slug; 			// Modified by Horacio  ***************
    
    			// 2. Album, pid or tags
    			if (isset ($args['album']) && ($args['gallery'] == false) )
    				$url .= '/' . $args['album'];
    			elseif  (isset ($args['album']) && isset ($args['gallery']) )
    				$url .= '/' . $args['album'] . '/' . $args['gallery'];
    
    			if  (isset ($args['gallerytag']))
    				$url .= '/tags/' . $args['gallerytag'];
    
    			if  (isset ($args['pid']))
    				$url .= '/image/' . $args['pid'];			
    
    			// 3. Navigation
    			if  (isset ($args['nggpage']) && ($args['nggpage']) )
    				$url .= '/page-' . $args['nggpage'];
    
    			// 4. Show images or Slideshow
    			if  (isset ($args['show']))
    				$url .= ( $args['show'] == 'slide' ) ? '/slideshow' : '/images';
    
    			global $q_config;																		// Added by Horacio (begins) ************
    			$lang = qtrans_getLanguage();
    			if(!$q_config['hide_default_language']||$lang!=$q_config['default_language']){
    				if(strpos($url,'?')===false) {
    					$url .= '?';
    				} else {
    					$url .= '&';
    				}
    				$url .= "lang=".$lang;
    			}																						// Added by Horacio (ends) ************

    http://wordpress.org/extend/plugins/nextgen-gallery/

Viewing 3 replies - 1 through 3 (of 3 total)
  • NextGen Gallery 1.8.2 and qTranslate 2.5.21 are working fine for me now!

    For those of us with multilingual sites:

    qtranslate allows you to have as many languages as .mo you have on your site.

    To stop NextGen Gallery from redirecting the web site to the default language as you click on albums, galleries, and navigation buttons, NextGen Gallery’s code has to be modified to use a qtraslate function:

    from:
    $nggRewrite->get_permalink(params) where params varies in pages nggfunctions.php, lib/navigation.php and lib/rewrite.php

    to:
    qtrans_convertURL($nggRewrite->get_permalink(params))

    For WP 3.2.1, NextGen 1.8.3 and qTranslate 2.5.24, it’s not working and $nggRewrite->get_permalink is not found on lib/rewrite.php.

    And with the first method, Query Mode (?lang=en), redirection stops, but it is not loading gallery.

    Found it, have to replace

    $nggRewrite->get_permalink ( $args );

    with:

    qtrans_convertURL($nggRewrite->get_permalink ( $args )).'/';

    in nggfunctions.php

    http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=3&t=197&sid=96ddcf0db7aac217af58c861df2bb64c&start=10

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Activate permalinks in NextGEN Gallery 1.8 and qTranslate 2.5.21 incompatibility’ is closed to new replies.
Skip to toolbar