• Welcome to Simple Machines Community Forum. Please login or sign up.

Integration Hooks Report

Started by emanuele, January 08, 2012, 09:56:03 AM

Previous topic - Next topic

emanuele

January 08, 2012, 09:56:03 AM Last Edit: February 13, 2013, 03:50:12 PM by Yoshi2889
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)


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.

Norv

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

Anthony`

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?

feline

January 08, 2012, 12:27:09 PM #3 Last Edit: January 08, 2012, 12:30:24 PM by feline
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 ...

emanuele

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.

Bugo

Great mod. What about a short description for every hook? Like help hint.

Please add russian translation.

feline

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

live627

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)

[SiNaN]

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.


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

emanuele

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


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.

Arantor

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.
No good deed goes unpunished
All helpful urges should be circumvented

Eclipse16V

I worked with:
SMF 2 in German

Shop:
SID Giessen

emanuele

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.

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

Bugo

I think you need replace <list> with <ul> (in Subs-IntegrationHooks.php)

Remove link doesn't work.

Updated russian translation in attachments.

emanuele

January 21, 2012, 05:10:30 AM #14 Last Edit: January 21, 2012, 08:11:56 AM by emanuele
Thanks for the report and for the new translation.

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

Fixed both! (hopefully :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.

4Kstore

is a great and useful mod, I can only help with the spanish translation
regards

¡¡NEW MOD: Sparkles User Names!!!

emanuele

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.

Adrek

Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

emanuele

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.

Adrek

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']];
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

emanuele

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!


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.

FrizzleFried

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)

NanoSector

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.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

emanuele

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


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.

NanoSector

Thanks, working now though it's missing images.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

emanuele

It was already ready for SMF 2.1!! :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.

NanoSector

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
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

FrizzleFried

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.

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.

FrizzleFried

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?

FrizzleFried

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!

Sudhakar Arjunan

Hi emanuele, could you be more specific about this hooks mod.
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Arantor

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.
No good deed goes unpunished
All helpful urges should be circumvented

Sudhakar Arjunan

Thank you arantor.

I will first learn about hooks. Then use the mods.  8)
Working on New Mods & Themes for SMF... Will update soon... My Blog page
My Smf forum : Discuss ITAcumens :: My SMF Forum

Arantor

Are you writing mods with hooks? If not, you almost certainly do not need this mod.
No good deed goes unpunished
All helpful urges should be circumvented

Bugo

Updated russian translation, for 1.3.

vbgamer45

Great mod wish I knew about this sooner for working with mods with hooks.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Costa

pt_PT and pt_BR translations attached :) Thanks for the mod.
Hugo Costa
Todas as MP's a pedir ajuda são sujeitas a radioactividade, microondas, queimadas e atiradas borda fora.

"At least someone appreciates the fact that I am doing and not thinking..."
"Laziness is counter-revolutionary."

acsieben

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

emanuele

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


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.

acsieben

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.

emanuele

Thanks. :)
That's probably a common behaviour of several pages I think (since the mod uses a standard template).


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.

live627


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.

NanoSector

Maybe giving some more information helps... Where did you encounter that issue? Do you have mods installed which may cause that issue?
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

live627

Are you trolling me? I honestly don't see why more info is needed...

NanoSector

Good luck fixing the mod/your install then.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

emanuele

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?


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.

live627

Certainly a zero-byte file would have nothing in it. I thought you knew that .

emanuele

* emanuele has never seen a zero-byte file. :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.

Arantor

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.
No good deed goes unpunished
All helpful urges should be circumvented

emanuele

* emanuele points Arantor to the :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.

Oceander

Nice mod.  Thanks for it.  I'm trying to figure out how integration hooks work and this will make it so much easier.

Oceander

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.

Kindred

Probably an error...  But the author of this mod has not been around for a while
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

aegersz

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];
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

Why does it tell me that some hooks are not found yet they are in use ?
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

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;


The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Advertisement: