Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: live627 on July 23, 2010, 10:11:58 PM

Title: Add or Remove buttons
Post by: live627 on July 23, 2010, 10:11:58 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=2650)

This mod will add options to remove or display the buttons of your choice

The current buttons supported are as follows
Home
Help
Search
Profile
Personal Messages
Calendar


Version 0.4.
Fixed the other buttons, they had the same errors as the home button
nobody probably noticed since the buttons were not their to click
if a member stumbles on an action where you have disabled the button
for that action, it will not attempt to select that button as its
disabled.
Added a lot more default to home actions, this mod should be completely
bug free now.

Version 0.3
The Home button bug is fixed, no more errors when disabling the home button.
I didn't add Admin or Moderate for obvious reasons.

I have not added any support for portals.
Title: Re: Add or Remove buttons
Post by: gbsothere on July 23, 2010, 10:13:58 PM
Congratulations, John.  It looks great!   :)
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on July 23, 2010, 10:56:48 PM
Wow, this was approved without any warnings from the Customization team, that's a 1st :)

Your welcome, Enjoy :)
Title: Re: Add or Remove buttons
Post by: Afro on July 24, 2010, 04:58:29 AM
Looks good John. Weldone. I needed something like this but i had to remove buttons manually all the time.
This will be helpful when RC4 Comes out.
Title: Re: Add or Remove buttons
Post by: tRu3_sKiTz0 on July 24, 2010, 09:46:58 AM
How would you suggest rtemoving the tniy portal button from the main menu?
Title: Re: Add or Remove buttons
Post by: Afro on July 24, 2010, 10:31:03 AM
check the Sources/subs.php file for the related code.
Title: Re: Add or Remove buttons
Post by: SN on July 24, 2010, 10:47:56 AM
if you remove a button... can you add it back?

say if somone removes the wrong button by mistake... if you know what i mean
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on July 24, 2010, 12:34:14 PM
Quote from: tRu3_sKiTz0 on July 24, 2010, 09:46:58 AM
How would you suggest rtemoving the tniy portal button from the main menu?


I will be updating the mod with different versions, they will be called "portal" versions, those versions will have the additional options for adding or removing the portal created buttons.

Quote from: SN on July 24, 2010, 10:47:56 AM
if you remove a button... can you add it back?

say if somone removes the wrong button by mistake... if you know what i mean

Yes, you can add or remove buttons as you please, just check to disable, un-check will bring it back
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on July 24, 2010, 04:25:41 PM
Bug found;

When removing the "Home" button, all default current actions result in an empty button on the right side at the end, I'm working on a fix for this at the moment, for now, just leave your home buttons on.
Title: Re: Add or Remove buttons
Post by: tRu3_sKiTz0 on July 24, 2010, 08:50:01 PM
Keep up the good work! I can't wait till the remove all portal buttons!
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on July 24, 2010, 08:57:57 PM
I'm still waiting for portal support requests, I cant just guess which portal you use lol :)

However, I think I will start a Simple Portal supported version 1st, depends on the demand
Title: Re: Add or Remove buttons
Post by: tRu3_sKiTz0 on July 24, 2010, 11:37:12 PM
Well tiny portal is the one that has a button in the main menu and I would loev to get rid of that. I only keep TP installed because it kind hods my forum together in a nice way but I dont use it so I wanna lose the button for it.
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on July 25, 2010, 12:06:04 AM
Quote from: tRu3_sKiTz0 on July 24, 2010, 11:37:12 PM
Well tiny portal is the one that has a button in the main menu and I would loev to get rid of that. I only keep TP installed because it kind hods my forum together in a nice way but I dont use it so I wanna lose the button for it.

Added to the to do list then :)
Title: Re: Add or Remove buttons
Post by: SN on July 25, 2010, 04:51:18 AM
Tiny portal would be the one i would want too :P
Title: Re: Add or Remove buttons
Post by: ~DS~ on July 25, 2010, 05:01:20 AM
Why? It's easier to comment out with // in the Subs.php or you can do this:

'show' => true, $context['allow_view_contact'],

To:
'show' => false, $context['allow_view_contact'],

Just replace true to false to hide the menu, if true is not there then add false.
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on July 25, 2010, 01:06:02 PM
Quote from: Delita on July 25, 2010, 05:01:20 AM
Why? It's easier to comment out with // in the Subs.php or you can do this:

