Custom Profile Field Mod

Started by winrules, March 30, 2006, 02:21:25 PM

Previous topic - Next topic

Aramaki

Hi.

On my forum I use this mod. It rulez but misses one feature - field type "Image" would be great. I want members to upload their portrait besides avatar.

Didn't find any plugin doing this.

Kindred

This mod is not going to be further developed, since the functionality has been incorporated into SMF 2.0.

Geko,   If you want that, then you should request a new 2.0 mod to do specifically that...  you should not piggyback a new (and unrelated) request in this mod thread.
Сл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."

gibsongk55

Hi,

I am using this mod on SMF 1.1.8 and recently checked the error logs and was wondering if anyone has this error and is it related to this mod?  I would think so.  I am also using thai language and english template.

8: Undefined index: registration_language_template_field
ไฟล์: /home8/moretele/public_html/poodarai/Themes/default/Register.template.php (before sub template - eval?)
บรรทัด: 157



Thanks,

Gibs

ehsizzup

Hello all.

I successfully installed this mod, but I would like to be able to move the custom field(s) to the top of the registration process. 

Is this possible?

Thanks in advance.

Gerry.

Kindred

you'll have to move the code around in register.template.php
Сл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."

ehsizzup

#2505
I've tried to cut and paste it in about a dozen places, but I always get errors.

My register.template.php is listed below.  Can you show me where to move the code to?  The section that calls the extra fields is about 172 lines in.   

Thanks in advance.

// 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();">
<table border="0" width="100%" cellpadding="3" cellspacing="0" class="tborder">
<tr class="titlebg">
<td>', $txt[9001], '</td>
</tr><tr class="windowbg">
<td width="100%">
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tr>
<td width="40%">
<b>', $txt[98], ':</b>
<div class="smalltext">', $txt[520], '</div>
</td>
<td>
<input type="text" name="user" size="20" tabindex="', $context['tabindex']++, '" maxlength="25" />
</td>
</tr><tr>
<td width="40%">
<b>', $txt[69], ':</b>
<div class="smalltext">', $txt[679], '</div>
</td>
<td>
<input type="text" name="email" size="30" tabindex="', $context['tabindex']++, '" />';

// Are they allowed to hide their email?
if ($context['allow_hide_email'])
echo '
<label for="hideEmail"><input type="checkbox" name="hideEmail" id="hideEmail" class="check" checked="checked" /> ', $txt[721], '</label>';

echo '
</td>
</tr><tr>
<td width="40%">
<b>', $txt[81], ':</b>
</td>
<td>
<input type="password" name="passwrd1" size="30" tabindex="', $context['tabindex']++, '" />
</td>
</tr><tr>
<td width="40%">
<b>', $txt[82], ':</b>
</td>
<td>
<input type="password" name="passwrd2" size="30" tabindex="', $context['tabindex']++, '" />
</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>';
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>';
}

## Start MOD Are You Human?
if (!empty($modSettings['are_you_human_s']))
echo '
<tr valign="top">
<td width="40%" valign="top">
<b>', $context['are_you_human_question'], ':</b>
<div class="smalltext">', $txt['are_you_human_desc'], '</div>
</td>
<td>
<select name="', $_SESSION['are_you_human']['name'], '" tabindex="',  $context['tabindex']++, '" class="select">',
$context['are_you_human_answers'], '
</select>
</td>
</tr>';
## End MOD Are You Human?

// Are there age restrictions in place?
if (!empty($modSettings['coppaAge']))
echo '
<tr>
<td colspan="2" align="center" 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>';
    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="100%" align="center" border="0" cellspacing="0" cellpadding="5" class="tborder" style="border-top: 0;">
<tr>
<td class="windowbg2" style="padding-top: 8px; padding-bottom: 8px;">
', $context['agreement'], '
</td>
</tr><tr>
<td align="center" class="windowbg2">
<label for="regagree"><input type="checkbox" name="regagree" onclick="checkAgree();" id="regagree" class="check" /> <b>', $txt[585], '</b></label>
</td>
</tr>
</table>';

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

// 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>';
}

ehsizzup

I'm OK now.  I struggled through it.

Thanks anyhow.

g.

ehsizzup

I noticed that the new custom field that we created (CP1) is not displayed in the user profile or member lists even though I have it configured to do so. 

I'm not using the default theme.  Is there something I should be coding into my theme templates?



G.

Kindred

yup...   on 1.1.x, you will have to manually install any code into your custom theme template files.
Сл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."

den2

Hi all
I want show field in staff page, but i m getting this error

8: Undefined index: member
Dosya: /home/xxx/public_html/forum/Themes/default/languages/Staff.english.php (main sub template - eval?)
Satır: 177



echo '<td class="windowbg" align="left">', $context['member']['options']['cp1telefon'], '</td>';

full code:
line 177. hxxp:pastebin.com/m33ce869c [nonactive]

Kindred

???    Why is there an echo statement in your language file?
Сл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."

den2

i dont know :)

can you Shows  the right way?

Kindred

echo statements like that belong in TEMPLATE files...   I don't know specifically what you are trying to do, but I would suggest checking out the staff.template.php file
Сл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."

recived

How can we calculate different variants of the field "selection box" and check the results.
  For example, there's a box "test" type "selection box". There 3 options one, two, three. Here's how to calculate how many users chose option one, but two, but three and set them on the forum ..? Thanks

ehsizzup

Quote from: Kindred on May 06, 2009, 01:28:28 PM
yup...   on 1.1.x, you will have to manually install any code into your custom theme template files.

I am using the Orange Line theme and it does not have its own Profile.template.php,  Display.template.php,  PersonalMessage.template.php, or Register.template.php. 

Those are the templates listed in the manual parse.   I'm new to this and I dont understand what other templates would need coding.  Please explain.

Thanks.
Gerry.

Garou

Technically you shouldn't need those file as SMF should read them from the default file if they don't exist in a custom theme. Just change the ones you do have then if the mod doesn't work on the theme, try coping the missing files from the default theme to your custom.

ehsizzup

Quote from: Garou on May 08, 2009, 07:10:42 AM
Technically you shouldn't need those file as SMF should read them from the default file if they don't exist in a custom theme. Just change the ones you do have then if the mod doesn't work on the theme, try coping the missing files from the default theme to your custom.

I tried this with copying the four templates into the OragneLine theme directory and it did not effect the mod at all.

Still no custom field info showing up anywhere in profiles or the member list.

Kindred ----> What am I doing wrong?  I went through all the templates by hand and all the mod lines are in there.


Kindred

is the code added into profile.php in the sources directory?
Сл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."

ehsizzup

Quote from: Kindred on May 08, 2009, 10:11:10 PM
is the code added into profile.php in the sources directory?

yes.  i went through the parse and it made all those changes.  But there is no sign of the custom field anywhere in my profile or member list.


global $sourcedir;
require_once($sourcedir . '/CustomProfile.php');
CheckFieldInput('profile');

$erase_options = array();



I looked through my database and didnt see any sign of the custom field either.  I found all the other member info, but no CP1.

?

Kindred

the data from custom fields gets added into the smf_themes tale of the database...   search for anything with CP
Сл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."

Advertisement: