===========
SECTION API
===========

The Profile section API is like an interface to the external modules APIs to list the latest activities of a specific user, or other stuff.

The API consist in a plugin, a function and a template. The entrypoint is the plugin, should call it from the Profile view template:
::
    {profilesection name='EZComments'}

By default, the plugin will add the UID of the user's current profile to the parameters, if it's not defined plus others, like:
::
    {profilesection name='EZComments' uid=$uid numitems=5}

The plugin will call to a section API function: ``Profile_sectionapi_ezcomments``, that can be stored in ``/config/functions/Profile/pnsectionapi/ezcomments.php`` but this time, it's a default function included in ``/modules/Profile/pnsectionapi.php``. That function is the responsible to retrieve the data to show in the section template.

This data, will be assigned to the ``$section`` variable in the ``profile_section_ezcomments.tpl`` template. There the data is listed and customized accordingly. That template can be stored in the ``/config/templates/Profile/sections`` folder.

The output generated by that template, will be shown where the *profilesection* plugin was called. Then, you can call different sections in the position of the view template that you want, and maintain and extend the profiles of your users with ease.

Any translation used in the function or API, should be included in the custom POT catalog in ``/config/locale/module_profile.pot`` as the admin help page indicates.

This Section API also includes an interface to load a section through AJAX. The URL of the function is ``/ajax.php?module=Profile&func=profilesection`` and needs the following parameters: ``$uid``, ``$name`` and optionally an array of arguments (``$args``).

Enjoy!
