ElkArte Community

Extending Elk => Addons => Topic started by: emanuele on April 18, 2014, 08:19:27 am

Title: What file did you edit?
Post by: emanuele on April 18, 2014, 08:19:27 am
This topic aims at both addon developers and "end users".

I would like to hear from you which files you were forced to edit, and how, in order to add the feature you wanted to build.

It doesn't matter how big or small the feature is, the important is to know how you want/ed to modify the code and what the project can do to allow easier extensibility.

Remember that at some point in the future (2.0? 3.0? 4.0? I don't know), the ability of the package manager to edit files may be removed in favour of an "hook/event-only" extension system, so it is important to know what are the weak points in respect to extensibility in the current codebase in order to improve them and reach a point that it will be possible to "change" almost any part of the software without having to rely on code edits.

Thanks!! :D
Title: Re: What file did you edit?
Post by: scripple on April 18, 2014, 11:20:27 pm
I have four custom mods, all of which have to make code edits.  Most very minor one extensive.

It edits the following files

I like hooks.  I'll happily use them where I can.  But I'm not too fond of your plan to get rid of code edits.  Especially for the theme.  Lots of mods probably want to make a small change to the theme templates and I don't see how the hooks can realistically handle all the places someone might want to inject something into the display.  Also even outside the theme you simply cut down on people's options.  Yes code changes are brittle.  And that's a pain.  But the alternative of you simply can't do that unless you willing to use your own patch system doesn't really seem like an improvement.

And huh, apparently bbcode doesn't like list in list.
Title: Re: What file did you edit?
Post by: emanuele on April 23, 2014, 07:23:18 pm
Quote from: scripple –
  • My basic theme mod.  It has to edit index.template.php to add my dark variant and remove one of the defaults.  Maybe there should be a hook for setting the variants?

That is kind of a mixed discussion, I'm not sure where to start at the moment... lol

Quote from: scripple –
  • An image annotation mod.  It allows you to draw boxes on images and leave a note beside them.  The note is also inserted into the topic as a normal post.  I had to edit Display.template.php to add a link from the post back to the image that was annotated.

    I got around any other mods by making my own post function for it that returns both success and error messages in json instead of using the existing js post function (name escapes me right now) as that calls too many "is_allowed" functions that redirect and thus return an unparseable response to the ajax call.

Yeah, isAllowedTo are a pain... >_<
That is in the list of things to do for 1.1 (and Joshua already did some).
Where did you edit Display.template.php?

Quote from: scripple –
  • An equivalent to the SMF New in Topic (or something like that) mod that adds a new indicator to each message that is new Display.template.php.  This makes it much easier to see which posts are actually new since sometimes the new post doesn't actually end up at the top.  (User images that are slow to load, or new responses that are shorter than the page height.)  All the information is already in the message list handed to Display.template.php so it's a shame this isn't an admin option layout option.
I did that  on my own forum...
I'd be tempted to say it should be "standard". O:-)
If nobody disagrees I may sneak it into 1.1. :P
So here we are talking about template_messages, right?

Quote from: scripple –
  • Auth.subs.php - modifies loadExistingMember to add a variable to the db queries.  (The id of the parent account.)  These queries could benefit from the hooks to add variables and tables like you've done with many other queries.
Good point.
I think around in the forum there is a discussion about that function, but probably about something slightly different.

Quote from: scripple –
  • Auth.controller.php - I want to stop the role play accounts from logging in directly.  But the only hook in action_login2 is to totally take over the login process.   There is nothing between that and calling doLogin to take any action.  So no extra ban or anti-spam extensions can go here either.
You mean integrate_validate_login?
What would you be able to do exactly? Log in the "parent" account or just "kick" them? Or something else completely?

Quote from: scripple –
  • Post.controller.php - Multiple edits to allow users to post as or modify the posts of their role play accounts while they are logged in as a different account.  I've mentioned before how every path to posting and the themes to display buttons to do what you have permission to do handles permissions to modify, remove, etc. differently.   There are no hooks in Post.controller.php
Post.controller is a mess... really... lol

I'll stop here because I'm falling asleep.

Just a thought, there are at least two general hooks for each action in Dispatcher that look like:
Code: [Select]
'integrate_action_' . action_name . '_before'
'integrate_action_' . action_name . '_after'
so, for example post and post2 the hook called are:
Code: [Select]
'integrate_action_post_before'
'integrate_action_post_after'
Yeah, the 2 is removed.
In both cases the name of the function/method is passed as argument.
You may take advantage of some of them to "cheat" and do what you want even if a specific hook is actually missing. ;D

Quote from: scripple –
  • Messages.subs.php - this is related to the Post stuff.  Mods to checkMessagePermissions which doesn't have any hooks.  Some parts of Post.controller.php call this function.  Many do not.
  • Subs.php - this is just to fix jsmodify I think it is from setting $_SESSION['old_url'].  This should really just be fixed in the baseline.  Maybe ema already did.  I think he was going to add ;xml to jsmodify so that 'js' doesn't have to be added to the list of things to check from in old_url.
  • Post.template.php - Add a select to allow the user to select which account to post as.
  • Display.template.php - Add a select to the quick reply form to select which account to post as.
  • Profile.controller.php - Modify the link tree to show the user account a role play account belongs to.  It's been a while but my impression was there weren't many hooks in the profile areas.
  • ManageThemes.controller.php - I only allow the real user account to make theme changes and look and layout changes.  Then I put mods here to set all the role play accounts to have those same settings.  Again not many hooks in this area.
  • ProfileInfo.template.php - Show a list of role play accounts with links to their profiles under the main user.

I like hooks.  I'll happily use them where I can.  But I'm not too fond of your plan to get rid of code edits.  Especially for the theme.  Lots of mods probably want to make a small change to the theme templates and I don't see how the hooks can realistically handle all the places someone might want to inject something into the display.  Also even outside the theme you simply cut down on people's options.  Yes code changes are brittle.  And that's a pain.  But the alternative of you simply can't do that unless you willing to use your own patch system doesn't really seem like an improvement.

And huh, apparently bbcode doesn't like list in list.
Looks fine here.
Are you using the WYSIWYG editor?
Title: Re: What file did you edit?
Post by: Joshua Dickerson on April 24, 2014, 03:05:43 pm
Scripple, I think the best option would be to relegate code edits to a separate software. So the plugin system would handle all of the plugins, but the package manager would be separate. Composer would be the route I'd like to see.
Title: Re: What file did you edit?
Post by: scripple on April 26, 2014, 01:29:03 pm
Quote from: emanuele – That is kind of a mixed discussion, I'm not sure where to start at the moment... lol
How about starting with where you're going to add the hook?  ;)

QuoteWhere did you edit Display.template.php?
On the line with the Reply #x so that for image notes it reads "[image] Reply #x".  Clicking on [image] takes you to the image with the annotation.

QuoteI did that  on my own forum...
I'd be tempted to say it should be "standard". O:-)
If nobody disagrees I may sneak it into 1.1. :P
So here we are talking about template_messages, right?
I think it should be.  It's not like it destroys the layout or anything.  And yes in template_messages.

Quote from: scripple –
Quote from: scripple –
  • Auth.controller.php - I want to stop the role play accounts from logging in directly.  But the only hook in action_login2 is to totally take over the login process.   There is nothing between that and calling doLogin to take any action.  So no extra ban or anti-spam extensions can go here either.
You mean integrate_validate_login?
What would you be able to do exactly? Log in the "parent" account or just "kick" them? Or something else completely?
Yes integrate_validate_login.   And yes I just kick them with an error message saying to login as the main account.  That way stale passwords on child accounts don't matter.

QuotePost.controller is a mess... really... lol
Yes it is.

QuoteJust a thought, there are at least two general hooks for each action in Dispatcher that look like:

Code: [Select]
'integrate_action_' . action_name . '_before'
'integrate_action_' . action_name . '_after'
    I've used that but it's not much help in post and post2 unless I want to do all the work they're doing to decide if permissions are ok or not.  If that can be done easily than it would better for me to just submit a PR with a simpler post and post2.

    Quote
    QuoteAnd huh, apparently bbcode doesn't like list in list.

    Looks fine here.
    Are you using the WYSIWYG editor?
    No I was using the source mode editor.  Maybe there's an extra [/list] in my post or something that I missed.
    Title: Re: What file did you edit?
    Post by: scripple on April 26, 2014, 01:30:39 pm
    Quote from: groundup – Scripple, I think the best option would be to relegate code edits to a separate software. So the plugin system would handle all of the plugins, but the package manager would be separate. Composer would be the route I'd like to see.
    In that case mods would have to be installed in two parts.  I think that could get messy.  Oh this part is only hooks and installed fine but it relied on that other part which failed due to code edits that didn't match.  Now things are really hosed.  Could get ugly.
    Title: Re: What file did you edit?
    Post by: emanuele on April 26, 2014, 03:13:23 pm
    Quote from: scripple –
    QuoteWhere did you edit Display.template.php?
    On the line with the Reply #x so that for image notes it reads "[image] Reply #x".  Clicking on [image] takes you to the image with the annotation.
    Ohh, that one, yes, it's exactly where I put it as well. lol
    You could actually use a trick (it could be considered ugly, but if you want to go the "hard way" about edits is a possibility): hooking integrate_prepare_display_context, you could use something like that:
    Code: [Select]
    function is_new_post(&$output, &$message)
    {
    global $txt, $settings;
    static $txt_reply_number = null;

    // Better remember it for future reference
    if ($txt_reply_number === null)
    $txt_reply_number = $txt['reply_number'];

    // First message of the topic is a bit special
    if (empty($output['counter']))
    {
    if ($output['new'])
    $output['html_time'] = '<span class="new_posts">' . $txt['new'] . '</span>&nbsp;' . $output['html_time'];
    }
    // Any other message follow the same pattern
    else
    {
    if ($output['new'])
    $txt['reply_number'] = '<span class="new_posts">' . $txt['new'] . '</span>&nbsp;' . $txt_reply_number;
    // Better reset because it may have been changed before
    else
    $txt['reply_number'] = $txt_reply_number;
    }
    }
    Title: Re: What file did you edit?
    Post by: scripple on April 26, 2014, 04:01:35 pm
    Yeah that is pretty ugly but not as bad as what I did to the profile button to make it so that the user's avatar shows instead of the head and shoulder icon on narrow screens.  I'll have to look into it when I get some time and energy.
    Title: Re: What file did you edit?
    Post by: Joshua Dickerson on April 28, 2014, 12:21:01 pm
    Quote from: scripple –
    Quote from: groundup – Scripple, I think the best option would be to relegate code edits to a separate software. So the plugin system would handle all of the plugins, but the package manager would be separate. Composer would be the route I'd like to see.
    In that case mods would have to be installed in two parts.  I think that could get messy.  Oh this part is only hooks and installed fine but it relied on that other part which failed due to code edits that didn't match.  Now things are really hosed.  Could get ugly.
    No, Elkarte would interface with that other software or maybe the other way around.
    Title: Re: What file did you edit?
    Post by: emanuele on June 27, 2014, 03:03:47 am
    Quote from: scripple –
    Quote from: emanuele – That is kind of a mixed discussion, I'm not sure where to start at the moment... lol
    How about starting with where you're going to add the hook?  ;)
    I don't know if you noticed, but I added the hook there recently. Though it's not that useful as it may be: the problem is that with a theme you don't have any good way to unambiguously identify a theme.
    From an addon point or view, you can't rely on the id (except for 0), you can barely rely on the theme name, but is a bit... odd.
    This is a point that may require some work in the core: there should be a unique identifier similar to the package id of the mods stored somewhere in the database. And it's better if I stop it here, because I have some odd stuff going around in my mind related to themes... O:-)
    Title: Re: What file did you edit?
    Post by: ahrasis on August 06, 2014, 05:26:35 am
    Quote from: emanuele – Remember that at some point in the future (2.0? 3.0? 4.0? I don't know), the ability of the package manager to edit files may be removed in favour of an "hook/event-only" extension system, so it is important to know what are the weak points in respect to extensibility in the current codebase in order to improve them and reach a point that it will be possible to "change" almost any part of the software without having to rely on code edits.
    May be removed or has already been removed. I can't seem to create any working mod for RC2 so far.
    Title: Re: What file did you edit?
    Post by: emanuele on August 06, 2014, 05:46:47 am
    That's a bit of a general statement, there are some addons that do file edit here in this very board.
    Maybe some more details could help understanding your problem. ;)
    Title: Re: What file did you edit?
    Post by: ahrasis on August 06, 2014, 10:14:27 pm
    Really?

    So the package manager still working for old fashioned mod in addition to new one? So if I want to remove the header part, can I still do it via package manager?

    Let say my mod is to remove header by replacing this part:
    Code: [Select]
    	echo '
    </div>
    <div id="header" class="wrapper', !empty($settings['header_layout']) ? ($settings['header_layout'] == 1 ? ' centerheader' : ' rightheader') : '', '"', empty($context['minmax_preferences']['upshrink']) ? '' : ' style="display: none;" aria-hidden="true"', '>
    <h1 id="forumtitle">
    <a href="', $scripturl, '">', $context['forum_name'], '</a>
    </h1>';

    echo '
    <div id="logobox">
    <img id="logo" src="', $context['header_logo_url_html_safe'], '" alt="', $context['forum_name_html_safe'], '" title="', $context['forum_name_html_safe'], '" />', empty($settings['site_slogan']) ? '' : '
    <div id="siteslogan">' . $settings['site_slogan'] . '</div>', '
    </div>';

    // Show the menu here, according to the menu sub template.
    echo '
    </div>';

    To just this:
    Code: [Select]
    	// Show the menu here, according to the menu sub template.
    echo '
    </div>';

    I created a normal old fashioned mod package, but it doesn't work so far.
    Title: Re: What file did you edit?
    Post by: ahrasis on August 06, 2014, 10:28:40 pm
    To simplify things, I attached one of my trial mod that I cannot get installed by package manager. May be you can check what is wrong with it and explain since I have been trying but can't really understand what is wrong with it.
    Title: Re: What file did you edit?
    Post by: emanuele on August 07, 2014, 05:43:05 am
    The package manager emulation doesn't work "backwards".
    You are specifying in your "install" (and uninstall) commands the range "1.0 - 1.0.99", but the current version is "1.0 RC2", that is lower than 1.0, so it is not installed.

    I'm not sure this is a bug or not, I don't remember the emulation "specifications"[1], @Spuds what do you think?
    A test for that would be very useful so that we can remember how it is supposed to work (and maybe why O:-))
    Title: Re: What file did you edit?
    Post by: emanuele on August 07, 2014, 05:56:30 am
    A couple of things I noticed while looking at the package. ;)

    Code: [Select]
    <file name="THEMEDIR/languages/english/ManageSettings.english.php">
    should really be:
    Code: [Select]
    <file name="LANGUAGEDIR/ManageSettings.english.php">

    ManageSettings.english-utf8.php doesn't exists in ElkArte because there is no support for non-UTF8 charsets, so the "-utf8" has been stripped.

    This is related to SMF instead: you should never mix UTF8 and non-UTF8 charsets modifications in the same file. You should always have one file for each charset (not for language, but some language use different charsets).


    And not necessary, but probably "nice" (as in less typing lol):
    Code: [Select]
    <file name="SOURCEDIR/admin/Admin.controller.php">
    could be:
    Code: [Select]
    <file name="ADMINDIR/Admin.controller.php">
    Title: Re: What file did you edit?
    Post by: ahrasis on August 07, 2014, 07:24:39 am
    I surely have to learn more on this. Thanks for the guides. I'll have a go again and update it here afterwards.
    Title: Re: What file did you edit?
    Post by: ahrasis on August 07, 2014, 07:57:04 am
    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.
    Title: Re: What file did you edit?
    Post by: emanuele on August 07, 2014, 08:10:01 am
    Yes, of course I forgot english... :-[
    Title: Re: What file did you edit?
    Post by: Joshua Dickerson on August 07, 2014, 02:43:00 pm
    The hook found at https://github.com/elkarte/Elkarte/blob/master/sources/admin/Admin.controller.php#L571 should be changed to "integrate_admin_areas" and $admin_areas passed to it. That is a pretty easy change and will make it possible for ahrasis mod to work without code edits.
    Title: Re: What file did you edit?
    Post by: emanuele on August 07, 2014, 05:31:30 pm
    createMenu provides hook for any menu, no need for additional. ;)

    https://github.com/elkarte/Elkarte/blob/master/sources/subs/Menu.subs.php#L86
    Title: Re: What file did you edit?
    Post by: Joshua Dickerson on August 09, 2014, 05:28:14 pm
    As I mentioned before (http://www.elkarte.net/community/index.php?topic=937), loadLanguage() needs a hook. I think the best spot would be https://github.com/elkarte/Elkarte/blob/master/sources/Load.php#L2299

    It might need a lot of things passed to it to make it make sense: $template_name, $already_loaded, $attempts, $found, and $fatal.
    Title: Re: What file did you edit?
    Post by: Joshua Dickerson on August 09, 2014, 05:32:13 pm
    Ah, okay. Well, then @ahrasis , you should use that hook instead of doing code edits ;)
    Title: Re: What file did you edit?
    Post by: ahrasis on August 09, 2014, 11:17:18 pm
    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.
    Title: Re: What file did you edit?
    Post by: emanuele on August 11, 2014, 03:49:06 am
    Quote from: groundup – As I mentioned before (http://www.elkarte.net/community/index.php?topic=937), loadLanguage() needs a hook. I think the best spot would be https://github.com/elkarte/Elkarte/blob/master/sources/Load.php#L2299

    It might need a lot of things passed to it to make it make sense: $template_name, $already_loaded, $attempts, $found, and $fatal.
    Just to put ourself on the same line, what would you use the hook for?
    In the other topic you talk about logging, but an hook just for logging seems a bit overkill, I would add it to the debug class (that is present starting from 1.1, so it would be a bit limited for now, yeah...). Another thing that comes to my mind, would be load languages from external applications (maybe for integration?), in that case could be better to have something similar to the integrate_verification (I think) hook? So a loop through all the hooks and get as return an array of successful files loaded out outside to be removed from the list? In a similar case, then, the hook would be better before loadLanguage tries to load the file itself? In other words giving priority to the external loading.
    Or there are other things?
    Title: Re: What file did you edit?
    Post by: Joshua Dickerson on August 12, 2014, 05:55:28 pm
    So you can change a language file with a mod without editing anything else.
    Title: Re: What file did you edit?
    Post by: ahrasis on August 18, 2014, 03:42:35 am
    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.
    Title: Re: What file did you edit?
    Post by: Jorin on October 27, 2014, 05:37:02 am
    Hm... It seems this topic is far to complicated for my simple mind. :-[

    I want to write a little addon which changes a link in the menu. I downloaded some addons and had a look into package-info, but there are no strings like "search for this and change it into that" as I know them from SMF modifications.

    Will anybody write a small, easy to understand manual how addons must look like with ElkArte?
    Title: Re: What file did you edit?
    Post by: Spuds on October 27, 2014, 10:59:14 am
    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.
    Title: Re: What file did you edit?
    Post by: emanuele on October 28, 2014, 08:05:09 pm
    For reference, here there is a tutorial to add menus using a function (http://www.elkarte.net/community/index.php?topic=831.msg5805#msg5805), it doesn't explain (yet?) how to add the hook though.
    Title: Re: What file did you edit?
    Post by: vbgamer45 on January 26, 2017, 03:27:12 pm
    Wanting to add a scheduled task have the database query ready.
    But was looking to see if there was a hook or way to add to "class Scheduled_Task" I want add another function in there and load the language strings hopefully without editing the file.
    Title: Re: What file did you edit?
    Post by: ahrasis on January 26, 2017, 05:24:15 pm
    This could be useful:
    Quote from: Spuds – Remember Elk also has several "generic" hooks which allow you to act on almost every action and subaction ...  a few that I use are:

    Code: [Select]
    call_integration_hook('integrate_action_' . $hook . '_before', array($this->_function_name));
    call_integration_hook('integrate_action_' . $hook . '_after', array($this->_function_name));
    call_integration_hook('integrate_sa_' . $this->_name, array(&$subactions));
    call_integration_hook('integrate_list_' . $listOptions['id'], array(&$listOptions));

    The first two are in the Site Dispatcher, allowing you to act both before and after an action is initiated.  One minor thing to note and something that is being worked on, is the _after hook is not always guaranteed to fire ... for example an action with an exit / die / fatal etc inside of it.  So pretty much anywhere a ?action=xyz is called, these hooks are called.

    The third is in the Action.class allowing you integrate before a sub-action is called from a controller.  This allows you to easily add your own subActions to a controller, or simply act / trigger at the start of any subAction.  So wherever you see $action->initialize() in a controller, that hook is being called (~55 times)

    The last is called wherever you see a createList(); call, it allows you to add / modify to any list / form that gets displayed, this is super useful as we really implemented createList (~170 times)

    Edited:

    I did found these (but now sure what it is for) in ManageScheduledTasks.controller.php::
    Code: [Select]
    			call_integration_include_hook('integrate_autotask_include');

    Code: [Select]
    		// We need to find what's the action. call integrate_sa_manage_scheduled_tasks
    $subAction = $action->initialize($subActions, 'tasks');

    Otherwise, looking at the code, we could add a hook somewhere in the end of this line:
    Code: [Select]
    	public function action_index()
    {
    global $context, $txt;

    loadLanguage('ManageScheduledTasks');
    loadTemplate('ManageScheduledTasks');

    $subActions = array(
    'taskedit' => array($this, 'action_edit', 'permission' => 'admin_forum'),
    'tasklog' => array($this, 'action_log', 'permission' => 'admin_forum'),
    'tasks' => array($this, 'action_tasks', 'permission' => 'admin_forum'),
    );

    // Control those actions
    $action = new Action('manage_scheduled_tasks');

    // Now for the lovely tabs. That we all love.
    $context[$context['admin_menu_name']]['tab_data'] = array(
    'title' => $txt['scheduled_tasks_title'],
    'help' => '',
    'description' => $txt['maintain_info'],
    'tabs' => array(
    'tasks' => array(
    'description' => $txt['maintain_tasks_desc'],
    ),
    'tasklog' => array(
    'description' => $txt['scheduled_log_desc'],
    ),
    ),
    );

    // We need to find what's the action. call integrate_sa_manage_scheduled_tasks
    $subAction = $action->initialize($subActions, 'tasks');

    // Page details
    $context['page_title'] = $txt['maintain_info'];
    $context['sub_action'] = $subAction;

    // Call the right function for this sub-action.
    $action->dispatch($subAction);
    }

    As in my last comparison, SMF 2.1 Beta did put this hook there:
    Code: [Select]
    	call_integration_hook('integrate_manage_scheduled_tasks', array(&$subActions));

    // Call it.
    call_helper($subActions[$context['sub_action']]);

    Whether that hook add is necessary or otherwise, I don't know.
    Title: Re: What file did you edit?
    Post by: emanuele on January 26, 2017, 06:06:56 pm
    To add a new scheduled task there is no need to edit files.
    In 1.0: include your file using "integrate_autotask_include", then the task (i.e. the "task" column in the database) can be in the form of a simple function ("my_custom_task") or a static method ("MyScheduled::method") and it will be used.
    In 1.1: you'll have a class in sources/subs/ScheduledTask/ implementing the ScheduledTaskInterface.php and in the database you store the name of the class. Elk will take care of the rest.
    Title: Re: What file did you edit?
    Post by: emanuele on January 26, 2017, 06:12:16 pm
    @ahrasis any time you see
    Code: [Select]
    $action = new Action('something');
    $subAction = $action->initialize($subActions, 'an_action');
    you already have an hook available in the form:
    Code: [Select]
    integrate_sa_something
    that will pass you the $subActions array.
    Let's say the equivalent of:
    Code: [Select]
    call_integration_hook('integrate_sa_something', array(&$subActions));
    for reference, see the comment in the code you posted:
    Code: [Select]
    // We need to find what's the action. call integrate_sa_manage_scheduled_tasks
    Title: Re: What file did you edit?
    Post by: vbgamer45 on January 26, 2017, 06:12:51 pm
    Thanks will give it try
    Title: Re: What file did you edit?
    Post by: Cody on January 27, 2017, 10:07:48 pm
    I'm looking at trying to change/add information in the recent and unread posts pages, and there does not seem to be any way to add custom selects or joins to the sql and no hooks to work on the data before/in the context array.
    Title: Re: What file did you edit?
    Post by: emanuele on January 29, 2017, 08:03:08 am
    @Cody right you remembered me about this, I worked on this code for 1.1, and set it up to make it easier to add an hook to the queries, but for some reason I didn't add it.
    I'll try to find out the reason. lol
    Title: Re: What file did you edit?
    Post by: Cody on January 30, 2017, 02:09:30 am
    Something else I've noticed when trying to add to forms in various places. If the start and end of the form, essentially the form tag and the closing tag, were moved into their own layer it would be easier to add another layer when adding options to the form.

     It was possible with the post form because its in multiple parts, but to add settings to, for instance, the modify board form, you have to edit the template.
    Title: Re: What file did you edit?
    Post by: Cody on December 07, 2017, 07:06:30 pm
    The boards list class has no way of altering the database query to add or alter information in $context['categories'] for the main board index.  I can use a module to run another query and add information but its information that could have easily been gathered in the original query.