0

Hi all,

I want to create a required field on a registry form. I am using php nuke evolution and want the field "Game GUID" as a requirement. Where i am having the problems is i dont know where to put it in mysql and how to read it from the database.

I think there needs to be three files included in registering.

Sorry for repost, but i didnt put the code tag round my code.

//new_user1.php

if (!defined('MODULE_FILE')) {
die ("You can't access this file directly...");
}

if (!defined('CNBYA')) {
die('CNBYA protection');
}

if(!isset($_SESSION)) { session_start(); }

unset($_SESSION['YA1']);
unset($_SESSION['YA2']);

$_SESSION['YA1'] = true;

include_once(NUKE_BASE_DIR.'header.php');
title(_USERAPPLOGIN);
OpenTable();
echo "<form action='modules.php?name=$module_name' method='post' name='newuser'>\n";
echo "<table align='center' cellpadding='3' cellspacing='3' border='0'>\n";
echo "<tr><td align='center' bgcolor='$bgcolor1' colspan='2'><div class=\"textbold\">"._REGNEWUSER."</div></td></tr>\n";
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._NICKNAME.":</div>"._REQUIRED."</td><td bgcolor='$bgcolor1'><input type='text' name='ya_username' size='15' maxlength='".$ya_config['nick_max']."'><br /><span class='tiny'>("._YA_NICKLENGTH.")</span></td></tr>\n";
// menelaos: by request: added realname to the registration form
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._UREALNAME.":</div>"._REQUIRED."</td><td bgcolor='$bgcolor1'><input type='text' name='ya_realname' size='40' maxlength='60'><br /><span class='tiny'>"._YA_REALNAMENOTE."</span></td></tr>\n";

//GameGUID added By Geordie 
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._GAMEGUID.":</div>"._REQUIRED."</td><td bgcolor='$bgcolor1'><input type='text' name='ya_gameguid' size='8' maxlength='32'><br /><span class='tiny'>"._YA_GAMEGUID."</span></td></tr>\n";

echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._EMAIL.":</div>"._REQUIRED."</td><td bgcolor='$bgcolor1'><input type='text' name='ya_user_email' size='40' maxlength='255'>&nbsp;<span class='tiny'></span></td></tr>\n";

// menelaos: added configurable doublecheck email routine
if ($ya_config['doublecheckemail']==1) {
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._RETYPEEMAIL.":</div></td><td bgcolor='$bgcolor1'><input type='text' name='ya_user_email2' size='40' maxlength='255'></td></tr>\n";
} else {
echo "<input type='hidden' name='ya_user_email2' value='ya_user_email'>\n";
}

$result = $db->sql_query("SELECT * FROM ".$user_prefix."_cnbya_field WHERE (need = '2') OR (need = '3') ORDER BY pos");
while ($sqlvalue = $db->sql_fetchrow($result)) {
$t = $sqlvalue[fid];
$value2 = explode("::", $sqlvalue[value]);
if (substr($sqlvalue[name],0,1)=='_') eval( "\$name_exit = $sqlvalue[name];"); else $name_exit = $sqlvalue[name];
if (count($value2) == 1) {
echo "<tr><td bgcolor='$bgcolor2'>$name_exit</td><td bgcolor='$bgcolor3'>";
echo "<input type='text' name='nfield[$t]' size='20' maxlength='$sqlvalue[size]'>\n";
} else {
echo "<tr><td bgcolor='$bgcolor2'>$name_exit</td><td bgcolor='$bgcolor3'>";
echo "<select name='nfield[$t]'>\n";
for ($i = 0; $i<count($value2); $i++) {
echo "<option value=\"".trim($value2[$i])."\">".trim($value2[$i])."</option>\n";
}
echo "</select>";
}
if (($sqlvalue[need]) > 1) echo"&nbsp;<span class='tiny'>"._REQUIRED."</span>";
echo "</td></tr>\n";
}
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._PASSWORD.":</div></td><td bgcolor='$bgcolor1'><input type='password' name='user_password' size='10' maxlength='".$ya_config['pass_max']."' onkeyup='chkpwd(newuser.user_password.value)' onblur='chkpwd(newuser.user_password.value)' onmouseout='chkpwd(newuser.user_password.value)'>";
/*****[BEGIN]******************************************
[ Mod: Password Strength Meter v1.0.0 ]
******************************************************/
echo "<table width='300' cellpadding='2' cellspacing='0' border='1' bgcolor='#EBEBEB' style='border-collapse: collapse;'><tr>
<td id='td1' width='100' align='center'><div ID='div1'></div></td>
<td id='td2' width='100' align='center'><div ID='div2'></div></td>
<td id='td3' width='100' align='center'><div ID='div3'>"._PSM_NOTRATED."</div></td>
<td id='td4' width='100' align='center'><div ID='div4'></div></td>
<td id='td5' width='100' align='center'><div ID='div5'></div></td>
</tr></table><div ID='divTEMP'></div>";
echo _PSM_CLICK." <a href=\"javascript:strengthhelp()\">"._PSM_HERE."</a> "._PSM_HELP."<br />";
/*****[END]********************************************
[ Mod: Password Strength Meter v1.0.0 ]
******************************************************/
echo "<br /><span class='tiny'>("._BLANKFORAUTO.")</span><br /><span class='tiny'>("._YA_PASSLENGTH.")</span></td></tr>\n";
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._RETYPEPASSWORD.":</div></td><td bgcolor='$bgcolor1'><input type='password' name='user_password2' size='10' maxlength='".$ya_config['pass_max']."'><br /><span class='tiny'>("._BLANKFORAUTO.")</span><br /><span class='tiny'>("._YA_PASSLENGTH.")</span></td></tr>\n";
$gfxchk = array(3,4,6);
$gfx = security_code($gfxchk, 'stacked');
if(!empty($gfx)) {
echo "<tr><td bgcolor='$bgcolor2' colspan='2'><center>".$gfx."</center></td></tr>";
}
echo "<input type='hidden' name='op' value='new_confirm'>\n";
echo "<tr><td align='right' bgcolor='$bgcolor1' colspan='2'><input type='submit' value='"._YA_CONTINUE."'></td></tr>\n";
echo "</table></form>\n";
echo "<br />\n";
echo _WAITAPPROVAL."<br /><br />\n";
echo _COOKIEWARNING."<br />\n";
echo _ASREGUSER."<br />\n";
echo "<ul>\n";
echo "<li>"._ASREG1."\n";
echo "<li>"._ASREG2."\n";
echo "<li>"._ASREG3."\n";
echo "<li>"._ASREG4."\n";
echo "<li>"._ASREG5."\n";
$handle=opendir('themes');
while ($file = readdir($handle)) {
if ((!ereg("[.]",$file) AND file_exists("themes/$file/theme.php"))) { $thmcount++; }
}
closedir($handle);
if ($thmcount > 1) { echo "<li>"._ASREG6."\n"; }
$sql = "SELECT custom_title FROM ".$prefix."_modules WHERE active='1' AND view='1' AND inmenu='1'";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$custom_title = $row[custom_title];
if (!empty($custom_title)) { echo "<li>"._ACCESSTO." $custom_title\n"; }
}
$sql = "SELECT title FROM ".$prefix."_blocks WHERE active='1' AND view='1'";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$b_title = $row[title];
if (!empty($b_title)) { echo "<li>"._ACCESSTO." $b_title\n"; }
}
if (is_active("Journal")) { echo "<li>"._CREATEJOURNAL."\n"; }
if ($my_headlines == 1) { echo "<li>"._READHEADLINES."\n"; }
echo "<li>"._ASREG7."\n";
echo "</ul>\n";
echo _REGISTERNOW."<br />\n";
echo _WEDONTGIVE."<br /><br />\n";
CloseTable();
include_once(NUKE_BASE_DIR.'footer.php');

