Skip to content

Commit 7a06cf9

Browse files
committed
Migrate show_img and show_img_sig
1 parent 1fc3885 commit 7a06cf9

File tree

5 files changed

+57
-64
lines changed

5 files changed

+57
-64
lines changed

featherbb/Core/Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function parse_message($text, $hide_smilies)
132132
{
133133
$this->pd['in_signature'] = false;
134134
// Disable images via the $bbcd['in_post'] flag if globally disabled.
135-
if (ForumSettings::get('p_message_img_tag') !== '1' || User::get()['show_img'] !== '1')
135+
if (ForumSettings::get('p_message_img_tag') !== '1' || User::getPref('show.img') !== '1')
136136
if (isset($this->pd['bbcd']['img']))
137137
$this->pd['bbcd']['img']['in_post'] = false;
138138
return $this->parse_bbcode($text, $hide_smilies);
@@ -148,7 +148,7 @@ public function parse_signature($text)
148148
{
149149
$this->pd['in_signature'] = true;
150150
// Disable images via the $bbcd['in_sig'] flag if globally disabled.
151-
if (ForumSettings::get('p_sig_img_tag') !== '1' || User::get()['show_img_sig'] !== '1')
151+
if (ForumSettings::get('p_sig_img_tag') !== '1' || User::getPref('show.img.sig') !== '1')
152152
if (isset($this->pd['bbcd']['img']))
153153
$this->pd['bbcd']['img']['in_sig'] = false;
154154
return $this->parse_bbcode($text);

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_img', 'u.show_img_sig', '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.show_avatars', 'u.show_sig', '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_img` tinyint(1) NOT NULL DEFAULT '1',
213-
`show_img_sig` tinyint(1) NOT NULL DEFAULT '1',
214212
`show_avatars` tinyint(1) NOT NULL DEFAULT '1',
215213
`show_sig` tinyint(1) NOT NULL DEFAULT '1',
216214
`num_posts` int(10) unsigned NOT NULL DEFAULT '0',

featherbb/Model/Profile.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -828,8 +828,8 @@ public function update_profile($id, $info, $section)
828828
'disp.topics' => intval(Input::post('form_disp_topics')),
829829
'disp.posts' => intval(Input::post('form_disp_posts')),
830830
'show_smilies' => Input::post('form_show_smilies') ? '1' : '0',
831-
'show_img' => Input::post('form_show_img') ? '1' : '0',
832-
'show_img_sig' => Input::post('form_show_img_sig') ? '1' : '0',
831+
'show.img' => Input::post('form_show_img') ? '1' : '0',
832+
'show.img.sig' => Input::post('form_show_img_sig') ? '1' : '0',
833833
'show_avatars' => Input::post('form_show_avatars') ? '1' : '0',
834834
'show_sig' => Input::post('form_show_sig') ? '1' : '0',
835835
);
@@ -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_img', 'u.show_img_sig', '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.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');
10021002

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

featherbb/View/profile/section_display.php

Lines changed: 51 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
Container::get('hooks')->fire('view.profile.section_display.start');
1818
?>
1919

20-
<div class="blockform">
21-
<h2><span><?= Utils::escape($user['username']).' - '.__('Section display') ?></span></h2>
22-
<div class="box">
23-
<form id="profile5" method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= Router::pathFor('profileSection', ['id' => $id, 'section' => 'display']) ?>">
24-
<input type="hidden" name="csrf_name" value="<?= $csrf_name; ?>"><input type="hidden" name="csrf_value" value="<?= $csrf_value; ?>">
25-
<div><input type="hidden" name="form_sent" value="1" /></div>
20+
<div class="blockform">
21+
<h2><span><?= Utils::escape($user['username']).' - '.__('Section display') ?></span></h2>
22+
<div class="box">
23+
<form id="profile5" method="post" action="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= Router::pathFor('profileSection', ['id' => $id, 'section' => 'display']) ?>">
24+
<input type="hidden" name="csrf_name" value="<?= $csrf_name; ?>"><input type="hidden" name="csrf_value" value="<?= $csrf_value; ?>">
25+
<div><input type="hidden" name="form_sent" value="1" /></div>
2626
<?php
2727

2828
$styles = \FeatherBB\Core\Lister::getStyles();
@@ -32,12 +32,12 @@
3232
echo "\t\t\t".'<div><input type="hidden" name="form_style" value="'.$styles[0].'" /></div>'."\n";
3333
} elseif (count($styles) > 1) {
3434
?>
35-
<div class="inform">
36-
<fieldset>
37-
<legend><?php _e('Style legend') ?></legend>
38-
<div class="infldset">
39-
<label><?php _e('Styles') ?><br />
40-
<select name="form_style">
35+
<div class="inform">
36+
<fieldset>
37+
<legend><?php _e('Style legend') ?></legend>
38+
<div class="infldset">
39+
<label><?php _e('Styles') ?><br />
40+
<select name="form_style">
4141
<?php
4242

4343
foreach ($styles as $temp) {
@@ -49,60 +49,55 @@
4949
}
5050

5151
?>
52-
</select>
53-
<br /></label>
54-
</div>
55-
</fieldset>
56-
</div>
52+
</select>
53+
<br /></label>
54+
</div>
55+
</fieldset>
56+
</div>
5757
<?php
5858

5959
}
6060

6161
?>
6262
<?php if (ForumSettings::get('smilies') == '1' || ForumSettings::get('smilies.sig') == '1' || ForumSettings::get('o_signatures') == '1' || ForumSettings::get('o_avatars') == '1' || (ForumSettings::get('p_message_bbcode') == '1' && ForumSettings::get('p_message_img_tag') == '1')): ?>
63-
<div class="inform">
64-
<fieldset>
65-
<legend><?php _e('Post display legend') ?></legend>
66-
<div class="infldset">
67-
<p><?php _e('Post display info') ?></p>
68-
<div class="rbox">
69-
<?php if (ForumSettings::get('smilies') == '1' || ForumSettings::get('smilies.sig') == '1'): ?> <label><input type="checkbox" name="form_show_smilies" value="1"<?php if (User::getPref('smilies', $user['id']) == '1') {
70-
echo ' checked="checked"';
71-
} ?> /><?php _e('Show smilies') ?><br /></label>
72-
<?php endif; if (ForumSettings::get('o_signatures') == '1'): ?> <label><input type="checkbox" name="form_show_sig" value="1"<?php if ($user['show_sig'] == '1') {
73-
echo ' checked="checked"';
74-
} ?> /><?php _e('Show sigs') ?><br /></label>
75-
<?php endif; if (ForumSettings::get('o_avatars') == '1'): ?> <label><input type="checkbox" name="form_show_avatars" value="1"<?php if ($user['show_avatars'] == '1') {
76-
echo ' checked="checked"';
77-
} ?> /><?php _e('Show avatars') ?><br /></label>
78-
<?php endif; if (ForumSettings::get('p_message_bbcode') == '1' && ForumSettings::get('p_message_img_tag') == '1'): ?> <label><input type="checkbox" name="form_show_img" value="1"<?php if ($user['show_img'] == '1') {
79-
echo ' checked="checked"';
80-
} ?> /><?php _e('Show images') ?><br /></label>
81-
<?php endif; if (ForumSettings::get('o_signatures') == '1' && ForumSettings::get('p_sig_bbcode') == '1' && ForumSettings::get('p_sig_img_tag') == '1'): ?> <label><input type="checkbox" name="form_show_img_sig" value="1"<?php if ($user['show_img_sig'] == '1') {
82-
echo ' checked="checked"';
83-
} ?> /><?php _e('Show images sigs') ?><br /></label>
63+
<div class="inform">
64+
<fieldset>
65+
<legend><?php _e('Post display legend') ?></legend>
66+
<div class="infldset">
67+
<p><?php _e('Post display info') ?></p>
68+
<div class="rbox">
69+
<?php if (ForumSettings::get('smilies') == '1' || ForumSettings::get('smilies.sig') == '1'): ?>
70+
<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>
71+
<?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>
73+
<?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>
75+
<?php endif; if (ForumSettings::get('p_message_bbcode') == '1' && ForumSettings::get('p_message_img_tag') == '1'): ?>
76+
<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>
77+
<?php endif; if (ForumSettings::get('o_signatures') == '1' && ForumSettings::get('p_sig_bbcode') == '1' && ForumSettings::get('p_sig_img_tag') == '1'): ?>
78+
<label><input type="checkbox" name="form_show_img_sig" value="1"<?php if (User::getPref('show.img.sig', $user['id']) == '1') {echo ' checked="checked"';} ?> /><?php _e('Show images sigs') ?><br /></label>
8479
<?php endif; ?>
80+
</div>
8581
</div>
86-
</div>
87-
</fieldset>
88-
</div>
82+
</fieldset>
83+
</div>
8984
<?php endif; ?>
90-
<div class="inform">
91-
<fieldset>
92-
<legend><?php _e('Pagination legend') ?></legend>
93-
<div class="infldset">
94-
<label class="conl"><?php _e('Topics per page') ?><br /><input type="text" name="form_disp_topics" value="<?= User::getPref('disp.topics', $user['id']) ?>" size="6" maxlength="2" /><br /></label>
95-
<label class="conl"><?php _e('Posts per page') ?><br /><input type="text" name="form_disp_posts" value="<?= User::getPref('disp.posts', $user['id']) ?>" size="6" maxlength="2" /><br /></label>
96-
<p class="clearb"><?php _e('Paginate info') ?> <?php _e('Leave blank') ?></p>
97-
</div>
98-
</fieldset>
99-
</div>
100-
<p class="buttons"><input type="submit" name="update" value="<?php _e('Submit') ?>" /> <?php _e('Instructions') ?></p>
101-
</form>
85+
<div class="inform">
86+
<fieldset>
87+
<legend><?php _e('Pagination legend') ?></legend>
88+
<div class="infldset">
89+
<label class="conl"><?php _e('Topics per page') ?><br /><input type="text" name="form_disp_topics" value="<?= User::getPref('disp.topics', $user['id']) ?>" size="6" maxlength="2" /><br /></label>
90+
<label class="conl"><?php _e('Posts per page') ?><br /><input type="text" name="form_disp_posts" value="<?= User::getPref('disp.posts', $user['id']) ?>" size="6" maxlength="2" /><br /></label>
91+
<p class="clearb"><?php _e('Paginate info') ?> <?php _e('Leave blank') ?></p>
92+
</div>
93+
</fieldset>
94+
</div>
95+
<p class="buttons"><input type="submit" name="update" value="<?php _e('Submit') ?>" /> <?php _e('Instructions') ?></p>
96+
</form>
97+
</div>
98+
</div>
99+
<div class="clearer"></div>
102100
</div>
103-
</div>
104-
<div class="clearer"></div>
105-
</div>
106101

107102
<?php
108103
Container::get('hooks')->fire('view.profile.section_display.end');

0 commit comments

Comments
 (0)