0
我有一個Joomla的自注冊腳本和它的作品沒有問題,但現在我想添加像地址和細胞數一些「輪廓」字段。的Joomla與個人資料欄自定義註冊腳本
這是我的代碼:
<?php
if($_POST["name"] || $_POST["email"] || $_POST["username"] || $_POST["password"]){
define('_JEXEC', 1);
define('JPATH_BASE', dirname(__FILE__));
define('DS', DIRECTORY_SEPARATOR);
require_once (JPATH_BASE .DS.'includes'.DS.'defines.php');
require_once (JPATH_BASE .DS.'includes'.DS.'framework.php');
$app = JFactory::getApplication('site');
$app->initialise();
require_once(JPATH_BASE.DS.'components'.DS.'com_users'.DS.'models'.DS.'registration.php');
$lang = JFactory::getLanguage();
$extension = 'com_users';
$base_dir = JPATH_SITE;
$language_tag = 'it-IT';
$reload = true;
$lang->load($extension, $base_dir, $language_tag, $reload);
$model = new UsersModelRegistration();
jimport('joomla.mail.helper');
jimport('joomla.user.helper');
$username = $_POST['username'];
$name = $_POST['name'];
$email = $_POST['email'];
$block = '0';
$sendEmail = '1';
$activation = '';
$data = array('username' => $username,
'name' => $name,
'email1' => $email,
'password1' => $password, // First password field
'password2' => $password, // Confirm password field
'sendEmail' => $sendEmail,
'activation' => $activation,
'block' => 0);
echo $model->register($data);
}
?>
我已經添加以下代碼:
'profile.address1' => $indirizzo,
'profile.city' => $citta,
'profile.phone' => $cellulare,
,但它不工作...
我如何可以添加個人資料數據庫字段到這個註冊腳本?
感謝所有。
中的鏈接沒有任何提及個人資料欄位。 我加'$配置= JUserHelper :: getProfile($用戶> ID);'我可以讀取用戶領域,但我不能創建新的ID字段到user_profiles分貝。 – Kerberos