?>

//new_user2.php

if (!defined('MODULE_FILE')) {
die ("You can't access this file directly...");
}

if (!defined('CNBYA')) {
die('CNBYA protection');
}

include_once(NUKE_BASE_DIR.'header.php');
title(_USERREGLOGIN);
OpenTable();
echo "<form action='modules.php?name=$module_name' method='post' name='newuser'>\n";
echo "<table align='center' cellpadding='3' cellspacing='3' border='0'>\n";
echo "<tr><td align='center' bgcolor='$bgcolor1' colspan='2'><div class=\"textbold\">"._REGNEWUSER."</div></td></tr>\n";
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._NICKNAME.":</div></td><td bgcolor='$bgcolor1'><input type='text' name='ya_username' size='15' maxlength='".$ya_config['nick_max']."'>&nbsp;<span class='tiny'>"._REQUIRED."</span><br /><span class='tiny'>("._YA_NICKLENGTH.")</span></td></tr>\n";
// menelaos: by request: added realname to the registration form
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._UREALNAME.":</div>"._REQUIRED."</td><td bgcolor='$bgcolor1'><input type='text' name='ya_realname' size='40' maxlength='60'></td></tr>\n";

echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._EMAIL.":</div></td><td bgcolor='$bgcolor1'><input type='text' name='ya_user_email' size='40' maxlength='255'>&nbsp;<span class='tiny'>"._REQUIRED."</span></td></tr>\n";

// menelaos: added configurable doublecheck email routine
if ($ya_config['doublecheckemail']==1) {
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._RETYPEEMAIL.":</div></td><td bgcolor='$bgcolor1'><input type='text' name='ya_user_email2' size='40' maxlength='255'></td></tr>\n";
} else {
echo "<input type='hidden' name='ya_user_email2' value='ya_user_email'>\n";
}

$result = $db->sql_query("SELECT * FROM ".$user_prefix."_cnbya_field WHERE (need = '2') OR (need = '3') ORDER BY pos");
while ($sqlvalue = $db->sql_fetchrow($result)) {
$t = $sqlvalue[fid];
$value2 = explode("::", $sqlvalue[value]);
if (substr($sqlvalue[name],0,1)=='_') eval( "\$name_exit = $sqlvalue[name];"); else $name_exit = $sqlvalue[name];
if (count($value2) == 1) {
echo "<tr><td bgcolor='$bgcolor2'>$name_exit</td><td bgcolor='$bgcolor3'>";
echo "<input type='text' name='nfield[$t]' size='20' maxlength='$sqlvalue[size]'>\n";
} else {
echo "<tr><td bgcolor='$bgcolor2'>$name_exit</td><td bgcolor='$bgcolor3'>";
echo "<select name='nfield[$t]'>\n";
for ($i = 0; $i<count($value2); $i++) {
echo "<option value=\"".trim($value2[$i])."\">".trim($value2[$i])."</option>\n";
}
echo "</select>";
}
if (($sqlvalue[need]) > 1) echo"&nbsp;<span class='tiny'>"._REQUIRED."</span>";
echo "</td></tr>\n";
}

echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._PASSWORD.":</div></td><td bgcolor='$bgcolor1'><input type='password' name='user_password' size='10' maxlength='".$ya_config['pass_max']."' onkeyup='chkpwd(newuser.user_password.value)' onblur='chkpwd(newuser.user_password.value)' onmouseout='chkpwd(newuser.user_password.value)'>";
/*****[BEGIN]******************************************
[ Mod: Password Strength Meter v1.0.0 ]
******************************************************/
echo "<table width='300' cellpadding='2' cellspacing='0' border='1' bgcolor='#EBEBEB' style='border-collapse: collapse;'><tr>
<td id='td1' width='100' align='center'><div ID='div1'></div></td>
<td id='td2' width='100' align='center'><div ID='div2'></div></td>
<td id='td3' width='100' align='center'><div ID='div3'>"._PSM_NOTRATED."</div></td>
<td id='td4' width='100' align='center'><div ID='div4'></div></td>
<td id='td5' width='100' align='center'><div ID='div5'></div></td>
</tr></table><div ID='divTEMP'></div>";
echo _PSM_CLICK." <a href=\"javascript:strengthhelp()\">"._PSM_HERE."</a> "._PSM_HELP."<br />";
/*****[END]********************************************
[ Mod: Password Strength Meter v1.0.0 ]
******************************************************/
echo "<br /><span class='tiny'>("._BLANKFORAUTO.")</span><br /><span class='tiny'>("._YA_PASSLENGTH.")</span></td></tr>\n";
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._RETYPEPASSWORD.":</div></td><td bgcolor='$bgcolor1'><input type='password' name='user_password2' size='10' maxlength='".$ya_config['pass_max']."'><br /><span class='tiny'>("._BLANKFORAUTO.")</span><br /><span class='tiny'>("._YA_PASSLENGTH.")</span></td></tr>\n";

$gfxchk = array(3,4,6);
$gfx = security_code($gfxchk, 'stacked');
if(!empty($gfx)) {
echo "<tr><td bgcolor='$bgcolor2' colspan='2'><center>".$gfx."</center></td></tr>";
}
echo "<input type='hidden' name='op' value='new_confirm'>\n";
echo "<tr><td align='right' bgcolor='$bgcolor1' colspan='2'><input type='submit' value='"._YA_CONTINUE."'></td></tr>\n";
echo "</table></form>\n";
echo "<br />\n";
echo _YOUWILLRECEIVE."<br /><br />\n";
echo _COOKIEWARNING."<br />\n";
echo _ASREGUSER."<br />\n";
echo "<ul>\n";
echo "<li>"._ASREG1."\n";
echo "<li>"._ASREG2."\n";
echo "<li>"._ASREG3."\n";
echo "<li>"._ASREG4."\n";
echo "<li>"._ASREG5."\n";
$handle=opendir('themes');
while ($file = readdir($handle)) {
if ((!ereg("[.]",$file) AND file_exists("themes/$file/theme.php"))) { $thmcount++; }
}
closedir($handle);
if ($thmcount > 1) { echo "<li>"._ASREG6."\n"; }
$sql = "SELECT custom_title FROM ".$prefix."_modules WHERE active='1' AND view='1' AND inmenu='1'";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$custom_title = $row[custom_title];
if (!empty($custom_title)) { echo "<li>"._ACCESSTO." $custom_title\n"; }
}
$sql = "SELECT title FROM ".$prefix."_blocks WHERE active='1' AND view='1'";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$b_title = $row[title];
if (!empty($b_title)) { echo "<li>"._ACCESSTO." $b_title\n"; }
}
if (is_active("Journal")) { echo "<li>"._CREATEJOURNAL."\n"; }
if ($my_headlines == 1) { echo "<li>"._READHEADLINES."\n"; }
echo "<li>"._ASREG7."\n";
echo "</ul>\n";
echo _REGISTERNOW."<br />\n";
echo _WEDONTGIVE."<br /><br />\n";
echo "<center><span class='content'>[ <a href='modules.php?name=$module_name'>"._USERLOGIN."</a> | <a href='modules.php?name=$module_name&amp;op=pass_lost'>"._PASSWORDLOST."</a> ]</span></center>\n";
CloseTable();
include_once(NUKE_BASE_DIR.'footer.php');

?>

//new_user3.php

if (!defined('MODULE_FILE')) {
die ("You can't access this file directly...");
}

if (!defined('CNBYA')) {
die('CNBYA protection');
}

if(!isset($_SESSION)) { session_start(); }

unset($_SESSION['YA1']);
unset($_SESSION['YA2']);

$_SESSION['YA1'] = true;

function tz_select($default, $select_name = 'timezone')
{
$lang['tz']['-12'] = 'GMT - 12 Hours';
$lang['tz']['-11'] = 'GMT - 11 Hours';
$lang['tz']['-10'] = 'GMT - 10 Hours';
$lang['tz']['-9'] = 'GMT - 9 Hours';
$lang['tz']['-8'] = 'GMT - 8 Hours';
$lang['tz']['-7'] = 'GMT - 7 Hours';
$lang['tz']['-6'] = 'GMT - 6 Hours';
$lang['tz']['-5'] = 'GMT - 5 Hours';
$lang['tz']['-4'] = 'GMT - 4 Hours';
$lang['tz']['-3.5'] = 'GMT - 3.5 Hours';
$lang['tz']['-3'] = 'GMT - 3 Hours';
$lang['tz']['-2'] = 'GMT - 2 Hours';
$lang['tz']['-1'] = 'GMT - 1 Hours';
$lang['tz']['0'] = 'GMT';
$lang['tz']['1'] = 'GMT + 1 Hour';
$lang['tz']['2'] = 'GMT + 2 Hours';
$lang['tz']['3'] = 'GMT + 3 Hours';
$lang['tz']['3.5'] = 'GMT + 3.5 Hours';
$lang['tz']['4'] = 'GMT + 4 Hours';
$lang['tz']['4.5'] = 'GMT + 4.5 Hours';
$lang['tz']['5'] = 'GMT + 5 Hours';
$lang['tz']['5.5'] = 'GMT + 5.5 Hours';
$lang['tz']['6'] = 'GMT + 6 Hours';
$lang['tz']['6.5'] = 'GMT + 6.5 Hours';
$lang['tz']['7'] = 'GMT + 7 Hours';
$lang['tz']['8'] = 'GMT + 8 Hours';
$lang['tz']['9'] = 'GMT + 9 Hours';
$lang['tz']['9.5'] = 'GMT + 9.5 Hours';
$lang['tz']['10'] = 'GMT + 10 Hours';
$lang['tz']['11'] = 'GMT + 11 Hours';
$lang['tz']['12'] = 'GMT + 12 Hours';
$lang['tz']['13'] = 'GMT + 13 Hours';

if ( !isset($default) )
{
$default == $sys_timezone;
}
$tz_select = '<select name="user_timezone">';

while( list($offset, $zone) = @each($lang['tz']) )
{
$selected = ( $offset == $default ) ? ' selected="selected"' : '';
$tz_select .= '<option value="' . $offset . '"' . $selected . '>' . str_replace('GMT', 'UTC', $zone) . '</option>';
}
$tz_select .= '</select>';

return $tz_select;
}

