How to make xenforo 2 addons
#HOW TO MAKE XENFORO 2 ADDONS CODE#
Click on the Create New Code Event Listener. Navigate to: Development -> Code Event Listeners. XenForo comes with quite a few Listeners that we can choose from. Now we must listen for the class which this function belongs to be called (XenForo_ControllerPublic_Account). This is the function we want to override. The first word highlighted is just above: public function actionSignature(). As editing a signature is part of a members account look for Account.php. From your filemanager navigate to ControllerPublic. Nor is it a Helper, or a Response, that leaves us with Public. Editing a signature is not an Admin function. There are four Controller directories: Admin, Helper, Public, and Response. The rest of the fields we do not need for this Add-on.Īs the purpose of our Add-on is to not allow new members to edit (create) a signature, we must locate where members can edit their signature within XenForo, so we can Listen for the class being called. The Version ID is used internally to keep track of revisions.
The following fields for this Add-on need to be filled with the following information: Log into your AdminCP, and navigate to: Development -> Create Add-on To enable debug mode:Īnd add at the bottom: $config = true It is recommended that you first make a back-up of your config.php file before editing it. If you plan on building the Add-on step by step you will need to enable Debug Mode. The working Add-on will be available at the end of this walk-through for coders to reference, or for licensed members to use. I decided to not use screen shots in this walk-through as I want to give the feel that you already know XenForo's Model View Controller (MVC) concept and are about to write your Add-on. To accomplish this we will need to set up a Listener, an Admin Options Page, and create the PHP files. The Add-on created will allow Admins to prevent the editing of signatures for members with less than a specified amount of posts, and who belong to a particular group. This walk-through will take you step-by-step through the process of creating a working XenForo Add-on.