Resource icon

We built our first XenForo add-on and wrote a tutorial about it

twisted1919

Member
twisted1919 submitted a new resource:

We built our first XenForo add-on and wrote a tutorial about it - Building our first XenForo add-on

Hello everyone,

We just went through a migration from XenForo 1.x to 2.1 where we had to port some of our changes as add-ons for the 2.1 version. We thought it would help to write a blog post related to writing a XenForo add-on, mainly because we're not XenForo developers, but it was easy enough to write a add-on.

You can read the article on our blog, we did our best to include screenshots and code examples to make this...

Read more about this resource...
 
PHP:
        // don't validate admin area
        if (isset($_SERVER['SCRIPT_FILENAME']) && basename($_SERVER['SCRIPT_FILENAME']) == 'admin.php') {
            return true;
        }
can be
PHP:
        // don't validate admin area
        if (\XF::app() instanceof \XF\Admin\App)
        {
            return true;
        }



PHP:
        if (count($licenses) > 0) {
            $error = 'This license is already in use!';
            return false;
        }
can be
PHP:
        if ($licenses->count())
        {
            $error = 'This license is already in use!';
            return false;
        }


You haven't made use of hints for class extension


PHP:
$entity->error('Your support has expired, please renew your support pack before posting new content!', null, false);
Use phrase system.
 
// don't validate admin area if (\XF::app() instanceof \XF\Admin\App) { return true; }
Thank you, i did not know about this class.

if ($licenses->count()) { $error = 'This license is already in use!'; return false; }
Thanks, makes sense, i see it implements ArrayCollection.

You haven't made use of hints for class extension
i know, this was on purpose for now.

Use phrase system.
Any hits where can i read about this?

Thanks for taking the time to review this ;)
 
Gotcha, i'll revise this later in this case, maybe the docs will be updated.
Meanwhile i have updated the article to include your suggestions, thanks again :)
 
@Alfa1 - Ah, that would be nice, wouldn't it ? :)
The above post highlights our XF usage for our company needs though, not for MailWizz the application.

Currently there are no plans for bringing MailWizz as a XF add-on, they are both two huge applications which work best on their own.
There's an API for MailWizz which can be used for a bridge in between the two, but again, our hands are full right now, so we can't take this responsibility.

Thanks for the interest though!
 
Back
Top Bottom