Home arrow Forum Hack to make SMF Joomfish aware. It works
  Welcome, Guest. Please login or register.
Did you miss your activation email?
December 04, 2008, 06:37:38 PM
Home New Posts Search Calendar


Login with username, password and session length
+  Joomla Forum
|-+  Joomla Hacks
| |-+  Joomla-SMF Forum Support
| | |-+  Joomla-SMF 2.0.x (Moderators: -Wolverine, kai920)
| | | |-+  Hack to make SMF Joomfish aware. It works
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 Go Down Print
Author Topic: Hack to make SMF Joomfish aware. It works  (Read 4359 times)
GlingGlo
Joomla Pro
**

Karma: +1/-1
Offline Offline

Posts: 99


View Profile
Hack to make SMF Joomfish aware. It works
« on: December 27, 2006, 04:56:48 PM »

Hi,

This is 3 minor changes you must do in the Joomfish 1.7 language selection module so that when a certain language is selected, the language is changed in SMF too. I chose to leave the original line commented out ( // ) but if you want you can delete it. So this is in my mod_jflanguageselection.php

Code:
if( file_exists( $mosConfig_absolute_path . $langImg ) ) {
// Modified by yournameheretoeasetrackingmodifications
$outString .= '<li><a href="' .$href. '"><img src="' .$mosConfig_live_site . $langImg. '" alt="' .$language->name. '" /></a></li>';
//$outString .= '<li><a href="' .$href. '"><img src="' .$mosConfig_live_site . $langImg. '" alt="' .$language->name. '" border="0" >'.$language->name.'</a></li>';
} else {
$outString .= '<li><a href="' .$href. '">' .$language->name. '</a></li>';
}

and also:

Code:
if( eregi('=', $var ) ) {
list($key, $value) = explode( "=", $var);
//Modified by yournameheretoeasetrackingmodifications
//if( $key != "lang" ) {
if( $key != "lang" && $key != "language"){
if( $hrefVars != "" ) $hrefVars .= "&amp;";
$hrefVars .= "$key=$value";
}

and last, at the end, righ before this line:

Code:
return sefRelToAbs( $href );

You must ADD this piece of code including ALL the languages you use in your site:

Code:
// Added by your usernameheretoeasetrackingmodifications
if( $iso=='en' ) $smflang .= "&language=english";
        elseif( $iso=='es' ) $smflang .= "&language=spanish";
        $href.= $smflang;

Cheers,
NiCo      
« Last Edit: December 27, 2006, 05:00:02 PM by GlingGlo » Logged
Sherie
Joomla Newbie
*

Karma: +0/-0
Offline Offline

Posts: 6


View Profile
Re: Hack to make SMF Joomfish aware. It works
« Reply #1 on: December 27, 2006, 05:58:14 PM »

Brilliant! Thank you very much.  Kiss
Logged
Sherie
Joomla Newbie
*

Karma: +0/-0
Offline Offline

Posts: 6


View Profile
Re: Hack to make SMF Joomfish aware. It works
« Reply #2 on: December 27, 2006, 08:20:25 PM »

Just one teeny weeny question.

In the Admin area, the help pop-ups are not working, because an instance of lang,en/" is added to each link.

Code:
<a href="http://ailemiz.net/component/option,com_smf/Itemid,34/action,helpadmin/help,permissions/"lang,en/"

Is this because of your elegant Joomfish mod, or something else do you think.

Thanks
Logged
-Wolverine
Moderator
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: Hack to make SMF Joomfish aware. It works
« Reply #3 on: December 28, 2006, 09:45:56 AM »

Is this only happening in the admin?  What I mean is if lang,en is appended to the other links in the site as well without problems?
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
GlingGlo
Joomla Pro
**

Karma: +1/-1
Offline Offline

Posts: 99


View Profile
Re: Hack to make SMF Joomfish aware. It works
« Reply #4 on: December 28, 2006, 09:57:53 AM »

Just one teeny weeny question.

In the Admin area, the help pop-ups are not working, because an instance of lang,en/" is added to each link.

Code:
<a href="http://ailemiz.net/component/option,com_smf/Itemid,34/action,helpadmin/help,permissions/"lang,en/"

Is this because of your elegant Joomfish mod, or something else do you think.

Thanks

Could you be more specific about what popups you mean, and what exactly happens, so i try it in my site? However, even without being absolutely sure what you refer to, i am almost sure i am not having that problem  Wink

Cheers,
NiCo
Logged
-Wolverine
Moderator
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: Hack to make SMF Joomfish aware. It works
« Reply #5 on: December 28, 2006, 03:36:34 PM »

That could have been a problem in previous versions but should not be happening in JSMF 2.0 Final.
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
Sherie
Joomla Newbie
*

Karma: +0/-0
Offline Offline

Posts: 6


View Profile
Re: Hack to make SMF Joomfish aware. It works
« Reply #6 on: December 28, 2006, 08:40:16 PM »

Admin area help pop-ups
I was wrong! The help in Admin IS working, but is wrapped in the site template and so I did not look carefully enough to notice the help content was actually there! Sorry.

See attached help_popup.jpg

the lang,en/" thing
Wolverine asked:
Quote
Is this only happening in the admin?  What I mean is if lang,en is appended to the other links in the site as well without problems?

Good point Wolverine. I checked, and yes, lang,en/" IS being added all over the place, but NOT causing any problems anywhere! The following source code screen grab is of the main page, in Turkish, which despite the lang,en/" works fine.

See code.jpg

All is well I think. Sorry for the false alarm  Embarrassed
Logged
-Wolverine
Moderator
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: Hack to make SMF Joomfish aware. It works
« Reply #7 on: December 28, 2006, 09:46:59 PM »

no problems, thanks for poasting that all is ok. 
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
fuaank
Joomla Newbie
*

Karma: +0/-0
Offline Offline

Posts: 8


View Profile
Re: Hack to make SMF Joomfish aware. It works
« Reply #8 on: March 22, 2007, 11:57:26 AM »

Hi NiCo,

I tried your hack with version 2.0.2 of jsmf and it has no effect. Have you managed to get it to work with 2.0.2?

joomla 1.0.12
cb 1.0.2
smf 1.1.2
Logged
GlingGlo
Joomla Pro
**

Karma: +1/-1
Offline Offline

Posts: 99


View Profile
Re: Hack to make SMF Joomfish aware. It works
« Reply #9 on: March 22, 2007, 11:18:59 PM »

fuaank...yes my joomfish hack works with the latest version of jsmf(2.0.2). Why wouldnīt? What you are doing is setting the smf language variable, instead of by changing it in your smf profil, hacking it so it is passed by the url when you use the joomfish language selector.

NiCo
Logged
fuaank
Joomla Newbie
*

Karma: +0/-0
Offline Offline

Posts: 8


View Profile
Re: Hack to make SMF Joomfish aware. It works
« Reply #10 on: March 23, 2007, 05:11:09 AM »

Hm.. maybe there are some pre-requisites I am missing. I am using the jsmf bridge in non wrapped mode, I have joomla standard SEF turned on, and smf allow user to change language to off. Is that a problem?

Applying your hack causes no error message even with error reporting turned to maximum. It seems hard to find out what I am missing this way! The necessary languages are present in both joomla and smf and switching works fine within joomla itself.

I do not see a change in URLs when calling the forum after applying your hack(!) And: even when I call it like this
Code:
index.php?option=com_smf&Itemid=85&language=german
it will still load the forum in its default language (english).
Logged
GlingGlo
Joomla Pro
**

Karma: +1/-1
Offline Offline

Posts: 99


View Profile
Re: Hack to make SMF Joomfish aware. It works
« Reply #11 on: March 23, 2007, 12:41:40 PM »

fuaank:

itīs not when calling the forum that you should see a change in the url, but when switching the language with the joomfish language selector module.

i have 2, spanish and english, so my 2 urls in the selector(i have clickable images...maybe if you have a combo box you donīt get to see the url):

http://www.mysite.com/index.php?lang=es&language=spanish

and

http://www.mysite.com/index.php?lang=en&language=english

note that lang=es is the joomfish changing the joomla language, and the &language=spanish is the added bit of the hack, to change the smf language accordingly.

NiCo Wink
Logged
fuaank
Joomla Newbie
*

Karma: +0/-0
Offline Offline

Posts: 8


View Profile
Re: Hack to make SMF Joomfish aware. It works
« Reply #12 on: April 05, 2007, 05:16:59 PM »

Hi there, Nico.

just got back from vacation and gave the issue another try. I turned off SEF, turned on maximum error reporting, turned on forum embedding, turned on language link display instead of the drop-down... all to be as close as possible to your settings... But it still doesn't work.

I do get the same link styles you mention and they only appear when I switch the language with the joomfish language selector while on the forum page. It changes the language in the joomla portions of the site but the forum menus just stay in the default language.

Nico, could you check if you have userLanguage setting in table smf_settings to 1 or 0? I have a feeling it is because I have this to 0 that it does not work. Turning it on however causes all kinds of problems including the copyright statement missing notice?!
Logged
fuaank
Joomla Newbie
*

Karma: +0/-0
Offline Offline

Posts: 8


View Profile
Re: Hack to make SMF Joomfish aware. It works
« Reply #13 on: April 05, 2007, 05:35:35 PM »

ok, I just made it work. Allowing visitors to change smf language setting made all the difference.

The havoc wreaked when I first turned this on came from smf standard install coming with utf8 versions of german. After I manually reinstalled german in western ISO as is the rest of my site it was ok.

Thank you for helping!
Logged
armybot
Joomla Newbie
*

Karma: +1/-0
Offline Offline

Posts: 26


View Profile
Re: Hack to make SMF Joomfish aware. It works
« Reply #14 on: May 16, 2007, 09:06:24 AM »

Hi there.
Your hack works.
The only problem that I have now is that joomlafish works *only* if I have a  forum wrapped page visible otherwise not.
Furthermore, I've tons of logs such as "Undefined variable: smflang".

Could you help me?

Thanks in advance,

A.
fuaank:

itīs not when calling the forum that you should see a change in the url, but when switching the language with the joomfish language selector module.

i have 2, spanish and english, so my 2 urls in the selector(i have clickable images...maybe if you have a combo box you donīt get to see the url):

http://www.mysite.com/index.php?lang=es&language=spanish

and

http://www.mysite.com/index.php?lang=en&language=english

note that lang=es is the joomfish changing the joomla language, and the &language=spanish is the added bit of the hack, to change the smf language accordingly.

NiCo Wink
Logged
Pages: [1] 2 Go Up Print 
« previous next »
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Joomla Forum | Powered by SMF 1.1 RC1.
© 2001-2005, Lewis Media. All Rights Reserved.
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!

Joomla Hacks is a Joomla Components, Joomla Modules, Joomla Templates, & Joomla Mambots resource portal. None of the text or images in this public website may be copied without the expressed written consent of the authors. Copyright 2005 by JoomlaHacks.com. Powered by Joomla. All rights reserved.
Terms of Use
Joomla Hacks



Joomla Hacks
German Lang French Lang Italian Lang Spanish Lang Japanese Lang Chinese Lang
i-Vibe.com
Search Contact About Advertise Blogs Topsites Submit News Register Login