please help me how to remove Help button
./Sources/Subs.php
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => false,
'sub_buttons' => array(
),
),
Quote from: Labradoodle-360 on July 23, 2010, 10:35:20 PM
./Sources/Subs.php
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => false,
'sub_buttons' => array(
),
),
Or you could install this mod:
http://custom.simplemachines.org/mods/index.php?mod=2650
P.S
Using false on the show part of the array, didnt work for me, what works is nothing like below
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => '',
'sub_buttons' => array(
),
),
Labradoodle-360, why would you just either comment that out or just get rid of that block of code? I think that would make life a lot easier.
It is easier for some people, but what is the problem with changing show to false?
Quote from: Kill Em All on July 24, 2010, 12:14:54 AM
Labradoodle-360, why would you just either comment that out or just get rid of that block of code? I think that would make life a lot easier.
bro , some users want things back after a while so "it'vd be more convenient just to change the value to true rather than to search for whole code".Just my opinion :)
Exactly the reason.
Personally, I remove code; or comment it out. However, I also have full backups of everything, fresh copies of all SMF versions and know PHP and coding in general.
Quote from: Kill Em All on July 24, 2010, 12:14:54 AM
Labradoodle-360, why would you just either comment that out or just get rid of that block of code? I think that would make life a lot easier.
I would actually leave the code in and do it that way, simply to make less changes as possible, so mods can install easier.
Quote from: Labradoodle-360 on July 24, 2010, 01:33:30 AM
It is easier for some people, but what is the problem with changing show to false?
I don't think that works, really, I just made a mod (linked above) and changing true to false dose not actually disable the button, you just add a blank " ' ', ". That's what happened to me anyway. The block of code should be left their IMO, for better mod compatibility.
Just in case a mod adds another tab right before the help one
'help' => array(
'title' => $txt['help'],
another array here
Quote from: ♪ JohnCcCcCc ♫ on July 24, 2010, 01:45:22 AM
Quote from: Kill Em All on July 24, 2010, 12:14:54 AM
Labradoodle-360, why would you just either comment that out or just get rid of that block of code? I think that would make life a lot easier.
I would actually leave the code in and do it that way, simply to make less changes as possible, so mods can install easier.
That makes absolutely no sense, whether you comment it out or change that code there to false, it would still cause problems with mods...
I understand that you have backups and stuff, but I personally think comments would be easier. Plus it would be hard for the average Joe to remember that it was changed from true to false instead of reading a nice comment.
Quote from: Kill Em All on July 24, 2010, 12:14:54 AM
Labradoodle-360, why would you just either comment that out or just get rid of that block of code? I think that would make life a lot easier.
I meant that...
That's why I said "leave the code in"
Changing true to false will not remove the button anyway you change true to ''
Maybe we can better go back on-topic ?
This discussion can be realy confused for the topic starter.
The solution has been said many times, in many different ways, they should be fine, anywho;
Removing the button manually
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),
Change that to
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => '',
'sub_buttons' => array(
),
),
Or better still use this mod which allows you to turn several buttons on and off as you please.
http://custom.simplemachines.org/mods/index.php?mod=2650
Quote from: ♪ JohnCcCcCc ♫ on July 25, 2010, 12:10:11 AM
I meant that...
That's why I said "leave the code in"
Changing true to false will not remove the button anyway you change true to ''
i'm not getting your this comment,for me changing it to false worked perfectly.
Quote from: Joker™ on July 25, 2010, 01:12:44 PM
Quote from: ♪ JohnCcCcCc ♫ on July 25, 2010, 12:10:11 AM
I meant that...
That's why I said "leave the code in"
Changing true to false will not remove the button anyway you change true to ''
i'm not getting your this comment,for me changing it to false worked perfectly.
Tried again, its not working for me, are you sure its working for you?
Quote from: ♪ JohnCcCcCc ♫ on July 25, 2010, 01:51:04 PM
Quote from: Joker™ on July 25, 2010, 01:12:44 PM
Quote from: ♪ JohnCcCcCc ♫ on July 25, 2010, 12:10:11 AM
I meant that...
That's why I said "leave the code in"
Changing true to false will not remove the button anyway you change true to ''
i'm not getting your this comment,for me changing it to false worked perfectly.
Tried again, its not working for me, are you sure its working for you?
Eh? It does work. Are you SURE it's not working for you?
Really...
No its not working, that's really weird, I naturally assumed that would work, and its supposed to..
I'd better check my localhost xampp server just in case things are not right...
It works fine for me too, although I might not like the solution, it does work and it is proper.
Its just my opinion.
Why? It's better than removing because you might just need them back one day by changing it to 'true'. ;)
Quote from: ♪ JohnCcCcCc ♫ on July 25, 2010, 01:54:51 PM
Really...
No its not working, that's really weird, I naturally assumed that would work, and its supposed to..
I'd better check my localhost xampp server just in case things are not right...
I just reinstalled XAMPP, and now using false works, what the hell happened ??? ? lol
I'm glad its fixed, but what, how, why?? lol (Windows maybe lol)
Quote from: Delita on July 25, 2010, 02:35:02 PM
Why? It's better than removing because you might just need them back one day by changing it to 'true'. ;)
That's why I made the Add or Remove buttons mod, a simple click enables or disables lol
Weird thing is I didn't use true, I used '' only, and it was still approved by the customization team, if that's not proper, then why approve the mod?
Quote from: Delita on July 25, 2010, 02:35:02 PM
Why? It's better than removing because you might just need them back one day by changing it to 'true'. ;)
I just prefer using comments if I wanted to remove something, its easier to remember for me.
@♪ JohnCcCcCc ♫, I wasn't saying that there was only one way, there are multiple ways to achieve this.
Quote from: Kill Em All on July 25, 2010, 02:41:10 PM
Quote from: Delita on July 25, 2010, 02:35:02 PM
Why? It's better than removing because you might just need them back one day by changing it to 'true'. ;)
I just prefer using comments if I wanted to remove something, its easier to remember for me.
@♪ JohnCcCcCc ♫, I wasn't saying that there was only one way, there are multiple ways to achieve this.
Comments? You mean comment out the line? Or adding // ? How?
either // or open comment and close it with /* */
/* 'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
), */
// 'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),
Like that?
Yea like the top one (recommended)
You would have to add // to every single line to comment the whole thing out
Exactly.
I'll also usually add a comment above the block of code I commented out such as:
// HEY, we commented this out so that we can remove/add/whatever this feature
Just makes life a lot easier, atleast for me.
I was thinking about making things easier for mods though, I already know you dont agree with me Kill Em All
However, the less code changed, the less chance of failed tests, I don't think anybody in their right mind would make a mod where you;
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),
Some code
goes here
maybe some more
here
While it could just be
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
Some code
goes here
maybe some more
here
You can see then if someone was to change true to false, it would not effect the mod, as removing the code completely or commenting it out would effect it.
I would do this
//We disabled this button, since we dont need it, default setting = 'show' => true,
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => false,
'sub_buttons' => array(
),
),
Well first its unlikely a mod is going to be playing around with other buttons. But for argument sake lets say a lot of mods do.
The way the package manager works, it has to be the exact same code when its finding and replacing that block of code. Even if a space is off, its going to give a test failed. So its not really helping the cause anyways.
Its not that I don't agree with you per say, its just that I think my way is better, but there really is no better way because any way will work. Everyone codes differently, thats whats great about coding, you can be free and no subject to such strict guidelines.
Quote from: Kill Em All on July 25, 2010, 03:04:59 PM
Well first its unlikely a mod is going to be playing around with other buttons. But for argument sake lets say a lot of mods do.
The way the package manager works, it has to be the exact same code when its finding and replacing that block of code. Even if a space is off, its going to give a test failed. So its not really helping the cause anyways.
Its not that I don't agree with you per say, its just that I think my way is better, but there really is no better way because any way will work. Everyone codes differently, thats whats great about coding, you can be free and no subject to such strict guidelines.
If they wish to add another button, they will need to search one of the arrays however.
I recently created a mod, which allows you to add upto 5 buttons (why, been hearing "how do I add custom buttons" all week long, lol) anywho
This is part of the code
'search' => array(
'title' => $txt['search'],
'href' => $scripturl . '?action=search',
The rest of the code is here, but u get the point (5 custom button arrays)
'sub_buttons' => array(
),
),
I did this because, I know people who add buttons may also want to remove existing buttons, as to save space.
Like in my mod that lets you remove buttons, I changed the show part of the array, just so you can use both mods together.
You see my point here though..
I see. So we don't end up confusing the topic author, we will just leave it at that.
FrancisVic, do you need any further assistance with this, if not, please feel free to mark this as solved. :)
thanks guy.
I am going to mark the topic solved, please feel free to unmark it solved if you have further questions. :)