Skip to content

Commit

Permalink
#961 Enable all Inbox settings, remove from zFeatures
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick committed Nov 10, 2014
1 parent 72a9706 commit 7742cb0
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 48 deletions.
24 changes: 12 additions & 12 deletions backstage/private_messages.php → backstage/inbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,48 +58,48 @@
require_once FORUM_ROOT.'include/cache.php';
generate_config_cache();

redirect('private_messages.php');
redirect('inbox.php');
}

$page_title = array(luna_htmlspecialchars($luna_config['o_board_title']), $lang['Admin'], $lang['Options']);
define('FORUM_ACTIVE_PAGE', 'admin');
require 'header.php';
load_admin_nav('settings', 'private_messages');
load_admin_nav('settings', 'inbox');

?>

<form class="form-horizontal" method="post" action="private_messages.php">
<form class="form-horizontal" method="post" action="inbox.php">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">zPMMainSettings<span class="pull-right"><input class="btn btn-primary" type="submit" name="save" value="<?php echo $lang['Save'] ?>" /></span></h3>
<h3 class="panel-title">Inbox settings<span class="pull-right"><input class="btn btn-primary" type="submit" name="save" value="<?php echo $lang['Save'] ?>" /></span></h3>
</div>
<div class="panel-body">
<input type="hidden" name="form_sent" value="1" />
<fieldset>
<div class="form-group">
<label class="col-sm-3 control-label">zEnablePMs</label>
<label class="col-sm-3 control-label">Use Inbox</label>
<div class="col-sm-9">
<div class="checkbox">
<label>
<input type="checkbox" name="form[pms_enabled]" value="1" <?php if ($luna_config['o_pms_enabled'] == '1') echo ' checked="checked"' ?> />
Enable Private Messaging
Allow users to use Inbox.
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">zNotificationPMs</label>
<label class="col-sm-3 control-label">Inbox Notifications</label>
<div class="col-sm-9">
<div class="checkbox">
<label>
<input type="checkbox" name="form[pms_notification]" value="1" <?php if ($luna_config['o_pms_notification'] == '1') echo ' checked="checked"' ?> />
Allow users to be notified through email about new private messages
Allow users to be notified through email about new Inbox messages.
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">zReceivers<span class="help-block">The number of receivers a PMs can have</span></label>
<label class="col-sm-3 control-label">Receivers<span class="help-block">The number of receivers an Inbox message can have</span></label>
<div class="col-sm-9">
<input type="text" class="form-control" name="form[pms_max_receiver]" maxlength="5" value="<?php echo luna_htmlspecialchars($luna_config['o_pms_max_receiver'] - 1) ?>" />
</div>
Expand All @@ -109,7 +109,7 @@
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">zPMPermissions<span class="pull-right"><input class="btn btn-primary" type="submit" name="save" value="<?php echo $lang['Save'] ?>" /></span></h3>
<h3 class="panel-title">Inbox permissions<span class="pull-right"><input class="btn btn-primary" type="submit" name="save" value="<?php echo $lang['Save'] ?>" /></span></h3>
</div>
<div class="panel-body">
<input type="hidden" name="form_sent" value="1" />
Expand All @@ -125,11 +125,11 @@
<div class="checkbox">
<label>
<input type="checkbox" name="allow[<?php echo $cur_group['g_id'] ?>]" value="1" <?php if ($cur_group['g_pm'] == '1') echo ' checked="checked"' ?> />
Allow users to be notified through email about new private messages
Allow users to be notified through email about new Inbox messages.
</label>
</div>
<input type="text" class="form-control" name="limit[<?php echo $cur_group['g_id'] ?>]" maxlength="5" value="<?php echo $cur_group['g_pm_limit'] ?>" />
<p class="help-block">The maximum amount of messages a user in this group can have in his inbox. 0 is no limit.</p>
<p class="help-block">The maximum amount of messages a user in this group can have in his Inbox. 0 is no limit.</p>
</div>
</div>
<?php
Expand Down
2 changes: 1 addition & 1 deletion backstage/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
if (isset($_GET['saved']))
echo '<div class="alert alert-success"><h4>'.$lang['Settings saved'].'</h4></div>';

