Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter npetetin

    (@npetetin)

    Hi.

    It hasn’t been fixed at all in 1.3.0 release, has it?

    Here is the code of the function as it should be:

    function bpml_icl_ls_languages_filter($langs) {
    	global $sitepress, $bp, $bp_unfiltered_uri;
    	$default_language = $sitepress->get_default_language();
    
    	if(!isset($bp_unfiltered_uri[0])){
    		$bp_unfiltered_uri[0] = '';
    	}
    
    	// Recreates language selector - the all components should have all languages
    	if(version_compare(BP_VERSION, '1.5') >= 0){
    		$langs = $sitepress->get_active_languages();
    		$url = '';
    		foreach($bp_unfiltered_uri as $key => $path){
    			$url .= '/' . $path;
    		}
    
    		$homepage = get_option('home');
    		$urlToFlags = ICL_PLUGIN_URL . '/res/flags/';
    		foreach ($langs as $key => $lang) {
    			$langs[$key]['country_flag_url'] = $urlToFlags . "$key.png";
    			$langs[$key]['language_code'] = $key;
    
    			if($translated_name = $sitepress->get_display_language_name($key, $sitepress->get_current_language())){
    				$langs[$key]['translated_name'] = $translated_name;
    			} else {
    				$langs[$key]['translated_name'] = $lang['english_name'];
    			}
    
    			if($default_language == $key){
    				$langs[$key]['url'] =  $homepage . $url;
    			} else {
    				$langs[$key]['url'] =  $homepage . '/' . $lang['code'] . $url;
    			}
    
    			if($sitepress->get_current_language() == $key){
    				$langs[$key]['active'] =  '1';
    			} else {
    				$langs[$key]['active'] =  0;
    			}
    
    			unset($langs[$key]['code']);
    			unset($langs[$key]['english_name']);
    			unset($langs[$key]['display_name'] );
    		}
    	} else {
    		if (!in_array($bp_unfiltered_uri[0], $bp->root_components)) {
    			return $langs;
    		}
    
    		foreach ($langs as $key => $lang) {
    			$langs[$key]['url'] = $sitepress->convert_url(get_option('home')
    					. '/' . implode('/', $bp_unfiltered_uri), $lang['language_code']);
    		}
    	}
    	return $langs;
    }

    You can copy-paste it, it works pretty well!

    Thanks.

    Am I wrong or the posted plugin doesn’t fix the submitted issue at all?

    I have the exact same need: revamping the welcome screen for my customized and specialized MU installation.

    Is it possible?

    Thread Starter npetetin

    (@npetetin)

    As I also posted in WPML forum (http://forum.wpml.org/topic.php?id=5585), it has to adjust the ‘active’ attribute too (all languages are currently left active).

    Thanks.

    Hi ArtyShow.

    Your plugin is actually great. Are you still supporting it? Will you release a version 1 soon?

    I’m posting in this topic because there is a major bug on line 52 of wpbe-options.php that can’t let the email preview work: the opening php tag is simply missing! So the nonce value is wrong. You haven’t got feedback yet on this bug?

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)