Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Hooks System v1.0 - No more modifying core files!

Asked Modified Viewed 12,483 times
F
firebun
F
  • Junior Member, joined since
  • Contributed 13 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions
asked
Junior Member

Hi
Today I would like to release my Hook System but I wondering where I should put it?

It is not an infusion.
It is one file and a subdirectory with example files how to use it.

hooks.php - the main hook system

folder: hooks/

files in the hooks folder are for customizing your hooks.

This hooks system lets you create modifications and infusions without having to modify any core phpfusion files (mostly).

To make this system work you only need to add one line to maincore.php at the bottom and you are done and can start building your own hooks.

It is a very powerful system and it allows you to create actions before and after events by a user. For example you can have a hook that triggers an event after a user logs into your site. Maybe you want to send a message saying thanks for login or something. The sky is the limit.

Let me know where I should post this "addon".

Why build this hooks system?

I am working on a very large infusion and I did not want to modify core files.
My infusion is called "Members Rewards System". It is an all-in-one members rewards system. I've got large chunks of the code completed and working on finishing other pieces. Read the list of features and if you see anything that should be added or explained by all means let me know.

Here are some of the built in features and functionalities.

Hooks, Rules, Points, XP, Awards, Ranks, Pokes, Titles, Items/Gifts, Item Shop, Banking, Lotto, Robery, Random Adventure

Hooks: (the hook system I mentioned above)

Rules: Conditions that occur when specific events match a rule. Rules are used to trigger events.

Points: The points system. Just handles points. Making a new record for new users as well as giving and taking points based on the input you pass it.

XP: This tracks the lifetime total points (both positive and negative) of a user. Basically it is a transaction record of each time a point was given or taken as well as the timestamp and type of point (negative/positive) This information can be used in a fun way by using hooks and rules.

Awards: The awards consists of little 16pixel images that serve as awards given to users in an automated fashion for triggering certain events as defined by a rule.
It handles giving, taking awards based on the settings you choose in your rules.

Ranks: The rank adds ranks which serve as a rank of your standing in the digital community of your website. So for example, if you are very helpful or post usefull replies to topics, you perhaps trigger a rule that could for example occur when you receive 50 votes or 50 thank yous or 300 replies in a topic. In the rule that is triggered it can add or subtract your rank. You can have multiple ranks. They consist of text and image and you can choose to show one or the other.

Pokes : Adds pokes. Pokes are member to member micro messages. A member may choose to send a poke in exchange for a predetermined amount of points. Pokes may be set to free (0 points), this is defined in the settings. Pokes can be text or image (32x32 currently). You can have different types of pokes. War pokes, fun pokes, joke pokes, happy pokes, etc.

Titles: Titles adds titles like in guild wars. I stole the idea from there. Basically for performing a collection of events as defined in a rule you increase your title in relation to that event. For example you could have a title related to your forum called "Form Topics Posts" and you make a series of progressive titles for it and then you define a rule for each title. There is a setting to allow users to select one title to display in their profile across the site.
Forum Topic Posts:
- Newbie: Rule -> has between 0 and 10 posts
- New Member: Rule -> has between 11 and 50 posts
- Member: Rule -> has between 51 and 2000 posts
- Old Timer: Rule -> has between 2001 and 10000 posts
- Immortal: Rule -> has more than 10001 posts

Loves Writting Articles:
- Apprentice: Rule -> has less than 20 article posts with less than 5 possitive votes
- Writter: Rule -> has 50 article posts with more than 100 positive votes and 10 comments
- Master: Rule -> has 100 article posts and 10 news posts and 5 links all with at least 10 postitive votes and 3 comments

You build your rules. Its easy.


Items : Alone this doesn't do much visually but with the Item shop it is very handy. Items come in several flavors. Images, permissions, events and style tweaks. Items can be limited edition. They can trigger events, for example you could have an item that let the user change the color of their name.

Item Shop plugin: handles all inventory and sales. Add , edit or remove items from the shop. You can set the prices and rule for each item added. For example if you only wanted to show items of certain kind to a member with the Title of Newbie or a member who had a certain Award, you could.

Banking : If enabled, members can earn interest on points in your bank. THey can signup with the bank (you can define a point fee - weekly/monthly/etc). With the bank account they can deposit and withdraw points. You can configure all interest, fees, the name of the bank, etc.

Lotto : You configure the lotto frequency, the jackpot method to use and ticket point prices. Simple.

Robbery : You can allow members to rob other members. Configure the % of points taken in a successful robbery, the success rate and points lost for failure.

Random Adventure : Random one line strings of text with yes or no answers. Example: Before you lies a vast desert. Do you cross it? Yes/No. Randomly the script itself chooses the correct answer. If the user matches the script random answer then they user gets a configured amount points or triggers a rule. ANother example: You come across a room full of zombies. Kill them with your chainsaw? yes/no - a user picks yes and the script picked yes so this triggers a rule that gives the user a rare item from the item database (not something sold in the item shop).


And more.

The Member Reward System is still being worked and I am not sure when it will be released but before official release I will need beta tester, if your interested let me know.

:)
0 replies

21 posts

J
JoiNNN
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums
answered
Veteran Member

OK, this one seems to make use of replace_in_output(). replace_in_output() is the only thing we have close to hooks, but that's not how we should approach this since replace_in_output is only meant for simply replacing/injecting HTML in the output.
0 replies

Category Forum

General Discussion

Labels

None yet

Statistics

  • Views 0 views
  • Posts 21 posts
  • Votes 0 votes
  • Topic users 9 members

9 participants

F
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
C
C
Best regards,
Christian Damsgaard Jørgensen.
  • Member, joined since
  • Contributed 125 posts on the community forums.
  • Started 4 threads in the forums
F
F
Falcon 10
  • Member, joined since
  • Contributed 128 posts on the community forums.
  • Started 5 threads in the forums
K
K
Kot 10
  • Junior Member, joined since
  • Contributed 32 posts on the community forums.
  • Started 11 threads in the forums
P
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
G
G
Ex Senior Dev.
  • Member, joined since
  • Contributed 131 posts on the community forums.
J
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums
T
T
Tyler 10
Helping, would be pointing you in the right direction, not doing it all for you.
  • Member, joined since
  • Contributed 198 posts on the community forums.
  • Started 3 threads in the forums
F
F
  • Junior Member, joined since
  • Contributed 13 posts on the community forums.
  • Started 3 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet