News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Registration no longer works / avatar selection problem

Started by samurai-lupin, March 15, 2008, 06:08:26 PM

Previous topic - Next topic

samurai-lupin

Hello,

my SMF installation is at www.detektorforum.de/smf

For a reason I do not know, users can no longer register. When ever someone submitts a registration he receives an error saying "An avatar is required! Please select one."

Thus the avatar selection seems to be broken? Here is my register.template.php

<?php
// Version: 1.1.2; Register

// Before registering - get their information.
function template_before()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

// Make sure they've agreed to the terms and conditions.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function verifyAgree()
{
if (document.forms.creator.passwrd1.value != document.forms.creator.passwrd2.value)
{
alert("'
, $txt['register_passwords_differ_js'], '");
return false;
}'
;

// If they haven't checked the "I agree" box, tell them and don't submit.
if ($context['require_agreement'])
echo '

if (!document.forms.creator.regagree.checked)
{
alert("'
, $txt['register_agree'], '");
return false;
}'
;

// Otherwise, let it through.
echo '

return true;
}'
;

if ($context['require_agreement'])
echo '
function checkAgree()
{
document.forms.creator.regSubmit.disabled = isEmptyText(document.forms.creator.user) || isEmptyText(document.forms.creator.email) || isEmptyText(document.forms.creator.passwrd1) || !document.forms.creator.regagree.checked;
setTimeout("checkAgree();", 1000);
}
setTimeout("checkAgree();", 1000);'
;

if ($context['visual_verification'])
{
echo '
function refreshImages()
{
// Make sure we are using a new rand code.
var new_url = new String("'
, $context['verificiation_image_href'], '");
new_url = new_url.substr(0, new_url.indexOf("rand=") + 5);

// Quick and dirty way of converting decimal to hex
var hexstr = "0123456789abcdef";
for(var i=0; i < 32; i++)
new_url = new_url + hexstr.substr(Math.floor(Math.random() * 16), 1);'
;

if ($context['use_graphic_library'])
echo '
document.getElementById("verificiation_image").src = new_url;'
;
else
echo '
document.getElementById("verificiation_image_1").src = new_url + ";letter=1";
document.getElementById("verificiation_image_2").src = new_url + ";letter=2";
document.getElementById("verificiation_image_3").src = new_url + ";letter=3";
document.getElementById("verificiation_image_4").src = new_url + ";letter=4";
document.getElementById("verificiation_image_5").src = new_url + ";letter=5";'
;
echo '
}'
;
}

echo '
// ]]></script>

<form action="'
, $scripturl, '?action=register2" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator" onsubmit="return verifyAgree();">
<script language="JavaScript" type="text/javascript" src="'
, $settings['theme_url'] , '/AjaxRegFed.js"></script>
<table border="0" width="100%" cellpadding="3" cellspacing="0" class="tborder">
<tr class="titlebg">
<td>'
, $txt[97], ' - ', $txt[517], '</td>
</tr><tr class="windowbg">
<td width="100%">
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr>
<td width="40%" valign=top>
<b>'
, $txt[98], ':</b>
<div class="smalltext">'
, $txt[520], '</div>
</td>
<td valign=top>
<input type="text" name="user" size="20" tabindex="'
, $context['tabindex']++, '" maxlength="25" onChange="checkUsername();"/>
<div id="usercheck" name="usercheck">&nbsp;</div>
</td>
</tr><tr>
<td width="40%" valign=top>
<b>'
, $txt[69], ':</b>
<div class="smalltext">'
, $txt[679], '</div>
</td>
<td valign=top>


<input type="text" name="email" size="30" tabindex="'
, $context['tabindex']++, '" onChange="checkEmail();"/>';
// Are they allowed to hide their email?
if ($context['allow_hide_email'])
echo '<br><div class="smalltext"><label for="hideEmail"><input type="checkbox" name="hideEmail" id="hideEmail" class="check" /> ', $txt[721], '</label></div>';

echo '<div id="emailcheck" name="emailcheck">&nbsp;</div>


</td>
</tr><tr>
<td width="40%" valign=top>
<b>'
, $txt[81], ':</b>
</td>
<td valign=top>
<input type="password" name="passwrd1" size="30" tabindex="'
, $context['tabindex']++, '" onChange="checkPasswrd1();"/>
<div id="passwrd1check" name="passwrd1check">&nbsp;</div>
</td>
</tr><tr>
<td width="40%" valign=top>
<b>'
, $txt[82], ':</b>
</td>
<td valign=top>
<input type="password" name="passwrd2" size="30" tabindex="'
, $context['tabindex']++, '" onChange="checkPasswrd2();"/>
<div id="passwrd2check" name="passwrd2check">&nbsp;</div>
</td>
</tr>'
;

if ($context['visual_verification'])
{
echo '
<tr valign="top">
<td width="40%" valign="top">
<b>'
, $txt['visual_verification_label'], ':</b>
<div class="smalltext">'
, $txt['visual_verification_description'], '</div>
</td>
<td valign=top>'
;
if ($context['use_graphic_library'])
echo '
<img src="'
, $context['verificiation_image_href'], '" alt="', $txt['visual_verification_description'], '" id="verificiation_image" /><br />';
else
echo '
<img src="'
, $context['verificiation_image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verificiation_image_1" />
<img src="'
, $context['verificiation_image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verificiation_image_2" />
<img src="'
, $context['verificiation_image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verificiation_image_3" />
<img src="'
, $context['verificiation_image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verificiation_image_4" />
<img src="'
, $context['verificiation_image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verificiation_image_5" />';
echo '
<input type="text" name="visual_verification_code" size="30" tabindex="'
, $context['tabindex']++, '" />
<div class="smalltext">
<a href="'
, $context['verificiation_image_href'], ';sound" onclick="return reqWin(this.href, 400, 120);">', $txt['visual_verification_sound'], '</a> | <a href="', $scripturl, '?action=register" onclick="refreshImages(); return false;">', $txt['visual_verification_request_new'], '</a>
</div>
</td>
</tr>'
;
}



//For the no pic language file
loadlanguage('Profile');

echo '<tr>
<td width="40%" valign=top>
<b>Avatar Select:</b>
<div class="smalltext">Bitte waehlen Sie ein Avatar Bild. <i>(optional)</i></div>
<div style="margin: 2ex;"><img name="avatar" id="avatar" src="'
.  $modSettings['avatar_url'] . '/blank.gif', '" alt="Do Nothing" /></div>
</td>
<td valign=top>
<select name="cat" id="cat" size="10" onchange="changeSel(\'\');">'
;
// Get a list of all the avatars.
$context['avatar_list'] = array();
$context['avatars'] = is_dir($modSettings['avatar_directory']) ? getAvatars('', 0) : array();


// This lists all the file catergories.
foreach ($context['avatars'] as $avatar)
echo '
<option value="'
, $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected="selected"' : ''), '>', $avatar['name'], '</option>';
echo '</select>

<select name="file" id="file" size="10" style="display: none;" onchange="showAvatar()"  disabled="disabled"><option></option></select>
</td>
</tr>'
;

// If flags is set for registration show it.
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3)
{
// Call the function that has all the flag info
$flags = CountryFlag();

echo '
<script language="JavaScript" type="text/javascript">
function showflags()
{
document.images.flags.src = document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value != \'\' ? \''
. $settings['default_theme_url'] . '/images/flags/\' + document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value + \'.png\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\';
}
</script>
<tr>
<td width="40%" valign="top">
<b>'
, $txt['country_flag_label'], ':</b> <div class="smalltext"><i>(optional)</i></div>
</td>
<td valign=top>
<select name="country" onchange="showflags()">
<option value=""></option>'
;

// Loop and show the drop down.
foreach ($flags as $key => $name)
echo '
<option value="'
, $key, '">', $name, '</option>';

echo '
</select>
<img id="flags" src="'
, $settings['default_theme_url'], '/images/blank.gif" width="25" height="15" align="top" />
</td>
</tr>'
;
}

// Registration - Show Gender mod
if (!empty($modSettings['registration_gender_admin_field']) && $modSettings['registration_gender_admin_field'] == 1)
{
echo '
<tr valign="top">
<td width="40%" valign="top">
<b>'
, $txt['registration_gender_template_field'], ':</b> <div class="smalltext"><i>(optional)</i></div>
</td>
<td valign=top>
<select name="gender" size="1">
<option value="0"></option>
<option value="1">'
, $txt[238], '</option>
<option value="2">'
, $txt[239], '</option>
</select>
</td>
</tr>'
;
}
// Registration - Show Gender mod


// IF REFERRAL INFORMATION IS SET IT WILL HAVE BEEN PASSED USING THIS VARIABLE
global $referrals;
if (isset($referrals))
{
echo ' <tr>
<td width="40%" valign=top><b>'
.$txt['referrals_information'].'</b></td>
<td valign=top>'
. $txt['referrals_youwerereferredby'].' '. $referrals['referredbyname'].
' '.$txt['referrals_on'].' '. date("jS M Y",$referrals['referredon']);

// NOW WRITE THE INFORMATION INTO HIDDEN INPUTS TO BE PASSED TO THE NEXT FUNCTION
echo ' <input type="hidden" name="referredby" value="'.$referrals['referredbyid'].'"/>
<input type="hidden" name="referredon" value="'
.$referrals['referredon'].'"/>
</td>
</tr>'
;
}


global $sourcedir;
require_once($sourcedir . '/CustomProfile.php');
RegistrationFields();
echo '
</table>
</td>
</tr>
</table>'
;

// Require them to agree here?
if ($context['require_agreement'])
echo '
<table width="94%" align="center" border="0" cellspacing="0" cellpadding="5" class="tborder" style="border-top: 0;">
<tr>
<td align="center" class="windowbg2" style="padding-top: 8px; padding-bottom: 8px;">

<div style="width: 100%; border: 1px solid; border-color: #7f9db9; margin-bottom: 1ex; height: 125px; overflow: auto;"><div align=justify>'
, $context['agreement'], '</div></div></center>

</td>
</tr><tr>
<td align="left" class="windowbg2">
<label for="regagree"><input type="checkbox" name="regagree" onclick="checkAgree();" id="regagree" class="check" /> <b>'
, $txt[585], '</b></label>
</td>
</tr>

'
;



// Are there age restrictions in place?
if (!empty($modSettings['coppaAge']))
echo '
<tr>
<td align="left" style="padding-top: 1ex;">
<label for="skip_coppa"><input type="checkbox" name="skip_coppa" id="skip_coppa" tabindex="'
, $context['tabindex']++, '" class="check" /> <b>', $context['coppa_desc'], '.</b></label>
</td>
</tr>'
;
echo
'


</table>'
;

// Invite MOD
if (!empty($context['invite_key']))
echo '
<input type="hidden" name="invite_key" value="'
, $context['invite_key'], '" />';
elseif (!empty($_REQUEST['inviter']) && (int)$_REQUEST['inviter'] !== 0)
echo '
<input type="hidden" name="inviter" value="'
, $_REQUEST['inviter'], '" />';


echo '
<br />
<div align="center">
<input type="submit" name="regSubmit" value="'
, $txt[97], '" />
</div>
</form>'
;



echo '
<script language="JavaScript" type="text/javascript">'
;
       echo
'
<!-- // -->'
. chr(60) . chr(33) . chr(91) . chr(67) . chr(68) . chr(65) . chr(84) . chr(65) . chr(91);
echo
'
var files = ["'
. implode('", "', $context['avatar_list']) . '"];
var avatar = document.getElementById("avatar");
var cat = document.getElementById("cat");
var selavatar = "";
var avatardir = "'
. $modSettings['avatar_url'] . '/";
var size = avatar.alt.substr(3, 2) + " " + avatar.alt.substr(0, 2) + String.fromCharCode(117, 98, 116);
var file = document.getElementById("file");

if (avatar.src.indexOf("blank.gif") > -1)
changeSel(selavatar);
else
previewExternalAvatar(avatar.src)

function changeSel(selected)
{
if (cat.selectedIndex == -1)
return;

if (cat.options[cat.selectedIndex].value.indexOf("/") > 0)
{
var i;
var count = 0;

file.style.display = "inline";
file.disabled = false;

for (i = file.length; i >= 0; i = i - 1)
file.options[i] = null;

for (i = 0; i < files.length; i++)
if (files[i].indexOf(cat.options[cat.selectedIndex].value) == 0)
{
var filename = files[i].substr(files[i].indexOf("/") + 1);
var showFilename = filename.substr(0, filename.lastIndexOf("."));
showFilename = showFilename.replace(/[_]/g, " ");

file.options[count] = new Option(showFilename, files[i]);

if (filename == selected)
{
if (file.options.defaultSelected)
file.options[count].defaultSelected = true;
else
file.options[count].selected = true;
}

count++;
}

if (file.selectedIndex == -1 && file.options[0])
file.options[0].selected = true;

showAvatar();
}
else
{
file.style.display = "none";
file.disabled = true;
document.getElementById("avatar").src = avatardir + cat.options[cat.selectedIndex].value;
document.getElementById("avatar").style.width = "";
document.getElementById("avatar").style.height = "";
}
}

function showAvatar()
{
if (file.selectedIndex == -1)
return;

document.getElementById("avatar").src = avatardir + file.options[file.selectedIndex].value;
document.getElementById("avatar").alt = file.options[file.selectedIndex].text;
document.getElementById("avatar").alt += file.options[file.selectedIndex].text == size ? "!" : "";
document.getElementById("avatar").style.width = "";
document.getElementById("avatar").style.height = "";
}

function previewExternalAvatar(src)
{
if (!document.getElementById("avatar"))
return;

var maxHeight = '
, !empty($modSettings['avatar_max_height_external']) ? $modSettings['avatar_max_height_external'] : 0, ';
var maxWidth = '
, !empty($modSettings['avatar_max_width_external']) ? $modSettings['avatar_max_width_external'] : 0, ';
var tempImage = new Image();

tempImage.src = src;
if (maxWidth != 0 && tempImage.width > maxWidth)
{
document.getElementById("avatar").style.height = parseInt((maxWidth * tempImage.height) / tempImage.width) + "px";
document.getElementById("avatar").style.width = maxWidth + "px";
}
else if (maxHeight != 0 && tempImage.height > maxHeight)
{
document.getElementById("avatar").style.width = parseInt((maxHeight * tempImage.width) / tempImage.height) + "px";
document.getElementById("avatar").style.height = maxHeight + "px";
}
document.getElementById("avatar").src = src;
}'
;
echo '
//'
. chr(93) . chr(93) . chr(62);
echo '
</script>'
;
// Uncheck the agreement thing....
if ($context['require_agreement'])
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
document.forms.creator.regagree.checked = false;
document.forms.creator.regSubmit.disabled = !document.forms.creator.regagree.checked;
// ]]></script>'
;
}

// After registration... all done ;).
function template_after()
{
global $context, $settings, $options, $txt, $scripturl;

// Not much to see here, just a quick... "you're now registered!" or what have you.
echo '
<br />
<table border="0" width="80%" cellpadding="3" cellspacing="0" class="tborder" align="center">
<tr class="titlebg">
<td>'
, $context['page_title'], '</td>
</tr><tr class="windowbg">
<td align="left">'
, $context['description'], '<br /><br /></td>
</tr>
</table>
<br />'
;
}

// Template for giving instructions about COPPA activation.
function template_coppa()
{
global $context, $settings, $options, $txt, $scripturl;

// Formulate a nice complicated message!
echo '
<br />
<table width="60%" cellpadding="4" cellspacing="0" border="0" class="tborder" align="center">
<tr class="titlebg">
<td>'
, $context['page_title'], '</td>
</tr><tr class="windowbg">
<td align="left">'
, $context['coppa']['body'], '<br /></td>
</tr><tr class="windowbg">
<td align="center">
<a href="'
, $scripturl, '?action=coppa;form;member=', $context['coppa']['id'], '" target="_blank">', $txt['coppa_form_link_popup'], '</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="', $scripturl, '?action=coppa;form;dl;member=', $context['coppa']['id'], '">', $txt['coppa_form_link_download'], '</a><br /><br />
</td>
</tr><tr class="windowbg">
<td align="left">'
, $context['coppa']['many_options'] ? $txt['coppa_send_to_two_options'] : $txt['coppa_send_to_one_option'], '</td>
</tr>'
;

// Can they send by post?
if (!empty($context['coppa']['post']))
{
echo '
<tr class="windowbg">
<td align="left"><b>1) '
, $txt['coppa_send_by_post'], '</b></td>
</tr><tr class="windowbg">
<td align="left" style="padding-bottom: 1ex;">
<div style="padding: 4px; width: 32ex; background-color: white; color: black; margin-left: 5ex; border: 1px solid black;">
'
, $context['coppa']['post'], '
</div>
</td>
</tr>'
;
}

// Can they send by fax??
if (!empty($context['coppa']['fax']))
{
echo '
<tr class="windowbg">
<td align="left"><b>'
, !empty($context['coppa']['post']) ? '2' : '1', ') ', $txt['coppa_send_by_fax'], '</b></td>
</tr><tr class="windowbg">
<td align="left" style="padding-bottom: 1ex;">
<div style="padding: 4px; width: 32ex; background-color: white; color: black; margin-left: 5ex; border: 1px solid black;">
'
, $context['coppa']['fax'], '
</div>
</td>
</tr>'
;
}

// Offer an alternative Phone Number?
if ($context['coppa']['phone'])
{
echo '
<tr class="windowbg" style="padding-bottom: 1ex;">
<td align="left">'
, $context['coppa']['phone'], '</td>
</tr>'
;
}
echo '
</table>
<br />'
;
}

// An easily printable form for giving permission to access the forum for a minor.
function template_coppa_form()
{
global $context, $settings, $options, $txt, $scripturl;

// Show the form (As best we can)
echo '
<table border="0" width="100%" cellpadding="3" cellspacing="0" class="tborder" align="center">
<tr>
<td align="left">'
, $context['forum_contacts'], '</td>
</tr><tr>
<td align="right">
<i>'
, $txt['coppa_form_address'], '</i>: ', $context['ul'], '<br />
'
, $context['ul'], '<br />
'
, $context['ul'], '<br />
'
, $context['ul'], '
</td>
</tr><tr>
<td align="right">
<i>'
, $txt['coppa_form_date'], '</i>: ', $context['ul'], '
<br /><br />
</td>
</tr><tr>
<td align="left">
'
, $context['coppa_body'], '
</td>
</tr>
</table>
<br />'
;
}

// Show a window containing the spoken verification code.
function template_verification_sound()
{
global $context, $settings, $options, $txt, $scripturl;

echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
, $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
<meta http-equiv="Content-Type" content="text/html; charset='
, $context['character_set'], '" />
<title>'
, $context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="'
, $settings['theme_url'], '/style.css" />
<style type="text/css">'
;

// Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are bigger...)
if ($context['browser']['needs_size_fix'])
echo '
@import('
, $settings['default_theme_url'], '/fonts-compat.css);';

// Just show the help text and a "close window" link.
echo '
</style>
</head>
<body style="margin: 1ex;">
<div class="popuptext">'
;
if ($context['browser']['is_ie'])
echo '
<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav">
<param name="AutoStart" value="1" />
<param name="FileName" value="'
, $context['verificiation_sound_href'], ';format=.wav" />
</object>'
;
else
echo '
<object type="audio/x-wav" data="'
, $context['verificiation_sound_href'], ';format=.wav">
<a href="'
, $context['verificiation_sound_href'], ';format=.wav">', $context['verificiation_sound_href'], ';format=.wav</a>
</object>'
;
echo '
<br />
<a href="'
, $context['verificiation_sound_href'], ';sound">', $txt['visual_verification_sound_again'], '</a><br />
<a href="javascript:self.close();">'
, $txt['visual_verification_sound_close'], '</a><br />
<a href="'
, $context['verificiation_sound_href'], ';format=.wav">', $txt['visual_verification_sound_direct'], '</a>
</div>
</body>
</html>'
;
}

function
template_admin_register()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '
<form action="'
, $scripturl, '?action=regcenter" method="post" accept-charset="', $context['character_set'], '" name="postForm" id="postForm">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function onCheckChange()
{
if (document.forms.postForm.emailActivate.checked)
{
document.forms.postForm.emailPassword.disabled = true;
document.forms.postForm.emailPassword.checked = true;
}
else
document.forms.postForm.emailPassword.disabled = false;
}
// ]]></script>
<table border="0" cellspacing="0" cellpadding="4" align="center" width="70%" class="tborder">
<tr class="titlebg">
<td colspan="2" align="center">'
, $txt['admin_browse_register_new'], '</td>
</tr>'
;
if (!empty($context['registration_done']))
echo '
<tr class="windowbg2">
<td colspan="2" align="center"><br />
'
, $context['registration_done'], '
</td>
</tr><tr class="windowbg2">
<td colspan="2" align="center"><hr /></td>
</tr>'
;
echo '
<tr class="windowbg2">
<th width="50%" align="right">
<label for="user_input">'
, $txt['admin_register_username'], ':</label>
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_register_username_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="user" id="user_input" size="30" maxlength="25" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="email_input">'
, $txt['admin_register_email'], ':</label>
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_register_email_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="email" id="email_input" size="30" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="password_input">'
, $txt['admin_register_password'], ':</label>
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_register_password_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="password" name="password" id="password_input" size="30" /><br />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="group_select">'
, $txt['admin_register_group'], ':</label>
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_register_group_desc'], '</div>
</th>
<td width="50%" align="left">
<select name="group" id="group_select">'
;

foreach ($context['member_groups'] as $id => $name)
echo '
<option value="'
, $id, '">', $name, '</option>';
echo '
</select><br />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="emailPassword_check">'
, $txt['admin_register_email_detail'], ':</label>
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_register_email_detail_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="checkbox" name="emailPassword" id="emailPassword_check" checked="checked"'
, !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 ? ' disabled="disabled"' : '', ' class="check" /><br />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="emailActivate_check">'
, $txt['admin_register_email_activate'], ':</label>
</th>
<td width="50%" align="left">
<input type="checkbox" name="emailActivate" id="emailActivate_check"'
, !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 ? ' checked="checked"' : '', ' onclick="onCheckChange();" class="check" /><br />
</td>
</tr><tr class="windowbg2">
<td width="100%" colspan="2" align="right">
<input type="submit" name="regSubmit" value="'
, $txt[97], '" />
<input type="hidden" name="sa" value="register" />
</td>
</tr>
</table>
<input type="hidden" name="sc" value="'
, $context['session_id'], '" />
</form>'
;
}

// Form for editing the agreement shown for people registering to the forum.
function template_edit_agreement()
{
global $context, $settings, $options, $scripturl, $txt;

// Just a big box to edit the text file ;).
echo '
<form action="'
, $scripturl, '?action=regcenter" method="post" accept-charset="', $context['character_set'], '">
<table border="0" cellspacing="0" cellpadding="4" align="center" width="80%" class="tborder">
<tr class="titlebg">
<td align="center">'
, $txt['smf11'], '</td>
</tr>'
;

// Warning for if the file isn't writable.
if (!empty($context['warning']))
echo '
<tr class="windowbg2">
<td style="color: red; font-weight: bold;" align="center">
'
, $context['warning'], '
</td>
</tr>'
;
echo '
<tr class="windowbg2">
<td align="center" style="padding-bottom: 1ex; padding-top: 2ex;">'
;

// Show the actual agreement in an oversized text box.
echo '
<textarea cols="70" rows="20" name="agreement" style="width: 94%; margin-bottom: 1ex;">'
, $context['agreement'], '</textarea><br />
<label for="requireAgreement"><input type="checkbox" name="requireAgreement" id="requireAgreement"'
, $context['require_agreement'] ? ' checked="checked"' : '', ' value="1" /> ', $txt[584], '.</label><br />
<br />
<input type="submit" value="'
, $txt[10], '" />
<input type="hidden" name="sa" value="agreement" />
</td>
</tr>
</table>
<input type="hidden" name="sc" value="'
, $context['session_id'], '" />
</form>'
;
}

function
template_edit_reserved_words()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<form action="'
, $scripturl, '?action=regcenter" method="post" accept-charset="', $context['character_set'], '">
<table border="0" cellspacing="1" class="bordercolor" align="center" cellpadding="4" width="80%">
<tr class="titlebg">
<td align="center">
'
, $txt[341], '
</td>
</tr><tr>
<td class="windowbg2" align="center">
<div style="width: 80%;">
<div style="margin-bottom: 2ex;">'
, $txt[342], '</div>
<textarea cols="30" rows="6" name="reserved" style="width: 98%;">'
, implode("\n", $context['reserved_words']), '</textarea><br />

<div align="left" style="margin-top: 2ex;">
<label for="matchword"><input type="checkbox" name="matchword" id="matchword" '
, $context['reserved_word_options']['match_word'] ? 'checked="checked"' : '', ' class="check" /> ', $txt[726], '</label><br />
<label for="matchcase"><input type="checkbox" name="matchcase" id="matchcase" '
, $context['reserved_word_options']['match_case'] ? 'checked="checked"' : '', ' class="check" /> ', $txt[727], '</label><br />
<label for="matchuser"><input type="checkbox" name="matchuser" id="matchuser" '
, $context['reserved_word_options']['match_user'] ? 'checked="checked"' : '', ' class="check" /> ', $txt[728], '</label><br />
<label for="matchname"><input type="checkbox" name="matchname" id="matchname" '
, $context['reserved_word_options']['match_name'] ? 'checked="checked"' : '', ' class="check" /> ', $txt[729], '</label><br />
</div>

<input type="submit" value="'
, $txt[10], '" name="save_reserved_names" style="margin: 1ex;" />
</div>
</td>
</tr>
</table>
<input type="hidden" name="sa" value="reservednames" />
<input type="hidden" name="sc" value="'
, $context['session_id'], '" />
</form>'
;
}

function
template_admin_settings()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

// Javascript for the verification image.
if ($context['use_graphic_library'])
{
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function refreshImages()
{
var imageType = document.getElementById(\'visual_verification_type_select\').value;
document.getElementById(\'verificiation_image\').src = \''
, $context['verificiation_image_href'], ';type=\' + imageType;
}
// ]]></script>'
;
}

echo '
<form action="'
, $scripturl, '?action=regcenter" method="post" accept-charset="', $context['character_set'], '">
<table border="0" cellspacing="1" cellpadding="4" align="center" width="100%" class="tborder">
<tr class="titlebg">
<td align="center">'
, $txt['settings'], '</td>
</tr>
<tr class="windowbg2">
<td align="center">'
;

// Functions to do some nice box disabling dependant on age restrictions.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function checkCoppa()
{
var coppaDisabled = document.getElementById(\'coppaAge_input\').value == 0;
document.getElementById(\'coppaType_select\').disabled = coppaDisabled;

var disableContacts = coppaDisabled || document.getElementById(\'coppaType_select\').options[document.getElementById(\'coppaType_select\').selectedIndex].value != 1;
document.getElementById(\'coppaPost_input\').disabled = disableContacts;
document.getElementById(\'coppaFax_input\').disabled = disableContacts;
document.getElementById(\'coppaPhone_input\').disabled = disableContacts;
}
// ]]></script>'
;
echo '
<table border="0" cellspacing="0" cellpadding="4" align="center" width="100%">
<tr class="windowbg2">
<th width="50%" align="right">
<label for="registration_method_select">'
, $txt['admin_setting_registration_method'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=registration_method" onclick="return reqWin(this.href);">?</a>)</span>:
</th>
<td width="50%" align="left">
<select name="registration_method" id="registration_method_select">
<option value="0"'
, empty($modSettings['registration_method']) ? ' selected="selected"' : '', '>', $txt['admin_setting_registration_standard'], '</option>
<option value="1"'
, !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 ? ' selected="selected"' : '', '>', $txt['admin_setting_registration_activate'], '</option>
<option value="2"'
, !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 2 ? ' selected="selected"' : '', '>', $txt['admin_setting_registration_approval'], '</option>
<option value="3"'
, !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 3 ? ' selected="selected"' : '', '>', $txt['admin_setting_registration_disabled'], '</option>
</select>
</td>
</tr>
<tr class="windowbg2">
<th width="50%" align="right">
<label for="notify_new_registration_check">'
, $txt['admin_setting_notify_new_registration'], '</label>:
</th>
<td width="50%" align="left">
<input type="checkbox" name="notify_new_registration" id="notify_new_registration_check" '
, !empty($modSettings['notify_new_registration']) ? 'checked="checked"' : '', ' class="check" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="send_welcomeEmail_check">'
, $txt['admin_setting_send_welcomeEmail'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=send_welcomeEmail" onclick="return reqWin(this.href);">?</a>)</span>:
</th>
<td width="50%" align="left">
<input type="checkbox" name="send_welcomeEmail" id="send_welcomeEmail_check"'
, !empty($modSettings['send_welcomeEmail']) ? ' checked="checked"' : '', ' class="check" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="password_strength_select">'
, $txt['admin_setting_password_strength'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=password_strength" onclick="return reqWin(this.href);">?</a>)</span>:
</th>
<td width="50%" align="left">
<select name="password_strength" id="password_strength_select">
<option value="0"'
, empty($modSettings['password_strength']) ? ' selected="selected"' : '', '>', $txt['admin_setting_password_strength_low'], '</option>
<option value="1"'
, !empty($modSettings['password_strength']) && $modSettings['password_strength'] == 1 ? ' selected="selected"' : '', '>', $txt['admin_setting_password_strength_medium'], '</option>
<option value="2"'
, !empty($modSettings['password_strength']) && $modSettings['password_strength'] == 2 ? ' selected="selected"' : '', '>', $txt['admin_setting_password_strength_high'], '</option>
</select>
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="visual_verification_type_select">
'
, $txt['admin_setting_image_verification_type'], ':<br />
<span class="smalltext" style="font-weight: normal;">
'
, $txt['admin_setting_image_verification_type_desc'], '
</span>
</label>
</th>
<td width="50%" align="left">
<select name="visual_verification_type" id="visual_verification_type_select" '
, $context['use_graphic_library'] ? 'onchange="refreshImages();"' : '', '>
<option value="1" '
, !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 1 ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_off'], '</option>
<option value="2" '
, !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 2 ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_vsimple'], '</option>
<option value="3" '
, !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 3 ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_simple'], '</option>
<option value="0" '
, empty($modSettings['disable_visual_verification']) ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_medium'], '</option>
<option value="4" '
, !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 4 ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_high'], '</option>
</select><br />'
;
if ($context['use_graphic_library'])
echo '
<img src="'
, $context['verificiation_image_href'], ';type=', empty($modSettings['disable_visual_verification']) ? 0 : $modSettings['disable_visual_verification'], '" alt="', $txt['admin_setting_image_verification_sample'], '" id="verificiation_image" /><br />';
else
{
echo '
<span class="smalltext">'
, $txt['admin_setting_image_verification_nogd'], '</span>';
}
echo '
</td>
</tr><tr class="windowbg2">
<td width="100%" colspan="2" align="center">
<hr />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaAge_input">'
, $txt['admin_setting_coppaAge'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=coppaAge" onclick="return reqWin(this.href);">?</a>)</span>:
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_setting_coppaAge_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="coppaAge" id="coppaAge_input" value="'
, !empty($modSettings['coppaAge']) ? $modSettings['coppaAge'] : '', '" size="3" maxlength="3" onkeyup="checkCoppa();" />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaType_select">'
, $txt['admin_setting_coppaType'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=coppaType" onclick="return reqWin(this.href);">?</a>)</span>:
</th>
<td width="50%" align="left">
<select name="coppaType" id="coppaType_select" onchange="checkCoppa();">
<option value="0"'
, empty($modSettings['coppaType']) ? ' selected="selected"' : '', '>', $txt['admin_setting_coppaType_reject'], '</option>
<option value="1"'
, !empty($modSettings['coppaType']) && $modSettings['coppaType'] == 1 ? ' selected="selected"' : '', '>', $txt['admin_setting_coppaType_approval'], '</option>
</select>
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaPost_input">'
, $txt['admin_setting_coppaPost'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=coppaPost" onclick="return reqWin(this.href);">?</a>)</span>:
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_setting_coppaPost_desc'], '</div>
</th>
<td width="50%" align="left">
<textarea name="coppaPost" id="coppaPost_input" rows="4" cols="35">'
, $context['coppaPost'], '</textarea>
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaFax_input">'
, $txt['admin_setting_coppaFax'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=coppaPost" onclick="return reqWin(this.href);">?</a>)</span>:
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_setting_coppaPost_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="coppaFax" id="coppaFax_input" value="'
, !empty($modSettings['coppaFax']) ? $modSettings['coppaFax'] : '', '" size="22" maxlength="35" />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaPhone_input">'
, $txt['admin_setting_coppaPhone'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=coppaPost" onclick="return reqWin(this.href);">?</a>)</span>:
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_setting_coppaPost_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="coppaPhone" id="coppaPhone_input" value="'
, !empty($modSettings['coppaPhone']) ? $modSettings['coppaPhone'] : '', '" size="22" maxlength="35" />
</td>
</tr><tr class="windowbg2">
<td width="100%" colspan="3" align="right">
<input type="submit" name="save" value="'
, $txt[10], '" />
<input type="hidden" name="sa" value="settings" />
</td>
</tr>

<tr class="windowbg2">
<td width="100%" colspan="2" align="center">
<hr />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="ajaxregEnabled">'
, $txt['ajaxreg_enabled_label'], '</label>:
</th>
<td width="50%" align="left">
<input type="checkbox" name="ajaxregEnabled" id="ajaxregEnabled" '
, !empty($modSettings['ajaxregEnabled']) ? 'checked="checked"' : '', ' class="check" />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="ajaxregFailureCSS">'
, $txt['ajaxreg_failureCSS_label'], '</label>
</th>
<td width="50%" align="left">
<input type="text" name="ajaxregFailureCSS" id="ajaxregFailureCSS" value="'
, !empty($modSettings['ajaxregFailureCSS']) ? $modSettings['ajaxregFailureCSS'] : '', '" size="50" maxlength="200" />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="ajaxregSuccessCSS">'
, $txt['ajaxreg_successCSS_label'], '</label>
</th>
..

Incomplete file, please attach in future large files

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

samurai-lupin

Hello,

it is SMF 1.1.4.

Here is a list of my installed mods.

1.     Active Members In Topic      1.5       [ Uninstall ]  [ List Files ]  [ Delete ]
2.    Ad Managment    2.3    [ Uninstall ] [ List Files ] [ Delete ]
3.    Advanced Recent-Posts    1.1    [ Uninstall ] [ List Files ] [ Delete ]
4.    VisualWarning    1.41    [ Uninstall ] [ List Files ] [ Delete ]
5.    Who's Online Buddies    1.0    [ Uninstall ] [ List Files ] [ Delete ]
6.    Google Member Map    0.1    [ Uninstall ] [ List Files ] [ Delete ]
7.    FlashChat Integration    1.0    [ Apply Mod ] [ List Files ] [ Delete ]
8.    Visual Verification Options    0.5    [ Uninstall ] [ List Files ] [ Delete ]
9.    Auto Email Inactive Ordinary Users    1.2    [ Uninstall ] [ List Files ] [ Delete ]
10.    Auto Embed Video Clips    2.1.2    [ Uninstall ] [ List Files ] [ Delete ]
11.    Attachments layout    1.3    [ Uninstall ] [ List Files ] [ Delete ]
12.    Attachments Positioning    1.1    [ Uninstall ] [ List Files ] [ Delete ]
13.    SMF Gallery Lite    1.8.1.2    [ Apply Mod ] [ List Files ] [ Delete ]
14.    AutoSig    1.2    [ Uninstall ] [ List Files ] [ Delete ]
15.    AvatarOnBoard    1.1    [ Uninstall ] [ List Files ] [ Delete ]
16.    Avatars at Index Mod    1.5    [ Uninstall ] [ List Files ] [ Delete ]
17.    AvatarSelect    1.1.2    [ Uninstall ] [ List Files ] [ Delete ]
18.    Award Mod    1.11    [ Uninstall ] [ List Files ] [ Delete ]
19.    SMF Ajax Registration Feedback    1.0.0    [ Uninstall ] [ List Files ] [ Delete ]
20.    Board Viewers Mod    1.2    [ Uninstall ] [ List Files ] [ Delete ]
21.    Bookmarks    1.1    [ Uninstall ] [ List Files ] [ Delete ]
22.    Buddy Message Highlight    1.2    [ Uninstall ] [ List Files ] [ Delete ]
23.    Enhanced Calendar    1.1    [ Uninstall ] [ List Files ] [ Delete ]
24.    SMFShop    3.0    [ Uninstall ] [ List Files ] [ Delete ]
25.    cbi, 1.0    1.0    [ Uninstall ] [ List Files ] [ Delete ]
26.    Count unread topics on index    1.1    [ Uninstall ] [ List Files ] [ Delete ]
27.    Country Flags    1.0.1    [ Uninstall ] [ List Files ] [ Delete ]
28.    Custom Profile Field Mod    3.17    [ Uninstall ] [ List Files ] [ Delete ]
29.    Double Post Stopper    1.0.1    [ Uninstall ] [ List Files ] [ Delete ]
30.    Downloads System    1.0.3    [ Uninstall ] [ List Files ] [ Delete ]
31.    Easy Edit Meta Data    1.0    [ Uninstall ] [ List Files ] [ Delete ]
32.    EmailFlash    2.0    [ Uninstall ] [ List Files ] [ Delete ]
33.    Enchanced post template    1.0.2    [ Uninstall ] [ List Files ] [ Delete ]
34.    Enhanced Forum Statistics    1.0    [ Uninstall ] [ List Files ] [ Delete ]
35.    Export Personal Messages    1.1    [ Uninstall ] [ List Files ] [ Delete ]
36.    FavIcon    1.1    [ Uninstall ] [ List Files ] [ Delete ]
37.    SMF Arcade    2.0.12    [ Uninstall ] [ List Files ] [ Delete ]
38.    Invite    1.14    [ Uninstall ] [ List Files ] [ Delete ]
39.    Hide Board    1.1    [ Uninstall ] [ List Files ] [ Delete ]
40.    LinkImageToOriginalSize    1.0    [ Uninstall ] [ List Files ] [ Delete ]
41.    Member Awards    1.0.2    [ Uninstall ] [ List Files ] [ Delete ]
42.    Highlight Search Keywords    1.1    [ Uninstall ] [ List Files ] [ Delete ]
43.    Ignore user    1.4    [ Uninstall ] [ List Files ] [ Delete ]
44.    Internal Links Use Same Window    1.2    [ Uninstall ] [ List Files ] [ Delete ]
45.    Profile Comments    1.3.6    [ Uninstall ] [ List Files ] [ Delete ]
46.    Popup PM Message - Uses The Same Window    1.3    [ Uninstall ] [ List Files ] [ Delete ]
47.    Member Notepad    1.0    [ Uninstall ] [ List Files ] [ Delete ]
48.    Page View Counter    1.0    [ Uninstall ] [ List Files ] [ Delete ]
49.    Show Google PageRank    1.0    [ Uninstall ] [ List Files ] [ Delete ]
50.    Order News    1.0.3    [ Uninstall ] [ List Files ] [ Delete ]
51.    move recent posts to the top    1.0    [ Uninstall ] [ List Files ] [ Delete ]
52.    SMF Poll Mod    1.1.1    [ Uninstall ] [ List Files ] [ Delete ]
53.    SMF Sitemap    1.2.1    [ Uninstall ] [ List Files ] [ Delete ]
54.    SMFbuy    1.2    [ Uninstall ] [ List Files ] [ Delete ]
55.    SSI Latest Members    1.0.1    [ Uninstall ] [ List Files ] [ Delete ]
56.    Thank You Mod    1.2.1    [ Uninstall ] [ List Files ] [ Delete ]
57.    Todays Birthday    0.1    [ Uninstall ] [ List Files ] [ Delete ]
58.    New Topic Button    1.0    [ Uninstall ] [ List Files ] [ Delete ]
59.    Topic Member Post Count    1.1.5    [ Uninstall ] [ List Files ] [ Delete ]
60.    SMF Trader System    1.1    [ Uninstall ] [ List Files ] [ Delete ]
61.    Treasury    2.06    [ Uninstall ] [ List Files ] [ Delete ]
62.    Registration - Show Gender mod    1.0.0    [ Uninstall ] [ List Files ] [ Delete ]
63.    SMF 1.1.4 Search "brd" Bug Fix (1.0.1)    1.0.1    [ Uninstall ] [ List Files ] [ Delete ]
64.    Add Sitepreviews    1.31    [ Uninstall ] [ List Files ] [ Delete ]
65.    View Single Post    2.0    [ Uninstall ] [ List Files ] [ Delete ]
66.    View Single PM    1.3    [ Uninstall ] [ List Files ] [ Delete ]
67.    Signature Option Post    1.1    [ Uninstall ] [ List Files ] [ Delete ]
68.    Report Icon Mod    1.0    [ Uninstall ] [ List Files ] [ Delete ]
69.    Reg Bar    1.0.1    [ Uninstall ] [ List Files ] [ Delete ]
70.    Referrals Mod    1.4    [ Uninstall ] [ List Files ] [ Delete ]
71.    Recent posts user preference    2.51    [ Uninstall ] [ List Files ] [ Delete ]
72.    Profile User Action    1.1    [ Uninstall ] [ List Files ] [ Delete ]
73.    Most Popular Topic Today    2.0    [ Uninstall ] [ List Files ] [ Delete ]
74.    MessagePreviewOnHover    1.5    [ Uninstall ] [ List Files ] [ Delete ]
75.    MessagePreview    1.2    [ Uninstall ] [ List Files ] [ Delete ]
76.    Member List Position Filter    1.1.0    [ Uninstall ] [ List Files ] [ Delete ]
77.    Link Thumbnail


The Avatar Selection and registration used to work fine but when I tried it again after some time I got up with the error message.


greyknight17

Is the Avatar selection working properly in your profile? Did you install any of the avatar related mods recently before this problem began? How about the Custom Profile Mod (if you used that to set the required Avatar selection)?

samurai-lupin

Hello,

I have noticed that for some unknown reason

'avatar' => "'$regOptions[avatar]'",

in subs-members.php

had been quoted out.

After I fixed this it works again.

However, when a new user registers now, he does not automatically get logged in. Is there a way to change this?

Thank you.

Rumbaar

What Method of registration employed for new members do you have?
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

samurai-lupin

I have immediate registration selected. DO you have any suggestion whoch file could be corrupt / contain the error?

Rumbaar

Are they able to log in once they are registered?  Or they just not automatically logged in straight after they've completed the registration process.   Were they automatically logged in before?  If so did this only happen after you made the single change you posted above?
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

samurai-lupin

Hello,

they can log in manually. Also it used to work before but I can't unfortunatelly tell after which change / mod it stopped working.

Also I noticed that when a user fails to full in a registration field, he / she will get prompted to the forum index instead of seeing an error screen?!

samurai-lupin

Well, I think that the template_after() function etc. are not being called? At least users just get prompted back to the forum index after registration. Also there are no error message screens case they forget to fill in a field.

The same counts true when a user forgets enter any text the subject or message body field when making a posting.

I am unfortunately stuck with this strange error and would appreciate any helpf what might be teh reason. Thank you very much.

Rumbaar

Can you link to your forum, so can take a look at the register template.  Or attach the Register.template.php here and take a look to see if anything stands out.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

samurai-lupin

Hello,

I am attaching my register.template.php (original version including the avatar select mod).

By the way, may I ask where your avatar originates from? It looks pretty neat. Is it from a video game?

<?php
// Version: 1.1.2; Register

// Before registering - get their information.
function template_before()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

// Make sure they've agreed to the terms and conditions.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function verifyAgree()
{
if (document.forms.creator.passwrd1.value != document.forms.creator.passwrd2.value)
{
alert("'
, $txt['register_passwords_differ_js'], '");
return false;
}'
;

// If they haven't checked the "I agree" box, tell them and don't submit.
if ($context['require_agreement'])
echo '

if (!document.forms.creator.regagree.checked)
{
alert("'
, $txt['register_agree'], '");
return false;
}'
;

// Otherwise, let it through.
echo '

return true;
}'
;

if ($context['require_agreement'])
echo '
function checkAgree()
{
document.forms.creator.regSubmit.disabled = isEmptyText(document.forms.creator.user) || isEmptyText(document.forms.creator.email) || isEmptyText(document.forms.creator.passwrd1) || !document.forms.creator.regagree.checked;
setTimeout("checkAgree();", 1000);
}
setTimeout("checkAgree();", 1000);'
;

if ($context['visual_verification'])
{
echo '
function refreshImages()
{
// Make sure we are using a new rand code.
var new_url = new String("'
, $context['verificiation_image_href'], '");
new_url = new_url.substr(0, new_url.indexOf("rand=") + 5);

// Quick and dirty way of converting decimal to hex
var hexstr = "0123456789abcdef";
for(var i=0; i < 32; i++)
new_url = new_url + hexstr.substr(Math.floor(Math.random() * 16), 1);'
;

if ($context['use_graphic_library'])
echo '
document.getElementById("verificiation_image").src = new_url;'
;
else
echo '
document.getElementById("verificiation_image_1").src = new_url + ";letter=1";
document.getElementById("verificiation_image_2").src = new_url + ";letter=2";
document.getElementById("verificiation_image_3").src = new_url + ";letter=3";
document.getElementById("verificiation_image_4").src = new_url + ";letter=4";
document.getElementById("verificiation_image_5").src = new_url + ";letter=5";'
;
echo '
}'
;
}

echo '
// ]]></script>

<form action="'
, $scripturl, '?action=register2" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator" onsubmit="return verifyAgree();">
<script language="JavaScript" type="text/javascript" src="'
, $settings['theme_url'] , '/AjaxRegFed.js"></script>
<table border="0" width="100%" cellpadding="3" cellspacing="0" class="tborder">
<tr class="titlebg">
<td>'
, $txt[97], ' - ', $txt[517], '</td>
</tr><tr class="windowbg">
<td width="100%">
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr>
<td width="40%" valign=top>
<b>'
, $txt[98], ':</b>
<div class="smalltext">'
, $txt[520], '</div>
</td>
<td valign=top>
<input type="text" name="user" size="30" tabindex="'
, $context['tabindex']++, '" maxlength="30" onChange="checkUsername();"/>
<div id="usercheck" name="usercheck">&nbsp;</div>
</td>
</tr><tr>
<td width="40%" valign=top>
<b>'
, $txt[69], ':</b>
<div class="smalltext">'
, $txt[679], '</div>
</td>
<td valign=top>


<input type="text" name="email" size="30" tabindex="'
, $context['tabindex']++, '" onChange="checkEmail();"/>';
// Are they allowed to hide their email?
if ($context['allow_hide_email'])
echo '<br><div class="smalltext"><label for="hideEmail"><input type="checkbox" name="hideEmail" id="hideEmail" class="check" /> ', $txt[721], '</label></div>';

echo '<div id="emailcheck" name="emailcheck">&nbsp;</div>


</td>
</tr><tr>
<td width="40%" valign=top>
<b>'
, $txt[81], ':</b>
</td>
<td valign=top>
<input type="password" name="passwrd1" size="30" tabindex="'
, $context['tabindex']++, '" onChange="checkPasswrd1();"/>
<div id="passwrd1check" name="passwrd1check">&nbsp;</div>
</td>
</tr><tr>
<td width="40%" valign=top>
<b>'
, $txt[82], ':</b>
</td>
<td valign=top>
<input type="password" name="passwrd2" size="30" tabindex="'
, $context['tabindex']++, '" onChange="checkPasswrd2();"/>
<div id="passwrd2check" name="passwrd2check">&nbsp;</div>
</td>
</tr>'
;

if ($context['visual_verification'])
{
echo '
<tr valign="top">
<td width="40%" valign="top">
<b>'
, $txt['visual_verification_label'], ':</b>
<div class="smalltext">'
, $txt['visual_verification_description'], '</div>
</td>
<td valign=top>'
;
if ($context['use_graphic_library'])
echo '
<img src="'
, $context['verificiation_image_href'], '" alt="', $txt['visual_verification_description'], '" id="verificiation_image" /><br />';
else
echo '
<img src="'
, $context['verificiation_image_href'], ';letter=1" alt="', $txt['visual_verification_description'], '" id="verificiation_image_1" />
<img src="'
, $context['verificiation_image_href'], ';letter=2" alt="', $txt['visual_verification_description'], '" id="verificiation_image_2" />
<img src="'
, $context['verificiation_image_href'], ';letter=3" alt="', $txt['visual_verification_description'], '" id="verificiation_image_3" />
<img src="'
, $context['verificiation_image_href'], ';letter=4" alt="', $txt['visual_verification_description'], '" id="verificiation_image_4" />
<img src="'
, $context['verificiation_image_href'], ';letter=5" alt="', $txt['visual_verification_description'], '" id="verificiation_image_5" />';
echo '
<input type="text" name="visual_verification_code" size="30" tabindex="'
, $context['tabindex']++, '" />
<div class="smalltext">
<a href="'
, $context['verificiation_image_href'], ';sound" onclick="return reqWin(this.href, 400, 120);">', $txt['visual_verification_sound'], '</a> | <a href="', $scripturl, '?action=register" onclick="refreshImages(); return false;">', $txt['visual_verification_request_new'], '</a>
</div>
</td>
</tr>'
;
}



//For the no pic language file
loadlanguage('Profile');

echo '<tr>
<td width="40%" valign=top>
<b>Avatar Bild auswaehlen:</b>
<div class="smalltext">Ein eigenes Avatar Bild koennen Sie nach Ihrer Registrierung hochladen.</div>
<div style="margin: 2ex;"><img name="avatar" id="avatar" src="'
.  $modSettings['avatar_url'] . '/blank.gif', '" alt="Do Nothing" /></div>
</td>
<td valign=top>
<select name="cat" id="cat" size="12" onchange="changeSel(\'\');">'
;
// Get a list of all the avatars.
$context['avatar_list'] = array();
$context['avatars'] = is_dir($modSettings['avatar_directory']) ? getAvatars('', 0) : array();


// This lists all the file catergories.
foreach ($context['avatars'] as $avatar)
echo '
<option value="'
, $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected="selected"' : ''), '>', $avatar['name'], '</option>';
echo '</select>

<select name="file" id="file" size="10" style="display: none;" onchange="showAvatar()"  disabled="disabled"><option></option></select>
</td>
</tr>'
;

// If flags is set for registration show it.
if (!empty($modSettings['country_flag_ask']) && $modSettings['country_flag_ask'] == 2 || $modSettings['country_flag_ask'] == 3)
{
// Call the function that has all the flag info
$flags = CountryFlag();

echo '
<script language="JavaScript" type="text/javascript">
function showflags()
{
document.images.flags.src = document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value != \'\' ? \''
. $settings['default_theme_url'] . '/images/flags/\' + document.forms.creator.country.options[document.forms.creator.country.selectedIndex].value + \'.png\' : \'' . $settings['default_theme_url'] . '/images/flags/blank.gif\';
}
</script>
<tr>
<td width="40%" valign="top">
<b>'
, $txt['country_flag_label'], ':</b> <div class="smalltext"><i>(optional)</i></div>
</td>
<td valign=top>
<select name="country" onchange="showflags()">
<option value=""></option>'
;

// Loop and show the drop down.
foreach ($flags as $key => $name)
echo '
<option value="'
, $key, '">', $name, '</option>';

echo '
</select>
<img id="flags" src="'
, $settings['default_theme_url'], '/images/blank.gif" width="25" height="15" align="top" />
</td>
</tr>'
;
}

// Registration - Show Gender mod
if (!empty($modSettings['registration_gender_admin_field']) && $modSettings['registration_gender_admin_field'] == 1)
{
echo '
<tr valign="top">
<td width="40%" valign="top">
<b>'
, $txt['registration_gender_template_field'], ':</b> <div class="smalltext"><i>(optional)</i></div>
</td>
<td valign=top>
<select name="gender" size="1">
<option value="0"></option>
<option value="1">'
, $txt[238], '</option>
<option value="2">'
, $txt[239], '</option>
</select>
</td>
</tr>'
;
}
// Registration - Show Gender mod


// IF REFERRAL INFORMATION IS SET IT WILL HAVE BEEN PASSED USING THIS VARIABLE
global $referrals;
if (isset($referrals))
{
echo ' <tr>
<td width="40%" valign=top><b>'
.$txt['referrals_information'].'</b></td>
<td valign=top>'
. $txt['referrals_youwerereferredby'].' '. $referrals['referredbyname'].
' '.$txt['referrals_on'].' '. date("jS M Y",$referrals['referredon']);

// NOW WRITE THE INFORMATION INTO HIDDEN INPUTS TO BE PASSED TO THE NEXT FUNCTION
echo ' <input type="hidden" name="referredby" value="'.$referrals['referredbyid'].'"/>
<input type="hidden" name="referredon" value="'
.$referrals['referredon'].'"/>
</td>
</tr>'
;
}


global $sourcedir;
require_once($sourcedir . '/CustomProfile.php');
RegistrationFields();
echo '
</table>
</td>
</tr>
</table>'
;

// Require them to agree here?
if ($context['require_agreement'])
echo '
<table width="94%" align="center" border="0" cellspacing="0" cellpadding="5" class="tborder" style="border-top: 0;">
<tr>
<td align="center" class="windowbg2" style="padding-top: 8px; padding-bottom: 8px;">

<div style="width: 100%; border: 1px solid; border-color: #7f9db9; margin-bottom: 1ex; height: 125px; overflow: auto;"><div align=justify>'
, $context['agreement'], '</div></div></center>

</td>
</tr>
           <tr>
<td align="left" class="windowbg2">
<label for="regagree"><input type="checkbox" name="regagree" onclick="checkAgree();" id="regagree" class="check" /> <b>'
, $txt[585], '</b></label>
</td>
</tr>
<tr><td align="left" class="windowbg2"><div class="normaltext" align=justify><b><i>Nach Ihrer Registrierung koennen Sie sich direkt mit Ihrem Login und Passwort anmelden. Sobald Sie eingelogt sind, koennen Sie auch Ihr Profil weiter bearbeiten und ergaenzen.</i></b></div></td></tr>

'
;



// Are there age restrictions in place?
if (!empty($modSettings['coppaAge']))
echo '
<tr>
<td align="left" style="padding-top: 1ex;">
<label for="skip_coppa"><input type="checkbox" name="skip_coppa" id="skip_coppa" tabindex="'
, $context['tabindex']++, '" class="check" /> <b>', $context['coppa_desc'], '.</b></label>
</td>
</tr>'
;
echo
'


</table>'
;

// Invite MOD
if (!empty($context['invite_key']))
echo '
<input type="hidden" name="invite_key" value="'
, $context['invite_key'], '" />';
elseif (!empty($_REQUEST['inviter']) && (int)$_REQUEST['inviter'] !== 0)
echo '
<input type="hidden" name="inviter" value="'
, $_REQUEST['inviter'], '" />';


echo '
<br />
<div align="center">
<input type="submit" name="regSubmit" value="'
, $txt[97], '" />
</div>
</form>'
;



echo '
<script language="JavaScript" type="text/javascript">'
;
       echo
'
<!-- // -->'
. chr(60) . chr(33) . chr(91) . chr(67) . chr(68) . chr(65) . chr(84) . chr(65) . chr(91);
echo
'
var files = ["'
. implode('", "', $context['avatar_list']) . '"];
var avatar = document.getElementById("avatar");
var cat = document.getElementById("cat");
var selavatar = "";
var avatardir = "'
. $modSettings['avatar_url'] . '/";
var size = avatar.alt.substr(3, 2) + " " + avatar.alt.substr(0, 2) + String.fromCharCode(117, 98, 116);
var file = document.getElementById("file");

if (avatar.src.indexOf("blank.gif") > -1)
changeSel(selavatar);
else
previewExternalAvatar(avatar.src)

function changeSel(selected)
{
if (cat.selectedIndex == -1)
return;

if (cat.options[cat.selectedIndex].value.indexOf("/") > 0)
{
var i;
var count = 0;

file.style.display = "inline";
file.disabled = false;

for (i = file.length; i >= 0; i = i - 1)
file.options[i] = null;

for (i = 0; i < files.length; i++)
if (files[i].indexOf(cat.options[cat.selectedIndex].value) == 0)
{
var filename = files[i].substr(files[i].indexOf("/") + 1);
var showFilename = filename.substr(0, filename.lastIndexOf("."));
showFilename = showFilename.replace(/[_]/g, " ");

file.options[count] = new Option(showFilename, files[i]);

if (filename == selected)
{
if (file.options.defaultSelected)
file.options[count].defaultSelected = true;
else
file.options[count].selected = true;
}

count++;
}

if (file.selectedIndex == -1 && file.options[0])
file.options[0].selected = true;

showAvatar();
}
else
{
file.style.display = "none";
file.disabled = true;
document.getElementById("avatar").src = avatardir + cat.options[cat.selectedIndex].value;
document.getElementById("avatar").style.width = "";
document.getElementById("avatar").style.height = "";
}
}

function showAvatar()
{
if (file.selectedIndex == -1)
return;

document.getElementById("avatar").src = avatardir + file.options[file.selectedIndex].value;
document.getElementById("avatar").alt = file.options[file.selectedIndex].text;
document.getElementById("avatar").alt += file.options[file.selectedIndex].text == size ? "!" : "";
document.getElementById("avatar").style.width = "";
document.getElementById("avatar").style.height = "";
}

function previewExternalAvatar(src)
{
if (!document.getElementById("avatar"))
return;

var maxHeight = '
, !empty($modSettings['avatar_max_height_external']) ? $modSettings['avatar_max_height_external'] : 0, ';
var maxWidth = '
, !empty($modSettings['avatar_max_width_external']) ? $modSettings['avatar_max_width_external'] : 0, ';
var tempImage = new Image();

tempImage.src = src;
if (maxWidth != 0 && tempImage.width > maxWidth)
{
document.getElementById("avatar").style.height = parseInt((maxWidth * tempImage.height) / tempImage.width) + "px";
document.getElementById("avatar").style.width = maxWidth + "px";
}
else if (maxHeight != 0 && tempImage.height > maxHeight)
{
document.getElementById("avatar").style.width = parseInt((maxHeight * tempImage.width) / tempImage.height) + "px";
document.getElementById("avatar").style.height = maxHeight + "px";
}
document.getElementById("avatar").src = src;
}'
;
echo '
//'
. chr(93) . chr(93) . chr(62);
echo '
</script>'
;
// Uncheck the agreement thing....
if ($context['require_agreement'])
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
document.forms.creator.regagree.checked = false;
document.forms.creator.regSubmit.disabled = !document.forms.creator.regagree.checked;
// ]]></script>'
;
}

// After registration... all done ;).
function template_after()
{
global $context, $settings, $options, $txt, $scripturl;

// Not much to see here, just a quick... "you're now registered!" or what have you.
echo '
<br />
<table border="0" width="80%" cellpadding="3" cellspacing="0" class="tborder" align="center">
<tr class="titlebg">
<td>'
, $context['page_title'], '</td>
</tr><tr class="windowbg">
<td align="left">'
, $context['description'], '<br /><br /></td>
</tr>
</table>
<br />'
;
}

// Template for giving instructions about COPPA activation.
function template_coppa()
{
global $context, $settings, $options, $txt, $scripturl;

// Formulate a nice complicated message!
echo '
<br />
<table width="60%" cellpadding="4" cellspacing="0" border="0" class="tborder" align="center">
<tr class="titlebg">
<td>'
, $context['page_title'], '</td>
</tr><tr class="windowbg">
<td align="left">'
, $context['coppa']['body'], '<br /></td>
</tr><tr class="windowbg">
<td align="center">
<a href="'
, $scripturl, '?action=coppa;form;member=', $context['coppa']['id'], '" target="_blank">', $txt['coppa_form_link_popup'], '</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="', $scripturl, '?action=coppa;form;dl;member=', $context['coppa']['id'], '">', $txt['coppa_form_link_download'], '</a><br /><br />
</td>
</tr><tr class="windowbg">
<td align="left">'
, $context['coppa']['many_options'] ? $txt['coppa_send_to_two_options'] : $txt['coppa_send_to_one_option'], '</td>
</tr>'
;

// Can they send by post?
if (!empty($context['coppa']['post']))
{
echo '
<tr class="windowbg">
<td align="left"><b>1) '
, $txt['coppa_send_by_post'], '</b></td>
</tr><tr class="windowbg">
<td align="left" style="padding-bottom: 1ex;">
<div style="padding: 4px; width: 32ex; background-color: white; color: black; margin-left: 5ex; border: 1px solid black;">
'
, $context['coppa']['post'], '
</div>
</td>
</tr>'
;
}

// Can they send by fax??
if (!empty($context['coppa']['fax']))
{
echo '
<tr class="windowbg">
<td align="left"><b>'
, !empty($context['coppa']['post']) ? '2' : '1', ') ', $txt['coppa_send_by_fax'], '</b></td>
</tr><tr class="windowbg">
<td align="left" style="padding-bottom: 1ex;">
<div style="padding: 4px; width: 32ex; background-color: white; color: black; margin-left: 5ex; border: 1px solid black;">
'
, $context['coppa']['fax'], '
</div>
</td>
</tr>'
;
}

// Offer an alternative Phone Number?
if ($context['coppa']['phone'])
{
echo '
<tr class="windowbg" style="padding-bottom: 1ex;">
<td align="left">'
, $context['coppa']['phone'], '</td>
</tr>'
;
}
echo '
</table>
<br />'
;
}

// An easily printable form for giving permission to access the forum for a minor.
function template_coppa_form()
{
global $context, $settings, $options, $txt, $scripturl;

// Show the form (As best we can)
echo '
<table border="0" width="100%" cellpadding="3" cellspacing="0" class="tborder" align="center">
<tr>
<td align="left">'
, $context['forum_contacts'], '</td>
</tr><tr>
<td align="right">
<i>'
, $txt['coppa_form_address'], '</i>: ', $context['ul'], '<br />
'
, $context['ul'], '<br />
'
, $context['ul'], '<br />
'
, $context['ul'], '
</td>
</tr><tr>
<td align="right">
<i>'
, $txt['coppa_form_date'], '</i>: ', $context['ul'], '
<br /><br />
</td>
</tr><tr>
<td align="left">
'
, $context['coppa_body'], '
</td>
</tr>
</table>
<br />'
;
}

// Show a window containing the spoken verification code.
function template_verification_sound()
{
global $context, $settings, $options, $txt, $scripturl;

echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
, $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
<meta http-equiv="Content-Type" content="text/html; charset='
, $context['character_set'], '" />
<title>'
, $context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="'
, $settings['theme_url'], '/style.css" />
<style type="text/css">'
;

// Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are bigger...)
if ($context['browser']['needs_size_fix'])
echo '
@import('
, $settings['default_theme_url'], '/fonts-compat.css);';

// Just show the help text and a "close window" link.
echo '
</style>
</head>
<body style="margin: 1ex;">
<div class="popuptext">'
;
if ($context['browser']['is_ie'])
echo '
<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav">
<param name="AutoStart" value="1" />
<param name="FileName" value="'
, $context['verificiation_sound_href'], ';format=.wav" />
</object>'
;
else
echo '
<object type="audio/x-wav" data="'
, $context['verificiation_sound_href'], ';format=.wav">
<a href="'
, $context['verificiation_sound_href'], ';format=.wav">', $context['verificiation_sound_href'], ';format=.wav</a>
</object>'
;
echo '
<br />
<a href="'
, $context['verificiation_sound_href'], ';sound">', $txt['visual_verification_sound_again'], '</a><br />
<a href="javascript:self.close();">'
, $txt['visual_verification_sound_close'], '</a><br />
<a href="'
, $context['verificiation_sound_href'], ';format=.wav">', $txt['visual_verification_sound_direct'], '</a>
</div>
</body>
</html>'
;
}

function
template_admin_register()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '
<form action="'
, $scripturl, '?action=regcenter" method="post" accept-charset="', $context['character_set'], '" name="postForm" id="postForm">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function onCheckChange()
{
if (document.forms.postForm.emailActivate.checked)
{
document.forms.postForm.emailPassword.disabled = true;
document.forms.postForm.emailPassword.checked = true;
}
else
document.forms.postForm.emailPassword.disabled = false;
}
// ]]></script>
<table border="0" cellspacing="0" cellpadding="4" align="center" width="70%" class="tborder">
<tr class="titlebg">
<td colspan="2" align="center">'
, $txt['admin_browse_register_new'], '</td>
</tr>'
;
if (!empty($context['registration_done']))
echo '
<tr class="windowbg2">
<td colspan="2" align="center"><br />
'
, $context['registration_done'], '
</td>
</tr><tr class="windowbg2">
<td colspan="2" align="center"><hr /></td>
</tr>'
;
echo '
<tr class="windowbg2">
<th width="50%" align="right">
<label for="user_input">'
, $txt['admin_register_username'], ':</label>
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_register_username_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="user" id="user_input" size="30" maxlength="25" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="email_input">'
, $txt['admin_register_email'], ':</label>
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_register_email_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="email" id="email_input" size="30" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="password_input">'
, $txt['admin_register_password'], ':</label>
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_register_password_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="password" name="password" id="password_input" size="30" /><br />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="group_select">'
, $txt['admin_register_group'], ':</label>
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_register_group_desc'], '</div>
</th>
<td width="50%" align="left">
<select name="group" id="group_select">'
;

foreach ($context['member_groups'] as $id => $name)
echo '
<option value="'
, $id, '">', $name, '</option>';
echo '
</select><br />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="emailPassword_check">'
, $txt['admin_register_email_detail'], ':</label>
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_register_email_detail_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="checkbox" name="emailPassword" id="emailPassword_check" checked="checked"'
, !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 ? ' disabled="disabled"' : '', ' class="check" /><br />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="emailActivate_check">'
, $txt['admin_register_email_activate'], ':</label>
</th>
<td width="50%" align="left">
<input type="checkbox" name="emailActivate" id="emailActivate_check"'
, !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 ? ' checked="checked"' : '', ' onclick="onCheckChange();" class="check" /><br />
</td>
</tr><tr class="windowbg2">
<td width="100%" colspan="2" align="right">
<input type="submit" name="regSubmit" value="'
, $txt[97], '" />
<input type="hidden" name="sa" value="register" />
</td>
</tr>
</table>
<input type="hidden" name="sc" value="'
, $context['session_id'], '" />
</form>'
;
}

// Form for editing the agreement shown for people registering to the forum.
function template_edit_agreement()
{
global $context, $settings, $options, $scripturl, $txt;

// Just a big box to edit the text file ;).
echo '
<form action="'
, $scripturl, '?action=regcenter" method="post" accept-charset="', $context['character_set'], '">
<table border="0" cellspacing="0" cellpadding="4" align="center" width="80%" class="tborder">
<tr class="titlebg">
<td align="center">'
, $txt['smf11'], '</td>
</tr>'
;

// Warning for if the file isn't writable.
if (!empty($context['warning']))
echo '
<tr class="windowbg2">
<td style="color: red; font-weight: bold;" align="center">
'
, $context['warning'], '
</td>
</tr>'
;
echo '
<tr class="windowbg2">
<td align="center" style="padding-bottom: 1ex; padding-top: 2ex;">'
;

// Show the actual agreement in an oversized text box.
echo '
<textarea cols="70" rows="20" name="agreement" style="width: 94%; margin-bottom: 1ex;">'
, $context['agreement'], '</textarea><br />
<label for="requireAgreement"><input type="checkbox" name="requireAgreement" id="requireAgreement"'
, $context['require_agreement'] ? ' checked="checked"' : '', ' value="1" /> ', $txt[584], '.</label><br />
<br />
<input type="submit" value="'
, $txt[10], '" />
<input type="hidden" name="sa" value="agreement" />
</td>
</tr>
</table>
<input type="hidden" name="sc" value="'
, $context['session_id'], '" />
</form>'
;
}

function
template_edit_reserved_words()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<form action="'
, $scripturl, '?action=regcenter" method="post" accept-charset="', $context['character_set'], '">
<table border="0" cellspacing="1" class="bordercolor" align="center" cellpadding="4" width="80%">
<tr class="titlebg">
<td align="center">
'
, $txt[341], '
</td>
</tr><tr>
<td class="windowbg2" align="center">
<div style="width: 80%;">
<div style="margin-bottom: 2ex;">'
, $txt[342], '</div>
<textarea cols="30" rows="6" name="reserved" style="width: 98%;">'
, implode("\n", $context['reserved_words']), '</textarea><br />

<div align="left" style="margin-top: 2ex;">
<label for="matchword"><input type="checkbox" name="matchword" id="matchword" '
, $context['reserved_word_options']['match_word'] ? 'checked="checked"' : '', ' class="check" /> ', $txt[726], '</label><br />
<label for="matchcase"><input type="checkbox" name="matchcase" id="matchcase" '
, $context['reserved_word_options']['match_case'] ? 'checked="checked"' : '', ' class="check" /> ', $txt[727], '</label><br />
<label for="matchuser"><input type="checkbox" name="matchuser" id="matchuser" '
, $context['reserved_word_options']['match_user'] ? 'checked="checked"' : '', ' class="check" /> ', $txt[728], '</label><br />
<label for="matchname"><input type="checkbox" name="matchname" id="matchname" '
, $context['reserved_word_options']['match_name'] ? 'checked="checked"' : '', ' class="check" /> ', $txt[729], '</label><br />
</div>

<input type="submit" value="'
, $txt[10], '" name="save_reserved_names" style="margin: 1ex;" />
</div>
</td>
</tr>
</table>
<input type="hidden" name="sa" value="reservednames" />
<input type="hidden" name="sc" value="'
, $context['session_id'], '" />
</form>'
;
}

function
template_admin_settings()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

// Javascript for the verification image.
if ($context['use_graphic_library'])
{
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function refreshImages()
{
var imageType = document.getElementById(\'visual_verification_type_select\').value;
document.getElementById(\'verificiation_image\').src = \''
, $context['verificiation_image_href'], ';type=\' + imageType;
}
// ]]></script>'
;
}

echo '
<form action="'
, $scripturl, '?action=regcenter" method="post" accept-charset="', $context['character_set'], '">
<table border="0" cellspacing="1" cellpadding="4" align="center" width="100%" class="tborder">
<tr class="titlebg">
<td align="center">'
, $txt['settings'], '</td>
</tr>
<tr class="windowbg2">
<td align="center">'
;

// Functions to do some nice box disabling dependant on age restrictions.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function checkCoppa()
{
var coppaDisabled = document.getElementById(\'coppaAge_input\').value == 0;
document.getElementById(\'coppaType_select\').disabled = coppaDisabled;

var disableContacts = coppaDisabled || document.getElementById(\'coppaType_select\').options[document.getElementById(\'coppaType_select\').selectedIndex].value != 1;
document.getElementById(\'coppaPost_input\').disabled = disableContacts;
document.getElementById(\'coppaFax_input\').disabled = disableContacts;
document.getElementById(\'coppaPhone_input\').disabled = disableContacts;
}
// ]]></script>'
;
echo '
<table border="0" cellspacing="0" cellpadding="4" align="center" width="100%">
<tr class="windowbg2">
<th width="50%" align="right">
<label for="registration_method_select">'
, $txt['admin_setting_registration_method'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=registration_method" onclick="return reqWin(this.href);">?</a>)</span>:
</th>
<td width="50%" align="left">
<select name="registration_method" id="registration_method_select">
<option value="0"'
, empty($modSettings['registration_method']) ? ' selected="selected"' : '', '>', $txt['admin_setting_registration_standard'], '</option>
<option value="1"'
, !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 ? ' selected="selected"' : '', '>', $txt['admin_setting_registration_activate'], '</option>
<option value="2"'
, !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 2 ? ' selected="selected"' : '', '>', $txt['admin_setting_registration_approval'], '</option>
<option value="3"'
, !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 3 ? ' selected="selected"' : '', '>', $txt['admin_setting_registration_disabled'], '</option>
</select>
</td>
</tr>
<tr class="windowbg2">
<th width="50%" align="right">
<label for="notify_new_registration_check">'
, $txt['admin_setting_notify_new_registration'], '</label>:
</th>
<td width="50%" align="left">
<input type="checkbox" name="notify_new_registration" id="notify_new_registration_check" '
, !empty($modSettings['notify_new_registration']) ? 'checked="checked"' : '', ' class="check" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="send_welcomeEmail_check">'
, $txt['admin_setting_send_welcomeEmail'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=send_welcomeEmail" onclick="return reqWin(this.href);">?</a>)</span>:
</th>
<td width="50%" align="left">
<input type="checkbox" name="send_welcomeEmail" id="send_welcomeEmail_check"'
, !empty($modSettings['send_welcomeEmail']) ? ' checked="checked"' : '', ' class="check" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="password_strength_select">'
, $txt['admin_setting_password_strength'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=password_strength" onclick="return reqWin(this.href);">?</a>)</span>:
</th>
<td width="50%" align="left">
<select name="password_strength" id="password_strength_select">
<option value="0"'
, empty($modSettings['password_strength']) ? ' selected="selected"' : '', '>', $txt['admin_setting_password_strength_low'], '</option>
<option value="1"'
, !empty($modSettings['password_strength']) && $modSettings['password_strength'] == 1 ? ' selected="selected"' : '', '>', $txt['admin_setting_password_strength_medium'], '</option>
<option value="2"'
, !empty($modSettings['password_strength']) && $modSettings['password_strength'] == 2 ? ' selected="selected"' : '', '>', $txt['admin_setting_password_strength_high'], '</option>
</select>
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="visual_verification_type_select">
'
, $txt['admin_setting_image_verification_type'], ':<br />
<span class="smalltext" style="font-weight: normal;">
'
, $txt['admin_setting_image_verification_type_desc'], '
</span>
</label>
</th>
<td width="50%" align="left">
<select name="visual_verification_type" id="visual_verification_type_select" '
, $context['use_graphic_library'] ? 'onchange="refreshImages();"' : '', '>
<option value="1" '
, !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 1 ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_off'], '</option>
<option value="2" '
, !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 2 ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_vsimple'], '</option>
<option value="3" '
, !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 3 ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_simple'], '</option>
<option value="0" '
, empty($modSettings['disable_visual_verification']) ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_medium'], '</option>
<option value="4" '
, !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 4 ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_high'], '</option>
</select><br />'
;
if ($context['use_graphic_library'])
echo '
<img src="'
, $context['verificiation_image_href'], ';type=', empty($modSettings['disable_visual_verification']) ? 0 : $modSettings['disable_visual_verification'], '" alt="', $txt['admin_setting_image_verification_sample'], '" id="verificiation_image" /><br />';
else
{
echo '
<span class="smalltext">'
, $txt['admin_setting_image_verification_nogd'], '</span>';
}
echo '
</td>
</tr><tr class="windowbg2">
<td width="100%" colspan="2" align="center">
<hr />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaAge_input">'
, $txt['admin_setting_coppaAge'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=coppaAge" onclick="return reqWin(this.href);">?</a>)</span>:
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_setting_coppaAge_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="coppaAge" id="coppaAge_input" value="'
, !empty($modSettings['coppaAge']) ? $modSettings['coppaAge'] : '', '" size="3" maxlength="3" onkeyup="checkCoppa();" />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaType_select">'
, $txt['admin_setting_coppaType'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=coppaType" onclick="return reqWin(this.href);">?</a>)</span>:
</th>
<td width="50%" align="left">
<select name="coppaType" id="coppaType_select" onchange="checkCoppa();">
<option value="0"'
, empty($modSettings['coppaType']) ? ' selected="selected"' : '', '>', $txt['admin_setting_coppaType_reject'], '</option>
<option value="1"'
, !empty($modSettings['coppaType']) && $modSettings['coppaType'] == 1 ? ' selected="selected"' : '', '>', $txt['admin_setting_coppaType_approval'], '</option>
</select>
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaPost_input">'
, $txt['admin_setting_coppaPost'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=coppaPost" onclick="return reqWin(this.href);">?</a>)</span>:
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_setting_coppaPost_desc'], '</div>
</th>
<td width="50%" align="left">
<textarea name="coppaPost" id="coppaPost_input" rows="4" cols="35">'
, $context['coppaPost'], '</textarea>
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaFax_input">'
, $txt['admin_setting_coppaFax'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=coppaPost" onclick="return reqWin(this.href);">?</a>)</span>:
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_setting_coppaPost_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="coppaFax" id="coppaFax_input" value="'
, !empty($modSettings['coppaFax']) ? $modSettings['coppaFax'] : '', '" size="22" maxlength="35" />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="coppaPhone_input">'
, $txt['admin_setting_coppaPhone'], '</label> <span style="font-weight: normal;">(<a href="', $scripturl, '?action=helpadmin;help=coppaPost" onclick="return reqWin(this.href);">?</a>)</span>:
<div class="smalltext" style="font-weight: normal;">'
, $txt['admin_setting_coppaPost_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="coppaPhone" id="coppaPhone_input" value="'
, !empty($modSettings['coppaPhone']) ? $modSettings['coppaPhone'] : '', '" size="22" maxlength="35" />
</td>
</tr><tr class="windowbg2">
<td width="100%" colspan="3" align="right">
<input type="submit" name="save" value="'
, $txt[10], '" />
<input type="hidden" name="sa" value="settings" />
</td>
</tr>

<tr class="windowbg2">
<td width="100%" colspan="2" align="center">
<hr />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="ajaxregEnabled">'
, $txt['ajaxreg_enabled_label'], '</label>:
</th>
<td width="50%" align="left">
<input type="checkbox" name="ajaxregEnabled" id="ajaxregEnabled" '
, !empty($modSettings['ajaxregEnabled']) ? 'checked="checked"' : '', ' class="check" />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="ajaxregFailureCSS">'
, $txt['ajaxreg_failureCSS_label'], '</label>
</th>
<td width="50%" align="left">
<input type="text" name="ajaxregFailureCSS" id="ajaxregFailureCSS" value="'
, !empty($modSettings['ajaxregFailureCSS']) ? $modSettings['ajaxregFailureCSS'] : '', '" size="50" maxlength="200" />
</td>

Incomplete file.

Rumbaar

No please use the additional features area of reply and physically attach the file to the post, as you can see it's far too much code to be posting into a single post.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

samurai-lupin

Hello, thanky ou for your reply. I have attached the involved files.

Rumbaar

What does /AjaxRegFed.js do?

What mods have you installed that affect the registration process.  I notice a few modifications there.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

samurai-lupin

Hello,

Ajax checks the registration fields (username, password and e-mail address) to see if the username has been taken, if the passwords match and if the e-mail address is valid.

The other mods that may effect the registration are:

- Country Flag Mod
- Additional Profile Field Mod
- And of course the select avatar on registration mod

Thank you

Rumbaar

If you temporarily put in a fresh non edited version of Register.template.php do you get the same results?
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

samurai-lupin

I have tried it, but it unfortunately did NOT change anything. A user does not get logged in automatically, no receive a welcoem message or screen.

SleePy

Did you install any of those mods recently or a mod you installed before you noticed the issues?
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Hot Rides

I had the same problem, dont know if its related, but some of the avatars I upload would not work for the registration. You could select the avatar but it would not recognize it and tell ou to select one, but other avatars would work, I just disabled it. I would rather have the select as an option than a requirement.

Advertisement: