• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.0 Creating a Simple Modification

Kier

XenForo Developer
Staff member
#1
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.


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

Nice ... the past, present and future is planned in the same code. :)
 

Cezz

Well-known member
#9
Very nice plugin system I like it...

As for the fon't size decreasing on the navigation so more numbers will fit this is worrying, when we get to forums that have 20k or ever 100k pages of threads how small are those numbers going to look?
 

Been Told

Well-known member
#10
Really impressed. I could actually follow this tutorial and I'm having a strong suspicion, that I will actually be able to create XenForo addons myself! That is what I've really really been hoping for.
The promise of good documentation is also something that really makes me feel better about my chances of writing addons myself.

Thanks so much for this :)
 

Been Told

Well-known member
#12
As for the fon't size decreasing on the navigation so more numbers will fit this is worrying, when we get to forums that have 20k or ever 100k pages of threads how small are those numbers going to look?
I'm 99% certain that all it takes is one line of CSS to change that behavior. I highly doubt it's hard-coded.
 

Kier

XenForo Developer
Staff member
#13
Very nice plugin system I like it...

As for the fon't size decreasing on the navigation so more numbers will fit this is worrying, when we get to forums that have 20k or ever 100k pages of threads how small are those numbers going to look?
Optimise for the common case. Threads with over 9,999 pages? I don't think I've ever seen one.
 

SneakyDave

Well-known member
#14
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.
that itself is important, but even if there are changes to the underlying API, it appears that required changes to plug-ins shouldn't be too difficult, unless what you describe as "events" are heavily modified.
 

Brogan

XenForo moderator
Staff member
#16
Very nice plugin system I like it...

As for the fon't size decreasing on the navigation so more numbers will fit this is worrying, when we get to forums that have 20k or ever 100k pages of threads how small are those numbers going to look?
You could always increase the posts per page (ppp) to 30, that would instantly reduce the number of pages by 30%.

So a 20,000 post thread with 20 ppp would have 1,000 pages.
On a 30 ppp thread, that would be just 667 pages.
 

Cezz

Well-known member
#19
Optimise for the common case. Threads with over 9,999 pages? I don't think I've ever seen one.
You won't see a thread with over 9,999 pages but you may see a forum with over 9,999 pages... 20 threads per page 10,000 pages would only be 200,000 threads quite possible.
 

Cezz

Well-known member
#20
You could always increase the posts per page (ppp) to 30, that would instantly reduce the number of pages by 30%.

So a 20,000 post thread with 20 ppp would have 1,000 pages.
On a 30 ppp thread, that would be just 667 pages.
Again I am talking about threads in a forum instead of posts in a thread as the same navigation setup is used there... if you get above 9,999 pages then you would be going into the 10k page mark and that font may become very small then.