/*****[BEGIN]******************************************
[ Mod: XData v0.1.1 ]
******************************************************/
define_once('XDATA', true);
include_once(NUKE_MODULES_DIR.'Your_Account/public/custom_functions.php');
/*****[END]********************************************
[ Mod: XData v0.1.1 ]
******************************************************/
include_once(NUKE_BASE_DIR.'header.php');
title(_USERREGLOGIN);
OpenTable();
echo "<form action='modules.php?name=$module_name' method='post' name='newuser'>\n";
echo "<table align='center' cellpadding='3' cellspacing='3' border='0'>\n";
echo "<tr><td align='center' bgcolor='$bgcolor1' colspan='2'><div class=\"textbold\">"._REGNEWUSER."</div></td></tr>\n";
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._NICKNAME.":</div>"._REQUIRED."</td><td bgcolor='$bgcolor1'><input type='text' name='ya_username' size='15' maxlength='".$ya_config['nick_max']."'>&nbsp;<span class='tiny'>"._REQUIRED."</span><br /><span class='tiny'>("._YA_NICKLENGTH.")</span></td></tr>\n";
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._UREALNAME.":</div>"._REQUIRED."</td><td bgcolor='$bgcolor1'><input type='text' name='ya_realname' size='40' maxlength='60'></td></tr>\n";
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._EMAIL.":</div>"._REQUIRED."</td><td bgcolor='$bgcolor1'><input type='text' name='ya_user_email' size='40' maxlength='255'>&nbsp;<span class='tiny'>"._REQUIRED."</span></td></tr>\n";

// menelaos: added configurable doublecheck email routine
if ($ya_config['doublecheckemail']==1) {
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._RETYPEEMAIL.":</div></td><td bgcolor='$bgcolor1'><input type='text' name='ya_user_email2' size='40' maxlength='255'></td></tr>\n";
} else {
echo "<input type='hidden' name='ya_user_email2' value='ya_user_email'>\n";
}

$result = $db->sql_query("SELECT * FROM ".$user_prefix."_cnbya_field WHERE (need = '2') OR (need = '3') ORDER BY pos");
while ($sqlvalue = $db->sql_fetchrow($result)) {
$t = $sqlvalue[fid];
$value2 = explode("::", $sqlvalue[value]);
if (substr($sqlvalue[name],0,1)=='_') eval( "\$name_exit = $sqlvalue[name];"); else $name_exit = $sqlvalue[name];
if (count($value2) == 1) {
echo "<tr><td bgcolor='$bgcolor2'>$name_exit</td><td bgcolor='$bgcolor3'>";
echo "<input type='text' name='nfield[$t]' size='20' maxlength='$sqlvalue[size]'>\n";
} else {
echo "<tr><td bgcolor='$bgcolor2'>$name_exit</td><td bgcolor='$bgcolor3'>";
echo "<select name='nfield[$t]'>\n";
for ($i = 0; $i<count($value2); $i++) {
echo "<option value=\"".trim($value2[$i])."\">".trim($value2[$i])."</option>\n";
}
echo "</select>";
}
if (($sqlvalue[need]) > 1) echo"&nbsp;<span class='tiny'>"._REQUIRED."</span>";
echo "</td></tr>\n";
}

echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._PASSWORD.":</div></td><td bgcolor='$bgcolor1'><input type='password' name='user_password' size='10' maxlength='".$ya_config['pass_max']."' onkeyup='chkpwd(newuser.user_password.value)' onblur='chkpwd(newuser.user_password.value)' onmouseout='chkpwd(newuser.user_password.value)'>";
/*****[BEGIN]******************************************
[ Mod: Password Strength Meter v1.0.0 ]
******************************************************/
echo "<table width='300' cellpadding='2' cellspacing='0' border='1' bgcolor='#EBEBEB' style='border-collapse: collapse;'><tr>
<td height='18' id='td1' width='100' align='center'><div ID='div1'></div></td>
<td height='18' id='td2' width='100' align='center'><div ID='div2'></div></td>
<td height='18' id='td3' width='100' align='center'><div ID='div3'>"._PSM_NOTRATED."</div></td>
<td height='18' id='td4' width='100' align='center'><div ID='div4'></div></td>
<td height='18' id='td5' width='100' align='center'><div ID='div5'></div></td>
</tr></table><div ID='divTEMP'></div>";
echo _PSM_CLICK." <a href=\"javascript:strengthhelp()\">"._PSM_HERE."</a> "._PSM_HELP."<br />";
/*****[END]********************************************
[ Mod: Password Strength Meter v1.0.0 ]
******************************************************/
echo "<span class='tiny'>("._BLANKFORAUTO.")</span><br /><span class='tiny'>("._YA_PASSLENGTH.")</span></td></tr>\n";
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._RETYPEPASSWORD.":</div></td><td bgcolor='$bgcolor1'><input type='password' name='user_password2' size='10' maxlength='".$ya_config['pass_max']."'><br /><span class='tiny'>("._BLANKFORAUTO.")</span><br /><span class='tiny'>("._YA_PASSLENGTH.")</span></td></tr>\n";
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._UFAKEMAIL.":</div>"._OPTIONAL."</td><td bgcolor='$bgcolor1'><input type='text' name='femail' size='40' maxlength='255'><br />"._EMAILPUBLIC."</td></tr>\n";
/*****[BEGIN]******************************************
[ Mod: XData v0.1.1 ]
******************************************************/
$xd_meta = get_xd_metadata();
while ( list($code_name, $info) = each($xd_meta) )
{
if ($info['display_register'] == XD_DISPLAY_NORMAL && $info['signup'])
{
$value = isset($xdata[$code_name]) ? str_replace('"', '&quot;', $xdata[$code_name]) : '';
$length = ( $info['field_length'] > 0) ? ( $info['field_length'] ) : '';

switch ($info['field_type'])
{
case 'text':
$value = isset($xdata[$code_name]) ? str_replace('"', '&quot;', $xdata[$code_name]) : '';
$length = ( $info['field_length'] > 0) ? ( $info['field_length'] ) : '';
echo '<tr><td bgcolor="'.$bgcolor2.'"><div class="textbold">'.$info['field_name'].':</div>'.$info['field_desc'].'</td>
<td bgcolor="'.$bgcolor1.'"><input type="text" class="post"style="width: 200px" name="'.$code_name.'" size="35" maxlength="'.$length .'" value="'.$value.'" /></td></tr>';
break;

case 'textarea':
echo '<tr><td bgcolor="'.$bgcolor2.'"><div class="textbold">'.$info['field_name'].':</div>'.$info['field_desc'].'</td>
<td bgcolor="'.$bgcolor1.'"><textarea name="'.$code_name.'"style="width: 300px" rows="6" cols="30" class="post">'.$value.'</textarea></td></tr>';
break;

case 'radio':
echo '<tr><td bgcolor="'.$bgcolor2.'"><div class="textbold">'.$info['field_name'].':</div>'.$info['field_desc'].'</td><td bgcolor="'.$bgcolor1.'">';
while ( list( , $option) = each($info['values_array']) )
{
$select = ($xdata[$code_name] == $option) ? 'selected="selected"' : '';
echo '<input type="radio" name="'.$code_name.'" value="'.$option.'" '.$select.' /> <span class="gen">'.$option.'</span><br />';
}
echo '</td></tr>';
break;

case 'select':
echo '<tr><td bgcolor="'.$bgcolor2.'"><div class="textbold">'.$info['field_name'].':</div>'.$info['field_desc'].'</td><td bgcolor="'.$bgcolor1.'">';
echo '<select name="'.$code_name.'">';
while ( list( , $option) = each($info['values_array']) )
{
$select = ($xdata[$code_name] == $option) ? 'selected="selected"' : '';
echo '<option value="'.$option.'" '.$select.'>'.$option.'</option>';
}
echo '</select></td></tr>';
break;
}
}
elseif ($info['display_register'] == XD_DISPLAY_ROOT)
{
switch ($code_name) {
case "icq":
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._YICQ.":</div>"._OPTIONAL."</td><td bgcolor='$bgcolor1'><input type='text' name='user_icq' size='30' maxlength='100'></td></tr>\n";
break;
case "aim":
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._YAIM.":</div>"._OPTIONAL."</td><td bgcolor='$bgcolor1'><input type='text' name='user_aim' size='30' maxlength='100'></td></tr>\n";
break;
case "msn":
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._YMSNM.":</div>"._OPTIONAL."</td><td bgcolor='$bgcolor1'><input type='text' name='user_msnm' size='30' maxlength='100'></td></tr>\n";
break;
case "yim":
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._YYIM.":</div>"._OPTIONAL."</td><td bgcolor='$bgcolor1'><input type='text' name='user_yim' size='30' maxlength='100'></td></tr>\n";
break;
case "website":
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._YOURHOMEPAGE.":</div>"._OPTIONAL."</td><td bgcolor='$bgcolor1'><input type='text' name='user_website' size='40' maxlength='255'></td></tr>\n";
break;
case "location":
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._YLOCATION.":</div>"._OPTIONAL."</td><td bgcolor='$bgcolor1'><input type='text' name='user_from' size='30' maxlength='100'></td></tr>\n";
break;
case "occupation":
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._YOCCUPATION.":</div>"._OPTIONAL."</td><td bgcolor='$bgcolor1'><input type='text' name='user_occ' size='30' maxlength='100'></td></tr>\n";
break;
case "interests":
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._YINTERESTS.":</div>"._OPTIONAL."</td><td bgcolor='$bgcolor1'><input type='text' name='user_interests' size='30' maxlength='100'></td></tr>\n";
break;
case "signature":
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._SIGNATURE.":</div>"._OPTIONAL."<br />"._NOHTML."</td><td bgcolor='$bgcolor1'><textarea cols='50' rows='5' name='user_sig'></textarea><br />"._255CHARMAX."</td></tr>\n";
break;
}
}
}
/*****[END]********************************************
[ Mod: XData v0.1.1 ]
******************************************************/
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._RECEIVENEWSLETTER.":</div></td><td bgcolor='$bgcolor1'><select name='newsletter'><option value='1' selected>"._YES."</option><option value='0'>"._NO."</option></select></td></tr>\n";
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._ALWAYSSHOWEMAIL.":</div></td><td bgcolor='$bgcolor1'><select name='user_viewemail'><option value='1' selected>"._YES."</option><option value='0'>"._NO."</option></select></td></tr>\n";
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._HIDEONLINE.":</div></td><td bgcolor='$bgcolor1'><select name='user_allow_viewonline'><option value='0'>"._YES."</option><option value='1' selected>"._NO."</option></select></td></tr>\n";
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._FORUMSTIME.":</div></td><td bgcolor='$bgcolor1'>";
global $board_config;
echo tz_select($board_config['board_timezone'], 'timezone');
echo "</td></tr>\n";
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._FORUMSDATE.":</div>"._FORUMSDATEMSG."</td><td bgcolor='$bgcolor1'><input type='text' name='user_dateformat' value='D M d, Y g:i a' size='15' maxlength='14'></td></tr>\n";
echo "<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._EXTRAINFO.":</div>"._OPTIONAL."<br />"._NOHTML."</td><td bgcolor='$bgcolor1'><textarea cols='50' rows='5' name='bio'></textarea><br />"._CANKNOWABOUT."</td></tr>\n";

