SimplePortal
Support => English Support => Topic started by: Oldiesmann on November 09, 2009, 01:08:41 AM
-
I'm sure this has been brought up before, but searching didn't turn up anything useful...
I just converted www.seniorsandfriends.org to SimplePortal after we found that the shoutbox in the other portal wasn't as flexible as what we wanted.
However, we are missing one minor feature - the first link in the linktree is always the forum. We want something like this:
Portal homepage: Seniors and Friends (linking to index.php)
Forum: Seniors and Friends (linking to portal homepage) > Forum (linking to forum) ...
How can I add this functionality in?
-
The edit below should do what you want.
if ($modSettings['sp_portal_mode'] == 1)
$context['linktree'][0] = array(
'url' => $scripturl . '?action=forum',
'name' => $context['forum_name'],
);
This code will display the "Forum" part of the linktree, everywhere by default.
if ($modSettings['sp_portal_mode'] == 1)
{
array_unshift($context['linktree'], array(
'url' => $scripturl,
'name' => $context['forum_name_html_safe']
));
$context['linktree'][1] = array(
'url' => $scripturl . '?action=forum',
'name' => $txt['sp-forum'],
);
}
If you don't want to display the "Forum" link on the portal, then the code below will not display it there.
global $board, $topic;
if ($modSettings['sp_portal_mode'] == 1)
{
if (!empty($_REQUEST['action']) || !empty($board) || !empty($topic))
{
array_unshift($context['linktree'], array(
'url' => $scripturl,
'name' => $context['forum_name_html_safe'],
));
$context['linktree'][1] = array(
'url' => $scripturl . '?action=forum',
'name' => $txt['sp-forum'],
);
}
else
$context['linktree'][0] = array(
'url' => $scripturl,
'name' => $context['forum_name_html_safe'],
);
}
-
It used to be that way before 2.2 I believe. We changed the behavior because it isn't easy to get used to first item in the linktree linking to portal page rather than the board index.
-
Thanks for the code. That did exactly what I wanted :)
-
/me marks this as solved :P
-
Thank you, i was looking for this. ;D
-
I know this is old and the topic is solved, but not for me, as it still does not work how I want it to...
with this, When I am on portal i get :
Mysite->forum
and for pages, I get: Mysite -> forum ->pagename
I want it more logic.. so i wrote this fix, let me know if there is a drawback:
- When I am on Portal, i want the main link only: Mysite
- When I am in forum, i want : Mysite -> forum -> and page where I am.
the "forum" being the link to the forum index
- When i create a page, I want : Mysite ->Pagename (and not Mysite->forum->Pagename
To fix this i did the following based on the code above:
if ($modSettings['sp_portal_mode'] == 1)
{
if($context['SPortal']['on_portal'] == 1 || isset($_REQUEST['page']))
{
$context['linktree'][0] = array(
'url' => $scripturl,
'name' => $context['forum_name_html_safe']
);
}
else
{
array_unshift($context['linktree'], array(
'url' => $scripturl,
'name' => $context['forum_name_html_safe']
));
$context['linktree'][1] = array(
'url' => $scripturl . '?action=forum',
'name' => $txt['sp-forum'],
);
}
}
Now it seems to work as expected..
Luc