Nov 21, 2019, 12:52 AM

News:

Backup those files BEFORE manually editing them


QUICK NEWS

{NEW} - A new tutorial for Github is ready for your veiwing in the articles section.

{OLD} -New boards have been introduced. Stop on in and check it out.

Video of the week


Internal Links

SMF Sites

Quick Info

Converting mod to use hooks

Started by lurkalot, Aug 03, 2019, 06:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lurkalot

Is there anyone here familiar with using hooks in both SMF 2.0.15, and 2.1?  I'm wanting if possible to convert a very simple mod to use hooks instead of making file edits, and require some guidance if anyone is willing to hold my hand and walk me through it please.


Bigguy

I wish I knew more about them myself. If I could help I would but I would think someone will be along with ideas soon. ;)

lurkalot

Thanks Bigguy.  It's not a big issue, but I'd like to learn, and someone showing me how to do this on a very simple mod which only makes about two small file edits atm, I might actually be able to take it in. 

I have looked at other mods but I think they have more hooks, and just confuse the heck out of me. Start small is my theory.  To be honest it might not even be possible to use hooks for this, I've no idea.  :-[   

Bigguy

Check out the slide tab mod. It uses hooks but only a few. It may give you some ideas.

lurkalot

Thanks did just that. ;)  Have to say it's not clicking with me yet. lol.. :-[ 

Bigguy

Me either and I have had that mod for awhile, lol. From what I understand you put the meat and potatoes of the mod in a file:

meatpotatoes.php

and than use hooks to call the file....somehow.....I think.

Skhilled

I'm officially lost too! LOL I took a look at the SMF docs for hooks to see if I could make heads or tails of it cause I've always been curious on how that works:

https://wiki.simplemachines.org/smf/Integration_hooks

Nope, it just did my head in. LMAO I think I need a better understanding of PHP coding, etc. first as well as how SMF is coded to understand it better.

Bigguy


lurkalot

Thanks.  Tino just sent me a modified version of my mod,  he has converted it to use hooks for 2.1 for me.  So now I have the perfect thing to compare where I was going wrong. 

I have a lot to learn from the looks of it.

Bigguy

I think we all do. Which is not a bad thing at all. :)

beast




   If ya got any questions. Don't be afraid to ask.  ;D  :D  ;) I can say  :dontknow  with the best of them  ;D
thanks Guest for reading my post

Skhilled


lurkalot

Quote from: Skhilled on Aug 04, 2019, 03:44 PMLook under my avy...

lol..  Very true.  Though I do tend to learn something new every day, there's some things that just won't go in, no matter how hard I try.  ;)

Skhilled

I hear ya! LOL You just need them explained in a way that YOU can understand. Everyone see things and understands things differently. ;)

lurkalot

Quote from: Skhilled on Aug 05, 2019, 09:23 AMI hear ya! LOL You just need them explained in a way that YOU can understand. Everyone see things and understands things differently. ;)

Absolutely spot on there.  :rgton