Advertisement:

Author Topic: Avatar Select on Register  (Read 101298 times)

Offline SMFHacks.com Team

  • Jr. Member
  • **
  • Posts: 398
    • smfhacks on Facebook
    • @smfhacks on Twitter
    • SMFHacks.com
Avatar Select on Register
« on: December 28, 2006, 10:44:04 PM »
Link to Mod

Avatar Select on new user register. The user must select an avatar from the avatar gallery.  Mod modifies the default register.template.php
« Last Edit: June 11, 2011, 09:01:25 PM by vbgamer45 »
Disclaimer: SMFHacks.com Team is not affiliated with the SMF Team or the SimpleMachines NPO.

http://ForumRankings.net - Get Forum Ranked!
SMFHacks.com -  Paid Modifications for SMF
Latest Mods:
Community Suite
Newsletter Pro SMF Gallery Pro SMF Classifieds SMF Store

Offline RoarinRow

  • Full Member
  • ***
  • Posts: 662
  • Gender: Male
  • Ride my AV!
    • Avalanche Style
Re: Avatar Select on Register
« Reply #1 on: December 29, 2006, 12:38:32 AM »
Cool idea   8)

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

Offline teamvtec

  • Jr. Member
  • **
  • Posts: 110
Re: Avatar Select on Register
« Reply #2 on: December 29, 2006, 07:50:15 AM »
Thanks for the upgrade, works in IE7 ;D

Offline L.G.S

  • SMF Hero
  • ******
  • Posts: 2,658
  • Gender: Male
  • RuthlessIntent.com !
    • GamesandGoals.com
Re: Avatar Select on Register
« Reply #3 on: December 29, 2006, 08:39:03 AM »
Yeah this is good.
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


Offline 4LP3RUZ1

  • SMF Hero
  • ******
  • Posts: 3,438
  • Gender: Male
  • Frozen frogs are gone!
Re: Avatar Select on Register
« Reply #4 on: December 29, 2006, 08:44:03 AM »
* alperuzi is puzzled

I saw this mod before, how come the thread is no new? :)

good mod btw ;)

edit: oh, I have some translations for the mod, want me to pm them?

* alperuzi is still puzzled
the files I have are v1.2?
« Last Edit: December 29, 2006, 08:46:25 AM by alperuzi »
Frozen frogs are back :(

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,071
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Avatar Select on Register
« Reply #5 on: December 29, 2006, 10:15:23 AM »
I fixed the mod. It was never on the mod site before since it didn't work with internet explorer. But now the mod works with internet explorer as well!
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline checho_vacan

  • Semi-Newbie
  • *
  • Posts: 52
Re: Avatar Select on Register
« Reply #6 on: January 02, 2007, 12:28:25 PM »
It's working perfectly!... oldies version does'nt work for me n_n

Offline denislici

  • Jr. Member
  • **
  • Posts: 331
  • Gender: Male
  • . . SMF Ustası . .
    • FezaTasarım.com
Re: Avatar Select on Register
« Reply #7 on: January 03, 2007, 02:44:17 PM »
* alperuzi is puzzled

I saw this mod before, how come the thread is no new? :)

good mod btw ;)

edit: oh, I have some translations for the mod, want me to pm them?

* alperuzi is still puzzled
the files I have are v1.2?

i had downloaded the previus version of this mod from smfhacks.com and gived it in Turkish board(translated)... u have seen it there...
Love the Creature for Creator's sake. (English)
Duje Krijesen per hire te Krijuesit. (Albanian)
Yaradılan'ı sev Yaradan'dan ötürü. (Turkish)
Ami la Creatura per ce la creato il Creatore. (Italian)

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,071
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Avatar Select on Register
« Reply #8 on: January 03, 2007, 02:49:30 PM »
You should update that version as well then since this one works will all browsers
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline denislici

  • Jr. Member
  • **
  • Posts: 331
  • Gender: Male
  • . . SMF Ustası . .
    • FezaTasarım.com
Re: Avatar Select on Register
« Reply #9 on: January 03, 2007, 02:51:09 PM »

