Creating a Profile Plugin for Joomla 1.6

So there is other documentation out there. I'm basing most of this article on the official Joomla 1.6 documentation: http://docs.joomla.org/Creating_a_profile_plugin and I want to use an example that worked for me. Important: This is for Joomla version 1.6.x+.

Aim / Objective
  1. Add a field with a dropdown list.
  2. Add a button to upload an avatar (and sync with 3rd party avatar).
Not riveting stuff but something that all my clients want. Fortunately for me, I just created one plugin which I can install on any number of Joomla 1.6 sites and it does all this for me... Neat huh?

Folder
I'm going to shove all these files into a folder which I will then compress and install using the Joomla! CMS Extension Manager.

I'm going to call the folder "profile5" (without the double-quotes) and create a subfolder called "profiles".

So I should end up with the following file/directory structure:
copyraw
./profile5
     ./profile5/profiles
  1.  ./profile5 
  2.       ./profile5/profiles 
Also copy one of those handy blank "index.html" files into each of these folders in case "directory listing" gets enabled on your server.I'm going to refer to the files to create as being in this folder.

./profile5/profile5.php
copyraw
<?php
 /**
  * @version
  * @copyright  Copyright (C) 2011 JoelLipman.Com, Inc. All rights reserved.
  * @license            GNU General Public License version 2 or later; see LICENSE.txt
  */

 defined('JPATH_BASE') or die;

  /**
   * An example custom profile plugin.
   *
   * @package           Joomla.Plugins
   * @subpackage        user.profile
   * @version           1.6
   */
  class plgUserProfile5 extends JPlugin
  {
        /**
         * @param       string  The context for the data
         * @param       int             The user id
         * @param       object
         * @return      boolean
         * @since       1.6
         */
        function onContentPrepareData($context, $data)
        {
                // Check we are manipulating a valid form.
                if (!in_array($context, array('com_users.profile','com_users.registration','com_users.user','com_admin.profile'))){
                        return true;
                }
                $userId = isset($data->id) ? $data->id : 0;
                // Load the profile data from the database.
                $db = &JFactory::getDbo();
                $db->setQuery(
                        'SELECT profile_key, profile_value FROM #__user_profiles' .
                        ' WHERE user_id = '.(int) $userId .
                        ' AND profile_key LIKE \'profile5.%\'' .
                        ' ORDER BY ordering'
                );
                $results = $db->loadRowList();
                // Check for a database error.
                if ($db->getErrorNum()) {
                        $this->_subject->setError($db->getErrorMsg());
                        return false;
                }
                // Merge the profile data.
                $data->profile5 = array();
                foreach ($results as $v) {
                        $k = str_replace('profile5.', '', $v[0]);
                        $data->profile5[$k] = $v[1];
                }
                return true;
        }

        /**
         * @param       JForm   The form to be altered.
         * @param       array   The associated data for the form.
         * @return      boolean
         * @since       1.6
         */
        function onContentPrepareForm($form, $data)
        {
                // Load user_profile plugin language
                $lang = JFactory::getLanguage();
                $lang->load('plg_user_profile5', JPATH_ADMINISTRATOR);

                if (!($form instanceof JForm)) {
                        $this->_subject->setError('JERROR_NOT_A_FORM');
                        return false;
                }
                // Check we are manipulating a valid form.
                if (!in_array($form->getName(), array('com_users.profile', 'com_users.registration','com_users.user','com_admin.profile'))) {
                        return true;
                }
                if ($form->getName()=='com_users.profile')
                {
                        // Add the profile fields to the form.
                        JForm::addFormPath(dirname(__FILE__).'/profiles');
                        $form->loadFile('profile', false);
                        // Toggle whether the allergytime field is required.
                        if ($this->params->get('profile-require_allergytime', 1) > 0) {
                                $form->setFieldAttribute('allergytime', 'required', $this->params->get('profile-require_allergytime') == 2, 'profile');
                        } else {
                                $form->removeField('allergytime', 'profile');
                        }
                }

                //In this example, we treat the frontend registration and the back end user create or edit as the same.
                elseif ($form->getName()=='com_users.registration' || $form->getName()=='com_users.user' )
                {
                        // Add the registration fields to the form.
                        JForm::addFormPath(dirname(__FILE__).'/profiles');
                        $form->loadFile('profile', false);
                        // Toggle whether the allergytime field is required.
                        if ($this->params->get('register-require_allergytime', 1) > 0) {
                                $form->setFieldAttribute('allergytime', 'required', $this->params->get('register-require_allergytime') == 2, 'profile');
                        } else {
                                $form->removeField('allergytime', 'profile');
                        }
                }
        }

        function onUserAfterSave($data, $isNew, $result, $error)
        {
                $userId        = JArrayHelper::getValue($data, 'id', 0, 'int');
                if ($userId && $result && isset($data['profile5']) && (count($data['profile5'])))
                {
                        try
                        {
                                $db = &JFactory::getDbo();
                                $db->setQuery('DELETE FROM #__user_profiles WHERE user_id = '.$userId.' AND profile_key LIKE \'profile5.%\'');
                                if (!$db->query()) {
                                        throw new Exception($db->getErrorMsg());
                                }
                                $tuples = array();
                                $order = 1;
                                foreach ($data['profile5'] as $k => $v) {
                                        $tuples[] = '('.$userId.', '.$db->quote('profile5.'.$k).', '.$db->quote($v).', '.$order++.')';
                                }
                                $db->setQuery('INSERT INTO #__user_profiles VALUES '.implode(', ', $tuples));
                                if (!$db->query()) {
                                        throw new Exception($db->getErrorMsg());
                                }
                        }
                        catch (JException $e) {
                                $this->_subject->setError($e->getMessage());
                                return false;
                        }
                }

                return true;
        }

        /**
         * Remove all user profile information for the given user ID
         *
         * Method is called after user data is deleted from the database
         *
         * @param       array           $user           Holds the user data
         * @param       boolean         $success        True if user was succesfully stored in the database
         * @param       string          $msg            Message
         */
        function onUserAfterDelete($user, $success, $msg)
        {
                if (!$success) {
                        return false;
                }
                $userId        = JArrayHelper::getValue($user, 'id', 0, 'int');
                if ($userId)
                {
                        try
                        {
                                $db = JFactory::getDbo();
                                $db->setQuery(
                                        'DELETE FROM #__user_profiles WHERE user_id = '.$userId .
                                        " AND profile_key LIKE 'profile5.%'"
                                );

                                if (!$db->query()) {
                                        throw new Exception($db->getErrorMsg());
                                }
                        }
                        catch (JException $e)
                        {
                                $this->_subject->setError($e->getMessage());
                                return false;
                        }
                }
                return true;
        }
 }
 ?>
  1.  <?php 
  2.   /** 
  3.    * @version 
  4.    * @copyright  Copyright (C) 2011 JoelLipman.Com, Inc. All rights reserved. 
  5.    * @license            GNU General Public License version 2 or later; see LICENSE.txt 
  6.    */ 
  7.   
  8.   defined('JPATH_BASE') or die; 
  9.   
  10.    /** 
  11.     * An example custom profile plugin. 
  12.     * 
  13.     * @package           Joomla.Plugins 
  14.     * @subpackage        user.profile 
  15.     * @version           1.6 
  16.     */ 
  17.    class plgUserProfile5 extends JPlugin 
  18.    { 
  19.          /** 
  20.           * @param       string  The context for the data 
  21.           * @param       int             The user id 
  22.           * @param       object 
  23.           * @return      boolean 
  24.           * @since       1.6 
  25.           */ 
  26.          function onContentPrepareData($context, $data) 
  27.          { 
  28.                  // Check we are manipulating a valid form. 
  29.                  if (!in_array($context, array('com_users.profile','com_users.registration','com_users.user','com_admin.profile'))){ 
  30.                          return true
  31.                  } 
  32.                  $userId = isset($data->id) ? $data->id : 0
  33.                  // Load the profile data from the database. 
  34.                  $db = &JFactory::getDbo()
  35.                  $db->setQuery( 
  36.                          'SELECT profile_key, profile_value FROM #__user_profiles' . 
  37.                          ' WHERE user_id = '.(int) $userId . 
  38.                          ' AND profile_key LIKE \'profile5.%\'' . 
  39.                          ' ORDER BY ordering' 
  40.                  )
  41.                  $results = $db->loadRowList()
  42.                  // Check for a database error. 
  43.                  if ($db->getErrorNum()) { 
  44.                          $this->_subject->setError($db->getErrorMsg())
  45.                          return false
  46.                  } 
  47.                  // Merge the profile data. 
  48.                  $data->profile5 = array()
  49.                  foreach ($results as $v) { 
  50.                          $k = str_replace('profile5.', '', $v[0])
  51.                          $data->profile5[$k] = $v[1]
  52.                  } 
  53.                  return true
  54.          } 
  55.   
  56.          /** 
  57.           * @param       JForm   The form to be altered. 
  58.           * @param       array   The associated data for the form. 
  59.           * @return      boolean 
  60.           * @since       1.6 
  61.           */ 
  62.          function onContentPrepareForm($form, $data) 
  63.          { 
  64.                  // Load user_profile plugin language 
  65.                  $lang = JFactory::getLanguage()
  66.                  $lang->load('plg_user_profile5', JPATH_ADMINISTRATOR)
  67.   
  68.                  if (!($form instanceof JForm)) { 
  69.                          $this->_subject->setError('JERROR_NOT_A_FORM')
  70.                          return false
  71.                  } 
  72.                  // Check we are manipulating a valid form. 
  73.                  if (!in_array($form->getName(), array('com_users.profile', 'com_users.registration','com_users.user','com_admin.profile'))) { 
  74.                          return true
  75.                  } 
  76.                  if ($form->getName()=='com_users.profile') 
  77.                  { 
  78.                          // Add the profile fields to the form. 
  79.                          JForm::addFormPath(dirname(__FILE__).'/profiles')
  80.                          $form->loadFile('profile', false)
  81.                          // Toggle whether the allergytime field is required. 
  82.                          if ($this->params->get('profile-require_allergytime', 1) > 0) { 
  83.                                  $form->setFieldAttribute('allergytime', 'required', $this->params->get('profile-require_allergytime') == 2, 'profile')
  84.                          } else { 
  85.                                  $form->removeField('allergytime', 'profile')
  86.                          } 
  87.                  } 
  88.   
  89.                  //In this example, we treat the frontend registration and the back end user create or edit as the same. 
  90.                  elseif ($form->getName()=='com_users.registration' || $form->getName()=='com_users.user' ) 
  91.                  { 
  92.                          // Add the registration fields to the form. 
  93.                          JForm::addFormPath(dirname(__FILE__).'/profiles')
  94.                          $form->loadFile('profile', false)
  95.                          // Toggle whether the allergytime field is required. 
  96.                          if ($this->params->get('register-require_allergytime', 1) > 0) { 
  97.                                  $form->setFieldAttribute('allergytime', 'required', $this->params->get('register-require_allergytime') == 2, 'profile')
  98.                          } else { 
  99.                                  $form->removeField('allergytime', 'profile')
  100.                          } 
  101.                  } 
  102.          } 
  103.   
  104.          function onUserAfterSave($data, $isNew, $result, $error) 
  105.          { 
  106.                  $userId        = JArrayHelper::getValue($data, 'id', 0, 'int')
  107.                  if ($userId && $result && isset($data['profile5']) && (count($data['profile5']))) 
  108.                  { 
  109.                          try 
  110.                          { 
  111.                                  $db = &JFactory::getDbo()
  112.                                  $db->setQuery('DELETE FROM #__user_profiles WHERE user_id = '.$userId.' AND profile_key LIKE \'profile5.%\'')
  113.                                  if (!$db->query()) { 
  114.                                          throw new Exception($db->getErrorMsg())
  115.                                  } 
  116.                                  $tuples = array()
  117.                                  $order = 1
  118.                                  foreach ($data['profile5'] as $k => $v) { 
  119.                                          $tuples[] = '('.$userId.', '.$db->quote('profile5.'.$k).', '.$db->quote($v).', '.$order++.')'
  120.                                  } 
  121.                                  $db->setQuery('INSERT INTO #__user_profiles VALUES '.implode(', ', $tuples))
  122.                                  if (!$db->query()) { 
  123.                                          throw new Exception($db->getErrorMsg())
  124.                                  } 
  125.                          } 
  126.                          catch (JException $e) { 
  127.                                  $this->_subject->setError($e->getMessage())
  128.                                  return false
  129.                          } 
  130.                  } 
  131.   
  132.                  return true
  133.          } 
  134.   
  135.          /** 
  136.           * Remove all user profile information for the given user ID 
  137.           * 
  138.           * Method is called after user data is deleted from the database 
  139.           * 
  140.           * @param       array           $user           Holds the user data 
  141.           * @param       boolean         $success        True if user was succesfully stored in the database 
  142.           * @param       string          $msg            Message 
  143.           */ 
  144.          function onUserAfterDelete($user, $success, $msg) 
  145.          { 
  146.                  if (!$success) { 
  147.                          return false
  148.                  } 
  149.                  $userId        = JArrayHelper::getValue($user, 'id', 0, 'int')
  150.                  if ($userId) 
  151.                  { 
  152.                          try 
  153.                          { 
  154.                                  $db = JFactory::getDbo()
  155.                                  $db->setQuery( 
  156.                                          'DELETE FROM #__user_profiles WHERE user_id = '.$userId . 
  157.                                          " AND profile_key LIKE 'profile5.%'" 
  158.                                  )
  159.   
  160.                                  if (!$db->query()) { 
  161.                                          throw new Exception($db->getErrorMsg())
  162.                                  } 
  163.                          } 
  164.                          catch (JException $e) 
  165.                          { 
  166.                                  $this->_subject->setError($e->getMessage())
  167.                                  return false
  168.                          } 
  169.                  } 
  170.                  return true
  171.          } 
  172.   } 
  173.   ?> 