$gfxchk = array(3,4,6);
$gfx = security_code($gfxchk, 'stacked');
if(!empty($gfx)) {
echo "<tr><td bgcolor='$bgcolor2' colspan='2'><center>".$gfx."</center></td></tr>";
}


echo "<input type='hidden' name='op' value='new_confirm'>\n";
echo "<tr><td align='right' bgcolor='$bgcolor1' colspan='2'><input type='submit' value='"._YA_CONTINUE."'></td></tr>\n";
echo "</table></form>\n";
echo "<br />\n";
echo ""._COOKIEWARNING."<br />\n";
echo ""._ASREGUSER."<br />\n";
echo "<ul>\n";
echo "<li>"._ASREG1."\n";
echo "<li>"._ASREG2."\n";
echo "<li>"._ASREG3."\n";
echo "<li>"._ASREG4."\n";
echo "<li>"._ASREG5."\n";
$handle=opendir('themes');
while ($file = readdir($handle)) {
if ((!ereg("[.]",$file) AND file_exists("themes/$file/theme.php"))) { $thmcount++; }
}
closedir($handle);
if ($thmcount > 1) { echo "<li>"._ASREG6."\n"; }
$sql = "SELECT custom_title FROM ".$prefix."_modules WHERE active='1' AND view='1' AND inmenu='1'";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$custom_title = $row[custom_title];
if (!empty($custom_title)) { echo "<li>"._ACCESSTO." $custom_title\n"; }
}
$sql = "SELECT title FROM ".$prefix."_blocks WHERE active='1' AND view='1'";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$b_title = $row[title];
if (!empty($b_title)) { echo "<li>"._ACCESSTO." $b_title\n"; }
}
if (is_active("Journal")) { echo "<li>"._CREATEJOURNAL."\n"; }
if ($my_headlines == 1) { echo "<li>"._READHEADLINES."\n"; }
echo "<li>"._ASREG7."\n";
echo "</ul>\n";
echo _REGISTERNOW."<br />\n";
echo _WEDONTGIVE."<br /><br />\n";
CloseTable();
include_once(NUKE_BASE_DIR.'footer.php');

?>

You can see the registery for http://www.thelastcause.com/CallOfDu...nt&op=new_user

Hope i have explained well, and that someone could be so kind as to help me out.

Thanks You,
Greetz
Geordie

Edit:

I guess thus is the file that reads from the database?

//saveuser.php

if (!defined('MODULE_FILE')) {
die ("You can't access this file directly...");
}

if (!defined('CNBYA')) {
die('CNBYA protection');
}

$stop = "";
global $cookie;
$check = $cookie[1];
$check2 = $cookie[2];
$result = $db->sql_query("SELECT user_id, user_password, user_email FROM ".$user_prefix."_users WHERE username='$check'");
$row = $db->sql_fetchrow($result);
$vuid = $row['user_id'];
$ccpass = $row['user_password'];
$tuemail = strtolower($row['user_email']);
$user_sig = str_replace("<br />", "\r\n", $user_sig);
$user_sig = ya_fixtext($user_sig);
$user_email = strtolower($user_email);
$user_email = ya_fixtext($user_email);
$femail = ya_fixtext($femail);
$user_website = ya_fixtext($user_website);
$bio = ya_fixtext($bio);
$user_icq = ya_fixtext($user_icq);
$user_aim = ya_fixtext($user_aim);
$user_yim = ya_fixtext($user_yim);
$user_msnm = ya_fixtext($user_msnm);
$user_occ = ya_fixtext($user_occ);
$user_from = ya_fixtext($user_from);
$user_interests = ya_fixtext($user_interests);
$realname = ya_fixtext($realname);
$user_dateformat = ya_fixtext($user_dateformat);
$newsletter = intval($newsletter);
$user_viewemail = intval($user_viewemail);
$user_allow_viewonline = intval($user_allow_viewonline);
$user_timezone = intval($user_timezone);
if ($ya_config['allowmailchange'] < 1) {
if ($tuemail != $user_email) { ya_mailCheck($user_email); }
}
if ($user_password > "" OR $vpass > "") { ya_passCheck($user_password, $vpass); }

$result = $db->sql_query("SELECT * FROM ".$user_prefix."_cnbya_field WHERE need = '3' ORDER BY pos");
while ($sqlvalue = $db->sql_fetchrow($result)) {
$t = $sqlvalue[fid];
if (empty($nfield[$t])) {
include_once(NUKE_BASE_DIR.'header.php');
opentable();
if (substr($sqlvalue[name],0,1)=='_') eval( "\$name_exit = $sqlvalue[name];"); else $name_exit = $sqlvalue[name];
echo "<center><span class='title'><strong>"._ERRORREG."</strong></span><br /><br />";
echo "<span class='content'>"._YA_FILEDNEED1."$name_exit"._YA_FILEDNEED2."<br /><br />"._GOBACK."</span></center>";
closetable();
include_once(NUKE_BASE_DIR.'footer.php');
exit;
};
}

