News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Hi need help to Remove HELP button

Started by FrancisVic, July 23, 2010, 10:29:33 PM

Previous topic - Next topic

FrancisVic

please help me how to remove Help button

Matthew K.

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

ɔɔɔɔɔɔuɥoɾ

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


SMF 2.0 RC5

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

Kill Em All

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.


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

Matthew K.

It is easier for some people, but what is the problem with changing show to false?

Joker™

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

Matthew K.

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.

ɔɔɔɔɔɔuɥoɾ

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


SMF 2.0 RC5

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

Kill Em All

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.


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

ɔɔɔɔɔɔuɥoɾ

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


SMF 2.0 RC5

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

CapadY

Maybe we can better go back on-topic ?
This discussion can be realy confused for the topic starter.
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

ɔɔɔɔɔɔuɥoɾ

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


SMF 2.0 RC5

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

Joker™

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


SMF 2.0 RC5

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

~DS~

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?
"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ɾ

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


SMF 2.0 RC5

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

Kill Em All

It works fine for me too, although I might not like the solution, it does work and it is proper.

Its just my opinion.


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

~DS~

Why? It's better than removing because you might just need them back one day by changing it to 'true'. ;)
"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: ♪ 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?


SMF 2.0 RC5

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

Kill Em All

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.


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

~DS~

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?
"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ɾ

either // or open comment and close it with /* */


SMF 2.0 RC5

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

~DS~

/* '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?
"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ɾ

Yea like the top one (recommended)

You would have to add // to every single line to comment the whole thing out


SMF 2.0 RC5

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

Kill Em All

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.


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

ɔɔɔɔɔɔuɥoɾ

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



SMF 2.0 RC5

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

Kill Em All

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.


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

ɔɔɔɔɔɔuɥoɾ

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


SMF 2.0 RC5

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

Kill Em All

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


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.


Kill Em All

I am going to mark the topic solved, please feel free to unmark it solved if you have further questions. :)


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

Advertisement: