Skip to content

Commit

Permalink
#1334 Revamp Inbox main design
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick committed Sep 4, 2015
1 parent 0d8f6f5 commit b42d733
Showing 1 changed file with 62 additions and 53 deletions.
115 changes: 62 additions & 53 deletions themes/Sixteen/inbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
if (!defined('FORUM'))
exit;

include load_page('inbox-delete-post.php');

?>
<div class="row">
<div class="col-sm-3 profile-nav">
Expand All @@ -19,7 +21,7 @@
</div>
</div>
<div class="col-sm-9 profile">
<?php load_inbox_nav('inbox'); ?>
<h2 class="profile-title"><?php _e('Inbox', 'luna') ?></h2>
<p><span class="pages-label"><?php echo paginate($num_pages, $page, 'inbox.php?') ?></span></p>
<form method="post" action="inbox.php">
<fieldset>
Expand All @@ -30,7 +32,12 @@
</div>
<div class="btn-group">
<a href="#" data-toggle="modal" data-target="#delete-form" class="btn btn-danger"><span class="fa fa-fw fa-trash"></span> <?php _e('Delete', 'luna') ?></a>
<?php include load_page('inbox-delete-post.php'); ?>
</div>
<div class="btn-group pull-right">
<?php if ($page == 'view') { ?>
<a type="button" class="btn btn-success" href="new_inbox.php?reply=<?php echo $tid ?>"><span class="fa fa-fw fa-reply"></span> <?php _e('Reply', 'luna') ?></a>
<?php } ?>
<a type="button" class="btn btn-success" href="new_inbox.php"><span class="fa fa-fw fa-pencil"></span> <?php _e('Compose', 'luna') ?></a>
</div>
</div>
<div class="panel panel-default">
Expand All @@ -41,75 +48,77 @@
<table class="table">
<thead>
<tr>
<th style="width: 18px;"><input type="checkbox" id="checkAllButon" value="1" onclick="checkAll('selected_messages[]','checkAllButon');" /></th>
<th><?php _e('Messages', 'luna') ?></th>
<th><?php _e('Sender', 'luna') ?></th>
<th><?php _e('Receiver(s)', 'luna') ?></th>
<th><?php _e('Last post', 'luna') ?></th>
<th><label style="display: inline; white-space: nowrap;"><?php _e('Select', 'luna') ?> <input type="checkbox" id="checkAllButon" value="1" onclick="checkAll('selected_messages[]','checkAllButon');" /></label></th>
</tr>
</thead>
<tbody>
<?php
// Fetch messages
$result = $db->query("SELECT * FROM ".$db->prefix."messages WHERE show_message=1 AND owner='".$luna_user['id']."' ORDER BY last_post DESC LIMIT ".$limit) or error("Unable to find the list of the pms.", __FILE__, __LINE__, $db->error());
// If there are messages in this folder.
if ($db->num_rows($result)) {
while ($cur_mess = $db->fetch_assoc($result)) {
$item_status = 'roweven';
if ($cur_mess['showed'] == '0') {
$item_status .= ' inew';
$icon_type = 'icon icon-new';
$subject = '<a href="viewinbox.php?tid='.$cur_mess['shared_id'].'&amp;mid='.$cur_mess['id'].'">'.
'<strong>'.luna_htmlspecialchars($cur_mess['subject']).'</strong>'.
'</a>';
} else {
$icon_type = 'icon';
$subject = '<a href="viewinbox.php?tid='.$cur_mess['shared_id'].'&amp;mid='.$cur_mess['id'].'">'.
luna_htmlspecialchars($cur_mess['subject']).
'</a>';
}
$last_post = '<a href="viewinbox.php?tid='.$cur_mess['shared_id'].'&amp;mid='.$cur_mess['id'].'&amp;pid='.$cur_mess['last_post_id'].'#p'.$cur_mess['last_post_id'].'">'.format_time($cur_mess['last_post']).'</a> <span class="byuser">'.__('by', 'luna').' '.luna_htmlspecialchars($cur_mess['last_poster']).'</span>';
?>
<?php
// Fetch messages
$result = $db->query("SELECT * FROM ".$db->prefix."messages WHERE show_message=1 AND owner='".$luna_user['id']."' ORDER BY last_post DESC LIMIT ".$limit) or error("Unable to find the list of the pms.", __FILE__, __LINE__, $db->error());

// If there are messages in this folder.
if ($db->num_rows($result)) {
while ($cur_mess = $db->fetch_assoc($result)) {
$item_status = 'roweven';
if ($cur_mess['showed'] == '0') {
$item_status .= ' inew';
$icon_type = 'icon icon-new';
$subject = '<a href="viewinbox.php?tid='.$cur_mess['shared_id'].'&amp;mid='.$cur_mess['id'].'">'.
'<strong>'.luna_htmlspecialchars($cur_mess['subject']).'</strong>'.
'</a>';
} else {
$icon_type = 'icon';
$subject = '<a href="viewinbox.php?tid='.$cur_mess['shared_id'].'&amp;mid='.$cur_mess['id'].'">'.
luna_htmlspecialchars($cur_mess['subject']).
'</a>';
}

$last_post = '<a href="viewinbox.php?tid='.$cur_mess['shared_id'].'&amp;mid='.$cur_mess['id'].'&amp;pid='.$cur_mess['last_post_id'].'#p'.$cur_mess['last_post_id'].'">'.format_time($cur_mess['last_post']).'</a> <span class="byuser">'.__('by', 'luna').' '.luna_htmlspecialchars($cur_mess['last_poster']).'</span>';
?>
<tr class="<?php echo $item_status ?>">
<td>
<input type="checkbox" name="selected_messages[]" value="<?php echo $cur_mess['shared_id'] ?>" />
</td>
<td>
<div class="<?php echo $icon_type ?>"></div>
<div><?php echo $subject ?></div>
</td>
<td>
<?php
if ($luna_user['g_view_users'] == '1')
echo '<a href="profile.php?id='.$cur_mess['sender_id'].'">'.luna_htmlspecialchars($cur_mess['sender']).'</a>';
else
echo luna_htmlspecialchars($cur_mess['sender']);
?>
<?php
if ($luna_user['g_view_users'] == '1')
echo '<a href="profile.php?id='.$cur_mess['sender_id'].'">'.luna_htmlspecialchars($cur_mess['sender']).'</a>';
else
echo luna_htmlspecialchars($cur_mess['sender']);
?>
</td>
<td>
<?php
if ($luna_user['g_view_users'] == '1') {
$ids_list = explode(', ', $cur_mess['receiver_id']);
$sender_list = explode(', ', $cur_mess['receiver']);
$sender_list = str_replace('Deleted', __('Deleted', 'luna'), $sender_list);
for($i = '0'; $i < count($ids_list); $i++){
echo '<a href="profile.php?id='.$ids_list[$i].'">'.luna_htmlspecialchars($sender_list[$i]).'</a>';
if($ids_list[$i][count($ids_list[$i])-'1'])
echo'<br />';
}
} else
echo luna_htmlspecialchars($cur_mess['receiver']);
?>
<?php
if ($luna_user['g_view_users'] == '1') {
$ids_list = explode(', ', $cur_mess['receiver_id']);
$sender_list = explode(', ', $cur_mess['receiver']);
$sender_list = str_replace('Deleted', __('Deleted', 'luna'), $sender_list);

for($i = '0'; $i < count($ids_list); $i++){
echo '<a href="profile.php?id='.$ids_list[$i].'">'.luna_htmlspecialchars($sender_list[$i]).'</a>';

if($ids_list[$i][count($ids_list[$i])-'1'])
echo'<br />';
}
} else
echo luna_htmlspecialchars($cur_mess['receiver']);
?>
</td>
<td><?php echo $last_post ?></td>
<td><input type="checkbox" name="selected_messages[]" value="<?php echo $cur_mess['shared_id'] ?>" /></td>
</tr>
<?php
}
} else
echo "\t".'<tr><td colspan="4">'.__('No messages', 'luna').'</td></tr>'."\n";
?>
<?php
}
} else
echo "\t".'<tr><td colspan="4">'.__('No messages', 'luna').'</td></tr>'."\n";
?>
</tbody>
</table>
</div>
Expand Down

0 comments on commit b42d733

Please sign in to comment.