Hi need help to Remove HELP button

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

Previous topic - Next topic

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