if (empty($stop) AND ($user_id == $vuid) AND ($check2 == $ccpass)) {
if (!eregi("http://", $user_website) AND !empty($user_website)) {
$user_website = "http://$user_website";
}
if ($bio) { filter_text($bio); $bio = $EditedMessage; $bio = Fix_Quotes($bio); }
if (!empty($user_password)) {
global $cookie;
$db->sql_query("LOCK TABLES ".$user_prefix."_users, ".$user_prefix."_cnbya_value WRITE");
/*****[BEGIN]******************************************
[ Base: Evolution Functions v1.5.0 ]
******************************************************/
$user_password = md5($user_password);
/*****[END]********************************************
[ Base: Evolution Functions v1.5.0 ]
******************************************************/

if ( ($ya_config['emailvalidate'] == '0') OR ($tuemail == $user_email) ) {
$db->sql_query("UPDATE ".$user_prefix."_users SET name='$realname', user_email='$user_email', femail='$femail', user_website='$user_website', user_password='$user_password', bio='$bio', user_icq='$user_icq', user_occ='$user_occ', user_from='$user_from', user_interests='$user_interests', user_sig='$user_sig', user_aim='$user_aim', user_yim='$user_yim', user_msnm='$user_msnm', newsletter='$newsletter', user_viewemail='$user_viewemail', user_allow_viewonline='$user_allow_viewonline', user_notify='$user_notify', user_notify_pm='$user_notify_pm', user_popup_pm='$user_popup_pm', user_attachsig='$user_attachsig', user_allowbbcode='$user_allowbbcode', user_allowhtml='$user_allowhtml', user_allowsmile='$user_allowsmile', user_timezone='$user_timezone', user_dateformat='$user_dateformat' WHERE user_id='$user_id'");
} else {
$db->sql_query("UPDATE ".$user_prefix."_users SET name='$realname', femail='$femail', user_website='$user_website', user_password='$user_password', bio='$bio', user_icq='$user_icq', user_occ='$user_occ', user_from='$user_from', user_interests='$user_interests', user_sig='$user_sig', user_aim='$user_aim', user_yim='$user_yim', user_msnm='$user_msnm', newsletter='$newsletter', user_viewemail='$user_viewemail', user_allow_viewonline='$user_allow_viewonline', user_notify='$user_notify', user_notify_pm='$user_notify_pm', user_popup_pm='$user_popup_pm', user_attachsig='$user_attachsig', user_allowbbcode='$user_allowbbcode', user_allowhtml='$user_allowhtml', user_allowsmile='$user_allowsmile', user_timezone='$user_timezone', user_dateformat='$user_dateformat' WHERE user_id='$user_id'");
$datekey = date("F Y");
$check_num = substr(md5(hexdec($datekey) * hexdec($cookie[2]) * hexdec($sitekey) * hexdec($user_email) * hexdec($tuemail)), 2, 10);
$finishlink = "$nukeurl/modules.php?name=$module_name&op=changemail&id=$user_id&mail=$user_email&check_num=$check_num";
$message .= _CHANGEMAIL1." $tuemail "._CHANGEMAIL2." $user_email"._CHANGEMAIL3." $sitename.<br /><br />";
$message .= _CHANGEMAILFIN."<br /><br />$finishlink<br /><br />";
$subject = _CHANGEMAILSUB;
ya_mail($user_email, $subject, $message, '');
}

if (count($nfield) > 0) {
foreach ($nfield as $key => $var) {
if (($db->sql_numrows($db->sql_query("SELECT * FROM ".$user_prefix."_cnbya_value WHERE fid='$key' AND uid = '$user_id'"))) == 0) {
$sql = "INSERT INTO ".$user_prefix."_cnbya_value (uid, fid, value) VALUES ('$user_id', '$key','$nfield[$key]')";
$db->sql_query($sql);
}
else {
$db->sql_query("UPDATE ".$user_prefix."_cnbya_value SET value='$nfield[$key]' WHERE fid='$key' AND uid = '$user_id'");
}
}
}

$sql = "SELECT * FROM ".$user_prefix."_users WHERE username='$username' AND user_password='$user_password'";
$result = $db->sql_query($sql);
if ($db->sql_numrows($result) == 1) {
$userinfo = $db->sql_fetchrow($result);
yacookie($userinfo[user_id],$userinfo[username],$userinfo[user_password],$userinfo[storynum],$userinfo[umode],$userinfo[uorder],$userinfo[thold],$userinfo[noscore],$userinfo[ublockon],$userinfo[theme],$userinfo[commentmax]);
} else {
echo "<center>"._SOMETHINGWRONG."</center><br />";
}
$db->sql_query("UNLOCK TABLES");
} else {
$db->sql_query("LOCK TABLES ".$user_prefix."_users,".$user_prefix."_cnbya_value WRITE");

if ( ($ya_config['emailvalidate'] == '0') OR ($tuemail == $user_email) ) {
$q = "UPDATE ".$user_prefix."_users SET name='$realname', user_email='$user_email', femail='$femail', user_website='$user_website', bio='$bio', user_icq='$user_icq', user_occ='$user_occ', user_from='$user_from', user_interests='$user_interests', user_sig='$user_sig', user_aim='$user_aim', user_yim='$user_yim', user_msnm='$user_msnm', newsletter='$newsletter', user_viewemail='$user_viewemail', user_allow_viewonline='$user_allow_viewonline', user_notify='$user_notify', user_notify_pm='$user_notify_pm', user_popup_pm='$user_popup_pm', user_attachsig='$user_attachsig', user_allowbbcode='$user_allowbbcode', user_allowhtml='$user_allowhtml', user_allowsmile='$user_allowsmile', user_timezone='$user_timezone', user_dateformat='$user_dateformat' WHERE user_id='$user_id'";
$db->sql_query($q);
} else {

$db->sql_query("UPDATE ".$user_prefix."_users SET name='$realname', femail='$femail', user_website='$user_website', bio='$bio', user_icq='$user_icq', user_occ='$user_occ', user_from='$user_from', user_interests='$user_interests', user_sig='$user_sig', user_aim='$user_aim', user_yim='$user_yim', user_msnm='$user_msnm', newsletter='$newsletter', user_viewemail='$user_viewemail', user_allow_viewonline='$user_allow_viewonline', user_notify='$user_notify', user_notify_pm='$user_notify_pm', user_popup_pm='$user_popup_pm', user_attachsig='$user_attachsig', user_allowbbcode='$user_allowbbcode', user_allowhtml='$user_allowhtml', user_allowsmile='$user_allowsmile', user_timezone='$user_timezone', user_dateformat='$user_dateformat' WHERE user_id='$user_id'");
$datekey = date("F Y");
$check_num = substr(md5(hexdec($datekey) * hexdec($cookie[2]) * hexdec($sitekey) * hexdec($user_email) * hexdec($tuemail)), 2, 10);

$finishlink = "$nukeurl/modules.php?name=$module_name&op=changemail&id=$user_id&mail=$user_email&check_num=$check_num";
$message .= _CHANGEMAIL1." $tuemail "._CHANGEMAIL2." $user_email"._CHANGEMAIL3." $sitename.<br /><br />";
$message .= _CHANGEMAILFIN."<br /><br />$finishlink<br /><br />";
$subject = _CHANGEMAILSUB;
ya_mail($user_email, $subject, $message, '');
}

if (count($nfield) > 0) {
foreach ($nfield as $key => $var) {
if (($db->sql_numrows($db->sql_query("SELECT * FROM ".$user_prefix."_cnbya_value WHERE fid='$key' AND uid = '$user_id'"))) == 0) {
$sql = "INSERT INTO ".$user_prefix."_cnbya_value (uid, fid, value) VALUES ('$user_id', '$key','$nfield[$key]')";
$db->sql_query($sql);
}
else {
$db->sql_query("UPDATE ".$user_prefix."_cnbya_value SET value='$nfield[$key]' WHERE fid='$key' AND uid = '$user_id'");
}
}
}

$db->sql_query("UNLOCK TABLES");
}
redirect("modules.php?name=$module_name");
} else {
include_once(NUKE_BASE_DIR.'header.php');
OpenTable();
echo "<center><span class='title'><strong>"._ERRORREG."</strong></span><br /><br />";
echo "<span class='content'>$stop<br /><br />"._GOBACK."</span></center>";
CloseTable();
include_once(NUKE_BASE_DIR.'footer.php');
}

?>

Hope this is not too much....

Edited by Geordie_Ben: n/a

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Geordie_Ben
0

I've never used phpNuke before but if it operates in roughly the same manner that php does then requiring a field to be submitted does not happen on the database(sql) side, it happens during the "error checking" of the form being submitted so you can tell the user that not all the information was submitted before doing anything within the database.

0

Right... Not any of the people that help here have experience with PHP NUKE (that I know of), and even if they did, they would never go through 500 lines of code, of which they do not know what code does what. Perhaps you should narrow your problem down to a max of 50 lines and post a reply containing it?

You can just simply do the following if you want 1 field to be required:

if (isset($_POST['field'])) {
 $field = htmlentities(addslashes($_POST['field']));
} else {
 $field = "";
}

if ($field != "") {
 // Do something
 echo "Good you entered something at 'field'!";
} else {
 echo "The field 'field' is required!";
 // Do some other stuff
}

~G

Edited by Graphix: n/a

0

Hi guys,

thanks for replying.

@Nyight i think its along the lines of phpbb if im correct.

Ok well what i have is the custom field on the register form

//GameGUID added By Geordie

echo"<tr><td bgcolor='$bgcolor2'><div class=\"textbold\">"._GAMEGUID.":</div>"._REQUIRED."</td><td bgcolor='$bgcolor1'><input type='text' name='ya_gameguid' size='8' maxlength='32'><br /><span class='tiny'>"._YA_GAMEGUID."</span></td></tr>\n";

What i would like this to do, is store the entered field into the database. And if this field has not had a value entered the registration will give an error.

What im guessing is that in this code from saveuser.php.....

if ( ($ya_config['emailvalidate'] == '0') OR ($tuemail == $user_email) ) {$db->sql_query("UPDATE ".$user_prefix."_users SET name='$realname', user_email='$user_email', femail='$femail', user_website='$user_website', user_password='$user_password', bio='$bio', user_icq='$user_icq', user_occ='$user_occ', user_from='$user_from', user_interests='$user_interests', user_sig='$user_sig', user_aim='$user_aim', user_yim='$user_yim', user_msnm='$user_msnm', newsletter='$newsletter', user_viewemail='$user_viewemail', user_allow_viewonline='$user_allow_viewonline', user_notify='$user_notify', user_notify_pm='$user_notify_pm', user_popup_pm='$user_popup_pm', user_attachsig='$user_attachsig', user_allowbbcode='$user_allowbbcode', user_allowhtml='$user_allowhtml', user_allowsmile='$user_allowsmile', user_timezone='$user_timezone', user_dateformat='$user_dateformat' WHERE user_id='$user_id'");} 

else {$db->sql_query("UPDATE ".$user_prefix."_users SET name='$realname', femail='$femail', user_website='$user_website', user_password='$user_password', bio='$bio', user_icq='$user_icq', user_occ='$user_occ', user_from='$user_from', user_interests='$user_interests', user_sig='$user_sig', user_aim='$user_aim', user_yim='$user_yim', user_msnm='$user_msnm', newsletter='$newsletter', user_viewemail='$user_viewemail', user_allow_viewonline='$user_allow_viewonline', user_notify='$user_notify', user_notify_pm='$user_notify_pm', user_popup_pm='$user_popup_pm', user_attachsig='$user_attachsig', user_allowbbcode='$user_allowbbcode', user_allowhtml='$user_allowhtml', user_allowsmile='$user_allowsmile', user_timezone='$user_timezone', user_dateformat='$user_dateformat' WHERE user_id='$user_id'");

I will have to enter some code from the database. So, am i right in saying under the table nuke_users i will create field "Gameguid"

Edited by Geordie_Ben: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.