./profile5/profile5.xml
copyraw
<?xml version="1.0" encoding="utf-8"?>
        <!-- $Id:  -->
 <extension version="1.6" type="plugin" group="user">
        <name>User - Profile - JoelLipman.Com</name>
        <author>Joel Lipman</author>
        <creationDate>April 2011</creationDate>
        <copyright>(C) 2011 JoelLipman.Com. All rights reserved.</copyright>
        <license>GNU General Public License version 2 or later; see LICENSE.txt</license>
        <authorEmail>This email address is being protected from spambots. You need JavaScript enabled to view it.</authorEmail>
        <authorUrl>www.joellipman.com</authorUrl>
        <version>1.6.0</version>
        <description>PLG_USER_PROFILE5_XML_DESCRIPTION</description>

        <files>
                <filename plugin="profile5">profile5.php</filename>
                <filename>index.html</filename>
                <folder>profiles</folder>
        </files>

        <languages>
                <language tag="en-GB">en-GB.plg_user_profile5.ini</language>
                <language tag="en-GB">en-GB.plg_user_profile5.sys.ini</language>
        </languages>

        <config>
                <fields name="params">

                        <fieldset name="basic">
                                <field name="register-require-user" type="spacer"
                                        label="PLG_USER_PROFILE5_FIELD_NAME_REGISTER_REQUIRE_USER"
                                />

                                <field name="register-require_allergytime" type="list"
                                        description="PLG_USER_PROFILE5_FIELD_ALLERGYTIME_DESC"
                                        label="PLG_USER_PROFILE5_FIELD_ALLERGYTIME_LABEL"
                                >
                                        <option value="2">JOPTION_REQUIRED</option>
                                        <option value="1">JOPTION_OPTIONAL</option>
                                        <option value="0">JDISABLED</option>
                                </field>

                                <field name="profile-require-user" type="spacer"
                                        label="PLG_USER_PROFILE5_FIELD_NAME_PROFILE_REQUIRE_USER"
                                />

                                <field name="profile-require_allergytime" type="list"
                                        description="PLG_USER_PROFILE5_FIELD_ALLERGYTIME_DESC"
                                        label="PLG_USER_PROFILE5_FIELD_ALLERGYTIME_LABEL"
                                >
                                        <option value="2">JOPTION_REQUIRED</option>
                                        <option value="1">JOPTION_OPTIONAL</option>
                                        <option value="0">JDISABLED</option>
                                </field>

                        </fieldset>

                </fields>
        </config>
 </extension>
  1.  <?xml version="1.0" encoding="utf-8"?> 
  2.          <!-- $Id:  --> 
  3.   <extension version="1.6" type="plugin" group="user"> 
  4.          <name>User - Profile - JoelLipman.Com</name> 
  5.          <author>Joel Lipman</author> 
  6.          <creationDate>April 2011</creationDate> 
  7.          <copyright>(C) 2011 JoelLipman.Com. All rights reserved.</copyright> 
  8.          <license>GNU General Public License version 2 or later; see LICENSE.txt</license> 
  9.          <authorEmail>This email address is being protected from spambots. You need JavaScript enabled to view it.</authorEmail> 
  10.          <authorUrl>www.joellipman.com</authorUrl> 
  11.          <version>1.6.0</version> 
  12.          <description>PLG_USER_PROFILE5_XML_DESCRIPTION</description> 
  13.   
  14.          <files> 
  15.                  <filename plugin="profile5">profile5.php</filename> 
  16.                  <filename>index.html</filename> 
  17.                  <folder>profiles</folder> 
  18.          </files> 
  19.   
  20.          <languages> 
  21.                  <language tag="en-GB">en-GB.plg_user_profile5.ini</language> 
  22.                  <language tag="en-GB">en-GB.plg_user_profile5.sys.ini</language> 
  23.          </languages> 
  24.   
  25.          <config> 
  26.                  <fields name="params"> 
  27.   
  28.                          <fieldset name="basic"> 
  29.                                  <field name="register-require-user" type="spacer" 
  30.                                          label="PLG_USER_PROFILE5_FIELD_NAME_REGISTER_REQUIRE_USER" 
  31.                                  /> 
  32.   
  33.                                  <field name="register-require_allergytime" type="list" 
  34.                                          description="PLG_USER_PROFILE5_FIELD_ALLERGYTIME_DESC" 
  35.                                          label="PLG_USER_PROFILE5_FIELD_ALLERGYTIME_LABEL" 
  36.                                  > 
  37.                                          <option value="2">JOPTION_REQUIRED</option> 
  38.                                          <option value="1">JOPTION_OPTIONAL</option> 
  39.                                          <option value="0">JDISABLED</option> 
  40.                                  </field> 
  41.   
  42.                                  <field name="profile-require-user" type="spacer" 
  43.                                          label="PLG_USER_PROFILE5_FIELD_NAME_PROFILE_REQUIRE_USER" 
  44.                                  /> 
  45.   
  46.                                  <field name="profile-require_allergytime" type="list" 
  47.                                          description="PLG_USER_PROFILE5_FIELD_ALLERGYTIME_DESC" 
  48.                                          label="PLG_USER_PROFILE5_FIELD_ALLERGYTIME_LABEL" 
  49.                                  > 
  50.                                          <option value="2">JOPTION_REQUIRED</option> 
  51.                                          <option value="1">JOPTION_OPTIONAL</option> 
  52.                                          <option value="0">JDISABLED</option> 
  53.                                  </field> 
  54.   
  55.                          </fieldset> 
  56.   
  57.                  </fields> 
  58.          </config> 
  59.   </extension> 

