http://docs.joomla.org/Creating_a_profile_plugin
Like I mentioned in an earlier post, where I showed how to add custom fields to the profile plugin that is already included with Joomla, the joomla example is very useful, but doesn't really get into adding new fields. What I recommend is comparing that code with my code to see what I changed. Also you can refer to my old post for some guidance. I would use a diff tool like Meld. To install in Fedora 16 just type:
yum install meld
in a command line terminal.
These files need to be created inside of your Joomla 2.5.4 installation. The paths given are relative to the root of the installation. These will not be overwritten during updates, because these names and paths do not exist in the original, but I do keep some backups, just in case.
The below 5 files comprise the entire plugin. First, create them all in their appropriate places on the server. (Just click the links below to download the files).
Then just go to the Extension Manager: Discover tab in the Joomla Administrator panel in the back end and click the blue "Discover" button on the upper right. If you've done everything right, Joomla should see it listed as "Profile 7". Check the box next to it and then click the yellow "Install" button on the upper right. It should be ready to go. You now should be able to find it in Joomla, Plug-in Manager: Plug-ins, and enable it. Be sure and disable any other profile plugins you may have running, including the stock Joomla Profile plugin, or there could be conflicts OR they will both be displayed on your register and profile edit pages!
/administrator/language/en-GB/en-GB.plg_user_profile7.ini
/administrator/language/en-GB/en-GB.plg_user_profile7.sys.ini
/plugins/user/profile/profiles/profile.xml
I was missing a "7" there. Thanks to Patrick for pointing that out, and sorry for any trouble this may have caused to anyone who was trying this.)
Please note, that the last file listed above is "profile.xml", not profile7 like the others. This is VERY important. Be careful! These locations are in the Joomla installation. Create them all with gedit or your text editor of choice (or just download them, now that I've posted links) and place them in their places on your server using an FTP client (or however you can get them there). I use FileZilla. (Sorry, but I don't have time to give a tut on using FTP or any other method of writing files to your server, maybe some other time.)
Here are the files. I tried to highlight in blue the differences between my plugin and the standard plugin, I may have missed highlighting a "7" on a "Profile 7" here or there - they are peppered throughout all 5 files and finding and creating these inside the original code was the biggest challenge of the entire project. (You see I couldn't just leave it with the name "profile" because then it would be overwritten every time you update, just like the standard plugin.) I will post both the content and links for download:
( NOTE: I would LOVE to have these files posted in a prettier format. If you happen to know a way to post frames inside of blogger or know anything that would make these look better, please let me know!)
en-GB.plg_user_profile7.ini (click for download)
-------------------------------------------------------------------------------------------------------------------
; Joomla! Project
; Copyright (C) 2005 - 2012 Open Source Matters. 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_PROFILE7_XML_DESCRIPTION="User Profile 7 Plug-in"
PLG_USER_PROFILE7="User - Profile 7"
PLG_USER_PROFILE7_SLIDER_LABEL="User Profile 7"
PLG_USER_PROFILE7_FIELD_ABOUT_ME_DESC="Choose an option for the field About Me."
PLG_USER_PROFILE7_FIELD_ABOUT_ME_LABEL="About Me:"
PLG_USER_PROFILE7_FIELD_ADDRESS1_DESC="Choose an option for the field Address1"
PLG_USER_PROFILE7_FIELD_ADDRESS1_LABEL="Address 1:"
PLG_USER_PROFILE7_FIELD_ADDRESS2_DESC="Choose an option for the field Address2"
PLG_USER_PROFILE7_FIELD_ADDRESS2_LABEL="Address 2:"
PLG_USER_PROFILE7_FIELD_CITY_DESC="Choose an option for the field City"
PLG_USER_PROFILE7_FIELD_CITY_LABEL="City:"
PLG_USER_PROFILE7_FIELD_COUNTRY_DESC="Choose an option for the field Country"
PLG_USER_PROFILE7_FIELD_COUNTRY_LABEL="Country:"
PLG_USER_PROFILE7_FIELD_COUNTRY_MESSAGE="Country Required"
PLG_USER_PROFILE7_FIELD_DOB_DESC="Choose an option for the field Date of Birth"
PLG_USER_PROFILE7_FIELD_DOB_LABEL="Date of Birth:"
PLG_USER_PROFILE7_FIELD_FAVORITE_BOOK_DESC="Choose an option for the field Favourite Book"
PLG_USER_PROFILE7_FIELD_FAVORITE_BOOK_LABEL="Favourite Book:"
PLG_USER_PROFILE7_FIELD_NAME_PROFILE_REQUIRE_USER="User profile fields for Profile 7 edit form"
PLG_USER_PROFILE7_FIELD_NAME_REGISTER_REQUIRE_USER="User profile fields for registration and administrator user Profile 7 forms"
PLG_USER_PROFILE7_FIELD_PHONE_DESC="Choose an option for the field Phone"
PLG_USER_PROFILE7_FIELD_PHONE_LABEL="Phone:"
PLG_USER_PROFILE7_FIELD_POSTAL_CODE_DESC="Choose an option for the field Postal Code"
PLG_USER_PROFILE7_FIELD_POSTAL_CODE_LABEL="Postal / ZIP Code:"
PLG_USER_PROFILE7_FIELD_POSTAL_CODE_MESSAGE="Postal Code Required"
PLG_USER_PROFILE7_FIELD_REGION_DESC="Choose an option for the field Region"
PLG_USER_PROFILE7_FIELD_REGION_LABEL="Region:"
PLG_USER_PROFILE7_FIELD_TOS_DESC="Agree to terms of service"
PLG_USER_PROFILE7_FIELD_TOS_LABEL="Terms of Service"
PLG_USER_PROFILE7_FIELD_WEB_SITE_DESC="Choose an option for the field Web Site"
PLG_USER_PROFILE7_FIELD_WEB_SITE_LABEL="Web site:"
PLG_USER_PROFILE7_OPTION_AGREE="Agree"
PLG_USER_PROFILE7_OPTION_YES="YES"
PLG_USER_PROFILE7_FIELD_SUBSCRIBE_DESC="Subscribe to get emails about updates"
PLG_USER_PROFILE7_FIELD_SUBSCRIBE_LABEL="Receive Update Emails"
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
; Joomla! Project
; Copyright (C) 2005 - 2012 Open Source Matters. 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_PROFILE7="User - Profile 7"
PLG_USER_PROFILE7_XML_DESCRIPTION="User Profile 7 Plug-in"
-------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------
/**
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_BASE') or die;
jimport('joomla.utilities.date');
jimport('joomla.user.user');
jimport('joomla.utilities.arrayhelper');
/**
* An example custom profile plugin.
*
* @package Joomla.Plugin
* @subpackage User.profile
* @version 1.6
*/
class plgUserProfile7 extends JPlugin
{
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
/**
* @param string $context The context for the data
* @param int $data 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.user', 'com_users.registration', 'com_admin.profile'))) {
return true;
}
if (is_object($data))
{
$userId = isset($data->id) ? $data->id : 0;
if (!isset($data->profile) and $userId > 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 'profile7.%'" .
' 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->profile7 = array();
foreach ($results as $v)
{
$k = str_replace('profile7.', '', $v[0]);
$data->profile7[$k] = json_decode($v[1], true);
if ($data->profile7[$k] === null)
{
$data->profile7[$k] = $v[1];
}
}
}
if (!JHtml::isRegistered('users.url')) {
JHtml::register('users.url', array(__CLASS__, 'url'));
}
if (!JHtml::isRegistered('users.calendar')) {
JHtml::register('users.calendar', array(__CLASS__, 'calendar'));
}
if (!JHtml::isRegistered('users.tos')) {
JHtml::register('users.tos', array(__CLASS__, 'tos'));
}
if (!JHtml::isRegistered('users.subscribe')) {JHtml::register('users.subscribe', array(__CLASS__, 'subscribe'));
}
}
return true;
}
public static function url($value)
{
if (empty($value))
{
return JHtml::_('users.value', $value);
}
else
{
$value = htmlspecialchars($value);
if(substr ($value, 0, 4) == "http") {
return '<a href="'.$value.'">'.$value.'</a>';
}
else {
return '<a href="http://'.$value.'">'.$value.'</a>';
}
}
}
public static function calendar($value)
{
if (empty($value)) {
return JHtml::_('users.value', $value);
} else {
return JHtml::_('date', $value, null, null);
}
}
public static function tos($value)
{
if ($value) {
return JText::_('JYES');
}
else {
return JText::_('JNO');
}
}
{
if ($value) {
return JText::_('JYES');
}
else {
return JText::_('JNO');
}
}
/**
* @param JForm $form The form to be altered.
* @param array $data The associated data for the form.
*
* @return boolean
* @since 1.6
*/
function onContentPrepareForm($form, $data)
{
if (!($form instanceof JForm))
{
$this->_subject->setError('JERROR_NOT_A_FORM');
return false;
}
// Check we are manipulating a valid form.
$name = $form->getName();
if (!in_array($name, array('com_admin.profile', 'com_users.user', 'com_users.profile', 'com_users.registration'))) {
return true;
}
// Add the registration fields to the form.
JForm::addFormPath(dirname(__FILE__).'/profiles');
$form->loadFile('profile', false);
$fields = array(
'address1',
'address2',
'city',
'region',
'country',
'postal_code',
'phone',
'website',
'favoritebook',
'aboutme',
'tos',
'dob',
'subscribe',
);
foreach ($fields as $field) {
// Case using the users manager in admin
if ($name == 'com_users.user') {
// Remove the field if it is disabled in registration and profile
if ($this->params->get('register-require_' . $field, 1) == 0 &&
$this->params->get('profile-require_' . $field, 1) == 0) {
$form->removeField($field, 'profile7');
}
}
// Case registration
elseif ($name == 'com_users.registration') {
// Toggle whether the field is required.
if ($this->params->get('register-require_' . $field, 1) > 0) {
$form->setFieldAttribute($field, 'required', ($this->params->get('register-require_' . $field) == 2) ? 'required' : '', 'profile7');
}
else {
$form->removeField($field, 'profile7');
}
}
// Case profile in site or admin
elseif ($name == 'com_users.profile' || $name == 'com_admin.profile') {
// Toggle whether the field is required.
if ($this->params->get('profile-require_' . $field, 1) > 0) {
$form->setFieldAttribute($field, 'required', ($this->params->get('profile-require_' . $field) == 2) ? 'required' : '', 'profile7');
}
else {
$form->removeField($field, 'profile7');
}
}
}
return true;
}
function onUserAfterSave($data, $isNew, $result, $error)
{
$userId = JArrayHelper::getValue($data, 'id', 0, 'int');
////BEGIN CUSTOM CODE
//
//put this inside the onUserAfterSave function in profile7.php
// This code will check if the user clicked the radio button for email
// updates by checking the 'subscribe' boolean in the data
// then assign the user to that group (group 9) if true
$groupID = 9; //9 is the value for the subscriber group in the ACL
//DEBUG code that forces if statement to come up true:
//$subscribeFlag = 1;
if ($userId && (isset($data['profile7']['subscribe'])))
{
$subscribeFlag = ($data['profile7']['subscribe']);
if (!($subscribeFlag == 0))
{
try
{
JUserHelper::addUserToGroup($userId, $groupID);
}
catch (JException $e)
{
$this->_subject->setError($e->getMessage());
return false;
}
}
else
{
try
{
JUserHelper::removeUserFromGroup($userId, $groupID);
}
catch (JException $e)
{
$this->_subject->setError($e->getMessage());
return false;
}
}
}
//END CUSTOM CODE
//
if ($userId && $result && isset($data['profile7']) && (count($data['profile7'])))
{
try
{
//Sanitize the date
if (!empty($data['profile7']['dob'])) {
$date = new JDate($data['profile7']['dob']);
$data['profile7']['dob'] = $date->format('Y-m-d');
}
$db = JFactory::getDbo();
$db->setQuery(
'DELETE FROM #__user_profiles WHERE user_id = '.$userId .
" AND profile_key LIKE 'profile7.%'"
);
if (!$db->query()) {
throw new Exception($db->getErrorMsg());
}
$tuples = array();
$order = 1;
foreach ($data['profile7'] as $k => $v)
{
$tuples[] = '('.$userId.', '.$db->quote('profile7.'.$k).', '.$db->quote(json_encode($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 'profile.%'"
);
if (!$db->query()) {
throw new Exception($db->getErrorMsg());
}
}
catch (JException $e)
{
$this->_subject->setError($e->getMessage());
return false;
}
}
return true;
}
}
----------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<extension version="2.5" type="plugin" group="user">
<name>plg_user_profile7</name>
<author>Joomla! Project</author>
<creationDate>January 2008</creationDate>
<copyright>(C) 2005 - 2012 Open Source Matters. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>2.5.0</version>
<description>PLG_USER_PROFILE7_XML_DESCRIPTION</description>
<files>
<filename plugin="profile7">profile7.php</filename>
<filename>index.html</filename>
<folder>profiles</folder>
</files>
<languages>
<language tag="en-GB">en-GB.plg_user_profile7.ini</language>
<language tag="en-GB">en-GB.plg_user_profile7.sys.ini</language>
</languages>
<config>
<fields name="params">
<fieldset name="basic">
<field name="register-require-user" type="spacer" class="text"
label="PLG_USER_PROFILE7_FIELD_NAME_REGISTER_REQUIRE_USER"
/>
<field name="register-require_address1" type="list"
description="PLG_USER_PROFILE7_FIELD_ADDRESS1_DESC"
label="PLG_USER_PROFILE7_FIELD_ADDRESS1_LABEL"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="register-require_address2" type="list"
description="PLG_USER_PROFILE7_FIELD_ADDRESS2_DESC"
label="PLG_USER_PROFILE7_FIELD_ADDRESS2_LABEL"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="register-require_city" type="list"
description="PLG_USER_PROFILE7_FIELD_CITY_DESC"
label="PLG_USER_PROFILE7_FIELD_CITY_LABEL"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="register-require_region" type="list"
description="PLG_USER_PROFILE7_FIELD_REGION_DESC"
label="PLG_USER_PROFILE7_FIELD_REGION_LABEL"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="register-require_country" type="list"
description="PLG_USER_PROFILE7_FIELD_COUNTRY_DESC"
label="PLG_USER_PROFILE7_FIELD_COUNTRY_LABEL"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="register-require_postal_code" type="list"
description="PLG_USER_PROFILE7_FIELD_POSTAL_CODE_DESC"
label="PLG_USER_PROFILE7_FIELD_POSTAL_CODE_LABEL"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="register-require_phone" type="list"
description="PLG_USER_PROFILE7_FIELD_PHONE_DESC"
label="PLG_USER_PROFILE7_FIELD_PHONE_LABEL"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="register-require_website" type="list"
description="PLG_USER_PROFILE7_FIELD_WEB_SITE_DESC"
label="PLG_USER_PROFILE7_FIELD_WEB_SITE_LABEL"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="register-require_favoritebook"
type="list"
label="PLG_USER_PROFILE7_FIELD_FAVORITE_BOOK_LABEL"
description="PLG_USER_PROFILE7_FIELD_FAVORITE_BOOK_DESC"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field
name="register-require_aboutme"
type="list"
label="PLG_USER_PROFILE7_FIELD_ABOUT_ME_LABEL"
description="PLG_USER_PROFILE7_FIELD_ABOUT_ME_DESC"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field
name="register-require_tos"
type="list"
label="PLG_USER_PROFILE7_FIELD_TOS_LABEL"
description="PLG_USER_PROFILE7_FIELD_TOS_DESC"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field
name="register-require_subscribe"
type="list"
label="PLG_USER_PROFILE7_FIELD_SUBSCRIBE_LABEL"
description="PLG_USER_PROFILE7_FIELD_SUBSCRIBE_DESC">
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field
name="register-require_dob"
type="list"
label="PLG_USER_PROFILE7_FIELD_DOB_LABEL"
description="PLG_USER_PROFILE7_FIELD_DOB_DESC">
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="spacer1" type="spacer"
hr="true"
/>
<field name="profile-require-user" type="spacer" class="text"
label="PLG_USER_PROFILE7_FIELD_NAME_PROFILE_REQUIRE_USER"
/>
<field name="profile-require_address1" type="list"
description="PLG_USER_PROFILE7_FIELD_ADDRESS1_DESC"
label="PLG_USER_PROFILE7_FIELD_ADDRESS1_LABEL"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="profile-require_address2" type="list"
description="PLG_USER_PROFILE7_FIELD_ADDRESS2_DESC"
label="PLG_USER_PROFILE7_FIELD_ADDRESS2_LABEL"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="profile-require_city" type="list"
description="PLG_USER_PROFILE7_FIELD_CITY_DESC"
label="PLG_USER_PROFILE7_FIELD_CITY_LABEL"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="profile-require_region" type="list"
description="PLG_USER_PROFILE7_FIELD_REGION_DESC"
label="PLG_USER_PROFILE7_FIELD_REGION_LABEL"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="profile-require_country" type="list"
description="PLG_USER_PROFILE7_FIELD_COUNTRY_DESC"
label="PLG_USER_PROFILE7_FIELD_COUNTRY_LABEL"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="profile-require_postal_code" type="list"
description="PLG_USER_PROFILE7_FIELD_POSTAL_CODE_DESC"
label="PLG_USER_PROFILE7_FIELD_POSTAL_CODE_LABEL"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="profile-require_phone" type="list"
description="PLG_USER_PROFILE7_FIELD_PHONE_DESC"
label="PLG_USER_PROFILE7_FIELD_PHONE_LABEL"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="profile-require_website" type="list"
description="PLG_USER_PROFILE7_FIELD_WEB_SITE_DESC"
label="PLG_USER_PROFILE7_FIELD_WEB_SITE_LABEL"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field name="profile-require_favoritebook"
type="list"
label="PLG_USER_PROFILE7_FIELD_FAVORITE_BOOK_LABEL"
description="PLG_USER_PROFILE7_FIELD_FAVORITE_BOOK_DESC">
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field
name="profile-require_aboutme"
type="list"
label="PLG_USER_PROFILE7_FIELD_ABOUT_ME_LABEL"
description="PLG_USER_PROFILE7_FIELD_ABOUT_ME_DESC">
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field
name="profile-require_tos"
type="list"
label="PLG_USER_PROFILE7_FIELD_TOS_LABEL"
description="PLG_USER_PROFILE7_FIELD_TOS_DESC">
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field
name="profile-require_dob"
type="list"
label="PLG_USER_PROFILE7_FIELD_DOB_LABEL"
description="PLG_USER_PROFILE7_FIELD_DOB_DESC"
>
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
<field
name="profile-require_subscribe"
type="list"
label="PLG_USER_PROFILE7_FIELD_SUBSCRIBE_LABEL"
description="PLG_USER_PROFILE7_FIELD_SUBSCRIBE_DESC">
<option value="2">JOPTION_REQUIRED</option>
<option value="1">JOPTION_OPTIONAL</option>
<option value="0">JDISABLED</option>
</field>
</fieldset>
</fields>
</config>
</extension>
--------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<form>
<fields name="profile7">
<fieldset name="profile7"
label="PLG_USER_PROFILE7_SLIDER_LABEL"
>
<field
name="address1"
type="text"
id="address1"
description="PLG_USER_PROFILE7_FIELD_ADDRESS1_DESC"
filter="string"
label="PLG_USER_PROFILE7_FIELD_ADDRESS1_LABEL"
message="PLG_USER_PROFILE7_FIELD_ADDRESS1_MESSAGE"
size="30"
/>
<field
name="address2"
type="text"
id="address2"
description="PLG_USER_PROFILE7_FIELD_ADDRESS2_DESC"
filter="string"
label="PLG_USER_PROFILE7_FIELD_ADDRESS2_LABEL"
message="PLG_USER_PROFILE7_FIELD_ADDRESS1_MESSAGE"
size="30"
/>
<field
name="city"
type="text"
id="city"
description="PLG_USER_PROFILE7_FIELD_CITY_DESC"
filter="string"
label="PLG_USER_PROFILE7_FIELD_CITY_LABEL"
message="PLG_USER_PROFILE7_FIELD_CITY_MESSAGE"
size="30"
/>
<field
name="region"
type="text"
id="region"
description="PLG_USER_PROFILE7_FIELD_REGION_DESC"
filter="string"
label="PLG_USER_PROFILE7_FIELD_REGION_LABEL"
message="PLG_USER_PROFILE7_FIELD_REGION_MESSAGE"
size="30"
/>
<field
name="country"
type="text"
id="country"
description="PLG_USER_PROFILE7_FIELD_COUNTRY_DESC"
filter="string"
label="PLG_USER_PROFILE7_FIELD_COUNTRY_LABEL"
message="PLG_USER_PROFILE7_FIELD_COUNTRY_MESSAGE"
size="30"
/>
<field
name="postal_code"
type="text"
id="postal_code"
description="PLG_USER_PROFILE7_FIELD_POSTAL_CODE_DESC"
filter="string"
label="PLG_USER_PROFILE7_FIELD_POSTAL_CODE_LABEL"
message="PLG_USER_PROFILE7_FIELD_POSTAL_CODE_MESSAGE"
size="30"
/>
<field
name="phone"
type="tel"
id="phone"
description="PLG_USER_PROFILE7_FIELD_PHONE_DESC"
filter="string"
label="PLG_USER_PROFILE7_FIELD_PHONE_LABEL"
message="PLG_USER_PROFILE7_FIELD_PHONE_MESSAGE"
size="30"
/>
<field
name="website"
type="url"
id="website"
description="PLG_USER_PROFILE7_FIELD_WEB_SITE_DESC"
filter="string"
label="PLG_USER_PROFILE7_FIELD_WEB_SITE_LABEL"
message="PLG_USER_PROFILE7_FIELD_WEB_SITE_MESSAGE"
size="30"
/>
<field
name="favoritebook"
type="text"
description="PLG_USER_PROFILE7_FIELD_FAVORITE_BOOK_DESC"
filter="string"
label="PLG_USER_PROFILE7_FIELD_FAVORITE_BOOK_LABEL"
message="PLG_USER_PROFILE7_FIELD_FAVORITE_BOOK_MESSAGE"
size="30"
/>
<field
name="aboutme"
type="textarea"
description="PLG_USER_PROFILE7_FIELD_ABOUT_ME_DESC"
label="PLG_USER_PROFILE7_FIELD_ABOUT_ME_LABEL"
message="PLG_USER_PROFILE7_FIELD_ABOUT_ME_MESSAGE"
cols="30"
rows="5"
filter="safehtml"
/>
<field
name="subscribe"
type="radio"
default="0"
label="PLG_USER_PROFILE7_FIELD_SUBSCRIBE_LABEL"
description="PLG_USER_PROFILE7_FIELD_SUBSCRIBE_DESC">
<option value="0">PLG_USER_PROFILE7_OPTION_NO</option>
<option value="1">PLG_USER_PROFILE7_OPTION_YES</option>
</field>
<field
name="tos"
type="radio"
label="PLG_USER_PROFILE7_FIELD_TOS_LABEL"
description="PLG_USER_PROFILE7_FIELD_TOS_DESC">
<option value="1">PLG_USER_PROFILE7_OPTION_AGREE</option>
</field>
<field
name="dob"
type="calendar"
label="PLG_USER_PROFILE7_FIELD_DOB_LABEL"
description="PLG_USER_PROFILE7_FIELD_DOB_DESC">
</field>
</fieldset>
</fields>
</form>
------------------------------------------------------------------------------------------------------------