yeah i checked it, u have choosen the error of registering a user from admin panel too, thanx...
« Last Edit: January 29, 2007, 04:44:24 AM by denislici »
Love the Creature for Creator's sake. (English)
Duje Krijesen per hire te Krijuesit. (Albanian)
Yaradılan'ı sev Yaradan'dan ötürü. (Turkish)
Ami la Creatura per ce la creato il Creatore. (Italian)

Offline Webby

  • Full Member
  • ***
  • Posts: 482
  • Gender: Male
  • Let's generate some buttons !
    • marcovanveelen.nl
Re: Avatar Select on Register
« Reply #10 on: January 05, 2007, 05:28:12 AM »
I installed it without any problem, but when I go test it, it generates loads of errors in the log :

Quote
http://www.marcovanveelen.nl/forum/index.php?action=register 
8: Undefined index: member
Bestand: /home/vhosts/marcovanveelen.nl/httpdocs/forum/Themes/default/languages/Profile.dutch-utf8.php (eval?)
Regel: 875

What could be the trick to get this solved ?

Offline samurai-lupin

  • Full Member
  • ***
  • Posts: 522
Re: Avatar Select on Register
« Reply #11 on: January 28, 2007, 09:04:41 AM »
Hello everybody,

I was unfortunately having some trouble installing this mod manually on my RC2 board. I get the following error:

Fatal error:  Call to undefined function:  getavatars() in /hsphere/local/home/thunting/thunting.com/smf/Sources/Load.php(1613) : eval()'d code on line 116

Here is my register.template.php in which I suppose there might be an error:

Code: [Select]
<?php
// Version: 1.1 RC2; 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;
}

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;
}
// ]]></script>

<form action="'
$scripturl'?action=register2" method="post" name="creator" id="creator" onsubmit="return verifyAgree();">
<br>
<table border="0" width="100%" cellpadding="3" cellspacing="0" class="tborder">

<tr><td><table width=100% cellpadding=0 cellspacing=0 border=0><tr><td valign=top><font face=verdana,arial,helvetica size=+1>Gain real Treasure for free:</font></b><p><div align=justify><font size=-1 verdana,arial,helvetica>THunting.com offers the unique possibility of gaining real treasure and relics for free! For each new topic that you start on our forum you will be given <b>10</b> credits and <b>5</b> credits for each reply to an existing topic. Credits can be exchanged for items such as old silver coins, tokens, medals and much more in our <i>THunting.com Shop</i>. <p>Furthermore you will be given <b>250</b> credits for each new member that you refer to THunting.com. The new member will need to insert your screen name in the below <i>Referrer</i> field.<p><i><b>THunting.com is where Treasure is!</b></i></td><td width=15></td><td valign=top><img src="http://www.thunting.com/thunting/images/shopbuy.jpg"></td></tr></table></td></tr>


<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%">
<b>'
$txt[98], ':</b>
</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" /> '
$txt[721], '</label>';

echo '
</td>
</tr><tr>
<td width="40%">
<b>'
$txt[81], ':</b><br><div class="smalltext">Must be at least 8 characters long
</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><tr>
<!-- Begin CAPTCHA Mod 0.1 -->
<td width="40%">
<b>'
$txt['captchaEnter'], ':</b>
</td>
<td>
'
$context['captcha_image'], '</br> Attention: All characters are <b>case sensitive
<!--<input type="password" name="passwrd2" size="30" />-->
</td>
<!-- End CAPTCHA Mod -->
</tr>
'
;

loadlanguage('Profile');

echo '<tr>
<td width="40%">
<b>Avatar Select:</b>
<div class="smalltext">Please select an avatar.</div>
<div style="margin: 2ex;"><img name="avatar" id="avatar" src="' 
.  $modSettings['avatar_url'] . '/blank.gif''" alt="Do Nothing" /></div>
</td>
<td>
<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'] == || $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%" align="top">
<b>'
$txt['country_flag_label'], ':</b>
</td>
<td>
<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>'
;
}


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;"><div align=justify>
'
$context['agreement'], '
</td>
</tr>

