Add a tab to the profiles

  • Overview

    This doc shows how to build a simple module with the purpose of adding another page to a module.

    You have a profile that you want to add another tab to to output something there that is custom.

    First thing we have to do is to create a simple module.
  • Give the module a name

    In your /modules folder create a folder to house your module with your developer prefix .

    In this demonstration we use the module name apBar.

    The first file created is include.php this will contain the _meta() function and the _inti() function

    Every module needs to have these 2 functions.
  • include.php

    The include.php file for the module.
    <?php
    /**
     * Jamroom 5 include.php module
     * @copyright 2016 by Your Details - All Rights Reserved
     * @author Your Name - yourname@wherever.net
     * 21 07, 2016
     */
    
    // make sure we are not being called directly
    
    defined('APP_DIR') or exit();
    
    /**
     * meta
     */
    function apBar_meta()
    {
        $_tmp = array(
            'name'        => 'Bar Moudle',
            'url'         => 'bar',
            'version'     => '1.0.0',
            'developer'   => 'Your Name, &copy;' . strftime('%Y'),
            'description' => 'A custom module to add a page to the profile',
            'category'    => 'profiles'
        );
        return $_tmp;
    }
    
    /**
     * init
     */
    function apBar_init()
    {
        return true;
    }
    
  • /templates/item_index.tpl

    Add whatever contents you want for this new page to this template file and it will display on all profiles.
    this is the item index page for the bar module.

    If you want to limit it to just certain quotas, then check out the quota config docs.
  • youtube
    add a section to the profiles.

Tags