1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-17 08:18:18 +03:00

добавлена возможность отключать оповещении на емайл при добавлении в друзья

This commit is contained in:
Mzhelskiy Maxim 2008-10-28 19:24:35 +00:00
parent 654ee7b647
commit 3df02a0936
6 changed files with 23 additions and 3 deletions

View file

@ -83,6 +83,7 @@ class ActionSettings extends Action {
$this->oUserCurrent->setSettingsNoticeNewComment( getRequest('settings_notice_new_comment') ? 1 : 0 );
$this->oUserCurrent->setSettingsNoticeNewTalk( getRequest('settings_notice_new_talk') ? 1 : 0 );
$this->oUserCurrent->setSettingsNoticeReplyComment( getRequest('settings_notice_reply_comment') ? 1 : 0 );
$this->oUserCurrent->setSettingsNoticeNewFriend( getRequest('settings_notice_new_friend') ? 1 : 0 );
$this->oUserCurrent->setProfileDate(date("Y-m-d H:i:s"));
if ($this->User_Update($this->oUserCurrent)) {
$this->Message_AddNoticeSingle('Настройки успешно сохранены');

View file

@ -287,6 +287,12 @@ class Notify extends Module {
}
public function SendUserFriendNew(UserEntity_User $oUserTo,UserEntity_User $oUserFrom) {
/**
* Проверяем можно ли юзеру рассылать уведомление
*/
if (!$oUserTo->getSettingsNoticeNewFriend()) {
return ;
}
/**
* Передаём в шаблон переменные
*/

View file

@ -121,6 +121,9 @@ class UserEntity_User extends Entity {
public function getSettingsNoticeReplyComment() {
return $this->_aData['user_settings_notice_reply_comment'];
}
public function getSettingsNoticeNewFriend() {
return $this->_aData['user_settings_notice_new_friend'];
}
@ -245,5 +248,8 @@ class UserEntity_User extends Entity {
public function setSettingsNoticeReplyComment($data) {
$this->_aData['user_settings_notice_reply_comment']=$data;
}
public function setSettingsNoticeNewFriend($data) {
$this->_aData['user_settings_notice_new_friend']=$data;
}
}
?>

View file

@ -70,7 +70,8 @@ class Mapper_User extends Mapper {
user_settings_notice_new_topic = ? ,
user_settings_notice_new_comment = ? ,
user_settings_notice_new_talk = ? ,
user_settings_notice_reply_comment = ?
user_settings_notice_reply_comment = ? ,
user_settings_notice_new_friend = ?
WHERE user_id = ?
";
if ($this->oDb->query($sql,$oUser->getPassword(),
@ -100,7 +101,8 @@ class Mapper_User extends Mapper {
$oUser->getSettingsNoticeNewTopic(),
$oUser->getSettingsNoticeNewComment(),
$oUser->getSettingsNoticeNewTalk(),
$oUser->getSettingsNoticeReplyComment(),
$oUser->getSettingsNoticeReplyComment(),
$oUser->getSettingsNoticeNewFriend(),
$oUser->getId())) {
return true;
}

View file

@ -231,7 +231,8 @@ ALTER TABLE `prefix_topic_comment_last`
ADD CONSTRAINT `prefix_topic_comment_new_fk1` FOREIGN KEY (`topic_id`) REFERENCES `prefix_topic` (`topic_id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- новое поля для настройки уведомления о новом друге
ALTER TABLE `prefix_user` ADD `user_settings_notice_new_friend` TINYINT( 1 ) NOT NULL DEFAULT '1';

View file

@ -34,6 +34,10 @@
<input {if $oUserCurrent->getSettingsNoticeReplyComment()}checked{/if} type="checkbox" id="settings_notice_reply_comment" name="settings_notice_reply_comment" value="1" {if $_aRequest.settings_notice_reply_comment==1}checked{/if}/>
<label for="settings_notice_reply_comment"> &mdash; при ответе на комментарий</label>
<br>
<input {if $oUserCurrent->getSettingsNoticeNewFriend()}checked{/if} type="checkbox" id="settings_notice_new_friend" name="settings_notice_new_friend" value="1" {if $_aRequest.settings_notice_new_friend==1}checked{/if}/>
<label for="settings_notice_new_friend"> &mdash; при добавлении вас в друзья</label>
<br>
</fieldset>
<p class="l-bot"><input type="submit" name="submit_settings_tuning" tabindex="6" value="сохранить настройки" /></p>