if (file_exists('../z.txt') && ($luna_config['o_notifications'] == '1' || $luna_config['o_forum_new_style'] == '1' || $luna_config['o_user_menu_sidebar'] == '1' || $luna_config['o_backstage_dark'] == '1' || $luna_config['o_reading_list'] == '1' || $luna_config['o_private_message'] == '1')) {
if (file_exists('../z.txt') && ($luna_config['o_notifications'] == '1' || $luna_config['o_forum_new_style'] == '1' || $luna_config['o_user_menu_sidebar'] == '1' || $luna_config['o_backstage_dark'] == '1' || $luna_config['o_reading_list'] == '1')) {
?>
<div class="alert alert-danger">
<h4>zSettings enabled!</h4>
Expand Down
14 changes: 1 addition & 13 deletions backstage/zsettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
'notifications' => isset($_POST['form']['notifications']) ? '1' : '0',
'forum_new_style' => isset($_POST['form']['forum_new_style']) ? '1' : '0',
'user_menu_sidebar' => isset($_POST['form']['user_menu_sidebar']) ? '1' : '0',
'reading_list' => isset($_POST['form']['reading_list']) ? '1' : '0',
'private_message' => isset($_POST['form']['private_message']) ? '1' : '0'
'reading_list' => isset($_POST['form']['reading_list']) ? '1' : '0'
);

foreach ($form as $key => $input) {
Expand Down Expand Up @@ -119,17 +118,6 @@
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">zPrivateMessages<span class="help-block"><span class="label label-kaput">heck, we even don't have a color for this</span></span></label>
<div class="col-sm-9">
<div class="checkbox">
<label>
<input type="checkbox" name="form[private_message]" value="1" <?php if ($luna_config['o_private_message'] == '1') echo ' checked="checked"' ?> />
enable private messaging system
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">zReadingList<span class="help-block"><span class="label label-success">normal</span></span></label>
<div class="col-sm-9">
Expand Down
16 changes: 8 additions & 8 deletions db_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ function stripslashes_array($array) {
if (array_key_exists('o_quickpost', $luna_config))
$db->query('DELETE FROM '.$db->prefix.'config WHERE conf_name = \'o_quickpost\'') or error('Unable to remove config value \'o_quickpost\'', __FILE__, __LINE__, $db->error());

// Since 0.0.3248: Add o_private_message/experimental feature
if (!array_key_exists('o_private_message', $luna_config))
$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_private_message\', \'0\')') or error('Unable to insert config value \'o_private_message\'', __FILE__, __LINE__, $db->error());

// Since 0.0.3250: Add the messages table
if (!$db->table_exists('messages')) {
$schema = array(
Expand Down Expand Up @@ -600,22 +596,26 @@ function stripslashes_array($array) {
// Since 0.0.3263: Add the num_pms column to the users table
$db->add_field('users', 'num_pms', 'INT(10) UNSIGNED', false, '0', 'num_posts') or error('Unable to add column "num_pms" to table "users"', __FILE__, __LINE__, $db->error());

// Since 0.0.3265: Add o_pms_enabled/experimental feature
// Since 0.0.3265: Add o_pms_enabled feature
if (!array_key_exists('o_pms_enabled', $luna_config))
$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_pms_enabled\', \'1\')') or error('Unable to insert config value \'o_pms_enabled\'', __FILE__, __LINE__, $db->error());

// Since 0.0.3265: Add o_pms_mess_per_page/experimental feature
// Since 0.0.3265: Add o_pms_mess_per_page feature
if (!array_key_exists('o_pms_mess_per_page', $luna_config))
$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_pms_mess_per_page\', \'10\')') or error('Unable to insert config value \'o_pms_mess_per_page\'', __FILE__, __LINE__, $db->error());

// Since 0.0.3265: Add o_pms_max_receiver/experimental feature
// Since 0.0.3265: Add o_pms_max_receiver feature
if (!array_key_exists('o_pms_max_receiver', $luna_config))
$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_pms_max_receiver\', \'5\')') or error('Unable to insert config value \'o_pms_max_receiver\'', __FILE__, __LINE__, $db->error());

// Since 0.0.3265: Add o_pms_notification/experimental feature
// Since 0.0.3265: Add o_pms_notification feature
if (!array_key_exists('o_pms_notification', $luna_config))
$db->query('INSERT INTO '.$db->prefix.'config (conf_name, conf_value) VALUES (\'o_pms_notification\', \'1\')') or error('Unable to insert config value \'o_pms_notification\'', __FILE__, __LINE__, $db->error());

// Since 0.1.3283: Remove obsolete o_private_message permission from config table
if (array_key_exists('o_private_message', $luna_config))
$db->query('DELETE FROM '.$db->prefix.'config WHERE conf_name = \'o_private_message\'') or error('Unable to remove config value \'o_private_message\'', __FILE__, __LINE__, $db->error());

break;

// Preparse posts
Expand Down
4 changes: 2 additions & 2 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function process_form(the_form) {
$num_new_pm = $db->result($result_messages);

if ($num_new_pm > 0)
$new_inbox = '<span class="label label-danger">'.$num_new_pm.'</span>';
$new_inbox = '<span class="label label-danger">'.$num_new_pm.'</span>&nbsp;&nbsp;&nbsp;&nbsp;';
else
$new_inbox = '';
}
Expand Down Expand Up @@ -103,7 +103,7 @@ function process_form(the_form) {
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle avatar-item" data-toggle="dropdown">'.$new_inbox.'&nbsp;&nbsp;&nbsp;&nbsp;'.$user_avatar.' <span class="fa fa-angle-down"></a>
<a href="#" class="dropdown-toggle avatar-item" data-toggle="dropdown">'.$new_inbox."".$user_avatar.' <span class="fa fa-angle-down"></a>
<ul class="dropdown-menu">
<li><a href="pms_inbox.php">Inbox</a></li>
<li><a href="profile.php?id='.$luna_user['id'].'">'.$lang['Profile'].'</a></li>
Expand Down
8 changes: 3 additions & 5 deletions include/backstage_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ function load_admin_nav($section, $page) {
echo '<span class="fa fa-fw fa-sliders"></span> Features';
else if ($page == 'registration')
echo '<span class="fa fa-fw fa-plus-circle"></span> Registration';
else if ($page == 'inbox')
echo '<span class="fa fa-fw fa-comments"></span> Inbox';
else if ($page == 'email')
echo '<span class="fa fa-fw fa-envelope"></span> Email';
else if ($page == 'appearance')
Expand All @@ -113,8 +115,6 @@ function load_admin_nav($section, $page) {
echo '<span class="fa fa-fw fa-paint-brush"></span> Theme';
else if ($page == 'maintenance')
echo '<span class="fa fa-fw fa-coffee"></span> Maintenance';
else if ($page == 'private_messages')
echo '<span class="fa fa-fw fa-comments"></span> zPrivateMessages';
else if ($page == 'zsettings')
echo '<span class="fa fa-fw fa-cogs"></span> zSettings';

Expand Down Expand Up @@ -152,15 +152,13 @@ function load_admin_nav($section, $page) {
<li<?php if($page == 'settings') echo ' class="active"' ?>><a href="settings.php"><span class="fa fa-cogs"></span> Settings</a></li>
<li<?php if($page == 'features') echo ' class="active"' ?>><a href="features.php"><span class="fa fa-sliders"></span> Features</a></li>
<li<?php if($page == 'registration') echo ' class="active"' ?>><a href="registration.php"><span class="fa fa-plus-circle"></span> Registration</a></li>
<li<?php if($page == 'inbox') echo ' class="active"' ?>><a href="inbox.php"><span class="fa fa-comments"></span> Inbox</a></li>
<li<?php if($page == 'email') echo ' class="active"' ?>><a href="email.php"><span class="fa fa-envelope"></span> Email</a></li>
<li<?php if($page == 'appearance') echo ' class="active"' ?>><a href="appearance.php"><span class="fa fa-eye"></span> Appearance</a></li>
<li<?php if($page == 'menu') echo ' class="active"' ?>><a href="menu.php"><span class="fa fa-bars"></span> Menu</a></li>
<li<?php if($page == 'theme') echo ' class="active"' ?>><a href="theme.php"><span class="fa fa-paint-brush"></span> Theme</a></li>
<li<?php if($page == 'maintenance') echo ' class="active"' ?>><a href="maintenance.php"><span class="fa fa-coffee"></span> Maintenance</a></li>
<?php if (file_exists('../z.txt')) { ?>
<?php if ($luna_config['o_private_message'] == '1') { ?>
<li<?php if($page == 'private_messages') echo ' class="active"' ?>><a href="private_messages.php"><span class="fa fa-comments"></span> zPrivateMessages</a></li>
<?php } ?>
<li<?php if($page == 'zsettings') echo ' class="active"' ?>><a href="zsettings.php"><span class="fa fa-cogs"></span> zSettings</a></li>
<?php } ?>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions include/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ class Version {
const FORUM_VERSION = '0.0.9';

// The Luna Core version
const FORUM_CORE_VERSION = '0.1.3277';
const FORUM_CORE_VERSION = '0.1.3284';

// The database version number, every change in the database requires this number to go one up
const FORUM_DB_VERSION = 85.10;
const FORUM_DB_VERSION = 85.11;

// The parser version number, every change to the parser requires this number to go one up
const FORUM_PARSER_VERSION = 10;
Expand Down
9 changes: 4 additions & 5 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -1889,11 +1889,10 @@ function process_form(the_form) {
'o_user_menu_sidebar' => 0, // Experimental
'o_backstage_dark' => 0, // Experimental
'o_reading_list' => 0, // Experimental
'o_private_message' => 0, // Experimental
'o_pms_enabled' => 1, // Experimental
'o_pms_mess_per_page' => 10, // Experimental
'o_pms_max_receiver' => 5, // Experimental
'o_pms_notification' => 1, // Experimental
'o_pms_enabled' => 1,
'o_pms_mess_per_page' => 10,
'o_pms_max_receiver' => 5,
'o_pms_notification' => 1,
'p_message_img_tag' => 1,
'p_message_all_caps' => 1,
'p_subject_all_caps' => 1,
Expand Down

0 comments on commit 7742cb0

Please sign in to comment.