By Yannick on Thursday, 25 July 2013
Posted in General Issues
Replies 10
Likes 0
Views 1.7K
Votes 0
Hello guys,

we have modified the Easyblog router a little bit, to add support for "FALANG" (a famous translation extension for Joomla 3 - find here: http://extensions.joomla.org/extensions/languages/multi-lingual-content/18210).

It brings the possibility to translate the Easyblog URLs by Falang.

Here the simple modification:

/components/com_easyblog/router.php on line 293



if( $config->get( 'main_sef_unicode' ) )
{
// some code...
}
else
{
// insert hack from below here...

$table = EasyBlogHelper::getTable( 'Blog' , 'Table' );
}




// HACK by yagendoo.com (Get original slug if translated)
if(JPluginHelper::isEnabled('system', 'falangdriver') === true)
{
$JLang = JFactory::getLanguage();
$currentLanguage = $JLang->getDefault();
$defaultLanguage = $JLang->getTag();
if($currentLanguage != $defaultLanguage)
{
$langSlug = $segments[ ( $count - 1 ) ];
$langSlugClear = str_replace(':', '-', $langSlug);
$Dbo = JFactory::getDbo();
$Dbo->setQuery("SELECT original_text
FROM #__falang_content
WHERE reference_field = 'permalink'
AND reference_table = 'easyblog_post'
AND value = " . $Dbo->q($langSlugClear));
$Dbo->execute();
$originalSlug = $Dbo->loadResult();
if(!empty($originalSlug))
{
$segments[ ( $count - 1 ) ] = $originalSlug;
}
}
}
// END of hack


Also I attached you our FALANG content-elements. You can put it in your download-area. To use it, the users only have to upload it by FTP to:

/administrator/components/com_falang/contentelements
Hello Yannick,

I just bought EasyBloag. I read your post and I copied the .xml files in the folder /administrator/components/com_falang/contentelements

The code written in the first box, in the original file (/components/com_easyblog/router.php) actually exists (at line 297). What should I do?

The second code I did not understand where I have to write it.

Thanks in advance for the help and sorry for my bad English.

Best Regards,
Franco
·
Wednesday, 12 February 2014 00:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Franco,

I am sorry for the delay of this reply, got a little occupied with some development works. We actually applied the codes to the core as suggested by Yannick already I guess you just need to add the content elements part.
·
Thursday, 20 February 2014 22:50
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Mark,

thank you very much for the reply.

Cheers,
Franco
·
Friday, 21 February 2014 22:11
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome
·
Friday, 21 February 2014 22:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi

I just found this Hack and went to look for the code myself
I didn't find the code in the router.php file so I added it myself

Why did it get taken away?

Sincerely,


Dominicus
·
Monday, 12 January 2015 03:32
·
0 Likes
·
0 Votes
·
0 Comments
·
hello Dominicus Björkstam,

I'm still investigate on your issues from this post thread -> http://stackideas.com/forums/falang-and-easyblog-autopostlinks
By the way i have replied, please have a check
·
Monday, 12 January 2015 13:35
·
0 Likes
·
0 Votes
·
0 Comments
·
OK thanks
·
Monday, 12 January 2015 14:56
·
0 Likes
·
0 Votes
·
0 Comments
·
You're welcome.
·
Monday, 12 January 2015 17:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,
I am also looking to implement FaLang with Joomla 3.4 and EasyBlog 5.0.31. The XML files still work great. I am unable to view the translated content though the front-end. I looked at the EasyBlog router although it appears there have been some major changes since this post was originally written. Has anyone been successfully getting FaLang to work with EasyBlog 5? If this hack still works, where in the new router files would I place the code?

Thanks!
--Gary
·
Tuesday, 05 January 2016 00:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Gary,

I am really sorry for the delay of this reply.

There are lots of changed that has been made during the transition of easyblog 3.9 to easyblog 5 including the router behavior itself hence I am not sure if the modification above will works or not. You can try to include the custom code above inside your /components/com_easyblog/router.php at line 371~385 for entry url.

By the way we are not responsible if the customization did not working correctly as the code was not made by us. Hope you understand.
·
Tuesday, 05 January 2016 14:10
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post