SimplePortal
Support => English Support => Topic started by: xmathewx75 on January 21, 2011, 04:29:51 PM
-
Hello, I have a little issue with my tabs. I just opened my new forum for a game. So I tended to use simple portal, cause its simple for me. But I had simple portal installed before I got a new theme for site (http://wbs.worldbestsoldiers.x10.bz/). The theme I used was this; http://custom.simplemachines.org/themes/index.php?lemma=600 . I think the theme was the problem that got messed up with your simple portal. Now my "home" tab tend to only telport to home page not forum. So I tryed to make a forum button didn't work I will paste code below. Please help me.
Tabs look as of right now.
(http://img573.imageshack.us/img573/6692/tabserror.png)
Coding for tabs of theme;
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;
// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first = 'last';
$last = 'first';
}
else
{
$first = 'first';
$last = 'last';
}
// Show the start of the tab section.
echo '
<div id="stylefour">
<ul>';
// Show the [home] button.
echo '<li><a' , $current_action=='home' ? ' class="chosen"' : '' , ' href="', $scripturl, '"><b>' , $txt[103] , '</b></a></li>';
// Show the [forum] button.
echo '<li><a' , $current_action=='forum' ? ' class="chosen"' : '' , ' href="', $scripturl, '"><b>' , $txt[103] , '</b></a></li>';
// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '<li><a' , $current_action=='admin' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=admin"><b>' , $txt[2] , '</b></a></li>';
// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '<li><a' , $current_action=='profile' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=profile"><b>' , $txt[79] , '</b></a></li>';
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo '<li><a' , $current_action=='pm' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=pm"><b>' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</b></a></li>';
// the [member] list button
if ($context['allow_memberlist'])
echo '<li><a ' , $current_action=='mlist' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=mlist"><b>' , $txt[331] , '</b></a></li>';
// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo '<li><a ' , $current_action=='login' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=login"><b>' , $txt[34] , '</b></a></li>';
// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo '<li><a ' , $current_action=='register' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=register"><b>' , $txt[97] , '</b></a></li>';
// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo '<li><a ' , $current_action=='logout' ? ' class="chosen"' : '' , 'href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '"><b>' , $txt[108] , '</b></a></li>';
echo '
</ul>
</div>';
}
I am using;
1.1.12 SMF forum
2.3.3 Simple Portal
-
Yes. With SimplePortal, front page or standalone, "Home" goes to portal page. This is correct.
This theme defines the buttons in template_menu, so you are correct to add the forum button there. But you must finish the work to make the forum button work.
Please see http://simpleportal.net/index.php?topic=148.0 (http://simpleportal.net/index.php?topic=148.0)
You have
// Show the [forum] button.
echo '<li><a' , $current_action=='forum' ? ' class="chosen"' : '' , ' href="', $scripturl, '"><b>' , $txt[103] , '</b></a></li>';
This means the href is always $scripturl, which is ....../index.php
For the forum button, instead of
' href="', $scripturl, '">
you want
' href="', $scripturl, '?action=forum">
If you look at the tutorial, you'll see there's some sort-of-fancy code to turn off the forum button if you ever disable the portal. There is also some code for "Adding the forum action" to make the buttons change color the way they are supposed to, depending on "where" you are (portal page, boarddir, etc).