'show' => true, $context['allow_view_contact'],

To:
'show' => false, $context['allow_view_contact'],

Just replace true to false to hide the menu, if true is not there then add false.

You cannot use false, you replace

true,

with
'',
Title: Re: Add or Remove buttons
Post by: ~DS~ on July 25, 2010, 01:33:50 PM
That's not what I heard...
Title: Re: Add or Remove buttons
Post by: Joker™ on July 25, 2010, 01:46:31 PM
Quote from: ♪ JohnCcCcCc ♫ on July 25, 2010, 01:06:02 PM
You cannot use false, you replace

true,

with
'',

have you tried using false yet ?
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on July 25, 2010, 01:48:11 PM
Quote from: Joker™ on July 25, 2010, 01:46:31 PM
Quote from: ♪ JohnCcCcCc ♫ on July 25, 2010, 01:06:02 PM
You cannot use false, you replace

true,

with
'',

have you tried using false yet ?

How do you think I discovered it lol, I naturally assumed false would be it, seems if you add anything their it shows the button.
I discovered this while making this mod.
Title: Re: Add or Remove buttons
Post by: Joker™ on July 25, 2010, 03:37:07 PM
http://www.simplemachines.org/community/index.php?topic=392282.msg2717067#msg2717067 (http://www.simplemachines.org/community/index.php?topic=392282.msg2717067#msg2717067)

i think you got it sorted  :P  
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on July 25, 2010, 03:40:01 PM
Yea damn XAMPP messing me up lol, I will clean up the code later, fortunately the mod still actually works, I will add the new version right now, its not a big mess, if your currently using the mod, just give it a few minutes then check back at the mod site.
Title: Re: Add or Remove buttons
Post by: Hj Ahmad Rasyid Hj Ismail on August 05, 2010, 06:05:50 AM
John, I like this mod but it conflicts with Simple Portal when installing with regards to the 'home' menu. I have a thought to improve it in order for it to work even if Simple Portal mod is installed (I believe it doesn't conflict with other mod with regards to this home menu line) since it changed the home menu code in Subs.php.

Why not change instead of find this:
$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),

to find this:
$scripturl,
'show' => true,
'sub_buttons' => array(
),


And from changing it to this:
$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => empty($modSettings['addremovetab_home']) ? true : false,
'sub_buttons' => array(
),

to changing it to this:
$scripturl,
'show' => empty($modSettings['addremovetab_home']) ? true : false,
'sub_buttons' => array(
),


It simplifies the code but I think it should work. Just a thought that it may useful for the betterment of this mod.  :D
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on August 05, 2010, 11:40:21 AM
I will be releasing other versions as soon as I get more demand and time for testing to do so.

Add or Remove buttons (no portal)
Add or Remove buttons (Simple Portal)
Add or Remove buttons (Tinyportal)
Add or Remove buttons (other portals)


