This tutorial is how to disable alias so user no need to set they alias from beggining. so make the email address =
username@yourdomain.com
this is from
here that i make more perfect since i dont find someone that cant help me about this, if you can make this more perfect let us know too
1. go to admincp --> Permissions --> set Change alias to No to all usergroups
2. go to admincp --> Add New Plugin -->
Product = vbulletin mail system 3.0
Hook Location = global_start
Title = VBMS Add-Alias
Plugin PHP Code =
Quote:
$count = 1;
function str_split_php4($text, $split = 1)
{
if (!is_string($text)) return false;
if (!is_numeric($split) && $split < 1) return false;
$len = strlen($text);
$array = array();
$i = 0;
while ($i < $len)
{
$key = NULL;
for ($j = 0; $j < $split; $j += 1)
{
$key .= $text{$i};
$i += 1;
}
$array[] = $key;
}
return $array;
}
function make_alias($username)
{
$alias = strtolower($username);
$alias = str_replace(" ", "_", $alias);
$holdarr = str_split_php4($alias);
foreach ($holdarr as $val) {
if ((ord($val) >= 48 AND ord($val) <= 57) OR (ord($val) >= 45 AND ord($val) <= 46) OR (ord($val) == 95) OR (ord($val) >=97 AND ord($val) <=122)) $final .= $val;
}
return $final;
}
$newalias = make_alias($vbulletin->userinfo['username']);
$fixedalias = $newalias;
$aliascheck = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE vbms_alias ='" . $newalias . "'");
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user
SET vbms_alias = '" . $fixedalias . "'
WHERE userid = '" . $vbulletin->userinfo['userid'] . "'
");
|