News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Add or Remove buttons

Started by live627, July 23, 2010, 10:11:58 PM

Previous topic - Next topic

live627

Link to Mod

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.

gbsothere

Congratulations, John.  It looks great!   :)
My apologies, but I am taking a break from accepting PM requests for support.  If I am not currently assisting you, please do not ask as long as this notice is posted.  Thank you.

I Don't Want To Grow Old Alone


It has been proven that Steely Dan reduces the occurrence of road rage, according to an independent study.



A reminder about admin / ftp passwords etc.

ɔɔɔɔɔɔuɥoɾ

Wow, this was approved without any warnings from the Customization team, that's a 1st :)

Your welcome, Enjoy :)


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Afro

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.

tRu3_sKiTz0

How would you suggest rtemoving the tniy portal button from the main menu?

Afro

check the Sources/subs.php file for the related code.

SN

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

ɔɔɔɔɔɔuɥoɾ

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


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

ɔɔɔɔɔɔuɥoɾ

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.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

tRu3_sKiTz0

Keep up the good work! I can't wait till the remove all portal buttons!

ɔɔɔɔɔɔuɥoɾ

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


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

tRu3_sKiTz0

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.

ɔɔɔɔɔɔuɥoɾ

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 :)


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

SN

Tiny portal would be the one i would want too :P

~DS~

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.
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

ɔɔɔɔɔɔuɥoɾ

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
'',


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

~DS~

That's not what I heard...
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

Joker™

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 ?
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

ɔɔɔɔɔɔuɥoɾ

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.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Joker™

Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

ɔɔɔɔɔɔuɥoɾ

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.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Hj Ahmad Rasyid Hj Ismail

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

ɔɔɔɔɔɔuɥoɾ

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.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

diamondred123

you should make it update, like when i install ismple portal it adds it in
Learner but knows a little

lowburb

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

ɔɔɔɔɔɔuɥoɾ

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 :)


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

lowburb

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?

ɔɔɔɔɔɔuɥoɾ

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...


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

ɔɔɔɔɔɔuɥoɾ

Version 0.3 Released

Version 0.3
The Home button bug is fixed, no more errors when disabling the home button.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

ɔɔɔɔɔɔuɥoɾ

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.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Vandaahl

I'm getting compatibily errors when I use this mod with the Sitemap 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?

ɔɔɔɔɔɔuɥoɾ

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.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Vandaahl

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' |

ɔɔɔɔɔɔuɥoɾ

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?


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Vandaahl

Actually I had some more errors with other actions, but I solved them in the same way. No more errors (for now ;))

ɔɔɔɔɔɔuɥoɾ

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 :)


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Ken.

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.  :)
"If you don't have a stack of failures in your shop, you aren't trying hard enough". --Richard Raffin.


ɔɔɔɔɔɔuɥoɾ

This happens only when this mod is installed?

That's very odd since my mod only changes the true/false factor ???


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Ken.

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 Apply Filter: Only show the errors from this file  File: ../Sources/Admin.php
Line: 246
"If you don't have a stack of failures in your shop, you aren't trying hard enough". --Richard Raffin.


ɔɔɔɔɔɔuɥoɾ

Have you checked to make sure modifications.english.php has the edit

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

Something like the above


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Ken.

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.
"If you don't have a stack of failures in your shop, you aren't trying hard enough". --Richard Raffin.


TheSniperK2R

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.
www.crazykillas.com

www.crazykillas.com

TheSniperK2R

www.crazykillas.com

www.crazykillas.com

ɔɔɔɔɔɔuɥoɾ

Attach your Subs.php file from /Sources.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

eyo

does this work with rc3 emulated when im using rc4?

eyo

where do u find this when installed?

Siirist

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
Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

Kosuki

Failed to install on version 2.11

Siirist

Needed information:
- What's your SMF version?, What MODs are installed? What Theme(s) are you using? Have you backed up your database?

--> At least 50% of the questions asked are answered in the Online Manual <--
Mods for ver 1.x will NOT run on ver 2.x

badon

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.

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: