News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

[Solved] Anchor Tags Don't Work with Joomla SEF on

Started by oSa, November 23, 2006, 04:53:28 PM

Previous topic - Next topic

Orstio

THanks.

OK, change this:

//multilingual code url support
if( $mosConfig_sef && ($mosConfig_mbf_content || $mosConfig_multilingual_support) && $string!='index.php' && !eregi("^(([^:/?#]+):)",$string) && !strcasecmp(substr($string,0,9),'index.php') && !eregi('lang=', $string) ) {
$string .= '&lang='. $iso_client_lang;
}


to this:

//multilingual code url support
if( $mosConfig_sef && ($mosConfig_mbf_content || $mosConfig_multilingual_support) && $string!='index.php' && !eregi("^(([^:/?#]+):)",$string) && !strcasecmp(substr($string,0,9),'index.php') && !eregi('lang=', $string) ) {
$string = substr($string,0,strpos($string, '#')-1) . '&lang=' . $iso_client_lang . substr($string,strpos($string, '#'),strlen($string));
}

oSa

The links are correct and they work now, but there is antoher problem :-\ For example, my home page link:

http://www.artifm.net/component/option,com_frontpage/Itemid,1/lang,trindex.php?option,com_frontpage/

as you can see there is an extra "index.php?option,com_frontpage/" after /lang,tr.


Orstio

//multilingual code url support
if( $mosConfig_sef && ($mosConfig_mbf_content || $mosConfig_multilingual_support) && $string!='index.php' && !eregi("^(([^:/?#]+):)",$string) && !strcasecmp(substr($string,0,9),'index.php') && !eregi('lang=', $string) ) {
if (strpos($string, '#')!==0)
$string = substr($string,0,strpos($string, '#')-1) . '&lang=' . $iso_client_lang . substr($string,strpos($string, '#'),strlen($string));
else
$string.= '&lang=' . $iso_client_lang;
}

oSa

i think it doesn't enter the else part because links are still the same.

Orstio

How about if we turn it around?

//multilingual code url support
if( $mosConfig_sef && ($mosConfig_mbf_content || $mosConfig_multilingual_support) && $string!='index.php' && !eregi("^(([^:/?#]+):)",$string) && !strcasecmp(substr($string,0,9),'index.php') && !eregi('lang=', $string) ) {
if (strpos($string, '#')===0)
$string.= '&lang=' . $iso_client_lang;
else
$string = substr($string,0,strpos($string, '#')-1) . '&lang=' . $iso_client_lang . substr($string,strpos($string, '#'),strlen($string));
}

oSa

i guess i was wrong since it doesn't help.

Orstio

#46
It's closer than you think.

//multilingual code url support
if( $mosConfig_sef && ($mosConfig_mbf_content || $mosConfig_multilingual_support) && $string!='index.php' && !eregi("^(([^:/?#]+):)",$string) && !strcasecmp(substr($string,0,9),'index.php') && !eregi('lang=', $string) ) {
if (strpos($string, '#')===0){
$string.= '&lang=' . $iso_client_lang;
} else {
$string = substr($string,0,strpos($string, '#')) . '&lang=' . $iso_client_lang . (strpos($string, '#')===0 ? '' : substr($string,strpos($string, '#'),strlen($string)));
}
}

oSa

#47
Nope, it got worser:
http://www.artifm.net/&lang=trindex.php?option=com_smf&Itemid=26

it isn't SEF like this :)

Edit: were those triple "="s on purpose?
Edit2: It's 6.30 am here, i need to sleep and i suggest you too :)

Orstio

Yes, a triple "=" usually implies a boolean.  So 0 should be false.

//multilingual code url support
if( $mosConfig_sef && ($mosConfig_mbf_content || $mosConfig_multilingual_support) && $string!='index.php' && !eregi("^(([^:/?#]+):)",$string) && !strcasecmp(substr($string,0,9),'index.php') && !eregi('lang=', $string) ) {
if (strpos($string, '#')===false){
$string.= '&lang=' . $iso_client_lang;
} else {
$string = substr($string,0,strpos($string, '#')) . '&lang=' . $iso_client_lang . (strpos($string, '#')===false ? '' : substr($string,strpos($string, '#'),strlen($string)));
}
}

oSa

#49
There is nothing better than to get up in the morning and find that everyhing is working exactly as they should :) I've applied this last code change and voila!! All problems are gone now ;) I'm repeating myself but once again thank you Ortsio, for all the great support !!

I wish, this solution can be of help to other people but i guess it's a very specific one. Nevertheless, i've tried to summarize the solutions at the first message of this topic.

Advertisement: