|
Tuesday, 07 August 2007 |
|
In Leagueman you can define a com_jbulletin forum category foreach project.
There is a comments-link on the roundinfo page, which is a link to the assigned forum. Maybe you also want to create a link to the forum in your main menu. Due to Joomlas Itemid system you defined already a menu item pointing to your forum. With another menu item you point to your forum category with a different Itemid. Maybe you dont want that.
The solution is to create a new leagueman function, which creates the link with the proper Itemid for you. Read more for the code...
- Edit a Leagueman project, choose a forum category on "Integration" - tab.
-
Copy & Paste the code to a file called func.goforum.php.
-
Create a new menu item with a link to the URL: index.php?option=com_leagueman&func=goforum&p=1
defined( '_VALID_MOS' ) or
die( 'Direct Access to this location is not allowed.' );
$p = intval(mosGetParam($_REQUEST, 'p', 0));
$Itemid = intval(mosGetParam($_REQUEST, 'Itemid', 0));
$project = LM::getLMTable("Project");
if(!$project->load($p)){
mosRedirect("index.php", "No such Project available!");
}
$database->setQuery(
"SELECT id FROM jos_menu WHERE link = 'index.php?option=com_jbulletin'"
);
$fItemid = $database->loadResult();
$fItemid = ($fItemid) ? $fItemid : $Itemid;
$category = $project->getForumCategory();
if($category){
mosRedirect("index.php?option=com_jbulletin&Itemid="
. $fItemid
. "&func=showcat&catid="
. $category);
} else {
mosRedirect("index.php?option=com_jbulletin&Itemid=" . $fItemid);
}
However, the function will be part in Leagueman 1.0.
The same way we could link to a gallery category. |