collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 333
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!

Author Topic: Remove forum buttons from home page  (Read 8579 times)

0 Members and 1 Guest are viewing this topic.

Offline rocknroller

  • Jr. Member
  • **
  • Posts: 51
  • Gender: Male
  • Simple portal is great
    • Mini Chat - Domaca Pricaonica
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Remove forum buttons from home page
« on: November 25, 2011, 03:19:28 PM »
Option to remove Main menu buttons from portal home page.

example:
- You can make custom pages, related to your activities and link them. Make custom menu eg. Contacts, About us, Forum.. etc.
Sometimes you do not want to have a forum in the foreground.

have that option it would be nice.  :)
Tražite li mjesto za opuštanje, zabavu, Besplatno Upoznavanje, brbljanje i pricanje tu je Mini Chat HR, Domaci sajt sadrži sobe za druženje tj. chat za mobitel, isto kao i za stolna racunala. I to bez prijave email adrese, najbolje pricaonice su MiniChatHR.com

Offline Eliana Tamerin

  • Comrade
  • *
  • Posts: 2889
  • Gender: Female
  • SMF Version: 2 RC2
  • SP Version: 2.3.2
Re: Remove forum buttons from home page
« Reply #1 on: November 25, 2011, 07:15:46 PM »
You can do it by editing your Subs.php. For example:

Code: [Select]
'home' => array(
'title' => $txt['home'],
'href' => $modSettings['sp_portal_mode'] == 3 && empty($context['disable_sp']) ? $modSettings['sp_standalone_url'] : $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),
'forum' => array(
'title' => empty($txt['sp-forum']) ? 'Forum' : $txt['sp-forum'],
'href' => $scripturl . ($modSettings['sp_portal_mode'] == 1 && empty($context['disable_sp']) ? '?action=forum' : ''),
'show' => in_array($modSettings['sp_portal_mode'], array(1, 3)) && empty($context['disable_sp']),
'sub_buttons' => array(
),
),
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),
.
.
.
and so on

You can modify the 'show' lines, like so:
Code: [Select]
'show' => true,to
Code: [Select]
'show' => false,or
Code: [Select]
'show' => $current_action == 'forum',
I'm pretty sure the alternative would work as well, allowing you to keep all the links when you're on the forum, but not show them elsewhere.

So you could also modify the forum button's 'show' clause from:
Code: [Select]
'show' => in_array($modSettings['sp_portal_mode'], array(1, 3)) && empty($context['disable_sp']),to
Code: [Select]
'show' => in_array($modSettings['sp_portal_mode'], array(1, 3)) && empty($context['disable_sp']) && $current_action = 'forum',
Ms. Eliana TamerinIt should be painfully obvious by now that I don't respond to support PMs. Don't send me PMs for support. They will be ignored and deleted, post on the Support Boards to get support.

Offline rocknroller

  • Jr. Member
  • **
  • Posts: 51
  • Gender: Male
  • Simple portal is great
    • Mini Chat - Domaca Pricaonica
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Remove forum buttons from home page
« Reply #2 on: November 26, 2011, 09:07:27 AM »
thank you Eliana  :)

That is cool! but won't work for me.

 :| I tried like this also:

Code: [Select]
'show' => ($current_action == 'forum') ? 'true': 'false',
and I added in the global $current_action I do not know whether it is necessary, but won't work.
Tražite li mjesto za opuštanje, zabavu, Besplatno Upoznavanje, brbljanje i pricanje tu je Mini Chat HR, Domaci sajt sadrži sobe za druženje tj. chat za mobitel, isto kao i za stolna racunala. I to bez prijave email adrese, najbolje pricaonice su MiniChatHR.com

Offline Eliana Tamerin

  • Comrade
  • *
  • Posts: 2889
  • Gender: Female
  • SMF Version: 2 RC2
  • SP Version: 2.3.2
Re: Remove forum buttons from home page
« Reply #3 on: November 26, 2011, 09:18:58 AM »
My bad on the last bit of code, it should be this:
Code: [Select]
'show' => in_array($modSettings['sp_portal_mode'], array(1, 3)) && empty($context['disable_sp']) && $current_action == 'forum',
And yours should be this:
Code: [Select]
'show' => ($current_action == 'forum') ? true: false,But this code is superfluous. The $current_action == 'forum' statement will evaluate to true if true and false if false.
Ms. Eliana TamerinIt should be painfully obvious by now that I don't respond to support PMs. Don't send me PMs for support. They will be ignored and deleted, post on the Support Boards to get support.

Offline rocknroller

  • Jr. Member
  • **
  • Posts: 51
  • Gender: Male
  • Simple portal is great
    • Mini Chat - Domaca Pricaonica
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Remove forum buttons from home page
« Reply #4 on: November 27, 2011, 06:09:46 AM »
Maybe I was not clear enough  :P

I want a forum button on (home page and SP pages), and only forum button.
I don't want other buttons(related to forum) to show on (home page and SP pages).
eg. Help, Profile, My messages, Members... etc.
 ;D
This code work for me:

Code: [Select]
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => ($context['current_action']) == 'forum',
'sub_buttons' => array(
),
),

but there is issue with other actions eg. action=help also make disappear help button. Can we make some kind of variable for which would know that user is on home page and portal pages.

Then use it example:

