Kunena 7.0.2 Released

The Kunena team has announce the arrival of Kunena 7.0.2 [K 7.0.2] in stable which is now available for download as a native Joomla extension for J! 5.3.x/5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0

Solved [SOLVED] How to force the notification language?

More
9 years 7 months ago #178830 by xillibit

Mezzo wrote: Yes that's it :-)

I have another question before doing a test and posting a solution.

I found the file libraries/kunena/forum/message/message.php which creates the email with the last function "attachEmailBody". It could be possible to patch it so that I don't need to change the translations anymore, though I understand that it's a bad fix (I would need to patch it after each update of Kunena).

What is still bothering me is that a url is attached to the email so that we can go to the message that has been posted, and this url is also linked to the current language of the user that wrote the message on the forum. For example here is the url that I could receive:

Code:
http://mysite.com/fr/forum/category_name/topic_name#12
But I want this, always in english ("fr" becomes "en"):
Code:
http://mysite.com/en/forum/category_name/topic_name#12
I can of course add a function to replace "/XX/forum/" into "/en/forum/", but I was wandering if there is no other solutions, for example by slightly modifying the function "getPermaUrl" or "getPermaUri".

The methods getPermaUrl or getPermaUri doesn't handle multi-language, i need to check if these methods can be changed to do that

I don't provide support by PM, because this can be useful for someone else.

Please Log in or Create an account to join the conversation.

More
9 years 7 months ago - 9 years 6 months ago #178949 by Mezzo
Hello,

I understand that using overrides prevents an update to reinitialize the translations but there is still the problem with the url that can point to the site with a language other than English. I need to patch anyway.
I edited the file "components/com_kunena/template/system/layouts/email/subscription/default.php" (and not "libraries/kunena/forum/message/message.php" as I mentioned) and it worked.
I set manually the text (no translations anymore) and I modified the url with:
Code:
preg_replace('#http://([a-z\.-]+)/[a-z]+/[a-z]+/(.*)#', 'http://$1/en/forum/$2', $this->messageUrl)
This way
Code:
http://mysite.com/XX/YYYY/...
is changed to a url always pointing to the forum with the English interface
Code:
http://mysite.com/en/forum/...

I'll keep a track of these changes so that if Kunena is updated, I can patch again.

Regards,
Davy
Last edit: 9 years 6 months ago by Mezzo.

Please Log in or Create an account to join the conversation.

Time to create page: 0.279 seconds