./profile5/en-GB.plg_user_profile5.ini
copyraw
; Joomla! Project
; Copyright (C) 2011 JoelLipman.com. All rights reserved.
; License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php
; Note : All ini files need to be saved as UTF-8

PLG_USER_PROFILE5_XML_DESCRIPTION="User Profile Plug-in by JoelLipman.Com to add extra fields to the user forms."
PLG_USER_PROFILE5="User - Profile - JoelLipman.Com"
PLG_USER_PROFILE5_SLIDER_LABEL="User Profile - JoelLipman.Com"
PLG_USER_PROFILE5_FIELD_NAME_REGISTER_REQUIRE_USER="User profile fields for registration and administrator user profile - JoelLipman.Com forms"
PLG_USER_PROFILE5_FIELD_NAME_PROFILE_REQUIRE_USER="User profile fields for profile - JoelLipman.Com edit form"
PLG_USER_PROFILE5_FIELD_ALLERGYTIME_DESC="How long have you been dealing with this allergy?"
PLG_USER_PROFILE5_FIELD_ALLERGYTIME_LABEL="Time With Allergy?"
PLG_USER_PROFILE_FIELD_ALLERGYTIME_MESSAGE="Select one of the options"
PLG_USER_PROFILE5_XML_DESCRIPTION="User Profile - JoelLipman.Com Plugin"
JOELLIPMAN_BOOLEANYES="Yes"
JOELLIPMAN_BOOLEANNO="No"
JOELLIPMAN_ALLERGYTIMEOPTION0="Less than 6 months"
JOELLIPMAN_ALLERGYTIMEOPTION1="Less than a year"
JOELLIPMAN_ALLERGYTIMEOPTION2="1 year"
JOELLIPMAN_ALLERGYTIMEOPTION3="5 years"
JOELLIPMAN_ALLERGYTIMEOPTION4="10 years+"
PLG_USER_PROFILE5_FIELD_ALLERGYTIMEDISP_DESC="Choose to hide from other users?"
PLG_USER_PROFILE5_FIELD_ALLERGYTIMEDISP_LABEL="Hide from others?"
  1.  ; Joomla! Project 
  2.  ; Copyright (C) 2011 JoelLipman.com. All rights reserved. 
  3.  ; License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php 
  4.  ; Note : All ini files need to be saved as UTF-8 
  5.   
  6.  PLG_USER_PROFILE5_XML_DESCRIPTION="User Profile Plug-in by JoelLipman.Com to add extra fields to the user forms." 
  7.  PLG_USER_PROFILE5="User - Profile - JoelLipman.Com" 
  8.  PLG_USER_PROFILE5_SLIDER_LABEL="User Profile - JoelLipman.Com" 
  9.  PLG_USER_PROFILE5_FIELD_NAME_REGISTER_REQUIRE_USER="User profile fields for registration and administrator user profile - JoelLipman.Com forms" 
  10.  PLG_USER_PROFILE5_FIELD_NAME_PROFILE_REQUIRE_USER="User profile fields for profile - JoelLipman.Com edit form" 
  11.  PLG_USER_PROFILE5_FIELD_ALLERGYTIME_DESC="How long have you been dealing with this allergy?" 
  12.  PLG_USER_PROFILE5_FIELD_ALLERGYTIME_LABEL="Time With Allergy?" 
  13.  PLG_USER_PROFILE_FIELD_ALLERGYTIME_MESSAGE="Select one of the options" 
  14.  PLG_USER_PROFILE5_XML_DESCRIPTION="User Profile - JoelLipman.Com Plugin" 
  15.  JOELLIPMAN_BOOLEANYES="Yes" 
  16.  JOELLIPMAN_BOOLEANNO="No" 
  17.  JOELLIPMAN_ALLERGYTIMEOPTION0="Less than 6 months" 
  18.  JOELLIPMAN_ALLERGYTIMEOPTION1="Less than a year" 
  19.  JOELLIPMAN_ALLERGYTIMEOPTION2="1 year" 
  20.  JOELLIPMAN_ALLERGYTIMEOPTION3="5 years" 
  21.  JOELLIPMAN_ALLERGYTIMEOPTION4="10 years+" 
  22.  PLG_USER_PROFILE5_FIELD_ALLERGYTIMEDISP_DESC="Choose to hide from other users?" 
  23.  PLG_USER_PROFILE5_FIELD_ALLERGYTIMEDISP_LABEL="Hide from others?" 