I have to keep (find) code big, we never know who will change or add a buttons in their somewhere, where the link is $scripturl too (I don't know why they would, but some people do these things) lol

Once I get all my testing forums side by side, I will come up with a Universal Version which will work on all, If possible.
Title: Re: Add or Remove buttons
Post by: diamondred123 on August 05, 2010, 04:29:30 PM
you should make it update, like when i install ismple portal it adds it in
Title: Re: Add or Remove buttons
Post by: lowburb on August 08, 2010, 12:09:18 AM
Quote from: JohnCcCcCc on July 24, 2010, 04:25:41 PM
Bug found;

When removing the "Home" button, all default current actions result in an empty button on the right side at the end, I'm working on a fix for this at the moment, for now, just leave your home buttons on.

I was going to post this "bug" but saw that you already found it. So instead I'm posting in here so I can be notified when an update is released.

*patiently waiting*  ;D
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on August 08, 2010, 12:16:15 AM
Quote from: lowburb on August 08, 2010, 12:09:18 AM
Quote from: JohnCcCcCc on July 24, 2010, 04:25:41 PM
Bug found;

When removing the "Home" button, all default current actions result in an empty button on the right side at the end, I'm working on a fix for this at the moment, for now, just leave your home buttons on.

I was going to post this "bug" but saw that you already found it. So instead I'm posting in here so I can be notified when an update is released.

*patiently waiting*  ;D

The mod is still completely usable, just don't use the home button remove :), even if you do use the home button remove, it throws a few errors but nothing serious and forum changing :)
Title: Re: Add or Remove buttons
Post by: lowburb on August 08, 2010, 12:31:51 AM
It just so happens that I was looking to remove the Home button hence the "patiently waiting" LOL

Do you have any plans on figuring that out?
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on August 08, 2010, 12:34:41 AM
Quote from: lowburb on August 08, 2010, 12:31:51 AM
It just so happens that I was looking to remove the Home button hence the "patiently waiting" LOL

Do you have any plans on figuring that out?

Its actually more complicated that it seems, even the customization team missed it when approving this mod, it happens because of the $current_action array, everything defaults to home that does not have an current action set, so when you use these actions which default to the home button and the home button does not exist, well then it causes that error.

I have one solution, not very ethical though, we can just disable the current action array completely, but then the buttons will not be selected, however, you will have no errors in your log then.

As for a completely working solution, none yet, still working on that...
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on August 25, 2010, 10:16:16 AM
Version 0.3 Released

Version 0.3
The Home button bug is fixed, no more errors when disabling the home button.
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on August 25, 2010, 09:47:39 PM
Version 0.4 Released

Changelog;
Version 0.4
Fixed the other buttons, they had the same errors as the home button
nobody probably noticed since the buttons were not their to click
if a member stumbles on an action where you have disabled the button
for that action, it will not attempt to select that button as its
disabled.
Added a lot more default to home actions, this mod should be completely
bug free now.
Title: Re: Add or Remove buttons
Post by: Vandaahl on September 05, 2010, 07:21:14 PM
I'm getting compatibily errors when I use this mod with the Sitemap (http://custom.simplemachines.org/mods/index.php?mod=755) mod. If I hide menu buttons, and then open the sitemap link on my board, error messages show up in my error log, pointing to the template_menu() function on index.template.php, these lines to be exact:

<a class="', $button['active_button'] ? 'active ' : '', '" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
', $button['title'], '
</a>';


The error messages are: 8: Undefined index: title, and 8: Undefined index: href. Any ideas?
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on September 05, 2010, 07:27:25 PM
I have never seen that in testing, I will set up a test forum using this mod and the Sitemap mod too and see if I can track it down.
Title: Re: Add or Remove buttons
Post by: Vandaahl on September 06, 2010, 08:03:14 AM
Quote from: JohnCcCcCc on September 05, 2010, 07:27:25 PM
I have never seen that in testing, I will set up a test forum using this mod and the Sitemap mod too and see if I can track it down.

I have fixed the Sitemap issue by editing Subs.php and adding 'sitemap' to this part of your mod:

// Custom actions after this line  - In quotes with a comma between -  | , 'mycustomaction1', 'mycustomaction2' |
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on September 06, 2010, 11:46:45 AM
I implemented that part of the code just for situations like this, its actually designed for additional actions that default to home created by mods, so if the sitemap mod has an additional action that defaults to home when its page is active, that should fix the issue.

Have all your errors gone now?
Title: Re: Add or Remove buttons
Post by: Vandaahl on September 06, 2010, 04:05:09 PM
Actually I had some more errors with other actions, but I solved them in the same way. No more errors (for now ;))
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on September 06, 2010, 04:46:00 PM
Quote from: Vandaahl on September 06, 2010, 04:05:09 PM
Actually I had some more errors with other actions, but I solved them in the same way. No more errors (for now ;))

I'm glad that the new implementation I added has made it easy to solve errors :)

Enjoy the mod :)
Title: Re: Add or Remove buttons
Post by: Ken. on September 09, 2010, 10:42:28 AM
Have an issue that popped up and I'm not finding a solution so far.

Because of all the testing that happens on my site it sometimes needs to be reloaded with fresh copies of the SMF files and that process was started yesterday.

Add Remove Buttons v02 was working OK before the files reload, but after the reload v04 was installed. Because of some 'test failed' errors the mod was manually installed and now works as expected except for one issue... When the link for 'My Messages' is turned off the message count indicator remains and is moved to the end of the line of links/buttons.

I've tried any number of fixes that can be found here on SMF for commenting out links ..etc, but so far nothing helps.

