Advertisement:

Author Topic: Integration Hooks Report  (Read 29162 times)

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Integration Hooks Report
« 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
  • 1.0: initial release (thanks [SiNaN])
  • 1.1: added recursive scan of $sourcedir (see Feline's comment)
  • 1.2: fixed a couple of issues (thanks [SiNaN]) and added Russian translation (thanks Bugo)
  • 1.3: added inactivation of hooks and filter by hook - fixed issues reported by Bugo and updated Russian translation (thanks Bugo)
  • 1.4: fixed undefined index error reported by phantomm; added Spanish Latin (thanks 4Kstore) and Polish translations (thanks phantomm); fixed another error (wrong icon for delete)
  • 1.5: fixed the enabling/disabling and removal of hooks that were broken...
  • 1.5.1: restored the filter, added Italian translation, ignoring backup files, other minor fixes
  • 1.5.2: fixed hooks to be php 5.4 friendly; fixed (again) hooks filter function that was breaking the disabling of hooks; update Russian translation (thanks Bugo)
  • 1.5.3: added Dutch translation (by Yoshi2889)
« Last Edit: February 13, 2013, 03:50:12 PM by Yoshi2889 »


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Norv

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 18,313
  • Blue Wolf
Re: Integration Hooks Report
« Reply #1 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?
To-do lists are for deferral. The more things you write down the later they're done… until you have 100s of lists of things you don't do.
File a security report | Developers' Blog | Bug Tracker

Also known as Norv on D* | Norv N. on G+ | Norv on Github

Offline Anthony`

  • Sophist Member
  • *****
  • Posts: 1,347
  • Gender: Male
  • Formerly Project Evolution
    • AnthonyCalandra on GitHub
Re: Integration Hooks Report
« Reply #2 on: January 08, 2012, 12:24:49 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?

Offline feline

  • SMF Hero
  • ******
  • Posts: 1,638
  • Gender: Female
Re: Integration Hooks Report
« Reply #3 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 ...
« Last Edit: January 08, 2012, 12:30:24 PM by feline »

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: Integration Hooks Report
« Reply #4 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.


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Bugo

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,580
  • Gender: Male
    • dragomano on GitHub
    • @dragomano on Twitter
    • My patreon page
Re: Integration Hooks Report
« Reply #5 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.

Offline feline

  • SMF Hero
  • ******
  • Posts: 1,638
  • Gender: Female
Re: Integration Hooks Report
« Reply #6 on: January 08, 2012, 04:55:31 PM »
thank you for the report.
See if version 1.1 fixes this issue. :)
Thanks emanuele .. worked  :)

Offline live627

  • Developer
  • SMF Hero
  • *
  • Posts: 5,729
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
Re: Integration Hooks Report
« Reply #7 on: January 08, 2012, 05:03:10 PM »
Sweet mod! Bit geeky, though.

Quote
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?
Use red for missing (error class IIRC) and green for exists (no class for that)

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,526
  • Young and Foolish
    • SimplePortal
Re: Integration Hooks Report
« Reply #8 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 bug. Also, not sure where that uninstall.php file came from but install.php file should take care of uninstalling as well.


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.

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.

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.

Sweet mod! Bit geeky, though.

Quote
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?
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.
Former SMF Core Developer | My Mods | SimplePortal

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: Integration Hooks Report
« Reply #9 on: January 11, 2012, 10:24:28 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 bug.
Done thanks! ;)

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

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

Fixed and added Russian translation (thanks Bugo).


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 72,614
    • StoryBB/StoryBB on GitHub
Re: Integration Hooks Report
« Reply #10 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.

Offline Eclipse16V

  • Sophist Member
  • *****
  • Posts: 1,070
  • Gender: Male
  • Tornado Map
    • Eclipse16V on Facebook
    • @Eclipse16V on Twitter
    • Tornado Map
Re: Integration Hooks Report
« Reply #11 on: January 12, 2012, 03:19:58 AM »
Thanks for this Mod
I worked with:
SMF 2 in German

My Shop:
Das Lieschen

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: Integration Hooks Report
« Reply #12 on: January 18, 2012, 01:09:27 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.

Create hooks? Modify existing hooks using the interface?
Next round.

* emanuele is quite slow as developer... ::)


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Bugo

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,580
  • Gender: Male
    • dragomano on GitHub
    • @dragomano on Twitter
    • My patreon page
Re: Integration Hooks Report
« Reply #13 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.

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: Integration Hooks Report
« Reply #14 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)
« Last Edit: January 21, 2012, 08:11:56 AM by emanuele »


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline 4Kstore

  • SMF Hero
  • ******
  • Posts: 4,323
  • Gender: Male
    • agustintari on Facebook
    • @agustintarifa on Twitter
    • SSIMPLE TEAM PAGE
Re: Integration Hooks Report
« Reply #15 on: February 15, 2012, 11:51:37 PM »
is a great and useful mod, I can only help with the spanish translation
regards
¡¡NEW MOD: Sparkles User Names!!!

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: Integration Hooks Report
« Reply #16 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. :)


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Adrek

  • Sophist Member
  • *****
  • Posts: 1,081
  • Gender: Male
    • pages/smfpl/171860759503032 on Facebook
    • Adrek.pl
Re: Integration Hooks Report
« Reply #17 on: February 16, 2012, 04:58:59 AM »
And here is Polish language :)
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: Integration Hooks Report
« Reply #18 on: February 16, 2012, 05:58:36 AM »
Thanks phantomm, link added! :)

* emanuele should probably add the Italian too... :P


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Adrek

  • Sophist Member
  • *****
  • Posts: 1,081
  • Gender: Male
    • pages/smfpl/171860759503032 on Facebook
    • Adrek.pl
Re: Integration Hooks Report
« Reply #19 on: February 16, 2012, 11:56:46 AM »
I found this in logs:
Code: [Select]
/index.php?action=admin;area=modsettings;sa=hooks;a3f732d9de=fbcb6de2f6a87aefb127b7ec0b53b319
8: Undefined index: Subs.php
File: /public_html/Sources/Subs-IntegrationHooks.php
Line: 296

Code: [Select]
/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:
Code: [Select]
$current_hook = $temp_data['include'][$hook_status[$hook][$function]['in_file']];
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one