News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Forum Event Hooks / API

Started by pavsid, March 20, 2015, 11:45:40 AM

Previous topic - Next topic

pavsid

Hi all, I posted this in another forum but might be best here (original post: http://www.simplemachines.org/community/index.php?topic=534893.0)

...

Hi all, new here and comparing forum/discussion board software to ensure it will meet our requirements.

We want to create a link between the forum and our existing member base, rewarding users for engaging in the forum, and displaying their achievements in the forum, next to their avatar/profile summary.


I guess for this we need to know what hooks / APIs are available, so we know when someone has performed an action in the forum. Here are the features we will eventually need, I understand that some might be custom developments which we will have to make, but need to check they are all possible.

- Link existing members with forum users, and create a seamless login/registration between the two
- Create a link between their username & avatar on the website, and their username & avatar on the forum, so if either is updated it will be reflected on the other.
- Track when someone has created a new post (so we can reward them with points)
- Track when someone replies to a post
- Track when someone upvotes a reply/post (I understand there is a mod to upvote/downvote posts?)
- Modify a user's avatar/profile summary which appears next to their post, with points/badges etc taken from our existing database.

If there is already any API documentation please post the link, as I couldn't find it anywhere.

Many thanks in advance.

margarett

Hi and welcome to sm.org ;)

I removed your other post, no need to duplicate content ;)

As for your questions: a seamless integration is a tricky thing to achieve.
An overview of the integration possibilities can be found here
http://wiki.simplemachines.org/smf/Category:Integrating_SMF

Then each requirement you have requires some "manual labor" at your application's side, a little bit in SMF as well.

Quote- Link existing members with forum users, and create a seamless login/registration between the two
That's more or less easy to do, depending on how you look at the problem...
If you use SMF's login/registration "engine", you just use it and integrate the user details (that you get from global $user_info or $context) in your application.
If you use your own login/registration "engine", then you should probably look into our API and the functions it offers (login/logout/register, etc)

Quote- Create a link between their username & avatar on the website, and their username & avatar on the forum, so if either is updated it will be reflected on the other
Again, it depends on who holds the registrations.

Quote- Track when someone has created a new post (so we can reward them with points)
- Track when someone replies to a post
- Track when someone upvotes a reply/post (I understand there is a mod to upvote/downvote posts?)
Tricky... Best chance is to probably tweak Sources/Post.php (I think there is no hook for this) and edit some database table with this record. The up/downvote of the post should follow the same principle, only in a different file ;)

Quote- Modify a user's avatar/profile summary which appears next to their post, with points/badges etc taken from our existing database.
This should probably be handled in Sources/Load.php (loadMemberContext?) or in a hook, which updates the $user_info global array with some information from your database. Probably your easiest requirement :P
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

pavsid

Hi margarett, thanks so much for your reply - that's a great help.

You said "Again, it depends on who holds the registrations." and that we can use our own login/registration engine. If we go this way, then what about the link to update a forum user's profile? Would we just point that to our own application instead of the forum's?

Also, do you have a link to the official API, I can't seem to find it anywhere.

Actually, one more thing - these captcha's are a pain! I hope we can disable these for signed-in users and just have one at registration??


Kindred

http://wiki.simplemachines.org/smf/Category:Integrating_SMF


as for the captcha....   I actually recommend that you don't use it at all, since it does not stop spambots, really...
we only use it here because it is the only method we CAN use on 2.0.x with a multi-language, international forum.

2.1 will be better, since we can use multi-language questions
Слaва
Украинi

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

pavsid

Quote from: Kindred on March 21, 2015, 09:54:52 AM
http://wiki.simplemachines.org/smf/Category:Integrating_SMF


as for the captcha....   I actually recommend that you don't use it at all, since it does not stop spambots, really...
we only use it here because it is the only method we CAN use on 2.0.x with a multi-language, international forum.

2.1 will be better, since we can use multi-language questions

Thanks, I'm guessing that if we integrate our own registration form then we can but our own captcha on there i.e. Google's re-captcha.

Any idea when 2.1 will be released for production? I'm just thinking that if we are going to make loads of changes to the SMF code for our purposes then will we have to do them all again once 2.1 is released?

margarett

There is no scheduled data. We are working to get the second beta out shortly but we can't predict any time.
2.0 will be supported for a long time, so you should be fine with it ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Kindred

If you are making changes to smf code, then yes... those would have to be redone.  However,  the point of using hooks or the api is ti avoid altering core smf code.

As for a date... it will be released when it is ready... that is the only answer we will ever give when asked for dates or even timeframes. Sorry.
Слaва
Украинi

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

pavsid

Thanks all, I guess it's time to get integrating...!

live627

Sticking with 2.0.x is most certainly a safe bet as it will be supported for a very long time.

Advertisement: