Tutorials

Linking a member’s name to his/her email

By default, members are displayed with their name and email as separate columns in a table. You can instead have the member’s name linked to his/her email by editing country.php and members.php in a text editor.

In country.php, find the following, which should be around line 22 and 23:

<td><strong>Name</strong></td>
<td><strong>Email</strong></td>

Change them to:

<td><strong>Name + Email</strong></td>

Or something similar to that…as long as it’s in the same table cell. Do the same in members.php, the line numbers there are 17 and 18.

Then find lines 39 up until 55 (36 to 52 in members.php):

$id = sprintf("%03.0f", $id);
echo "<td>[$id]</td>

<td>$name</td>";
if ($hide != "h"){
$array = explode("@", $email);
$first = $array[0];
$last = $array[1];?>
<td><script TYPE="text/javascript">
emailE=('<?=$first?>' + '@' + '<?=$last?>')
document.write(
 '<A HREF="mailto:' + emailE + '">'
 + '@' +'</a>'
)

</SCRIPT></td>
<? } else {
echo "<td><s>@</s></td>"; }

Change them to this:

$id = sprintf("%03.0f", $id);
echo "<td>[$id]</td>";

if ($hide != "h"){
$array = explode("@", $email);
$first = $array[0];
$last = $array[1];?>
<td><script type="text/javascript">
emailE=('<?=$first?>' + '@' + '<?=$last?>')
document.write(
 '<a href="mailto:' + emailE + '">'
 + '<?=$name?>' +'</a>'
)

</script></td>
<? } else {
echo "<td>$name</td>"; }

That should change the listing to have the email address linked to the name in the member pages.

Comments

Error Comments are closed for this entry.