<tr>
<td align="center" class="windowbg2">
<table><tr><td>
<label for="skip_coppa"><input type="checkbox" name="skip_coppa" id="skip_coppa" tabindex="'
$context['tabindex']++, '" class="check" /> <b>'$context['coppa_desc'], '.</b></label><br>
<label for="regagree"><input type="checkbox" name="regagree" onclick="checkAgree();" id="regagree" class="check" /> <b>'
$txt[585], '</b></label>
</td></tr></table>
</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">'
;
        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 = "' 
$context['avatar_selected'] . '";
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>'
;

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

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

echo '
<form action="'
$scripturl'?action=regcenter" method="post" 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>
</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'] == ' 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'] == ' 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">
<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">
<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;

echo '
<form action="'
$scripturl'?action=regcenter" method="post">
<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'] == ' selected="selected"' '''>'$txt['admin_setting_registration_activate'], '</option>
<option value="2"'
, !empty($modSettings['registration_method']) && $modSettings['registration_method'] == ' selected="selected"' '''>'$txt['admin_setting_registration_approval'], '</option>
<option value="3"'
, !empty($modSettings['registration_method']) && $modSettings['registration_method'] == ' 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'] == ' selected="selected"' '''>'$txt['admin_setting_password_strength_medium'], '</option>
<option value="2"'
, !empty($modSettings['password_strength']) && $modSettings['password_strength'] == ' selected="selected"' '''>'$txt['admin_setting_password_strength_high'], '</option>
</select>
</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'] == ' 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="2" align="center">
<hr />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="pm_register_enable">'
$txt['pm_register_enable'], '</label>:
</th>
<td width="50%" align="left">
<input type="checkbox" name="pm_register_enable" id="pm_register_enable" '
, !empty($modSettings['pm_register_enable']) ? 'checked="checked"' ''' />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="pm_register_id">'
$txt['pm_register_id'], '</label>:
<div class="smalltext" style="font-weight: normal;">'
$txt['pm_register_id_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="pm_register_id" id="pm_register_id" value="'
, !empty($modSettings['pm_register_id']) ? $modSettings['pm_register_id'] : 0'" size="9" />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="pm_register_from">'
$txt['pm_register_from'], '</label>:
<div class="smalltext" style="font-weight: normal;">'
$txt['pm_register_from_desc'], '</div>
</th>
<td width="50%" align="left">
<input type="text" name="pm_register_from" id="pm_register_from" value="'
, !empty($modSettings['pm_register_from']) ? $modSettings['pm_register_from'] : '''" />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="pm_register_subject">'
$txt['pm_register_subject'], '</label>:
</th>
<td width="50%" align="left">
<input type="text" name="pm_register_subject" id="pm_register_subject" value="'
, !empty($modSettings['pm_register_subject']) ? $modSettings['pm_register_subject'] : '''" />
</td>
</tr><tr class="windowbg2" valign="top">
<th width="50%" align="right">
<label for="pm_register_body">'
$txt['pm_register_body'], '</label>:
<div class="smalltext" style="font-weight: normal;">'
$txt['pm_register_body_desc'], '</div>
</th>
<td width="50%" align="left">
<textarea name="pm_register_body" id="pm_register_body" rows=5" cols="35">' 
,!empty($modSettings['pm_register_body']) ? $modSettings['pm_register_body'] : $txt['pm_register_body_sample'], '</textarea>
</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>
</table>'
;

// Handle disabling of some of the input boxes.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA['
;

if (empty($modSettings['coppaAge']) || empty($modSettings['coppaType']))
echo '
document.getElementById(\\\\'
coppaPost_input').disabled = true;
document.getElementById(\\\\'
coppaFax_input').disabled = true;
document.getElementById(\\\\'
coppaPhone_input').disabled = true;';
if (empty($modSettings['coppaAge']))
echo '
document.getElementById(\\\\'
coppaType_select').disabled = true;';

echo '
// ]]></script>
</td>
</tr>
</table>
<input type="hidden" name="sc" value="'
$context['session_id'], '" />
</form>'
;
}

?>


// Recursive function to retrieve avatar files
function getAvatars($directory, $level)
{
global $context, $txt, $modSettings;

$result = array();

// Open the directory..
$dir = dir($modSettings['avatar_directory'] . (!empty($directory) ? '/' : '') . $directory);
$dirs = array();
$files = array();

if (!$dir)
return array();

while ($line = $dir->read())
{
if (in_array($line, array('.', '..', 'blank.gif', 'index.php')))
continue;

if (is_dir($modSettings['avatar_directory'] . '/' . $directory . (!empty($directory) ? '/' : '') . $line))
$dirs[] = $line;
else
$files[] = $line;
}
$dir->close();

// Sort the results...
natcasesort($dirs);
natcasesort($files);

if ($level == 0)
{
$result[] = array(
'filename' => 'blank.gif',
'checked' => in_array($context['member']['avatar']['server_pic'], array('', 'blank.gif')),
'name' => &$txt[422],
'is_dir' => false
);
}

foreach ($dirs as $line)
{
$tmp = getAvatars($directory . (!empty($directory) ? '/' : '') . $line, $level + 1);
if (!empty($tmp))
$result[] = array(
'filename' => htmlspecialchars($line),
'checked' => strpos($context['member']['avatar']['server_pic'], $line . '/') !== false,
'name' => '[' . htmlspecialchars(str_replace('_', ' ', $line)) . ']',
'is_dir' => true,
'files' => $tmp
);
unset($tmp);
}

foreach ($files as $line)
{
$filename = substr($line, 0, (strlen($line) - strlen(strrchr($line, '.'))));
$extension = substr(strrchr($line, '.'), 1);

// Make sure it is an image.
if (strcasecmp($extension, 'gif') != 0 && strcasecmp($extension, 'jpg') != 0 && strcasecmp($extension, 'jpeg') != 0 && strcasecmp($extension, 'png') != 0 && strcasecmp($extension, 'bmp') != 0)
continue;

$result[] = array(
'filename' => htmlspecialchars($line),
'checked' => $line == $context['member']['avatar']['server_pic'],
'name' => htmlspecialchars(str_replace('_', ' ', $filename)),
'is_dir' => false
);
if ($level == 1)
$context['avatar_list'][] = $directory . '/' . $line;
}

return $result;
}

Any help is highly appreciated. Thank you!

Sincerly,

Christian

Offline samurai-lupin

  • Full Member
  • ***
  • Posts: 522
Re: Avatar Select on Register
« Reply #12 on: January 30, 2007, 12:08:21 AM »
Or is it that this Mod can't be made to work with RC2 at all? Any help is highly appreciated. Thank you!

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,071
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Avatar Select on Register
« Reply #13 on: January 30, 2007, 09:16:31 AM »
It seems you did not copy the getavatars function to the register.template.php or register.php in the sources folder.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline samurai-lupin

  • Full Member
  • ***
  • Posts: 522
Re: Avatar Select on Register
« Reply #14 on: January 30, 2007, 01:31:30 PM »
Helo,

here is the solution for the problem (with RC2):

The instalation wants to add the getavatars function after ?> in register.template.php but in order to have it work properly it needs to be added before it.

Once you do this it will work just fine with RC2.

Thanks for this fine mod!

I have two questions, requests though:

1. What code change is neccessary to make the avatar select optional instead of requiring a user to select one

2. An upload function for your own avatar picture would be very nice, too

Regards,

Christian
« Last Edit: January 30, 2007, 02:21:18 PM by samurai-lupin »

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,071
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Avatar Select on Register
« Reply #15 on: January 30, 2007, 03:20:08 PM »
1. You would have to change the code in Register.php and remove the check the mod added.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline samurai-lupin

  • Full Member
  • ***
  • Posts: 522
Re: Avatar Select on Register
« Reply #16 on: January 30, 2007, 05:07:09 PM »
Thank you!

Do you also think that an upload option will be coming in the future?

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,071
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Avatar Select on Register
« Reply #17 on: January 30, 2007, 06:37:43 PM »
I don't see that happening I am busy with other mods.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline qubbah

  • Full Member
  • ***
  • Posts: 559
Re: Avatar Select on Register
« Reply #18 on: February 07, 2007, 11:00:46 AM »
where can i setting up this mod after installation?

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,071
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Avatar Select on Register
« Reply #19 on: February 07, 2007, 11:06:17 AM »
Mod appears on the register.template.php of the default theme.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro