Hi all,
I run 1.1.13 and was wondering if it is possible to make all email addresses hidden to all but Administrators.
Is there something I can also do that will also adjust all existing members profiles so that their email addresses will not be seen
Regards
Paul
Try this - http://custom.simplemachines.org/mods/index.php?mod=371
Great mod, but I want to remove the ability for people to see the email or any contact info when they click on the Members button.
The only way I can see without a mod is going through each member 1 at a time and adjusting their profile with "Email not visible" - Big job with over 750 members
You could write a quick script in PHP to do the update job for you using the forum's SSI.. This is rough but should work:
<?php
include $_SERVER['DOCUMENT_ROOT'].'/path/to/forum/SSI.php'; // takes care of connecting to mysql
if (!$context['user']['is_admin']) die('Only admins are allowed to run this script.'); // Protect yourself ;)
$query = db_query("SELECT ID_MEMBER FROM {$db_prefix}members WHERE hideEmail = 0",__FILE__,__LINE__); // Get current members with un-hidden emails
$numrows = mysql_numrows($query); // total found with un-hidden emails
$i=0;
while ($row = mysql_fetch_assoc($query)) {
$update = db_query("UPDATE {$db_prefix}members SET hideEmail = 1 WHERE ID_MEMBER = '".$row['ID_MEMBER']."'",__FILE__,__LINE__); // Hide the emails!
if ($update)
$i++;
}
echo 'A total of '.$i.' changes were made out of the '.$numrows.' found with un-hidden emails.';
?>
Hope this works (and that I'm actually allowed to post something like this...)! I ran it on my server and it worked as intended.