Kunena 7.0.4 Released

The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] in stable which is now available for download as a native Joomla extension for J! 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

Question Link Memu Item to Forum Category?

More
17 years 1 month ago #9059 by Werginz
First, I'd like to say, what a fantastic extension Kunena is to the Joomla CMS. Excellent work!

I wonder if it's possible to link a menu item from the Joomla front-end to a specific category in the forum. That is, I have a forum set up and have a menu item name "forum".

I have several categories set up but on in particulary, I'd like to be able to link to from the front page. Is that possible? I suppose I could create a menu item and use a URL as the target but that doesn't seem like the right approach.

If anyone has any ideas, I'd be grateful to hear.

Thanks

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

More
17 years 1 month ago #9081 by sozzled
It's possible to create menu items to individual forum categories, if that's what you're suggesting you'd like to do, using the Joomla Menu Item Manager.

As you've probably seen, Kunena forum categories usually take the URL form /forum?func=showcat&catid=id, where id is the forum category ID. Consequently, you could send your users to individual categories in your forum where they could browse the discussion threads. Is that what you'd like to do?

The solution is to create individual menu item(s) as follows:

Menu type: external link
Link: /forum?func=showcat&catid=id

... and then choose whatever other values you want/need as you would do normally use.

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

More
17 years 1 month ago #9113 by Werginz
Sozzled,

That is exactly what I want to do and I'll give this a try.

Thanks very much for the reply.

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

More
17 years 3 days ago #13948 by emeyer
previously on Fireboard and Joomla 1.0.15 with extended menu, this technique worked for me to link to multiple forums, and browsing to new subforums showed the currect menu itemid.

On upgrade to Kunena 1.09 and Joomla 1.5, I don't know exactly what changed, but I can't get the active menu highlight to track the current forum. I tried changing the code at top of class.kunena.php,but it still selects the main component when browsing to different forums in the content body, instead of the menu with the url pointing to the specific forum.

Can anyone please help with how to modify the code to set a particular menu itemid? I am happy to hardcode the forum catids in PHP, if I can find the right place to do it.

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

More
17 years 3 days ago #13976 by emeyer
I found the code in components/com_kunena/lib/kunena.link.class.php, change:
Code:
function GetCategoryLink($func, $catid, $catname, $rel='follow', $class=''){ switch ($catid){ case 1: $mymenuid=10; break; case 2: $mymenuid=11; break; default: $mymenuid=KUNENA_COMPONENT_ITEMID; } return CKunenaLink::GetSefHrefLink(KUNENA_JLIVEURL .'/index.php?option=com_kunena&Itemid='.$mymenuid.'&func='.$func.'&catid='.$catid, $catname, '', $rel, $class); }

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

