#SQL ALTER TABLE '.PREFIX.'users ADD Newsletter TINYINT(1) UNSIGNED NOT NULL; #OPEN member.php #FIND function editsettings() #FIND EmailNotifyPrivMsg=\''.$Newprofile['EmailNotifyPrivMsg'].'\' #REPLACE EmailNotifyPrivMsg=\''.$Newprofile['EmailNotifyPrivMsg'].'\', Newsletter=\''.$Newprofile['Newsletter'].'\' #FIND $ent['EmailNotifyPrivMsg'] = MakeRadioBoxArray('profile[EmailNotifyPrivMsg]',array('1'=>$txt['yes'],'0'=>$txt['no']),$CurrentUser['EmailNotifyPrivMsg']); #ADDAFTER $ent['Newsletter'] = MakeRadioBoxArray('profile[Newsletter]',array('1'=>$txt['yes'],'0'=>$txt['no']),$CurrentUser['Newsletter']); #FIND function register() #FIND EmailSubbedTopics,ViewLastXDays,SaveCookie,TimeZone,Bio,Location,LastActive,RegDate,RegIP,TitleID,Birthday) #REPLACE EmailSubbedTopics,ViewLastXDays,SaveCookie,TimeZone,Bio,Location,LastActive,RegDate,RegIP,TitleID,Birthday, Newsletter) #FIND \''.$_POST['userinfo']['usertitle'].'\',\''.$_POST['userinfo']['Birthday'].'\')'; #REPLACE \''.$_POST['userinfo']['usertitle'].'\',\''.$_POST['userinfo']['Birthday'].'\', \''.$_POST['userinfo']['Newsletter'].'\')'; #FIND $ent['EmailNotifyPrivMsg'] = MakeRadioBoxArray('userinfo[EmailNotifyPrivMsg]',array(1=>'Yes',0=>'No'),0); #ADDAFTER $ent['Newsletter'] = MakeRadioBoxArray('userinfo[Newsletter]',array(1=>'Yes',0=>'No'),0); #FIND } switch ($action) #REPLACE } function Unsubscribe() { global $fSettings,$ent,$txt,$code,$username; $sql = new DB_SQL; $code = preg_replace("#[^a-z0-9]#is",'',$code); $query = 'SELECT UserName,Email,Password FROM '.PREFIX.'users WHERE UserName=\''.$username.'\''; $sql->query($query); if(!$sql->num_rows()) { UhOh($txt['errNewsletterInvalidConfirm']); } list($name,$email,$password) = $sql->get_numeric(); if ($code != md5($name.$password.$email)) { UhOh($txt['errNewsletterInvalidConfirm']); } $query = 'UPDATE '.PREFIX.'users SET Newsletter=0 WHERE UserName=\''.$username.'\''; $sql->query($query); SomeMessage($txt['Newsletter'],$txt['NewsletterUnsubscribed']); } switch ($action) #FIND case 'editavatar': @require('./includes/avatars.php'); editavatar(); break; #ADDAFTER case 'unsubscribe': Unsubscribe(); break; #OPEN templates/editsettings.html #FIND