Code: [Select]
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => !$home_page OR !$sp_pages,
'sub_buttons' => array(
),
),
Tražite li mjesto za opuštanje, zabavu, Besplatno Upoznavanje, brbljanje i pricanje tu je Mini Chat HR, Domaci sajt sadrži sobe za druženje tj. chat za mobitel, isto kao i za stolna racunala. I to bez prijave email adrese, najbolje pricaonice su MiniChatHR.com

Offline Eliana Tamerin

  • Comrade
  • *
  • Posts: 2889
  • Gender: Female
  • SMF Version: 2 RC2
  • SP Version: 2.3.2
Re: Remove forum buttons from home page
« Reply #5 on: November 27, 2011, 05:24:18 PM »
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: [Select]
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';

You can find a complete list of SMF actions in the index.php file in your forum's root folder.
Ms. Eliana TamerinIt should be painfully obvious by now that I don't respond to support PMs. Don't send me PMs for support. They will be ignored and deleted, post on the Support Boards to get support.

Offline rocknroller

  • Jr. Member
  • **
  • Posts: 51
  • Gender: Male
  • Simple portal is great
    • Mini Chat - Domaca Pricaonica
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Remove forum buttons from home page
« Reply #6 on: November 29, 2011, 12:04:28 PM »
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: [Select]
$prem_buttons = 0;
and then somehow call it there  ;D
eg.

Code: [Select]
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => $prem_buttons = 0,
'sub_buttons' => array(
),
),
:)
Tražite li mjesto za opuštanje, zabavu, Besplatno Upoznavanje, brbljanje i pricanje tu je Mini Chat HR, Domaci sajt sadrži sobe za druženje tj. chat za mobitel, isto kao i za stolna racunala. I to bez prijave email adrese, najbolje pricaonice su MiniChatHR.com

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Remove forum buttons from home page
« Reply #7 on: November 29, 2011, 12:33:58 PM »
Try this:

Sources/Subs.php

Code: (Find) [Select]
$context['menu_buttons'] = $menu_buttons;
Code: (Replace) [Select]
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;
And slowly, you come to realize... It's all as it should be...

Offline rocknroller

  • Jr. Member
  • **
  • Posts: 51
  • Gender: Male
  • Simple portal is great
    • Mini Chat - Domaca Pricaonica
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Remove forum buttons from home page
« Reply #8 on: November 30, 2011, 06:14:33 PM »
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.
Tražite li mjesto za opuštanje, zabavu, Besplatno Upoznavanje, brbljanje i pricanje tu je Mini Chat HR, Domaci sajt sadrži sobe za druženje tj. chat za mobitel, isto kao i za stolna racunala. I to bez prijave email adrese, najbolje pricaonice su MiniChatHR.com

Offline Marjorie

  • Newbie
  • Posts: 2
Re: Remove forum buttons from home page
« Reply #9 on: December 01, 2011, 01:22:16 AM »
I don't support what you say.

Offline Eliana Tamerin

  • Comrade
  • *
  • Posts: 2889
  • Gender: Female
  • SMF Version: 2 RC2
  • SP Version: 2.3.2
Re: Remove forum buttons from home page
« Reply #10 on: December 01, 2011, 01:25:59 AM »
Marjorie, do you have a similar issue like what's been presented here? Or another problem?
Ms. Eliana TamerinIt should be painfully obvious by now that I don't respond to support PMs. Don't send me PMs for support. They will be ignored and deleted, post on the Support Boards to get support.

Offline rocknroller

  • Jr. Member
  • **
  • Posts: 51
  • Gender: Male
  • Simple portal is great
    • Mini Chat - Domaca Pricaonica
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Remove forum buttons from home page
« Reply #11 on: December 10, 2011, 07:28:15 AM »
Try this:

Sources/Subs.php

Code: (Find) [Select]
$context['menu_buttons'] = $menu_buttons;
Code: (Replace) [Select]
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;

that is great but i found one fault, if you add button, appears on the forum too. that should only be on the home and pages.  :|
Tražite li mjesto za opuštanje, zabavu, Besplatno Upoznavanje, brbljanje i pricanje tu je Mini Chat HR, Domaci sajt sadrži sobe za druženje tj. chat za mobitel, isto kao i za stolna racunala. I to bez prijave email adrese, najbolje pricaonice su MiniChatHR.com

Offline NightWalker

  • Semi Newbie
  • *
  • Posts: 5
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Remove forum buttons from home page
« Reply #12 on: April 06, 2014, 07:55:32 AM »
I have the same problem as the OP... sorry to reopen a old topic, but I got the same question so I guess its better to use this one... if I need to create another topic please let me know

the code that [SiNaN] give is awsome but is it possible to have a smiliar code for the forum?

I tried to add 'show' => !isset($_GET['action']) || $_GET['action'] != 'forum', on the bottuns that I dont want to show on the forum page, and it works, but only on the forum front page, if I got to a board, topic, PM, etc... all the other bottons appear....

I want the portal with is bottons and the forum and all forum directorys with differente bottons... is it possible?

Offline pavshinAN

  • Just Registered
  • Posts: 1
  • SMF Version: 1.1.5
  • SP Version: 2.0
Re: Remove forum buttons from home page
« Reply #13 on: June 23, 2014, 08:02:52 AM »
You can make custom pages, related to your activities and link them. Make custom menu eg. Contacts, About us, Forum.. etc