More
17 years 3 days ago #13986 by emeyer
...and here is a fix for all the other links by adding a method:
Code:
<?php defined ('_VALID_MOS') or die('Direct Access to this location is not allowed.'); class CKunenaLink{ function GetMenuid($catid){ switch ($catid){ case 9: return 236; case 10: return 237; case 13: return 238; case 12: return 239; default: return KUNENA_COMPONENT_ITEMID; } } function GetSefHrefLink($link, $name, $title, $rel, $class ='', $anker='', $attr=''){ return '<a '.($class ? 'class="'.$class.'" ' : '').'href="'.sefRelToAbs($link).($anker?('#'.$anker):'').'" title="'.$title.'"'.($rel ? ' rel="'.$rel.'"' : '').($attr ? ' '.$attr : '').'>'.$name.'</a>'; } function GetSimpleLink($id, $name=''){ return'<a href="'.$id.'">'.$name.'</a>'; } function GetCreditsLink(){ return CKunenaLink::GetSefHrefLink('http://www.kunena.com', 'Kunena', 'Kunena', 'follow', NULL, NULL, 'target="_blank"'); } function GetTeamCreditsLink($catid, $name=''){ return CKunenaLink::GetSefHrefLink(KUNENA_LIVEURLREL.'&amp;func=credits&amp;catid='.$catid, $name, '', 'follow'); } function GetKunenaLink($name , $rel='follow'){ return CKunenaLink::GetSefHrefLink(KUNENA_LIVEURLREL, $name, '', $rel); } function GetRSSLink($name , $rel='follow'){ return CKunenaLink::GetSefHrefLink(KUNENA_LIVEURLREL.'&amp;func=fb_rss&amp;no_html=1', $name, '', $rel, '', '', 'target="_blank"'); } function GetCategoryLink($func, $catid, $catname, $rel='follow', $class=''){ $Menuid=CKunenaLink::GetMenuid($catid); return CKunenaLink::GetSefHrefLink(KUNENA_JLIVEURL .'/index.php?option=com_kunena&amp;Itemid='.$Menuid.'&amp;func='.$func.'&amp;catid='.$catid, $catname, '', $rel, $class); } function GetCategoryListLink($name, $rel='follow', $class=''){ $Menuid=CKunenaLink::GetMenuid($catid); return CKunenaLink::GetSefHrefLink(KUNENA_JLIVEURL .'/index.php?option=com_kunena&amp;Itemid='.$Menuid.'&amp;func=listcat', $name, '', $rel, $class); } function GetCategoryPageLink($func, $catid, $page, $pagename, $rel='follow', $class=''){ $Menuid=CKunenaLink::GetMenuid($catid); if ($page == 1 || !is_numeric($page)){ // page 1 is identical to a link to the regular category link $pagelink = CKunenaLink::GetCategoryLink($func, $catid, $pagename, $rel, $class); }else{ $pagelink = CKunenaLink::GetSefHrefLink(KUNENA_JLIVEURL .'/index.php?option=com_kunena&amp;Itemid='.$Menuid.'&amp;func='.$func.'&amp;catid='.$catid.'&amp;page='.$page, $pagename, '', $rel, $class); } return $pagelink; } function GetCategoryReviewListLink($catid, $catname, $rel='nofollow', $class=''){ $Menuid=CKunenaLink::GetMenuid($catid); return CKunenaLink::GetSefHrefLink(KUNENA_JLIVEURL .'/index.php?option=com_kunena&amp;Itemid='.$Menuid.'&amp;func=review&amp;action=list&amp;catid='.$catid, $catname, '', $rel, $class); } function GetThreadLink($func, $catid, $threadid, $threadname, $title, $rel='follow', $class=''){ $Menuid=CKunenaLink::GetMenuid($catid); return CKunenaLink::GetSefHrefLink(KUNENA_JLIVEURL .'/index.php?option=com_kunena&amp;Itemid='.$Menuid.'&amp;func='.$func.'&amp;catid='.$catid.'&amp;id='.$threadid, $threadname, $title, $rel, $class); } function GetThreadPageLink($fbConfig, $func, $catid, $threadid, $page, $limit, $name, $anker='', $rel='follow', $class=''){ $Menuid=CKunenaLink::GetMenuid($catid); if ($page == 1 || !is_numeric($page) || !is_numeric($limit)){ $pagelink = CKunenaLink::GetSefHrefLink(KUNENA_JLIVEURL .'/index.php?option=com_kunena&amp;Itemid='.$Menuid.'&amp;func='.$func.'&amp;catid='.$catid.'&amp;id='.$threadid,$name, '', $rel, $class, $anker); }else{ $pagelink = CKunenaLink::GetSefHrefLink(KUNENA_JLIVEURL .'/index.php?option=com_kunena&amp;Itemid='.$Menuid.'&amp;func='.$func.'&amp;catid='.$catid.'&amp;id='.$threadid.'&amp;limit='.$limit.'&amp;limitstart='.(($page-1)*$limit), $name, '', $rel, $class, $anker); } return $pagelink; } function GetThreadPageURL($fbConfig, $func, $catid, $threadid, $page, $limit, $anker=''){ $Menuid=CKunenaLink::GetMenuid($catid); if ($page == 1 || !is_numeric($page) || !is_numeric($limit)){ $pageURL = htmlspecialchars_decode(KUNENA_LIVEURL).'&amp;Itemid='.$Menuid.'&func='.$func.'&catid='.$catid.'&id='.$threadid; }else{ $pageURL = htmlspecialchars_decode(KUNENA_LIVEURL).'&amp;Itemid='.$Menuid.'&func='.$func.'&catid='.$catid.'&id='.$threadid.'&limit='.$limit.'&limitstart='.(($page-1)*$limit); } return sefRelToAbs($pageURL).($anker?('#'.$anker):''); } function GetSamePageAnkerLink($anker, $name, $rel='nofollow'){ return CKunenaLink::GetSefHrefLink(htmlspecialchars(sefRelToAbs('index.php?'.$_SERVER['QUERY_STRING'])), $name, '', $rel, '', $anker); } function GetReportMessageLink($catid, $msg_id, $name, $rel='nofollow'){ $Menuid=CKunenaLink::GetMenuid($catid); return CKunenaLink::GetSefHrefLink(KUNENA_JLIVEURL .'/index.php?option=com_kunena&amp;Itemid='.$Menuid.'&amp;func=report&amp;catid='.$catid.'&amp;msg_id='.$msg_id, $name, '', $rel); } function GetMessageIPLink($msg_ip, $rel='nofollow'){ if ($msg_ip){ $iplink = '<a href="http://whois.domaintools.com/'.$msg_ip.'" target="_blank">'; $iplink .= 'IP: '.$msg_ip.'</a>'; }else{ $iplink = '&nbsp;'; } return $iplink; } function GetMyProfileLink($fbConfig, $userid, $name, $rel='nofollow'){ if($fbConfig->fb_profile == 'jomsocial' || $fbConfig->fb_profile == 'cb'){ return CKunenaLink::GetProfileLink($fbConfig, $userid, $name, $rel); }else{ return CKunenaLink::GetSefHrefLink(KUNENA_LIVEURLREL.'&amp;func=myprofile&amp;do=show', $name, '', $rel); } } function GetProfileLink($fbConfig, $userid, $name, $rel='nofollow', $class=''){ if ($userid > 0){ if($fbConfig->fb_profile == 'cb') { $kunenaProfile = CKunenaCBProfile::getInstance(); if ($link = $kunenaProfile->getProfileURL($userid)){ return CKunenaLink::GetSefHrefLink($link, $name, '', $rel, $class); } else return $name; } else return CKunenaLink::GetSefHrefLink(KUNENA_PROFILE_LINK_SUFFIX.$userid, $name, '', $rel, $class); } else return $name; } function GetViewLink($func, $id, $catid, $view, $name, $rel='nofollow'){ $Menuid=CKunenaLink::GetMenuid($catid); return CKunenaLink::GetSefHrefLink(KUNENA_JLIVEURL .'/index.php?option=com_kunena&amp;Itemid='.$Menuid.'&amp;func='.$func.'&amp;id='.$id.'&amp;view='.$view.'&amp;catid='.$catid, $name, '', $rel); } function GetPendingMessagesLink($catid, $name, $rel='nofollow'){ $Menuid=CKunenaLink::GetMenuid($catid); return CKunenaLink::GetSefHrefLink(KUNENA_JLIVEURL .'/index.php?option=com_kunena&amp;Itemid='.$Menuid.'&amp;func=review&action=list&amp;catid='.$catid, $name, '', $rel); } function GetShowLatestLink($name, $rel='follow'){ return CKunenaLink::GetSefHrefLink(KUNENA_LIVEURLREL.'&amp;func=latest', $name, '', $rel); } function GetShowLatestURL(){ return sefRelToAbs(KUNENA_LIVEURLREL.'&amp;func=latest'); } function GetShowMyLatestLink($name, $rel='nofollow'){ return CKunenaLink::GetSefHrefLink(KUNENA_LIVEURLREL.'&amp;func=mylatest', $name, '', $rel); } function GetShowLatestThreadsLink($period, $name, $rel='nofollow'){ return CKunenaLink::GetSefHrefLink(KUNENA_LIVEURLREL.'&amp;func=latest&amp;do=show&amp;sel='.$period, $name, '', $rel); } function GetLatestPageLink($func, $page, $rel='follow', $class='', $sel=''){ return CKunenaLink::GetSefHrefLink(KUNENA_LIVEURLREL.'&amp;func='.$func.'&amp;page='.$page.(($sel)?'&amp;sel='.$sel:''), $page, '', $rel, $class); } function GetPostNewTopicLink($catid, $name, $rel='nofollow'){ $Menuid=CKunenaLink::GetMenuid($catid); return CKunenaLink::GetSefHrefLink(KUNENA_LIVEURLREL.'&amp;func=post&amp;do=reply&amp;catid='.$catid, $name, '', $rel); } function GetTopicPostLink($do, $catid, $id, $name, $rel='nofollow'){ $Menuid=CKunenaLink::GetMenuid($catid); return CKunenaLink::GetSefHrefLink(KUNENA_JLIVEURL .'/index.php?option=com_kunena&amp;Itemid='.$Menuid.'&amp;func=post&amp;do='.$do.'&amp;catid='.$catid.'&amp;id='.$id, $name, '', $rel); } function GetTopicPostReplyLink($do, $catid, $id, $name, $rel='nofollow'){ $Menuid=CKunenaLink::GetMenuid($catid); return CKunenaLink::GetSefHrefLink(KUNENA_JLIVEURL .'/index.php?option=com_kunena&amp;Itemid='.$Menuid.'&amp;func=post&amp;do='.$do.'&amp;catid='.$catid.'&amp;replyto='.$id, $name, '', $rel); } function GetEmailLink($email, $name){ return CKunenaLink::GetSimpleLink('mailto:'.stripslashes($email), stripslashes($name)); } function GetKarmaLink($do, $catid, $pid, $userid, $name, $rel='nofollow'){ $Menuid=CKunenaLink::GetMenuid($catid); return CKunenaLink::GetSefHrefLink(KUNENA_JLIVEURL .'/index.php?option=com_kunena&amp;Itemid='.$Menuid.'&amp;func=karma&amp;do='.$do.'&amp;userid='.$userid.'&amp;pid='.$pid.'&amp;catid='.$catid, $name, '', $rel); } function GetRulesLink($fbConfig, $name, $rel='nofollow'){ $ruleslink = $fbConfig->rules_infb ? KUNENA_LIVEURLREL.'&amp;func=rules' : $fbConfig->rules_link; return CKunenaLink::GetSefHrefLink($ruleslink, $name, '', $rel); } function GetHelpLink($fbConfig, $name, $rel='nofollow'){ $helplink = $fbConfig->help_infb ? KUNENA_LIVEURLREL.'&amp;func=faq' : $fbConfig->help_link; return CKunenaLink::GetSefHrefLink($helplink, $name, '', $rel); } function GetSearchURL($fbConfig, $func, $searchword, $limitstart, $limit, $params=''){ $limitstr = "&amp;limitstart=$limitstart"; if ($limit != $fbConfig->messages_per_page_search) $limitstr .= "&amp;limit=$limit"; return sefRelToAbs(KUNENA_LIVEURLREL."&amp;func={$func}&amp;q={$searchword}{$params}{$limitstr}"); } function GetSearchLink($fbConfig, $func, $searchword, $limitstart, $limit, $name, $params='', $rel='nofollow'){ $limitstr = "&amp;limitstart=$limitstart"; if ($limit != $fbConfig->messages_per_page_search) $limitstr .= "&amp;limit=$limit"; return CKunenaLink::GetSefHrefLink(KUNENA_LIVEURLREL."&amp;func={$func}&amp;q={$searchword}{$params}{$limitstr}", $name, '', $rel); } function GetLatestPostAutoRedirectHTML($fbConfig, $pid, $limit){ global $database; $database->setQuery('SELECT a.thread AS thread, max(a.id) AS latest_id, max(a.catid) AS catid, count(*) AS totalmessages FROM #__fb_messages AS a, (SELECT max(thread) AS thread FROM #__fb_messages WHERE id='.$pid.') AS b WHERE a.thread = b.thread AND a.hold = 0 GROUP BY a.thread'); $database->loadObject($result); check_dberror("Unable to retrieve latest post."); $threadPages = ceil($result->totalmessages / $limit); $Output = '<div align="center">'; $Output .= CKunenaLink::GetThreadPageLink($fbConfig, 'view', $result->catid, $result->thread, $threadPages, $limit, _POST_SUCCESS_VIEW, $result->latest_id) .'<br />'; $Output .= CKunenaLink::GetCategoryLink('showcat', $result->catid, _POST_SUCCESS_FORUM).'<br />'; $Output .= '</div>'; $Output .= CKunenaLink::GetAutoRedirectHTML(CKunenaLink::GetThreadPageURL($fbConfig, 'view', $result->catid, $result->thread, $threadPages, $limit, $result->latest_id), 3500); return $Output; } function GetLatestPageAutoRedirectURL($fbConfig, $pid, $limit){ global $database; $database->setQuery('SELECT a.thread AS thread, max(a.id) AS latest_id, max(a.catid) AS catid, count(*) AS totalmessages FROM #__fb_messages AS a, (SELECT max(thread) AS thread FROM #__fb_messages WHERE id='.$pid.') AS b WHERE a.thread = b.thread AND a.hold = 0 GROUP BY a.thread'); $database->loadObject($result); check_dberror("Unable to retrieve latest post."); $threadPages = ceil($result->totalmessages / $limit); return htmlspecialchars_decode(CKunenaLink::GetThreadPageURL($fbConfig, 'view', $result->catid, $result->thread, $threadPages, $limit)); } function GetLatestCategoryAutoRedirectHTML($catid){ $Menuid=CKunenaLink::GetMenuid($catid); $Output = '<div id="Kunena_post_result" align="center">'; $Output .= CKunenaLink::GetCategoryLink('showcat', $catid, _POST_SUCCESS_FORUM).'<br />'; $Output .= '</div>'; $Output .= CKunenaLink::GetAutoRedirectHTML(KUNENA_JLIVEURL .'/index.php?option=com_kunena&amp;Itemid='.$Menuid.'&func=showcat&catid=' . $catid, 3500); return $Output; } function GetAutoRedirectHTML($url, $timeout){ $url = htmlspecialchars_decode($url); $Output = "\n<script type=\"text/javascript\">\n// <![CDATA[\n"; $Output .= "kunenaRedirectTimeout('$url', $timeout);"; $Output .= "\n// ]]>\n</script>\n"; return $Output; } } ?>

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

Time to create page: 0.243 seconds