Re: What file did you edit?
Reply #16 –
I surely have to learn more on this. Thanks for the guides. I'll have a go again and update it here afterwards.
Re: What file did you edit?
Reply #17 –
Ok. I got it now. Except for LANGUAGEDIR, I noted that we need to add /english too. Other than that, perfect. I can start doing some test porting.
Re: What file did you edit?
Reply #23 –
Thanks. I am learning how to create all the "hook" things as we speak. I will try to create that one for fun of learning. But doing that seems quite tedious to me as my need is quite small only. Those with greater needs may attempt this menu creation and rearrangement like a portal mod etc. Let's see how far I can go with this.
By the way there is some bug detected while posting this in my son's ipad mini. In the preview screen, the menu is stucked in the middle of the input box. When the preview is shown just right after the preview button is clicked, try clicking back at the input box as the menu simply sticked on the input box and not on the top.
Re: What file did you edit?
Reply #25 –
So you can change a language file with a mod without editing anything else.
Re: What file did you edit?
Reply #26 –
I have try the hook things (in SMF) and find that it really works in re-organizing my admin menu just fine. However, the menu is now on a separate subs file and mod installation won't affects that file at all. I guess it is still good to edit source file rather than creating a new one. The new file definitely will not be affected when a mod is install while default source will. Unless, a totally new menu need to be inserted, that will be a different thing altogether since it can be inserted at any part of the default menu / sub menu via the hook stuff.
Re: What file did you edit?
Reply #28 –
Indeed you will not see many "search for, replace with" addons for ElkArte, we are really really trying to move away from that since it makes upgrades and support and addons more fragile.
Instead of the "search for, replace with" which are generally referred to as code edits, instead what happens is a named hook is called. Now there are many 100's of named hooks. Often these hooks are in the same area's that in the past you would have made the code edit.
What the hook does is call a function that you "register" with the named hook, that function is passed a set of values from that area of the code. So for example you use one of the menu hook's, it will be passed the menu array which you manipulate (add, edit, delete keys etc). Most often the updated array is returned automatically to the calling hook.
This hook then has the same effect of the search and replace but without all of the longterm downside. Indeed it can look like a lot more work for a simple edit, but trust me, its well worth the up front effort to avoid problems.
If you provide an example of what you want to do, I'm sure a quick real life example could be posted.