Skip to content

Commit 21003f7

Browse files
committed
Migrate auto_notify
1 parent 425df94 commit 21003f7

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

featherbb/Controller/Install.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ public function create_db(array $data)
241241
'show.sig' => 1,
242242
'email.setting' => 1,
243243
'notify_with_post' => 0,
244+
'auto_notify' => 0,
244245
));
245246
Container::get('prefs')->setGroup(2, array(
246247
'post.min_interval' => 0,

featherbb/Model/Install.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ class Install
206206
`url` varchar(100) DEFAULT NULL,
207207
`location` varchar(30) DEFAULT NULL,
208208
`signature` text,
209-
`auto_notify` tinyint(1) NOT NULL DEFAULT '0',
210209
`num_posts` int(10) unsigned NOT NULL DEFAULT '0',
211210
`last_post` int(10) unsigned DEFAULT NULL,
212211
`last_search` int(10) unsigned DEFAULT NULL,

featherbb/Model/Post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ public function get_checkboxes($fid, $is_admmod, $is_subscribed)
12851285
$subscr_checked = (Input::post('subscribe')) ? true : false;
12861286
}
12871287
// If auto subscribed
1288-
elseif (User::get()->auto_notify) {
1288+
elseif (User::getPref('auto_notify')) {
12891289
$subscr_checked = true;
12901290
}
12911291
// If already subscribed to the topic

featherbb/Model/Profile.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -870,14 +870,14 @@ public function update_profile($id, $info, $section)
870870

871871
case 'privacy':
872872
{
873-
$form = array(
873+
$prefs = array(
874874
'email.setting' => intval(Input::post('form_email_setting')),
875875
'notify_with_post' => Input::post('form_notify_with_post') ? '1' : '0',
876876
'auto_notify' => Input::post('form_auto_notify') ? '1' : '0',
877877
);
878878

879-
if ($form['email_setting'] < 0 || $form['email_setting'] > 2) {
880-
$form['email_setting'] = ForumSettings::get('email.setting');
879+
if ($prefs['email.setting'] < 0 || $prefs['email.setting'] > 2) {
880+
$prefs['email.setting'] = ForumSettings::get('email.setting');
881881
}
882882

883883
break;
@@ -1003,7 +1003,7 @@ public function update_profile($id, $info, $section)
10031003

10041004
public function get_user_info($id)
10051005
{
1006-
$user['select'] = array('u.id', 'u.group_id', 'u.username', 'u.email', 'u.title', 'u.realname', 'u.url', 'u.location', 'u.signature', 'u.auto_notify', 'u.num_posts', 'u.last_post', 'u.registered', 'u.registration_ip', 'u.admin_note', 'u.last_visit', 'g.g_id', 'g.g_user_title', 'g.g_moderator');
1006+
$user['select'] = array('u.id', 'u.group_id', 'u.username', 'u.email', 'u.title', 'u.realname', 'u.url', 'u.location', 'u.signature', 'u.num_posts', 'u.last_post', 'u.registered', 'u.registration_ip', 'u.admin_note', 'u.last_visit', 'g.g_id', 'g.g_user_title', 'g.g_moderator');
10071007

10081008
$user = DB::for_table('users')
10091009
->table_alias('u')

featherbb/View/profile/section_privacy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<div class="rbox">
4444
<label><input type="checkbox" name="form_notify_with_post" value="1"<?php if ($user['prefs']['notify_with_post'] == '1') {echo ' checked="checked"';} ?> /><?php _e('Notify full') ?><br /></label>
4545
<?php if (ForumSettings::get('o_topic_subscriptions') == '1'): ?>
46-
<label><input type="checkbox" name="form_auto_notify" value="1"<?php if ($user['auto_notify'] == '1') {echo ' checked="checked"';} ?> /><?php _e('Auto notify full') ?><br /></label>
46+
<label><input type="checkbox" name="form_auto_notify" value="1"<?php if ($user['prefs']['auto_notify'] == '1') {echo ' checked="checked"';} ?> /><?php _e('Auto notify full') ?><br /></label>
4747
<?php endif; ?>
4848
</div>
4949
</div>

featherbb/View/topic.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
<input type="hidden" name="form_sent" value="1" />
141141
<input type="hidden" name="pid" value="<?= Utils::escape($pid) ?>" />
142142
<input type="hidden" name="page" value="<?= Utils::escape($page_number) ?>" />
143-
<?php if (ForumSettings::get('o_topic_subscriptions') == '1' && (User::get()->auto_notify == '1' || $cur_topic['is_subscribed'])): ?> <input type="hidden" name="subscribe" value="1" />
143+
<?php if (ForumSettings::get('o_topic_subscriptions') == '1' && (User::getPref('auto_notify') == '1' || $cur_topic['is_subscribed'])): ?> <input type="hidden" name="subscribe" value="1" />
144144
<?php endif;
145145

146146
if (User::get()->is_guest) {

0 commit comments

Comments
 (0)