TheOracle:
What is the array you have on where the moderators_level is being called from your create_account.php file (post the whole array block) ?
I am using the updated create account that you just released. Here it is:
if ($error == true) {
// hook notifier class
$zco_notifier->notify('NOTIFY_FAILURE_DURING_CREATE_ACCOUNT');
} else {
$sql_data_array = array('moderators_level' => 1,
'customers_firstname' => $firstname,
'customers_lastname' => $lastname,
'customers_email_address' => $email_address,
'customers_nick' => $nick,
'customers_telephone' => $telephone,
'customers_fax' => $fax,
'customers_newsletter' => (int)$newsletter,
'customers_email_format' => $email_format,
'customers_default_address_id' => 0,
'customers_password' => zen_encrypt_password($password),
'customers_authorization' => (int)CUSTOMERS_APPROVAL_AUTHORIZATION
);
if ((CUSTOMERS_REFERRAL_STATUS == '2' and $customers_referral != '')) $sql_data_array['customers_referral'] = $customers_referral;
if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = (empty($_POST['dob']) || $dob_entered == '0001-01-01 00:00:00' ? zen_db_prepare_input('0001-01-01 00:00:00') : zen_date_raw($_POST['dob']));
zen_db_perform(TABLE_CUSTOMERS, $sql_data_array);
$_SESSION['customer_id'] = $db->Insert_ID();
$sql_data_array = array('customers_id' => $_SESSION['customer_id'],
'entry_firstname' => $firstname,
'entry_lastname' => $lastname,
'entry_street_address' => $street_address,
'entry_postcode' => $postcode,
'entry_city' => $city,
'entry_country_id' => $country);
if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
if (ACCOUNT_STATE == 'true') {
if ($zone_id > 0) {
$sql_data_array['entry_zone_id'] = $zone_id;
$sql_data_array['entry_state'] = '';
} else {
$sql_data_array['entry_zone_id'] = '0';
$sql_data_array['entry_state'] = $state;
}
}
zen_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
$address_id = $db->Insert_ID();
// Additional customers fields.
$additional_sql = "";
$table_fields = $db->get_table_fields(TABLE_CUSTOMERS);
if (isset($table_fields) && !empty($table_fields)) {
foreach ($table_fields as $key => $val) {
if (!in_array($key, $customers_table_fields)) {
$key = zen_output_string_protected($key);
if (isset($_POST[$key]) && isset($table_fields[$key]) && eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,6}$", zen_db_prepare_input($_POST[$key])) && zen_validate_email($_POST[$key]) == true) {
$additional_sql .= "$key = '".zen_db_prepare_input($_POST[$key])."', ";
} elseif (isset($_POST[$key]) && isset($table_fields[$key]) && preg_match("/[a-zA-Z0-9\.\,;:%&#@!\^-_~`\"'\[\]\{\}\*\/\?\(\)\n\r]/", $_POST[$key])) {
$additional_sql .= "$key = '".zen_db_prepare_input(strip_tags($_POST[$key]))."', ";
} // End of if statement.
} // End of if statement.
} // End of foreach statement.
} // End of if statement.
if (!empty($additional_sql)) {
$additional_sql .= substr($additional_sql, 0, strlen($additional_sql) -2);
}
$sql = "update (" . TABLE_CUSTOMERS . "
set customers_default_address_id = '" . (int)$address_id . "', " . zen_db_output($additional_sql) . "
where customers_id = '" . (int)$_SESSION['customer_id'] . "')";
$db->Execute($sql);
// End of additional customers fields.
$sql = "insert into " . TABLE_CUSTOMERS_INFO . "
(customers_info_id, customers_info_number_of_logons, customers_info_date_account_created)
values ('" . (int)$_SESSION['customer_id'] . "', '0', now())";
$db->Execute($sql);
Also I am having problems with customer viewing or changing information on the customer end.
1054 Unknown column 'ac.field_required' in 'field list'
in:
[SELECT c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, c.customers_telephone, c.customers_fax, c.customers_email_format, c.customers_referral, ac.field_name, ac.field_status, ac.field_required , c.customers_cellphone FROM (customers c, customers_additional ac) WHERE c.customers_id = 26]