Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: emanuele on January 08, 2012, 09:56:03 AM

Title: Integration Hooks Report
Post by: emanuele on January 08, 2012, 09:56:03 AM
Complete credit for this mod goes to [SiNaN] (to me only the blames for having uploaded it only after several months...sorry everybody)

This mod adds an admin page where all the active hooks are presented.

Starting with version 1.3 it's possible to disable active hooks.
Please note disable hooks will most likely remove functionalities added by mods and in certain cases could break your forum! Do it only if you are absolutely sure of what you are doing
...I know this warning is useless and someone will eventually break it... :P ...well, it's not my fault.

The mod is also available at github: https://github.com/emanuele45/IntegrationHooks

Translations not yet in the package

Version log
Title: Re: Integration Hooks Report
Post by: Norv on January 08, 2012, 12:12:00 PM
Thank you, Emanuele, I think this mod will be useful for admins to know what hooks did mods add and eventually remove those they may not want or need (such as a menu/submenu item they may find to add too much to their menus). As a step towards a true menu editor, that. ;)

Or, if a hooked function is causing problems, the admin interface for hooks may allow to see which it is - unless the problematic function is affecting admin panel itself, of course.

I wonder how can this mod be improved, to be more useful, that is, to respond better to the needs of admins regarding the hooks mods installed on their forums may use?
Title: Re: Integration Hooks Report
Post by: Anthony` on January 08, 2012, 12:24:49 PM
Quote from: Norv on January 08, 2012, 12:12:00 PM
I wonder how can this mod be improved, to be more useful, that is, to respond better to the needs of admins regarding the hooks mods installed on their forums may use?

Enable/disable hooks from being executed? Create hooks? Modify existing hooks using the interface?
Title: Re: Integration Hooks Report
Post by: feline on January 08, 2012, 12:27:09 PM
That mod don't work correct ... it will only find files in the Source folder, but not in a subfolder of the Source folder.
Because may mods don't install all in the Source folder (like SimpleDesk, PortaMx) many active hooks will shown as Missing  :(
Also the Filename which hold the hook function would be interest ...
Title: Re: Integration Hooks Report
Post by: emanuele on January 08, 2012, 02:57:52 PM
Hi feline,

thank you for the report.
See if version 1.1 fixes this issue. :)

If you can confirm I'll remove 1.0 from download.
Title: Re: Integration Hooks Report
Post by: Bugo on January 08, 2012, 03:49:40 PM
Great mod. What about a short description for every hook? Like help hint.

Please add russian translation.
Title: Re: Integration Hooks Report
Post by: feline on January 08, 2012, 04:55:31 PM
Quote from: emanuele on January 08, 2012, 02:57:52 PM
thank you for the report.
See if version 1.1 fixes this issue. :)
Thanks emanuele .. worked  :)
Title: Re: Integration Hooks Report
Post by: live627 on January 08, 2012, 05:03:10 PM
Sweet mod! Bit geeky, though.

QuoteI wonder how can this mod be improved, to be more useful, that is, to respond better to the needs of admins regarding the hooks mods installed on their forums may use?
Use red for missing (error class IIRC) and green for exists (no class for that)
Title: Re: Integration Hooks Report
Post by: [SiNaN] on January 11, 2012, 04:31:02 AM
It feels nostalgic to see this mod again. You may want to get rid of the last two lines of hooks_admin_areas() and hooks_modify_modifications() functions now, as they were meant to be a workaround for this (http://dev.simplemachines.org/mantis/view.php?id=4638) bug. Also, not sure where that uninstall.php file came from but install.php file should take care of uninstalling as well.


Quote from: Project Evolution on January 08, 2012, 12:24:49 PM
Quote from: Norv on January 08, 2012, 12:12:00 PM
I wonder how can this mod be improved, to be more useful, that is, to respond better to the needs of admins regarding the hooks mods installed on their forums may use?

Enable/disable hooks from being executed? Create hooks? Modify existing hooks using the interface?

The next version of the mod was supposed to do all those but I never got around to coding it.

Quote from: feline on January 08, 2012, 12:27:09 PM
That mod don't work correct ... it will only find files in the Source folder, but not in a subfolder of the Source folder.
Because may mods don't install all in the Source folder (like SimpleDesk, PortaMx) many active hooks will shown as Missing  :(
Also the Filename which hold the hook function would be interest ...

The reason why it didn't consider that in the first place was that having a sub-directory in Sources directory is not something that's common.

Quote from: emanuele on January 08, 2012, 02:57:52 PM
Hi feline,

thank you for the report.
See if version 1.1 fixes this issue. :)

If you can confirm I'll remove 1.0 from download.

You may want to change "recoursive" as "recursive" though.

Quote from: live627 on January 08, 2012, 05:03:10 PM
Sweet mod! Bit geeky, though.

QuoteI wonder how can this mod be improved, to be more useful, that is, to respond better to the needs of admins regarding the hooks mods installed on their forums may use?
Use red for missing (error class IIRC) and green for exists (no class for that)

I guess you could say it looks geeky. Still, it turned out to be a good example for the use of generic lists. And yeah, using classes sounds better, if applied for the "Exists" field only.
Title: Re: Integration Hooks Report
Post by: emanuele on January 11, 2012, 10:24:28 AM
Quote from: [SiNaN] on January 11, 2012, 04:31:02 AM
It feels nostalgic to see this mod again. You may want to get rid of the last two lines of hooks_admin_areas() and hooks_modify_modifications() functions now, as they were meant to be a workaround for this (http://dev.simplemachines.org/mantis/view.php?id=4638) bug.
Done thanks! ;)

Quote from: [SiNaN] on January 11, 2012, 04:31:02 AM
Also, not sure where that uninstall.php file came from but install.php file should take care of uninstalling as well.
Simple explanation: I forgot to delete it...

Quote from: [SiNaN] on January 11, 2012, 04:31:02 AM
You may want to change "recoursive" as "recursive" though.
Yups...

Fixed and added Russian translation (thanks Bugo).
Title: Re: Integration Hooks Report
Post by: Arantor on January 11, 2012, 11:11:02 AM
You know, if the install process is just adding hooks, you can do that in package-info.xml directly by using a <code> block with the inline parameter... Doesn't help so much with the install process as a manual install might do, but it's something to consider.
Title: Re: Integration Hooks Report
Post by: Eclipse16V on January 12, 2012, 03:19:58 AM
Thanks for this Mod
Title: Re: Integration Hooks Report
Post by: emanuele on January 18, 2012, 01:09:27 PM
Quote from: Project Evolution on January 08, 2012, 12:24:49 PM
Enable/disable hooks from being executed?
This is done (waiting for a bit of testing :P) along with the possibility to filter the list by hook.

Quote from: Project Evolution on January 08, 2012, 12:24:49 PM
Create hooks? Modify existing hooks using the interface?
Next round.

/me is quite slow as developer... ::)
Title: Re: Integration Hooks Report
Post by: Bugo on January 20, 2012, 11:46:40 PM
I think you need replace <list> with <ul> (in Subs-IntegrationHooks.php)

Remove link doesn't work.

Updated russian translation in attachments.
Title: Re: Integration Hooks Report
Post by: emanuele on January 21, 2012, 05:10:30 AM
Thanks for the report and for the new translation.

File removed in the meantime, will check what the issue is.

Fixed both! (hopefully :P)
Title: Re: Integration Hooks Report
Post by: 4Kstore on February 15, 2012, 11:51:37 PM
is a great and useful mod, I can only help with the spanish translation
regards
Title: Re: Integration Hooks Report
Post by: emanuele on February 16, 2012, 04:15:36 AM
Thanks!
I'll add it to the package in few days!
In the meantime I put a link to your post in the mod's page. :)
Title: Re: Integration Hooks Report
Post by: Adrek on February 16, 2012, 04:58:59 AM
And here is Polish language :)
Title: Re: Integration Hooks Report
Post by: emanuele on February 16, 2012, 05:58:36 AM
Thanks phantomm, link added! :)

/me should probably add the Italian too... :P
Title: Re: Integration Hooks Report
Post by: Adrek on February 16, 2012, 11:56:46 AM
I found this in logs:
/index.php?action=admin;area=modsettings;sa=hooks;a3f732d9de=fbcb6de2f6a87aefb127b7ec0b53b319
8: Undefined index: Subs.php
File: /public_html/Sources/Subs-IntegrationHooks.php
Line: 296


/index.php?action=admin;area=modsettings;sa=hooks;a3f732d9de=fbcb6de2f6a87aefb127b7ec0b53b319
8: Undefined index: Subs-SimpleSpoiler.php
File: /public_html/Sources/Subs-IntegrationHooks.php
Line: 296


Line 296 is:
$current_hook = $temp_data['include'][$hook_status[$hook][$function]['in_file']];
Title: Re: Integration Hooks Report
Post by: emanuele on February 16, 2012, 03:00:49 PM
Thank you for the report and sorry for the mistake...
Apart from the fact it seems I packed (and pushed) the wrong file (leading to wrong icons), the error you were facing was in fact that I didn't consider the possibility that a file doesn't necessarily needs to be loaded through a hook...

Now it should be fixed!
Title: Re: Integration Hooks Report
Post by: FrizzleFried on May 24, 2012, 10:39:26 AM
I install this mod (no errors)... it redirects and I get:

QuoteUnable to load the 'integrationHooks_above' template.

?

EDIT:  Same thing when I attempt to visit that section of the admin again.  Same error in the error logs.

SMF 2.0.2
SimplePortal 2.3.5
Default Curve theme (modified)
Title: Re: Integration Hooks Report
Post by: NanoSector on May 24, 2012, 10:47:21 AM
Quote from: FrizzleFried on May 24, 2012, 10:39:26 AM
I install this mod (no errors)... it redirects and I get:

QuoteUnable to load the 'integrationHooks_above' template.

?

EDIT:  Same thing when I attempt to visit that section of the admin again.  Same error in the error logs.

SMF 2.0.2
SimplePortal 2.3.5
Default Curve theme (modified)

Same here.

Blank SMF 2.0.2 with only this mod installed.
Title: Re: Integration Hooks Report
Post by: emanuele on May 24, 2012, 12:57:08 PM
Luckily you are the only two who downloaded it... :P

Fixed.

I removed the template file because it was useless and I forgot to remove it's call in the source file...
Title: Re: Integration Hooks Report
Post by: NanoSector on May 24, 2012, 12:59:51 PM
Thanks, working now though it's missing images.
Title: Re: Integration Hooks Report
Post by: emanuele on May 24, 2012, 02:09:53 PM
It was already ready for SMF 2.1!! :P
Title: Re: Integration Hooks Report
Post by: NanoSector on May 24, 2012, 02:11:09 PM
Quote from: emanuele on May 24, 2012, 02:09:53 PM
It was already ready for SMF 2.1!! :P
lmao, awesome. Though not for 2.0.2 it seems :P
Title: Re: Integration Hooks Report
Post by: FrizzleFried on May 24, 2012, 04:14:15 PM
Do I just install over the old version?  When I attempt to uninstall the old version I get:

QuoteThis package cannot be uninstalled, because there is no uninstaller!

Please contact the mod author for more information.
Title: Re: Integration Hooks Report
Post by: emanuele on May 24, 2012, 06:42:01 PM
What version do you have?
Title: Re: Integration Hooks Report
Post by: FrizzleFried on May 24, 2012, 08:02:21 PM
Quote from: emanuele on May 24, 2012, 06:42:01 PM
What version do you have?

The first one you posted earlier today... :)  I was downloader #2 (Yoshi was the other).

:)

Feel free to shoot over the tiny edit if you'd like... we can go that route if necessary?
Title: Re: Integration Hooks Report
Post by: FrizzleFried on May 25, 2012, 01:46:40 PM
UPDATE: the uninstaller only didn't work via the INSTALLED PACKAGES list... when I went to the package manager itself it uninstalled without a hitch and I re-installed the newer updated package which works as is intended.  Thanks!
Title: Re: Integration Hooks Report
Post by: Sudhakar Arjunan on July 23, 2012, 01:20:50 PM
Hi emanuele, could you be more specific about this hooks mod.
Title: Re: Integration Hooks Report
Post by: Arantor on July 23, 2012, 02:03:14 PM
It's a mod that lists all the hooks that other mods use. More useful for debugging and expert use than general purpose use.

If you don't know what a hook is, odds are you do not need this mod.
Title: Re: Integration Hooks Report
Post by: Sudhakar Arjunan on July 24, 2012, 07:55:12 AM
Thank you arantor.

I will first learn about hooks. Then use the mods.  8)
Title: Re: Integration Hooks Report
Post by: Arantor on July 24, 2012, 10:15:33 AM
Are you writing mods with hooks? If not, you almost certainly do not need this mod.
Title: Re: Integration Hooks Report
Post by: Bugo on August 26, 2012, 09:19:57 AM
Updated russian translation, for 1.3.
Title: Re: Integration Hooks Report
Post by: vbgamer45 on February 15, 2013, 11:17:15 AM
Great mod wish I knew about this sooner for working with mods with hooks.
Title: Re: Integration Hooks Report
Post by: Costa on February 16, 2013, 07:13:55 AM
pt_PT and pt_BR translations attached :) Thanks for the mod.
Title: Re: Integration Hooks Report
Post by: acsieben on April 23, 2013, 05:33:34 PM
Hi,

This appears cropped using the admin menu in the sidebar, instead of the horizontal menu.
Also, it doesn't seem to detect "SAFacebookhooks", from the SA Facebook mod.

Cheers
Title: Re: Integration Hooks Report
Post by: emanuele on April 24, 2013, 05:06:18 AM
Quote from: acseven on April 23, 2013, 05:33:34 PM
This appears cropped using the admin menu in the sidebar, instead of the horizontal menu.
I'm not surprised.

Quote from: acseven on April 23, 2013, 05:33:34 PM
Also, it doesn't seem to detect "SAFacebookhooks", from the SA Facebook mod.
It may be the mod is using classes, I didn't consider that option at the time...
Title: Re: Integration Hooks Report
Post by: acsieben on April 24, 2013, 06:20:56 AM
Quote from: emanuele on April 24, 2013, 05:06:18 AM
Quote from: acseven on April 23, 2013, 05:33:34 PM
This appears cropped using the admin menu in the sidebar, instead of the horizontal menu.
I'm not surprised.

It was just a heads up in case you weren't aware - with the horizontal bar version you can always see the data, as the table overflows the theme's boundaries. With the sidebar it just gets cropped.
Title: Re: Integration Hooks Report
Post by: emanuele on April 26, 2013, 05:35:33 AM
Thanks. :)
That's probably a common behaviour of several pages I think (since the mod uses a standard template).
Title: Re: Integration Hooks Report
Post by: live627 on September 21, 2013, 11:08:05 PM

Warning: fread(): Length parameter must be greater than 0 in I:\www\smf_dev\Sources\Subs-IntegrationHooks.php on line 221


And it's loading... a zero-byte file.  How droll.
Title: Re: Integration Hooks Report
Post by: NanoSector on September 22, 2013, 04:29:29 PM
Maybe giving some more information helps... Where did you encounter that issue? Do you have mods installed which may cause that issue?
Title: Re: Integration Hooks Report
Post by: live627 on September 22, 2013, 05:46:04 PM
Are you trolling me? I honestly don't see why more info is needed...
Title: Re: Integration Hooks Report
Post by: NanoSector on September 23, 2013, 01:54:18 AM
Good luck fixing the mod/your install then.
Title: Re: Integration Hooks Report
Post by: emanuele on September 23, 2013, 04:05:26 AM
Quote from: live627 on September 21, 2013, 11:08:05 PM
Warning: fread(): Length parameter must be greater than 0 in I:\www\smf_dev\Sources\Subs-IntegrationHooks.php on line 221


And it's loading... a zero-byte file.  How droll.
Curious, are you able to find which file is it?
And if it actually contains anything?
Title: Re: Integration Hooks Report
Post by: live627 on September 24, 2013, 09:38:20 AM
Certainly a zero-byte file would have nothing in it. I thought you knew that .
Title: Re: Integration Hooks Report
Post by: emanuele on September 24, 2013, 04:42:29 PM
/me has never seen a zero-byte file. :P
Title: Re: Integration Hooks Report
Post by: Arantor on September 24, 2013, 06:04:40 PM
Sure you have though you probably never noticed it. In Windows, right click and create a new text file - boom, instant zero byte file.

In this mod? Not so much. Could well have been a bad install from SMF's slightly less than reliable mod installation.
Title: Re: Integration Hooks Report
Post by: emanuele on September 25, 2013, 04:19:09 AM
/me points Arantor to the :P
Title: Re: Integration Hooks Report
Post by: Oceander on January 30, 2016, 09:05:42 AM
Nice mod.  Thanks for it.  I'm trying to figure out how integration hooks work and this will make it so much easier.
Title: Re: Integration Hooks Report
Post by: Oceander on January 30, 2016, 03:40:41 PM
I think I may have found a little typo in the install.php file for version 1.5.3.  On line 100 of the file, in the template_install_script function, the first line in the first echo command has an extra double-quote mark at the end.

The line in question reads like this:
<div class="tborder login"">

I am guessing that there should only be one double-quote mark, not two, after the class name.
Title: Re: Integration Hooks Report
Post by: Kindred on January 30, 2016, 10:04:58 PM
Probably an error...  But the author of this mod has not been around for a while
Title: Re: Integration Hooks Report
Post by: aegersz on June 14, 2021, 04:44:03 AM
bug fix on line 327 in .Sources/Subs-IntegrationHooks.php (remove the extra $ in $sort_options so that it looks like this:
                                $sort[] = $sort_options[0];
Title: Re: Integration Hooks Report
Post by: aegersz on June 14, 2021, 06:18:34 AM
Why does it tell me that some hooks are not found yet they are in use ?
Title: Re: Integration Hooks Report
Post by: aegersz on June 14, 2021, 10:45:00 AM
whoops, ignore that - here is the correct sortable bug fix:

find:
                                $sort[] = $$sort_options[0];

replace:
//                              $sort[] = $$sort_options[0];
                                if  ($sort_options[0] == "hook")
                                        $sort[] = $hook;
                                if  ($sort_options[0] == "function")
                                        $sort[] = $function;
                                if  ($sort_options[0] == "file_name")
                                        $sort[] = $file_name;
                                if  ($sort_options[0] == "status")
                                        $sort[] = $status;