Development > Feature Requests

Remove forum buttons from home page

<< < (2/3) > >>

Eliana Tamerin:
Ahh, now I understand what you want.

You will likely need to add in every action of the forum into the area of Subs.php with the $current_action definitions, like this:

--- Code: --- if (isset($context['menu_buttons'][$context['current_action']]))
$current_action = $context['current_action'];
elseif ($context['current_action'] == 'search2')
$current_action = 'search';
elseif ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
elseif ($context['current_action'] == 'register2')
$current_action = 'register';
elseif ($context['current_action'] == 'login2' || ($user_info['is_guest'] && $context['current_action'] == 'reminder'))
$current_action = 'login';
elseif ($context['current_action'] == 'groups' && $context['allow_moderation_center'])
$current_action = 'moderate';

--- End code ---

You can find a complete list of SMF actions in the index.php file in your forum's root folder.

rocknroller:
must be easier and aesthetic way :P

can I create php block and put it on pages I want and home page, then create variable eg.


--- Code: ---$prem_buttons = 0;
--- End code ---

and then somehow call it there  ;D
eg.


--- Code: --- 'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => $prem_buttons = 0,
'sub_buttons' => array(
),
),
--- End code ---
:)

[SiNaN]:
Try this:

Sources/Subs.php


--- Code: (Find) --- $context['menu_buttons'] = $menu_buttons;
--- End code ---


--- Code: (Replace) --- if (getShowInfo(0, '', '$php return ({$page} !== \'\' || \'{$portal}\' === \'1\');'))
foreach ($menu_buttons as $id => $button)
{
if (!in_array($id, array('home', 'forum', 'login', 'register', 'logout')))
unset($menu_buttons[$id]);
}

$context['menu_buttons'] = $menu_buttons;
--- End code ---

rocknroller:
yes, that works. :)  Thank you.

 Now it is look like a real portal  :P I guess it can add custom buttons and array it there to appear only on portal and pages. that is great! You should consider adding this option in the official version.

Marjorie:
I don't support what you say.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version