Skip to content

Commit 971ec8e

Browse files
committed
Various fixes
1 parent ba6e60c commit 971ec8e

File tree

10 files changed

+24
-20
lines changed

10 files changed

+24
-20
lines changed

featherbb/Controller/Install.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,12 @@ public function create_db(array $data)
233233
'date_format' => 'Y-m-d',
234234
'language' => $data['language'],
235235
'style' => $data['style'],
236-
'smilies' => 1,
237-
'smilies.sig' => 1,
236+
'show.smilies.sig' => 1,
237+
'show.smilies' => 1,
238+
'show.img' => 1,
239+
'show.img.sig' => 1,
240+
'show.avatars' => 1,
241+
'show.sig' => 1,
238242
));
239243
Container::get('prefs')->setGroup(2, array(
240244
'post.min_interval' => 0,

featherbb/Core/Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ public function parse_bbcode(&$text, $hide_smilies = 0)
7777
// Set $smile_on flag depending on global flags and whether or not this is a signature.
7878
if ($this->pd['in_signature'])
7979
{
80-
$smile_on = (ForumSettings::get('smilies.sig') && User::getPref('smilies') && !$hide_smilies) ? 1 : 0;
80+
$smile_on = (ForumSettings::get('show.smilies.sig') && User::getPref('show.smilies') && !$hide_smilies) ? 1 : 0;
8181
}
8282
else
8383
{
84-
$smile_on = (ForumSettings::get('smilies') && User::getPref('smilies') && !$hide_smilies) ? 1 : 0;
84+
$smile_on = (ForumSettings::get('show.smilies') && User::getPref('show.smilies') && !$hide_smilies) ? 1 : 0;
8585
}
8686
// Split text into hidden and non-hidden chunks. Process the non-hidden content chunks.
8787
$parts = explode("\1", $text); // Hidden chunks pre-marked like so: "\1\2<code.../code>\1"

featherbb/Model/Admin/Options.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ public function update_options()
8585
'timezone' => floatval(Input::post('form_default_timezone')),
8686
'time_format' => Utils::trim(Input::post('form_time_format')),
8787
'date_format' => Utils::trim(Input::post('form_date_format')),
88-
'smilies' => Input::post('form_smilies') != '1' ? '0' : '1',
89-
'smilies.sig' => Input::post('form_smilies_sig') != '1' ? '0' : '1',
88+
'show.smilies' => Input::post('form_smilies') != '1' ? '0' : '1',
89+
'show.smilies.sig' => Input::post('form_smilies_sig') != '1' ? '0' : '1',
9090
'disp.topics' => intval(Input::post('form_disp_topics_default')),
9191
'disp.posts' => intval(Input::post('form_disp_posts_default')),
9292
);

featherbb/Model/Post.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ public function get_checkboxes($fid, $is_admmod, $is_subscribed)
12711271
}
12721272

12731273
if (!User::get()->is_guest) {
1274-
if (ForumSettings::get('smilies') == '1') {
1274+
if (ForumSettings::get('show.smilies') == '1') {
12751275
$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" tabindex="'.($cur_index++).'"'.(Input::post('hide_smilies') ? ' checked="checked"' : '').' />'.__('Hide smilies').'<br /></label>';
12761276
}
12771277

@@ -1293,7 +1293,7 @@ public function get_checkboxes($fid, $is_admmod, $is_subscribed)
12931293

12941294
$checkboxes[] = '<label><input type="checkbox" name="subscribe" value="1" tabindex="'.($cur_index++).'"'.($subscr_checked ? ' checked="checked"' : '').' />'.($is_subscribed ? __('Stay subscribed') : __('Subscribe')).'<br /></label>';
12951295
}
1296-
} elseif (ForumSettings::get('smilies') == '1') {
1296+
} elseif (ForumSettings::get('show.smilies') == '1') {
12971297
$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" tabindex="'.($cur_index++).'"'.(Input::post('hide_smilies') ? ' checked="checked"' : '').' />'.__('Hide smilies').'<br /></label>';
12981298
}
12991299

@@ -1316,7 +1316,7 @@ public function get_edit_checkboxes($can_edit_subject, $is_admmod, $cur_post, $c
13161316
}
13171317
}
13181318

1319-
if (ForumSettings::get('smilies') == '1') {
1319+
if (ForumSettings::get('show.smilies') == '1') {
13201320
if (Input::post('hide_smilies') || $cur_post['hide_smilies'] == '1') {
13211321
$checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" checked="checked" tabindex="'.($cur_index++).'" />'.__('Hide smilies').'<br /></label>';
13221322
} else {

featherbb/Model/Topic.php

Lines changed: 1 addition & 1 deletion
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::getPref('show.avatar') != '0') {
881+
if (ForumSettings::get('o_avatars') == '1' && User::getPref('show.avatars') != '0') {
882882
if (isset($avatar_cache[$cur_post['poster_id']])) {
883883
$cur_post['user_avatar'] = $avatar_cache[$cur_post['poster_id']];
884884
} else {

featherbb/View/admin/options.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,10 @@
300300
<tr>
301301
<th scope="row"><?php _e('Smilies label') ?></th>
302302
<td>
303-
<label class="conl"><input type="radio" name="form_smilies" value="1"<?php if (ForumSettings::get('smilies') == '1') {
303+
<label class="conl"><input type="radio" name="form_smilies" value="1"<?php if (ForumSettings::get('show.smilies') == '1') {
304304
echo ' checked="checked"';
305305
} ?> />&#160;<strong><?php _e('Yes') ?></strong></label>
306-
<label class="conl"><input type="radio" name="form_smilies" value="0"<?php if (ForumSettings::get('smilies') == '0') {
306+
<label class="conl"><input type="radio" name="form_smilies" value="0"<?php if (ForumSettings::get('show.smilies') == '0') {
307307
echo ' checked="checked"';
308308
} ?> />&#160;<strong><?php _e('No') ?></strong></label>
309309
<span class="clearb"><?php _e('Smilies help') ?></span>
@@ -312,10 +312,10 @@
312312
<tr>
313313
<th scope="row"><?php _e('Smilies sigs label') ?></th>
314314
<td>
315-
<label class="conl"><input type="radio" name="form_smilies_sig" value="1"<?php if (ForumSettings::get('smilies.sig') == '1') {
315+
<label class="conl"><input type="radio" name="form_smilies_sig" value="1"<?php if (ForumSettings::get('show.smilies.sig') == '1') {
316316
echo ' checked="checked"';
317317
} ?> />&#160;<strong><?php _e('Yes') ?></strong></label>
318-
<label class="conl"><input type="radio" name="form_smilies_sig" value="0"<?php if (ForumSettings::get('smilies.sig') == '0') {
318+
<label class="conl"><input type="radio" name="form_smilies_sig" value="0"<?php if (ForumSettings::get('show.smilies.sig') == '0') {
319319
echo ' checked="checked"';
320320
} ?> />&#160;<strong><?php _e('No') ?></strong></label>
321321
<span class="clearb"><?php _e('Smilies sigs help') ?></span>

featherbb/View/edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<li><span><a href="<?= Router::pathFor('help').'#bbcode' ?>" onclick="window.open(this.href); return false;"><?php _e('BBCode') ?></a> <?= (ForumSettings::get('p_message_bbcode') == '1') ? __('on') : __('off'); ?></span></li>
9393
<li><span><a href="<?= Router::pathFor('help').'#url' ?>" onclick="window.open(this.href); return false;"><?php _e('url tag') ?></a> <?= (ForumSettings::get('p_message_bbcode') == '1' && User::can('post.links')) ? __('on') : __('off'); ?></span></li>
9494
<li><span><a href="<?= Router::pathFor('help').'#img' ?>" onclick="window.open(this.href); return false;"><?php _e('img tag') ?></a> <?= (ForumSettings::get('p_message_bbcode') == '1' && ForumSettings::get('p_message_img_tag') == '1') ? __('on') : __('off'); ?></span></li>
95-
<li><span><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= Router::pathFor('help').'#smilies' ?>" onclick="window.open(this.href); return false;"><?php _e('Smilies') ?></a> <?= (ForumSettings::get('smilies') == '1') ? __('on') : __('off'); ?></span></li>
95+
<li><span><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= Router::pathFor('help').'#smilies' ?>" onclick="window.open(this.href); return false;"><?php _e('Smilies') ?></a> <?= (ForumSettings::get('show.smilies') == '1') ? __('on') : __('off'); ?></span></li>
9696
</ul>
9797
</div>
9898
</fieldset>

featherbb/View/profile/section_display.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@
5959
}
6060

6161
?>
62-
<?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')): ?>
62+
<?php if (ForumSettings::get('show.smilies') == '1' || ForumSettings::get('show.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')): ?>
6363
<div class="inform">
6464
<fieldset>
6565
<legend><?php _e('Post display legend') ?></legend>
6666
<div class="infldset">
6767
<p><?php _e('Post display info') ?></p>
6868
<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>
69+
<?php if (ForumSettings::get('show.smilies') == '1' || ForumSettings::get('show.smilies.sig') == '1'): ?>
70+
<label><input type="checkbox" name="form_show_smilies" value="1"<?php if (User::getPref('show.smilies', $user['id']) == '1') {echo ' checked="checked"';} ?> /><?php _e('Show smilies') ?><br /></label>
7171
<?php endif; if (ForumSettings::get('o_signatures') == '1'): ?>
7272
<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'): ?>

featherbb/View/profile/section_personality.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<li><span><a href="<?= Router::pathFor('help').'#bbcode' ?>" onclick="window.open(this.href); return false;"><?php _e('BBCode') ?></a> <?= (ForumSettings::get('p_sig_bbcode') == '1') ? __('on') : __('off'); ?></span></li>
4646
<li><span><a href="<?= Router::pathFor('help').'#url' ?>" onclick="window.open(this.href); return false;"><?php _e('url tag') ?></a> <?= (ForumSettings::get('p_sig_bbcode') == '1' && User::can('post.links')) ? __('on') : __('off'); ?></span></li>
4747
<li><span><a href="<?= Router::pathFor('help').'#img' ?>" onclick="window.open(this.href); return false;"><?php _e('img tag') ?></a> <?= (ForumSettings::get('p_sig_bbcode') == '1' && ForumSettings::get('p_sig_img_tag') == '1') ? __('on') : __('off'); ?></span></li>
48-
<li><span><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= Router::pathFor('help').'#smilies' ?>" onclick="window.open(this.href); return false;"><?php _e('Smilies') ?></a> <?= (ForumSettings::get('smilies.sig') == '1') ? __('on') : __('off'); ?></span></li>
48+
<li><span><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= Router::pathFor('help').'#smilies' ?>" onclick="window.open(this.href); return false;"><?php _e('Smilies') ?></a> <?= (ForumSettings::get('show.smilies.sig') == '1') ? __('on') : __('off'); ?></span></li>
4949
</ul>
5050
<?= $signature_preview ?>
5151
</div>

featherbb/View/topic.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
<li><span><a href="<?= Router::pathFor('help').'#bbcode' ?>" onclick="window.open(this.href); return false;"><?php _e('BBCode') ?></a> <?= (ForumSettings::get('p_message_bbcode') == '1') ? __('on') : __('off');?></span></li>
165165
<li><span><a href="<?= Router::pathFor('help').'#url' ?>" onclick="window.open(this.href); return false;"><?php _e('url tag') ?></a> <?= (ForumSettings::get('p_message_bbcode') == '1' && User::can('post.links')) ? __('on') : __('off');?></span></li>
166166
<li><span><a href="<?= Router::pathFor('help').'#img' ?>" onclick="window.open(this.href); return false;"><?php _e('img tag') ?></a> <?= (ForumSettings::get('p_message_bbcode') == '1' && ForumSettings::get('p_message_img_tag') == '1') ? __('on') : __('off');?></span></li>
167-
<li><span><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= Router::pathFor('help').'#smilies' ?>" onclick="window.open(this.href); return false;"><?php _e('Smilies') ?></a> <?= (ForumSettings::get('smilies') == '1') ? __('on') : __('off');?></span></li>
167+
<li><span><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-ent"><?= Router::pathFor('help').'#smilies' ?>" onclick="window.open(this.href); return false;"><?php _e('Smilies') ?></a> <?= (ForumSettings::get('show.smilies') == '1') ? __('on') : __('off');?></span></li>
168168
</ul>
169169
</div>
170170
</fieldset>

0 commit comments

Comments
 (0)