To make all user defined required, open register.php, comment out/delete
array('label', $lang_register_php['optional_info'])
and
$form_data = array_slice($form_data, 0, count($form_data)-1);
find
$profile1 = $superCage->post->getEscaped('user_profile1');
$profile2 = $superCage->post->getEscaped('user_profile2');
$profile3 = $superCage->post->getEscaped('user_profile3');
$profile4 = $superCage->post->getEscaped('user_profile4');
$profile5 = $superCage->post->getEscaped('user_profile5');
$profile6 = $superCage->post->getEscaped('user_profile6');
$agree_disclaimer = $superCage->post->getEscaped('agree');
and replace with
$profile1 = $CONFIG['user_profile1_name'] != '' ? trim(get_post_var('user_profile1')) : $superCage->post->getEscaped('user_profile1');
$profile2 = $CONFIG['user_profile2_name'] != '' ? trim(get_post_var('user_profile2')) : $superCage->post->getEscaped('user_profile2');
$profile3 = $CONFIG['user_profile3_name'] != '' ? trim(get_post_var('user_profile3')) : $superCage->post->getEscaped('user_profile3');
$profile4 = $CONFIG['user_profile4_name'] != '' ? trim(get_post_var('user_profile4')) : $superCage->post->getEscaped('user_profile4');
$profile5 = $CONFIG['user_profile5_name'] != '' ? trim(get_post_var('user_profile5')) : $superCage->post->getEscaped('user_profile5');
$profile6 = $CONFIG['user_profile6_name'] != '' ? trim(get_post_var('user_profile6')) : $superCage->post->getEscaped('user_profile6');
If you want to show an error message before the form will be submitted, open register.php, find
if (isset($lang_register_php[$element[1].'_warning2']) == TRUE) {
$warning2 = '<div id="'.$element[1].'_warning2" class="cpg_message_validation formFieldWarning" style="display:none;">' . $lang_register_php[$element[1].'_warning2'] . '</div>';
} else {
$warning2 = '';
}
below, add
if ($element[1] == 'user_profile1') {
$warning1 = '<div id="user_profile1_warning1" class="cpg_message_validation formFieldWarning" style="display:none;">';
$warning1 .= 'The ' . $CONFIG['user_profile1_name'] . ' mustn\'t be empty!';
$warning1 .= '</div>';
$warning2 = '';
}
if ($element[1] == 'user_profile2') {
$warning1 = '<div id="user_profile2_warning1" class="cpg_message_validation formFieldWarning" style="display:none;">';
$warning1 .= 'The ' . $CONFIG['user_profile2_name'] . ' mustn\'t be empty!';
$warning1 .= '</div>';
$warning2 = '';
}
if ($element[1] == 'user_profile3') {
$warning1 = '<div id="user_profile3_warning1" class="cpg_message_validation formFieldWarning" style="display:none;">';
$warning1 .= 'The ' . $CONFIG['user_profile3_name'] . ' mustn\'t be empty!';
$warning1 .= '</div>';
$warning2 = '';
}
if ($element[1] == 'user_profile4') {
$warning1 = '<div id="user_profile4_warning1" class="cpg_message_validation formFieldWarning" style="display:none;">';
$warning1 .= 'The ' . $CONFIG['user_profile4_name'] . ' mustn\'t be empty!';
$warning1 .= '</div>';
$warning2 = '';
}
if ($element[1] == 'user_profile5') {
$warning1 = '<div id="user_profile5_warning1" class="cpg_message_validation formFieldWarning" style="display:none;">';
$warning1 .= 'The ' . $CONFIG['user_profile5_name'] . ' mustn\'t be empty!';
$warning1 .= '</div>';
$warning2 = '';
}
find
case 'textarea':
if ($superCage->post->keyExists($element[1])) {
$value = $superCage->post->getEscaped($element[1]);
} else {
$value = '';
}
if ($element[2]) {
echo <<< EOT
<tr>
<td width="40%" class="{$row_style}">
{$element[2]}
</td>
<td width="60%" class="{$row_style}" valign="top">
<textarea name="{$element[1]}" rows="7" cols="60" class="textinput" style="width:100%">$value</textarea>
</td>
</tr>
EOT;
}
break;
and replace with
case 'textarea':
if ($superCage->post->keyExists($element[1])) {
$value = $superCage->post->getEscaped($element[1]);
} else {
$value = '';
}
if ($element[1] == 'user_profile6') {
$warning1 = '<div id="user_profile6_warning1" class="cpg_message_validation formFieldWarning" style="display:none;">';
$warning1 .= 'The ' . $CONFIG['user_profile6_name'] . ' mustn\'t be empty!';
$warning1 .= '</div>';
$warning2 = '';
}
if ($element[2]) {
echo <<< EOT
<tr>
<td width="40%" class="{$row_style}">
{$element[2]}
</td>
<td width="60%" class="{$row_style}" valign="top">
<textarea name="{$element[1]}" id="{$element[1]}" rows="7" cols="60" class="textinput" style="width:100%">$value</textarea>
{$warning1}
{$warning2}
</td>
</tr>
EOT;
}
break;
open js/register.js, find
if (errors != 0) {
$('#form_not_submit_top').show();
$('#form_not_submit_bottom').show();
return false;
} else {
return true;
}
above, add
// Check user_profile1
if($('#user_profile1').val() == '') {
$('#user_profile1_warning1').show();
errors++;
}
// Check user_profile2
if($('#user_profile2').val() == '') {
$('#user_profile2_warning1').show();
errors++;
}
// Check user_profile3
if($('#user_profile3').val() == '') {
$('#user_profile3_warning1').show();
errors++;
}
// Check user_profile4
if($('#user_profile4').val() == '') {
$('#user_profile4_warning1').show();
errors++;
}
// Check user_profile5
if($('#user_profile5').val() == '') {
$('#user_profile5_warning1').show();
errors++;
}
// Check user_profile6
if($('#user_profile6').val() == '') {
$('#user_profile6_warning1').show();
errors++;
}