Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: FrancisVic on July 23, 2010, 10:29:33 PM

Title: Hi need help to Remove HELP button
Post by: FrancisVic on July 23, 2010, 10:29:33 PM
please help me how to remove Help button
Title: Re: Hi need help to Remove HELP button
Post by: Matthew K. on July 23, 2010, 10:35:20 PM
./Sources/Subs.php
Code (Find) Select

'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),

Code (Replace) Select

'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => false,
'sub_buttons' => array(
),
),
Title: Re: Hi need help to Remove HELP button
Post by: ɔɔɔɔɔɔuɥoɾ on July 23, 2010, 11:51:52 PM
Quote from: Labradoodle-360 on July 23, 2010, 10:35:20 PM
./Sources/Subs.php
Code (Find) Select

'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),

Code (Replace) Select

'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(
            ),
         ),
Title: Re: Hi need help to Remove HELP button
Post by: 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.
Title: Re: Hi need help to Remove HELP button
Post by: Matthew K. on July 24, 2010, 01:33:30 AM
It is easier for some people, but what is the problem with changing show to false?
Title: Re: Hi need help to Remove HELP button
Post by: Joker™ on July 24, 2010, 01:40:03 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.

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 :)
Title: Re: Hi need help to Remove HELP button
Post by: Matthew K. on July 24, 2010, 01:43:11 AM
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.
Title: Re: Hi need help to Remove HELP button
Post by: ɔɔɔɔɔɔuɥoɾ 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.

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
Code (find) Select


         'help' => array(
            'title' => $txt['help'],

Code (Add before) Select

another array here
Title: Re: Hi need help to Remove HELP button
Post by: Kill Em All on July 24, 2010, 11:05:01 PM
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.
Title: Re: Hi need help to Remove HELP button
Post by: ɔɔɔɔɔɔuɥoɾ on July 25, 2010, 12:10:11 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 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 ''
Title: Re: Hi need help to Remove HELP button
Post by: CapadY on July 25, 2010, 05:53:42 AM
Maybe we can better go back on-topic ?
This discussion can be realy confused for the topic starter.
Title: Re: Hi need help to Remove HELP button
Post by: ɔɔɔɔɔɔuɥoɾ on July 25, 2010, 01:08:51 PM
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
Title: Re: Hi need help to Remove HELP button
Post by: 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.
Title: Re: Hi need help to Remove HELP button
Post by: ɔɔɔɔɔɔuɥoɾ 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?
Title: Re: Hi need help to Remove HELP button
Post by: ~DS~ on July 25, 2010, 01:52:58 PM
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?
Title: Re: Hi need help to Remove HELP button
Post by: ɔɔɔɔɔɔuɥoɾ 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...
Title: Re: Hi need help to Remove HELP button
Post by: Kill Em All on July 25, 2010, 02:30:49 PM
It works fine for me too, although I might not like the solution, it does work and it is proper.

Its just my opinion.
Title: Re: Hi need help to Remove HELP button
Post by: ~DS~ 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'. ;)
Title: Re: Hi need help to Remove HELP button
Post by: ɔɔɔɔɔɔuɥoɾ on July 25, 2010, 02:36:52 PM
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?
Title: Re: Hi need help to Remove HELP button
Post by: 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.
Title: Re: Hi need help to Remove HELP button
Post by: ~DS~ on July 25, 2010, 02:43:50 PM
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?
Title: Re: Hi need help to Remove HELP button
Post by: ɔɔɔɔɔɔuɥoɾ on July 25, 2010, 02:47:05 PM
either // or open comment and close it with /* */
Title: Re: Hi need help to Remove HELP button
Post by: ~DS~ on July 25, 2010, 02:50:21 PM
/* '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?
Title: Re: Hi need help to Remove HELP button
Post by: ɔɔɔɔɔɔuɥoɾ on July 25, 2010, 02:55:04 PM
Yea like the top one (recommended)

You would have to add // to every single line to comment the whole thing out
Title: Re: Hi need help to Remove HELP button
Post by: Kill Em All on July 25, 2010, 02:56:04 PM
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.
Title: Re: Hi need help to Remove HELP button
Post by: ɔɔɔɔɔɔuɥoɾ on July 25, 2010, 03:00:47 PM
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;

Code (FIND) Select

         'help' => array(
            'title' => $txt['help'],
            'href' => $scripturl . '?action=help',
            'show' => true,
            'sub_buttons' => array(
            ),
         ),

Code (Add Before) Select

Some code
goes here
maybe some more
here


While it could just be
Code (find) Select

         'help' => array(
            'title' => $txt['help'],
            'href' => $scripturl . '?action=help',

Code (add before) Select

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(
            ),
         ),

Title: Re: Hi need help to Remove HELP button
Post by: 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.
Title: Re: Hi need help to Remove HELP button
Post by: ɔɔɔɔɔɔuɥoɾ on July 25, 2010, 03:11:44 PM
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
Code ( Find) Select

'search' => array(
'title' => $txt['search'],
'href' => $scripturl . '?action=search',

Code ( Add before) Select

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..
Title: Re: Hi need help to Remove HELP button
Post by: Kill Em All on July 25, 2010, 03:17:03 PM
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. :)
Title: Re: Hi need help to Remove HELP button
Post by: FrancisVic on July 27, 2010, 12:58:44 AM
thanks guy.
Title: Re: Hi need help to Remove HELP button
Post by: Kill Em All on July 27, 2010, 02:37:42 AM
I am going to mark the topic solved, please feel free to unmark it solved if you have further questions. :)