Customizing the Registration Page.
I am referencing alot of things from the post by bdkyle on 2006/05/17
Customizing Registration Form - Help & Help Needed
The first thing most people want to do is remove the icon legend that is on the registration page.
This can be found in the file /public_html/components/com_comprofiler/comprofiler.html.php.
In the latest version of CB the lines that you want to change are located around line 1261. In fact at the end of that line there is the comment // to remove top icons explanation just comment or remove this line.
The same goes for the bottom icon legend at around line 1324 (these are approximate line numbers as I have already made some changes).
After commenting out these lines I added a simple tag to the bottom set
[code:1]
?>
Required Fields <font color="red">*</font> [/code:1]after the closing php ?> above it.
Just remember you want to comment out the //echo getFieldIcons(1,true,true,"","",true); on the lines I mentioned so you can look for that if the line numbers don't match up.
There is also a css fix for this problem (thanks Beat) [code:1]#cbIconsTop, #cbIconsBottom { display:none; }[/code:1] you can use whichever you want.
The next thing I wanted to do was remove the Icons located next to the registration fields. This is located in /public_html/administrator/components/com_comprofiler/comprofiler.class.php. Thanks to earchy for posting this.
[code:1]
function getFieldIcons($ui, $oReq, $oProfile, $oDescription="", $oTitle="", $showLabels=false) {
$templatePath = selectTemplate($ui);
$oReturn = "";
if($oDescription) $oReturn .= " ".cbFieldTip($ui, getLangDefinition($oDescription), getLangDefinition($oTitle) );
// if ($showLabels) $oReturn .= " ".cbFieldTip($ui, _UE_FIELDDESCRIPTION, "?"«»)." "._UE_FIELDDESCRIPTION." | ";
// if($oReq) $oReturn .= " <img src='".$templatePath."required.gif' width='16' height='16' alt='*' title='"._UE_FIELDREQUIRED."' />";
// if ($showLabels) $oReturn .= " "._UE_FIELDREQUIRED." | ";
// if($oProfile) $oReturn .= " <img src='".$templatePath."profiles.gif' width='16' height='16' alt='+' title='"._UE_FIELDONPROFILE."' />";
// if( $showLabels) $oReturn .= " "._UE_FIELDONPROFILE." | ";
// if((!$oProfile) or $showLabels) $oReturn .= " <img src='".$templatePath."noprofiles.gif' width='16' height='16' alt='-' title='"._UE_FIELDNOPROFILE."' />";
// if( $showLabels) $oReturn .= " "._UE_FIELDNOPROFILE;
return "<span class='cbFieldIcons".(($showLabels) ? "Labels" : ""«»)."'>".$oReturn."</span>";
}
[/code:1]
That is how you get rid of all or some of the offending icons.
Now we want to add the asterisk * to the end of our Registration fields so that they look the way we want.
I found the file /public_html/components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php. which controls the registration interface.
Starting at around line 433 I editied this file as below: Before:
[code:1]
<td class="titleCell"><?php echo _UE_YOUR_NAME; ?>:</td>
<td class="fieldCell"><input class="inputbox" type="text" size="40" id="name" name="name" mosReq="1" mosLabel="Name" value="<?php
if (isset($row->name)) echo htmlspecialchars($row->name);?>" /><?php
echo getFieldIcons(1,true,($ueConfig!=3)); ?></td>
</tr>
<?php
break;
}
?>
<tr>
<td class="titleCell"><?php echo _REGISTER_UNAME; ?></td>
<td class="fieldCell"><input type="text" id="username" name="username" autocomplete="off" mosReq="0" mosLabel="<?php
echo _REGISTER_UNAME; ?>" size="40" value="<?php if (isset($row->username)) echo htmlspecialchars($row->username);?>" class="inputbox" <?php
if ( ( isset( $ueConfig ) ) && ( $ueConfig ) ) {
echo 'onblur="cbSendUsernameCheck(this);" onkeyup="if (this.value != cbLastUsername) { document.getElementById(\'usernameCheckResponse\').innerHTML = \'\'; cbLastUsername = \'\'; }" ';
}
?>/><?php
echo getFieldIcons(1,true,($ueConfig!=1), sprintf( _VALID_AZ09, _UE_UNAME, 2 ), _REGISTER_UNAME); ?></td>
</tr>
<?php
if ( ( isset( $ueConfig ) ) && ( $ueConfig ) ) {
?>
<tr>
<td class="titleCell"> </td>
<td class="fieldCell"><?php
// <div id="usernameCheckLink"><input type=button value="<?php echo _UE_CHECK_USERNAME_AVAILABILITY; ? >" class="button" onclick="sendUsernameCheck(this);" /></div>
?><div id="usernameCheckResponse"></div>
</td>
</tr>
<?php
}
?>
<tr>
<td class="titleCell"><?php echo _REGISTER_EMAIL; ?></td>
<td class="fieldCell"><input type="text" id="email" name="email" mosReq="1" mosLabel="<?php
echo _REGISTER_EMAIL; ?>" size="40" value="<?php if (isset($row->email)) echo htmlspecialchars($row->email);?>" class="inputbox" /><?php
echo getFieldIcons(1,true,($ueConfig==1 || $ueConfig==2), _REGWARN_MAIL, _REGISTER_EMAIL); ?></td>
</tr>
<?php
if ($mosConfig_emailpass=="0" || isset($mosConfig_useractivation)) { ?>
<tr>
<td class="titleCell"><?php echo _REGISTER_PASS; ?></td>
<td class="fieldCell"><input class="inputbox" type="password" id="password" name="password" autocomplete="off" mosReq="0" mosLabel="<?php
echo _REGISTER_PASS; ?>" size="40" value="" /><?php
echo getFieldIcons(1,true,false, sprintf( _VALID_AZ09, _UE_PASS, 6 ), _REGISTER_PASS); ?></td>
</tr>
<tr>
<td class="titleCell"><?php echo _REGISTER_VPASS; ?></td>
[/code:1]
This is what it looked like when I was done: AFTER:
[code:1]
<td class="titleCell">Name:<font color="red">*</font></td>
<td class="fieldCell"><input class="inputbox" type="text" size="40" id="name" name="name" mosReq="1" mosLabel="Name" value="<?php
if (isset($row->name)) echo htmlspecialchars($row->name);?>" /><?php
echo getFieldIcons(1,true,($ueConfig!=3)); ?></td>
</tr>
<?php
break;
}
?>
<tr>
<td class="titleCell">Username:<font color="red">*</font></td>
<td class="fieldCell"><input type="text" id="username" name="username" autocomplete="off" mosReq="0" mosLabel="<?php
echo _REGISTER_UNAME; ?>" size="40" value="<?php if (isset($row->username)) echo htmlspecialchars($row->username);?>" class="inputbox" <?php
if ( ( isset( $ueConfig ) ) && ( $ueConfig ) ) {
echo 'onblur="cbSendUsernameCheck(this);" onkeyup="if (this.value != cbLastUsername) { document.getElementById(\'usernameCheckResponse\').innerHTML = \'\'; cbLastUsername = \'\'; }" ';
}
?>/><?php
echo getFieldIcons(1,true,($ueConfig!=1), sprintf( _VALID_AZ09, _UE_UNAME, 2 ), _REGISTER_UNAME); ?></td>
</tr>
<?php
if ( ( isset( $ueConfig ) ) && ( $ueConfig ) ) {
?>
<tr>
<td class="titleCell"> </td>
<td class="fieldCell"><?php
// <div id="usernameCheckLink"><input type=button value="<?php echo _UE_CHECK_USERNAME_AVAILABILITY; ? >" class="button" onclick="sendUsernameCheck(this);" /></div>
?><div id="usernameCheckResponse"></div>
</td>
</tr>
<?php
}
?>
<tr>
<td class="titleCell">E-mail<font color="red">*</font></td>
<td class="fieldCell"><input type="text" id="email" name="email" mosReq="1" mosLabel="<?php
echo _REGISTER_EMAIL; ?>" size="40" value="<?php if (isset($row->email)) echo htmlspecialchars($row->email);?>" class="inputbox" /><?php
echo getFieldIcons(1,true,($ueConfig==1 || $ueConfig==2), _REGWARN_MAIL, _REGISTER_EMAIL); ?></td>
</tr>
<?php
if ($mosConfig_emailpass=="0" || isset($mosConfig_useractivation)) { ?>
<tr>
<td class="titleCell">Password:<font color="red">*</font></td>
<td class="fieldCell"><input class="inputbox" type="password" id="password" name="password" autocomplete="off" mosReq="0" mosLabel="<?php
echo _REGISTER_PASS; ?>" size="40" value="" /><?php
echo getFieldIcons(1,true,false, sprintf( _VALID_AZ09, _UE_PASS, 6 ), _REGISTER_PASS); ?></td>
</tr>
<tr>
<td class="titleCell">Verify Password:<font color="red">*</font></td>
[/code:1]
This allows you to change what the registration feilds say without changing the language files (which I found to be tedious and it didn't work for me). Remember that this only makes a change on the registration page. If you want to change it globally you should research changing the language file that contains the appropriate fields.
Hopefully this brings together all of the different posts on the subject into one nice neat location. Good luck and remember if you find a way to do something that others haven't found yet post about it. We all gain from others knowledge only if it is available for us to use.
Post edited by: Drunk_N_Japan, at: 2008/02/25 16:57
Post edited by: Drunk_N_Japan, at: 2008/02/25 18:00