Skip to content

Commit ba6e60c

Browse files
committed
Migrate show_avatar and show_sig
1 parent 7a06cf9 commit ba6e60c

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

featherbb/Model/Api/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function display($id)
2020
// Remove sensitive fields for regular users
2121
if (!$this->isAdMod) {
2222
Container::get('hooks')->bind('model.profile.get_user_info', function ($user) {
23-
$user = $user->select_delete_many(array('u.email', 'u.registration_ip', 'u.email_setting', 'u.notify_with_post', 'u.auto_notify', 'u.show_avatars', 'u.show_sig', 'u.admin_note', 'u.last_visit'));
23+
$user = $user->select_delete_many(array('u.email', 'u.registration_ip', 'u.email_setting', 'u.notify_with_post', 'u.auto_notify', 'u.admin_note', 'u.last_visit'));
2424
return $user;
2525
});
2626
}

featherbb/Model/Install.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,6 @@ class Install
209209
`email_setting` tinyint(1) NOT NULL DEFAULT '1',
210210
`notify_with_post` tinyint(1) NOT NULL DEFAULT '0',
211211
`auto_notify` tinyint(1) NOT NULL DEFAULT '0',
212-
`show_avatars` tinyint(1) NOT NULL DEFAULT '1',
213-
`show_sig` tinyint(1) NOT NULL DEFAULT '1',
214212
`num_posts` int(10) unsigned NOT NULL DEFAULT '0',
215213
`last_post` int(10) unsigned DEFAULT NULL,
216214
`last_search` int(10) unsigned DEFAULT NULL,

featherbb/Model/Profile.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -830,8 +830,8 @@ public function update_profile($id, $info, $section)
830830
'show_smilies' => Input::post('form_show_smilies') ? '1' : '0',
831831
'show.img' => Input::post('form_show_img') ? '1' : '0',
832832
'show.img.sig' => Input::post('form_show_img_sig') ? '1' : '0',
833-
'show_avatars' => Input::post('form_show_avatars') ? '1' : '0',
834-
'show_sig' => Input::post('form_show_sig') ? '1' : '0',
833+
'show.avatars' => Input::post('form_show_avatars') ? '1' : '0',
834+
'show.sig' => Input::post('form_show_sig') ? '1' : '0',
835835
);
836836

837837
if ($prefs['disp.topics'] != '') {
@@ -998,7 +998,7 @@ public function update_profile($id, $info, $section)
998998

999999
public function get_user_info($id)
10001000
{
1001-
$user['select'] = array('u.id', 'u.username', 'u.email', 'u.title', 'u.realname', 'u.url', 'u.location', 'u.signature', 'u.email_setting', 'u.notify_with_post', 'u.auto_notify', 'u.show_avatars', 'u.show_sig', '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');
1001+
$user['select'] = array('u.id', 'u.username', 'u.email', 'u.title', 'u.realname', 'u.url', 'u.location', 'u.signature', 'u.email_setting', 'u.notify_with_post', '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');
10021002

10031003
$user = DB::for_table('users')
10041004
->table_alias('u')

featherbb/Model/Topic.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ public function print_posts($topic_id, $start_from, $cur_topic, $is_admmod)
878878
// Format the online indicator
879879
$cur_post['is_online_formatted'] = ($cur_post['is_online'] == $cur_post['poster_id']) ? '<strong>'.__('Online').'</strong>' : '<span>'.__('Offline').'</span>';
880880

881-
if (ForumSettings::get('o_avatars') == '1' && User::get()->show_avatars != '0') {
881+
if (ForumSettings::get('o_avatars') == '1' && User::getPref('show.avatar') != '0') {
882882
if (isset($avatar_cache[$cur_post['poster_id']])) {
883883
$cur_post['user_avatar'] = $avatar_cache[$cur_post['poster_id']];
884884
} else {
@@ -979,7 +979,7 @@ public function print_posts($topic_id, $start_from, $cur_topic, $is_admmod)
979979
$cur_post['message'] = Container::get('parser')->parse_message($cur_post['message'], $cur_post['hide_smilies']);
980980

981981
// Do signature parsing/caching
982-
if (ForumSettings::get('o_signatures') == '1' && $cur_post['signature'] != '' && User::get()->show_sig != '0') {
982+
if (ForumSettings::get('o_signatures') == '1' && $cur_post['signature'] != '' && User::getPref('show.sig') != '0') {
983983
// if (isset($avatar_cache[$cur_post['poster_id']])) {
984984
// $cur_post['signature_formatted'] = $avatar_cache[$cur_post['poster_id']];
985985
// } else {

featherbb/View/profile/section_display.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@
6969
<?php if (ForumSettings::get('smilies') == '1' || ForumSettings::get('smilies.sig') == '1'): ?>
7070
<label><input type="checkbox" name="form_show_smilies" value="1"<?php if (User::getPref('smilies', $user['id']) == '1') {echo ' checked="checked"';} ?> /><?php _e('Show smilies') ?><br /></label>
7171
<?php endif; if (ForumSettings::get('o_signatures') == '1'): ?>
72-
<label><input type="checkbox" name="form_show_sig" value="1"<?php if ($user['show_sig'] == '1') {echo ' checked="checked"';} ?> /><?php _e('Show sigs') ?><br /></label>
72+
<label><input type="checkbox" name="form_show_sig" value="1"<?php if (User::getPref('show.sig', $user['id']) == '1') {echo ' checked="checked"';} ?> /><?php _e('Show sigs') ?><br /></label>
7373
<?php endif; if (ForumSettings::get('o_avatars') == '1'): ?>
74-
<label><input type="checkbox" name="form_show_avatars" value="1"<?php if ($user['show_avatars'] == '1') {echo ' checked="checked"';} ?> /><?php _e('Show avatars') ?><br /></label>
74+
<label><input type="checkbox" name="form_show_avatars" value="1"<?php if (User::getPref('show.avatars', $user['id']) == '1') {echo ' checked="checked"';} ?> /><?php _e('Show avatars') ?><br /></label>
7575
<?php endif; if (ForumSettings::get('p_message_bbcode') == '1' && ForumSettings::get('p_message_img_tag') == '1'): ?>
7676
<label><input type="checkbox" name="form_show_img" value="1"<?php if (User::getPref('show.img', $user['id']) == '1') {echo ' checked="checked"';} ?> /><?php _e('Show images') ?><br /></label>
7777
<?php endif; if (ForumSettings::get('o_signatures') == '1' && ForumSettings::get('p_sig_bbcode') == '1' && ForumSettings::get('p_sig_img_tag') == '1'): ?>

0 commit comments

Comments
 (0)