Creating a AddOn for XenForo

Started Start date Start date - by Thread starter Thread starter Milen and have 1 Replies and 91 Views
Tags Tags
addon creating xenforo

Milen

Owner
Staff member
Admin
Messages
98
Reaction score
15
Points
8
Credits
119

Above all​

Almost everyone who uses XenForo wants to create their own addon (or at least that's how I am). But where do we start? Of course, we can use some existing sources as a starting point for our adventure in creating our first add-on. We start reading, experimenting, but before long we realize that our knowledge of PHP, CSS, JAVA and HTML is almost useless. HTML hasn't changed much since about a decade ago, unlike the other three programming languages. This is good news, but unfortunately, with HTML alone, we can't achieve much in XenForo. And the tutorials that are available online and are related to creating a XenForo addon are outdated, in other words, they can give us some basic knowledge about XenForo, but that's it.

My personal opinion is that the logic and order in this system is a total mishmash. Does it load quickly in the browser? Yes! Is it user-friendly? YES! Is it beautiful? YES! But if you want to create an add-on for it, oh man, get ready to be bullied. You have no idea what kind of wonder of wonders you're going to encounter. I literally created my first add-on by luck. It took me about two weeks to solve design problems and conflicts with the XenForo system, but I succeeded. I have no idea how I managed to do it, I know I wasted a lot of time and energy on something that is basically elementary. So, after all this, if you still have the desire to create your first add-on, then you can join this extreme adventure.

First step​

  1. The first thing you need to do is decide which version of XenForo you will be creating an add-on for, and understand its PHP version requirements.
    1. This is important so you know what you can and cannot use in your addon as PHP code.
  2. Next, you need to familiarize yourself with the structure and logic of XenForo.
    1. Here I can only wish you success, because I personally have no progress in this step (at least for the moment).
  3. Then you need to visit THIS site
    1. Again, to know what you can and can't do and how to use it in your PHP code.
Well, that's it for now, I'm going to make some coffee and sit down to study. :)

Tips:

This: XenBg\DailyQuote\:Admin\Controller\Quote is wrong!
Correct is: XenBg\DailyQuote\Admin\Controller\Quote - It must be without the colon, otherwise xenforo will not find the correct file.
 

Attachments

  • XenBg-big.webp
    XenBg-big.webp
    6.8 KB · Views: 241
Last edited:
Something that is important when adding widgets to your addon. A definition of your widget needs to be added, or maybe it's a path to your widget, I don't know exactly, but what I learned the hard way is this:
  1. You need to add a definition to your widget so that it can be added through the admin panel and visible to users.
  2. You will inevitably encounter a problem like this --> "Invalid class: XenBg\Demo\Widget\Bubu" :D
If you encounter this problem, you can keep this in mind:
  1. Is your widget's PHP file located in the correct directory?
  2. If it is there, does it have the correct name (Bubu.php)?
1737451016346.png

Well, we see that in my case there is a problem with the file name. What can I do? Should I change the file name or change the definition of my widget? Of course, it is better to change the widget definition to point to the correct file.
1737451209834.png

And now I click Save......... о_О Nothing is happening.....what the hell......... 😭 Don't panic.:ROFLMAO: This is because there is a problem in the widget's PHP file.
1737451434908.png
What do you think are the problems here...? We have the correct path in our widget definition, right? BUT.....................
  1. namespace - This little bugger can sometimes cause quite a few problems. In my case it leads to a folder NotWork. Let's fix this.​
Strange! Again nothing happens when I click the save button! It would be funny if I couldn't do it myself and wrote something like a tutorial on how to add a widget to addon. :ROFLMAO: I guess the problem comes from the class(OMG).
1737452029932.png
Will it work? I'm getting ready, click save and................... Ohhhhhh commmmmmmme ooooooon :oops: Again, nothing is happening, damn it. The file is fine, where am I wrong.....?
1737452881743.png
Well, it's simple, there must be some functions in the file after all :D Yes, it's complicated, but still, this is one of the good things about XenForo, you'll hardly add something to it that is literally useless!
 

More for you :)

Thread statistics

Created
Milen,
Last reply from
Milen,
Replies
1
Views
91

New threads

Hot

[XenBg] Portal
Day 1 I've been stubborn about making a portal anyway :D Why not start? After a lot of really hard work, I managed to get the forum to show some...
by Milen in Working on
Daily moon calendar
When we live in accordance with the lunar calendar, we begin to feel the natural rhythms that influence us and we can ride the energy wave, like a...
by Milen in Moon Calendar
[XenBg] Portal Pro [Addons]
[XenBg] Portal thread for updates and discussion. If you see this in the Last repli widget, there is likely a new update. You can take a look to...
by Milen in AddOn releases
XenBg Pro Style
Perhaps every person who owns any kind of website (whether it's a forum or a blog, it doesn't matter) has had a moment when they saw something and...
by Milen in Working on
Xenforo seo
! It's important google search engine to like your forum ! Day 1 Working on this addon is starting at 27.01.2025. I've been a webmaster for a...
by Milen in Working on
Back
Top