I want to learn to code addons for Xenforo. I have specific experience, where do I start?

Is it not more wise to learn php or do you create immediatly an addon and try to understand the code?
 
Is it not more wise to learn php or do you create immediatly an addon and try to understand the code?
I only knew basic PHP when I started, and I'd say I'm coping fairly good, mainly because of the excellent support community XenForo has. Instead of just the answer, you learn the method. That stays, and honestly I can read PHP code without much prior experience in PHP. Granted I had a fairly good understanding of Java which probably made it easier but even then, reading the W3Schools page on PHP and the PHP Documentation briefly (not all of it) is enough to get started with XF add-ons. I know lots of good XF developers learned that way.
 
Hmm, I see. You could have used notepad++ instead of that. But I guess you lost your motivation.
 
Everyone said get PHPStorm, but I fell at the first hurdle and couldn't even get to grips with that.

What specifically did you have troubles with? Just issues with phpStorm, or issues with learning modern PHP (MVC, etc)?Someone would likely be able to help you out :)
 
As I recall PHPStorm wanted me to set up a local server or something and that's over my head.
This?

upload_2016-5-11_19-54-44.webp

You likely just want the bottom one. On the next page you point it at your XF root, then that's it.

At some point you would need a local web server, though. That just involves having MySQL, Apache and PHP installed on your local machine. There are apps that help you do that. WAMP and XAMPP are popular ones. If you were using something like that, then you'd just need the top option.

In fact, to summarise I would do the following:

1) Download and install WAMP (or similar system)
2) You should then be able to access something like http://localhost from your browser, you'll likely hit the default document root
3) Locate which folder on your computer is the document root, replace the contents of that folder with the contents of the "upload" folder from the full XF download
4) Launch PhpStorm

upload_2016-5-11_19-59-29.webp

5) Click "Create New Project from Existing Files"
6) Click Next. Find your document root folder where you have copied your XF files. Click "Project Root"
7) Click Next. Give the project a name. Click Next. Click Finish.

That should be it. There's a few things on there that I've ignored, for now, because they're not important. That should get you going though.
 
As I recall PHPStorm wanted me to set up a local server or something and that's over my head.

You can start out with another simple php editor for the small stuff and then you can gradually upgrade to a php ide as you develop bigger and more advanced add ons.
 
You can start out with another simple php editor for the small stuff and then you can gradually upgrade to a php ide as you develop bigger and more advanced add ons.

I'd definitely recommend starting and sticking with phpStorm, it's by far the best one I've used. The cmd+option+shift+c hotkey is the greatest thing ever as well ;)
 
I'd definitely recommend starting and sticking with phpStorm, it's by far the best one I've used. The cmd+option+shift+c hotkey is the greatest thing ever as well ;)

I agree. I suggested a simpler php editor because @Stuart Wright found phpstorm a little complicated. And I thought that it would have been better if he started with something simple at the begin to ease him in add on developement.
 
I don't understand.

Shouldn't phpstorm be just an editor, I mean, why would you need to setup a localserver and point it to Xenforo?
You can just code on it without doing all of this this or am I missing sth here?
 
You don't "need" to. There are options to allow it, but it isn't essential.

Most people will be wanting to develop code in the editor and then see those changes live on a local server. Alternatively, you would have to set up a process to either automatically or manually sync your local files to a remote location.
 
Local server is needed if you plan to use the debugging function. That's the best thing for setting breakpoints, finding out what objects and variables are available, etc.

You can learn a lot more about what XenForo is doing by stepping through the code.
 
Last edited:
Back
Top Bottom