./profile5/en-GB.plg_user_profile5.sys.ini
copyraw
; Joomla! Project
; Copyright (C) 2011 JoelLipman.com. All rights reserved.
; License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php
; Note : All ini files need to be saved as UTF-8

PLG_USER_PROFILE5="User - Profile - JoelLipman.com"
PLG_USER_PROFILE5_XML_DESCRIPTION="User Profile Plug-in - JoelLipman.Com"
  1.  ; Joomla! Project 
  2.  ; Copyright (C) 2011 JoelLipman.com. All rights reserved. 
  3.  ; License http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see LICENSE.php 
  4.  ; Note : All ini files need to be saved as UTF-8 
  5.   
  6.  PLG_USER_PROFILE5="User - Profile - JoelLipman.com" 
  7.  PLG_USER_PROFILE5_XML_DESCRIPTION="User Profile Plug-in - JoelLipman.Com" 

./profile5/profiles/profile.xml
copyraw
<?xml version="1.0" encoding="utf-8"?>
	<!-- $Id: profile.xml 20156 2011-04-27 13:10:16Z joellipman $ -->
<form>
	<fields name="profile">
		<fieldset name="profile">
			<field
				name="allergytime"
				type="list"
				id="allergytime"
				description="PLG_USER_PROFILE5_FIELD_ALLERGYTIME_DESC"
				filter="string"
				label="PLG_USER_PROFILE5_FIELD_ALLERGYTIME_LABEL"
				message="PLG_USER_PROFILE_FIELD_ALLERGYTIME_MESSAGE"
				>
					<option value="0">JOELLIPMAN_ALLERGYTIMEOPTION0</option>
					<option value="1">JOELLIPMAN_ALLERGYTIMEOPTION1</option>
					<option value="2">JOELLIPMAN_ALLERGYTIMEOPTION2</option>
					<option value="3">JOELLIPMAN_ALLERGYTIMEOPTION3</option>
					<option value="4">JOELLIPMAN_ALLERGYTIMEOPTION4</option>
				</field>
			<field name="allergytimedisplay" type="list"
					description="PLG_USER_PROFILE5_FIELD_ALLERGYTIMEDISP_DESC"
					label="PLG_USER_PROFILE5_FIELD_ALLERGYTIMEDISP_LABEL"
				>
					<option value="1">JOELLIPMAN_BOOLEANYES</option>
					<option value="0">JOELLIPMAN_BOOLEANNO</option>
				</field>

		</fieldset>
	</fields>
