News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Integration hooks for 2.1

Started by Night09, December 22, 2014, 07:25:06 PM

Previous topic - Next topic

Hj Ahmad Rasyid Hj Ismail

And don't forget, you have several sub actions compared to mine which is just one. So define each of them as well.

Mstcool


Night09

Thanks for the code block Arantor, I made a few minor changes and some changes to the main settings template and now have the menu fully working.

Ive got two Hooks to make it work, an integrate_pre_include and an integrate_admin_areas.

I can clean it all up now and reinstall 2.1 fresh and test it all works as intended before moving forward. :)


butchs

Quote from: Antes on December 23, 2014, 08:19:56 AM
True, but you are missing a point that Hook related tutorials are really lacking. So you can't actually expect people to learn things on wild-guesses.

Quote from: Arantor on December 23, 2014, 09:49:26 AM
I continue to be amazed at the lack of understanding of hooks.

In the past I had to work things out the hard way just so I would be among the first to release a mod for the new version of SMF.  I think I will sit back and wait for the dust to settle this time around. 
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

Hj Ahmad Rasyid Hj Ismail

Quote from: Night09 on December 28, 2014, 07:03:18 PM
Ive got two Hooks to make it work, an integrate_pre_include and an integrate_admin_areas.
I supposed integrate_pre_include would include the file in all page load. If what you need with the file is just an integration with admin mod settings, then integrate_admin_include for the said file would do just fine.

Night09

Quote from: ahrasis on December 29, 2014, 11:59:20 AM
Quote from: Night09 on December 28, 2014, 07:03:18 PM
Ive got two Hooks to make it work, an integrate_pre_include and an integrate_admin_areas.
I supposed integrate_pre_include would include the file in all page load. If what you need with the file is just an integration with admin mod settings, then integrate_admin_include for the said file would do just fine.

Ive switched the hook and it does work correctly so will use that instead of the pre to reduce loads. TBH I hadnt thought of using that hook.

Arantor

*whistle*

Quote from: Arantor on December 24, 2014, 11:09:02 AM
If you're using that file only in admin, might I suggest using integrate_admin_include instead of integrate_pre_include; no need to load the settings code every single page load.
Holder of controversial views, all of which my own.


Night09

Quote from: Arantor on December 30, 2014, 11:43:01 AM
*whistle*

Quote from: Arantor on December 24, 2014, 11:09:02 AM
If you're using that file only in admin, might I suggest using integrate_admin_include instead of integrate_pre_include; no need to load the settings code every single page load.

Im going to blame it on the 'Glen Moray' the night I got it working. I do hold my hand up though and realise you did tell me that! ;)

Arantor

Holder of controversial views, all of which my own.


Night09

Just for reference the admin menu code installs into 2.0.9 with no issues.

Advertisement: