Advertisement:

Author Topic: Can I add multiple Custom Tabs if I install this mod more than once?  (Read 10368 times)

Offline RedPanda2013

  • Semi-Newbie
  • *
  • Posts: 95
  • Gender: Male
    • Investire in Borsa
Can I add multiple Custom Tabs if I install this mod more than once?

http://custom.simplemachines.org/mods/index.php?mod=2209

I got it working the first time but I need more than 1 custom tab now.

Cheers

Offline Sir Osis of Liver

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 5,956
  • Act like nothing's wrong ...
Re: Can I add multiple Custom Tabs if I install this mod more than once?
« Reply #1 on: December 26, 2016, 11:59:58 AM »
Installing a mod twice is a really bad idea.

Offline RedPanda2013

  • Semi-Newbie
  • *
  • Posts: 95
  • Gender: Male
    • Investire in Borsa
Re: Can I add multiple Custom Tabs if I install this mod more than once?
« Reply #2 on: December 26, 2016, 12:20:55 PM »
Installing a mod twice is a really bad idea.

right...sorry but I got the double effect with a social icons mod (which has been a pain to remove then because it removed only one installation so I had to manually edit the code) so I was hoping this time I could benefit from a double installation  :-[

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 54,327
  • Gender: Male
    • Kindred-999 on GitHub
Re: Can I add multiple Custom Tabs if I install this mod more than once?
« Reply #3 on: December 26, 2016, 01:16:00 PM »
no...   because the mod reads from the exact same field for both installs....   and also would have code conflicts.

if you want to add new menu items

http://wiki.simplemachines.org/smf/Buttons_-_How_do_I_add_buttons_to_SMF_2.0
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Colin

  • Development Team Mentor
  • Lead Developer
  • SMF Hero
  • *
  • Posts: 7,536
  • Gender: Male
  • SMF Developer
    • colinschoen on GitHub
Re: Can I add multiple Custom Tabs if I install this mod more than once?
« Reply #4 on: December 26, 2016, 10:09:53 PM »
You might also consider giving this mod a try for adding additional menu items:

http://custom.simplemachines.org/mods/index.php?mod=3310
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Offline Sir Osis of Liver

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 5,956
  • Act like nothing's wrong ...
Re: Can I add multiple Custom Tabs if I install this mod more than once?
« Reply #5 on: December 26, 2016, 11:23:06 PM »
Don't think OP wants just buttons.  That mod creates a custom page with the button.  The page is probably the main thing.

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 46,601
Re: Can I add multiple Custom Tabs if I install this mod more than once?
« Reply #6 on: December 27, 2016, 05:17:44 AM »
then maybe http://custom.simplemachines.org/mods/index.php?mod=331 would work. i believe it has an option to add the pages/actions to the menu as well.

Offline Steve

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 3,385
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: Can I add multiple Custom Tabs if I install this mod more than once?
« Reply #7 on: December 27, 2016, 06:53:36 PM »
Or possibly this one: http://custom.simplemachines.org/mods/index.php?mod=2657 though it doesn't add pages I don't think.

A little outdated but works fine on my 2.0.12 ...
Please do not PM me for support.

Offline RedPanda2013

  • Semi-Newbie
  • *
  • Posts: 95
  • Gender: Male
    • Investire in Borsa
Re: Can I add multiple Custom Tabs if I install this mod more than once?
« Reply #8 on: April 17, 2017, 01:30:58 PM »
no...   because the mod reads from the exact same field for both installs....   and also would have code conflicts.

if you want to add new menu items

http://wiki.simplemachines.org/smf/Buttons_-_How_do_I_add_buttons_to_SMF_2.0


I tried...and failed.

I followed this giude:

http://www.simplemachines.org/community/index.php?topic=261880.0

I tried adding 2 new tabs after the custom tab created by the first mod I used.


Code: [Select]
// All the buttons we can possible want and then some, try pulling the final list of buttons from cache first.
if (($menu_buttons = cache_get_data('menu_buttons-' . implode('_', $user_info['groups']) . '-' . $user_info['language'], $cacheTime)) === null || time() - $cacheTime <= $modSettings['settings_updated'])
{
$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),
'custom' => array(
'title' => !empty($modSettings['custom_tab_label']) ? $modSettings['custom_tab_label'] : $txt['custom_tab_label_default'],
'href' => !empty($modSettings['custom_tab_execute_url']) ? $modSettings['custom_tab_execute_url'] : $scripturl,
'show' => $user_info['is_guest'] ? !empty($modSettings['custom_tab_enable_guest_access']) : !empty($modSettings['custom_tab_enable_member_access']),
'sub_buttons' => array(
),
),
'nuovimessaggi' => array(
'title' => 'Nuovi Messaggi',
'href' => 'http://www.investireinborsa.club/forum/index.php?action=unread',
'show' => 'show' => !$user_info['is_guest'],
'sub_buttons' => array(
),
),
'nuoverisposte' => array(
'title' => 'Nuove Risposte',
'href' => 'http://www.investireinborsa.club/forum/index.php?action=unreadreplies',
'show' => 'show' => !$user_info['is_guest'],
'sub_buttons' => array(
),
),
'search' => array(
'title' => $txt['search'],
'href' => $scripturl . '?action=search',
'show' => $context['allow_search'],
'sub_buttons' => array(
),
),


After uploading that, my forum does not show anything, just a blank white screen.  ???

Online Shambles

  • SMF Hero
  • ******
  • Posts: 4,218
  • Gender: Male
    • i30 Owners Club
Re: Can I add multiple Custom Tabs if I install this mod more than once?
« Reply #9 on: April 17, 2017, 02:19:56 PM »
Code: [Select]
'show' => 'show' => !$user_info['is_guest'],
is incorrect in both places.

Code: (replace with) [Select]
'show' => !$user_info['is_guest'],

Offline RedPanda2013

  • Semi-Newbie
  • *
  • Posts: 95
  • Gender: Male
    • Investire in Borsa
Re: Can I add multiple Custom Tabs if I install this mod more than once?
« Reply #10 on: April 17, 2017, 03:22:07 PM »
Code: [Select]
'show' => 'show' => !$user_info['is_guest'],
is incorrect in both places.

Code: (replace with) [Select]
'show' => !$user_info['is_guest'],

Thank you!