×
Kunena 5.1.5 Released - Security Release (14 Oct 2018)

The Kunena team has announce the arrival of Kunena 5.1.5 [K 5.1.5] which is now available for download as a native Joomla extension for J! 3.8.x. This version addresses most of the issues that were discovered in K 5.1 and issues discovered during the development stages of K 5.1. This is a Security release.

× Please note: The Kunena project team takes NO responsibility for maintaining nor supporting anything in this category.

Solved Rewriting Kunena's URLs

More
3 years 10 months ago - 3 years 10 months ago #1 by simbunch
Hi folks!

Ok I have an issue that hopefully some of Kunena's devs can shine a light on. I'm trying to rewrite URLs on the system plugin (onAfterRoute) level by setting certain variables. Imagine this scenario: user goes to domain.com/myprofile , the plugin detects "myprofile" and sets a bunch of params (eg $input->set('option', 'com_kunena') and $input->set('view', 'user')), and Joomla handles the rest.

The problem here with Kunena (this method works with other extensions) is it will redirect to the proper Kunena URLs (whether SEF is enabled or not), which not only removes the custom URL, but also removes other params I have set. Is there something I can do to bypass this behavior? Something like adding a param that Kunena understands and thus will not redirect or provide additional URI handling. I'd really rather not have a core hack to Kunena.

Any assistance/info in this is greatly appreciated!

Note: the scenario is provided "as is", ie. no I cannot create a menu item for "user profile" (in this case), or use any other workaround.

-edit- I should add that I'm using vanilla Kunena (ie. just installed), and all the Kunena menu and menu items are untouched and displaying properly.
Last edit: 3 years 10 months ago by simbunch.

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

More
3 years 10 months ago #2 by simbunch
Replied by simbunch on topic Rewriting Kunena's URLs
Hi

Ok I made some progress. Consider the following code:
$uri = new JUri();
$uri->setVar('myvar', '1');
$uri->setVar('option', 'com_kunena');
$uri->setVar('vuew', 'user');
$uri->setVar('userid', '830');
$uri->setVar('Itemid', $itemid);
 
KunenaRoute::_($uri);

This works, in the sense that the user profile does get displayed. However the menu is missing. I'm still looking through Kunena's router.php for more information, but any assistance is greatly appreciated, thanks!

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

More
3 years 10 months ago #3 by simbunch
Replied by simbunch on topic Rewriting Kunena's URLs
Solved it by using $uri =& JURI::getInstance() instead, if anybody's curious :)

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

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to add attachements.
  • Not Allowed: to edit your message.
Time to create page: 0.094 seconds