Hide Email
NOTE:
Remove All PHP Tags
First you want to open up your phpMyAdmin and run this query:
Code
ALTER TABLE `members` ADD `ehidden` CHAR( 3 ) NOT NULL DEFAULT 'no';
Okay, you have your Database setup, Now you want to make it so your members can pick Yes or No
In your editprofile.php Find:
Code
Email: <input type='text' name='email' size='30' maxlength='55' value='$user[email]'><br>
Add After:
Code
Would You Like Your Email To Be Shown?:
<select name="ehidden">
<option selected="selected" value="no">No</option>
<option value="yes">Yes</option>
</select> <br />
This is the dropdown so users can pick yes or no.
Next you want to find:
PHP Code
$email = addslashes(htmlspecialchars($_POST[email]));
Add After:
PHP Code
$ehidden = htmlspecialchars($_POST[ehidden]);
This will submit the answer to the database to be stored and if they have FF and the developer toolbar make it so they can't change the value.
Next, Find the line that has:
PHP Code
$update = mysql_query("UPDATE members SET email = '$email', sex = '$sex', age = '$age', location = '$location' where username = '$logged[username]'");
In that line Replace:
PHP Code
location = '$location'
With
PHP Code
location = '$location', ehidden = '$ehidden'
Thats so the info will be stored and you will not get an error.
=====SAVE AND CLOSE=====
Now for the members.php file
In that file find:
PHP Code
Email: $user[email]<br>
Replace With:
PHP Code
<?
";//End the echo
if($profile[ehidden] == no){//if its not hidden
echo "Email: $profile[email]";//echo the email
}else{//if it is
echo("Email: <i>Hidden</i>");//Dont echo it
} //End else if
echo "
?>
=====SAVE AND CLOSE=====
You are now finished if you get any errors please post them below and i shall try to help you out