XF 1.0 Creating a Simple Modification

By exposing code events and allowing listeners to attach to them, XenForo makes it easy to alter its default functionality with simple callback classes.

The API for doing this is well-defined and documented, so modifications made in this way stand a very good chance of remaining backward compatible through future version updates.

This video shows me creating a simple add-on that allows us to see how an existing thread would look with over a thousand pages.

To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.

As usual, it's a large, HD video, so I suggest you view it at its original size by clicking the full-screen gadget in the bottom-right corner of the video.

Edit: If for whatever reason you can't view the video here, view it directly on Vimeo (but please leave comments here, not there).
 
WoW that looked fairly easy to program with :D Hopefully there will be some more "turotirals" like that in the future
 
Kier, regarding modifications and the xF framework, would it be correct to assume that modifications would all fall into the MVC rules, and that there'd be a file required for the model, view, and controller, or is the xF framework not that strict? Just curious.

And is there a standard name for these modifications, such as mods, plug-ins, hacks, modules, etc?
 
We use "add-on" to refer to the container that changes the behavior. But modifications are probably a good alternative term as well.

If you are creating new pages, you'll generally need a new controller. Whether or not you need a model (or a view) comes down to whether you can use the code we've already written. A view file is only required if you need to do processing that is too complex for a template.
 
Add-on is a bit cumbersome imo.
With vB there was always confusion with people as to what was a plugin and what was a mod.
Both words are used interchangeably by the majority of people.
I can understand why add-on makes sense, but people are lazy and will fail to reach for the hyphen when typing out the word. Or maybe im just the lazy one :D
 
In vB, the official terms were plugin (a code snippet that attached to a code hook) and product (a collection of plugins together with templates, phrases, options etc.).

I don't really care if people use add-on or addon or plugin or modification, provided that we standardise on 'listener' for the kind of code i added in the example video here.
 
I used to code a long time ago, but know nothing about coding for internet use. Any way of describing what a listener is to someone like me?
 
I used to code a long time ago, but know nothing about coding for internet use. Any way of describing what a listener is to someone like me?
It's discussed in the video, but essentially a listener is a piece of code that is executed when a particular event happens. It listens for the event to happen, then executes.
 
Got it.

EventA happens, and if there has been code/addon written to listen for EventA, the code will receive that information.

Like event driven interrupt service routines, where a function could be called which is in the addon code... and that is probably the terminology you are trying to avoid.

edit: this is from the first post
"By exposing code events and allowing listeners to attach to them"
 
You've completely lost me... could you explain what you mean please? :confused:
Sorry for the confusion... *I should never post after midnight.*
Discussions such as the following, though accurate I'm sure and are another cool feature, are greek to me:

(Kier: ) essentially a listener is a piece of code that is executed when a particular event happens. It listens for the event to happen, then executes.
(and Abomination's: ) EventA happens, and if there has been code/addon written to listen for EventA, the code will receive that information. Like event driven interrupt service routines, where a function could be called which is in the addon code...

My comment was meant to be a compliment but... as Rosanne Rosannadanna would say: Neverrr Minnnnd!
 
Top Bottom