</form>
  1.  <?xml version="1.0" encoding="utf-8"?> 
  2.      <!-- $Id: profile.xml 20156 2011-04-27 13:10:16Z joellipman $ --> 
  3.  <form> 
  4.      <fields name="profile"> 
  5.          <fieldset name="profile"> 
  6.              <field 
  7.                  name="allergytime" 
  8.                  type="list" 
  9.                  id="allergytime" 
  10.                  description="PLG_USER_PROFILE5_FIELD_ALLERGYTIME_DESC" 
  11.                  filter="string" 
  12.                  label="PLG_USER_PROFILE5_FIELD_ALLERGYTIME_LABEL" 
  13.                  message="PLG_USER_PROFILE_FIELD_ALLERGYTIME_MESSAGE" 
  14.                  > 
  15.                      <option value="0">JOELLIPMAN_ALLERGYTIMEOPTION0</option> 
  16.                      <option value="1">JOELLIPMAN_ALLERGYTIMEOPTION1</option> 
  17.                      <option value="2">JOELLIPMAN_ALLERGYTIMEOPTION2</option> 
  18.                      <option value="3">JOELLIPMAN_ALLERGYTIMEOPTION3</option> 
  19.                      <option value="4">JOELLIPMAN_ALLERGYTIMEOPTION4</option> 
  20.                  </field> 
  21.              <field name="allergytimedisplay" type="list" 
  22.                      description="PLG_USER_PROFILE5_FIELD_ALLERGYTIMEDISP_DESC" 
  23.                      label="PLG_USER_PROFILE5_FIELD_ALLERGYTIMEDISP_LABEL" 
  24.                  > 
  25.                      <option value="1">JOELLIPMAN_BOOLEANYES</option> 
  26.                      <option value="0">JOELLIPMAN_BOOLEANNO</option> 
  27.                  </field> 
  28.   
  29.          </fieldset> 
  30.      </fields> 
  31.  </form> 
Category: Joomla :: Article: 351

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: The information on this website is provided without warranty and any content is merely the opinion of the author. Please try to test in development environments prior to adapting them to your production environments. The articles are written in good faith and, at the time of print, are working examples used in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com

Related Articles

Joes Revolver Map

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin - Valid till 8 May 2022 3QnhmaBX7LQSRsC9hh6Je9rGQKEGNQNfPb
© 2022 Joel Lipman .com. All Rights Reserved.