Any tips would be greatly appreciated.  :)
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on September 09, 2010, 10:51:49 AM
This happens only when this mod is installed?

That's very odd since my mod only changes the true/false factor ???
Title: Re: Add or Remove buttons
Post by: Ken. on September 09, 2010, 11:18:53 AM
Yes, it only happens when the message button is turned off in the cp for ARB.
This error is showing it the logs:
Quote8: Undefined index:  addremovetab_settings_menu (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.ourfamilyforum.org%2FFamilyForum%2FThemes%2Fpandora20rc3%2Fimages%2Ffilter.gif&hash=90d9e022295e59a81a2c6bffa9ca7ce0f75609b7) (http://www.ourfamilyforum.org/FamilyForum/index.php?action=admin;area=logs;sa=errorlog;desc;filter=file;value=L2hvbWUva2Vua2F5am0vcHVibGljX2h0bWwvRmFtaWx5Rm9ydW0vU291cmNlcy9BZG1pbi5waHA=)  File: ../Sources/Admin.php
Line: 246
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on September 09, 2010, 11:21:10 AM
Have you checked to make sure modifications.english.php has the edit

$txt['addremovetab_settings_menu'] = 'Add or Remove buttons';

Something like the above
Title: Re: Add or Remove buttons
Post by: Ken. on September 09, 2010, 11:43:00 AM
It has that and includes the line for the PM's of course.
$txt['addremovetab_pm'] = 'Check here to disable the Personal Message\'s Button';

The command in the ARB cp for turning the button on or off works OK, it just leaves the message count indicator.
BTW... The counter has no link so it defaults to whatever page you are on when the count indicator is clicked.
Title: Re: Add or Remove buttons
Post by: TheSniperK2R on November 01, 2010, 02:53:55 PM
Hey guys i recentely have downloaded the latest version of this mod "Add or Remove Buttons" http://custom.simplemachines.org/mods/index.php?mod=2650 my smf version is SMF 2.0 RC3  and i am using the theme darkbreak. So my problem is everything work's correctly except the "remove memberlist" i have the teampage mod so there is no need for the member list tab to be there so i selected it to be removed and it still wont go away.
Title: Re: Add or Remove buttons
Post by: TheSniperK2R on November 07, 2010, 07:24:57 PM
bump
Title: Re: Add or Remove buttons
Post by: ɔɔɔɔɔɔuɥoɾ on November 22, 2010, 03:16:41 PM
Attach your Subs.php file from /Sources.
Title: Re: Add or Remove buttons
Post by: eyo on December 02, 2010, 08:40:13 AM
does this work with rc3 emulated when im using rc4?
Title: Re: Add or Remove buttons
Post by: eyo on December 04, 2010, 01:11:11 AM
where do u find this when installed?
Title: Re: Add or Remove buttons
Post by: Siirist on January 30, 2016, 12:28:09 AM
Quote from: eyo on December 04, 2010, 01:11:11 AM
where do u find this when installed?

If you had looked at the MOD Preview you would have seen at the top of the screen it says

Admin -> Configuration -> Forum -> Members -> Maintenance

Although that does seem odd, may be a SMF ver 1.x thing

Regards,
Siirist
Title: Re: Add or Remove buttons
Post by: Kosuki on April 14, 2016, 07:05:16 PM
Failed to install on version 2.11
Title: Re: Add or Remove buttons
Post by: Siirist on April 14, 2016, 07:53:03 PM
Quote from: Kosuki on April 14, 2016, 07:05:16 PM
Failed to install on version 2.11

http://wiki.simplemachines.org/smf/Installation_-_How_do_I_install_a_modification (http://wiki.simplemachines.org/smf/Installation_-_How_do_I_install_a_modification)

http://wiki.simplemachines.org/smf/How_can_I_install_a_mod_that_doesn't_work_in_my_SMF_version

Siirist
Title: Re: Add or Remove buttons
Post by: badon on October 31, 2016, 12:22:03 AM
I'm trying to uninstall a mod called "Add And Remove Buttons" version 0.4, and think it's this one even though this one is called "Add or Remove Buttons" ("And" versus "or"). I had an uninstallation failure. Screenshots attached.
Title: Re: Add or Remove buttons
Post by: Kindred on October 31, 2016, 06:59:33 AM
http://wiki.simplemachines.org/smf/Error_in_mod_installation