Esempio n. 1
0
    echo $image_width;
    ?>
" />
						</td>
					</tr>
					<tr>
						<td valign="middle" width="33%">0%</td>

						<td align="center" valign="middle" width="33%">50%</td>
						<td align="right" valign="middle" width="33%">100%</td>
					</tr>
				</tbody></table><br />
				
<table border="0" cellpadding="4" cellspacing="0" width="737">
<tr><td align='right'><?php 
    echo insertJumpTo($mailbox);
    ?>
</td></tr>
</table>

<form action="messages.php" method="post" name="mutliact">

<input type="hidden" name="action" value="moveordel" />
<table border="0" cellpadding="4" cellspacing="0" width="737">
<tr>
<td width="1%" class="colhead">Status</td>
<td class="colhead">Subject </td>
	<?php 
    if ($mailbox != PM_SENTBOX) {
        ?>
<td width="35%" class="colhead">Sender</td>
Esempio n. 2
0
         $mailbox_name = "{$lang['messages_inbox']}";
     } else {
         $mailbox_name = "{$lang['messages_sentbox']}";
     }
 }
 //$pmcount = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM messages WHERE receiver = ".$CURUSER['id']));
 $pmcount = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER['id'] . " AND location >= '1' || sender=" . $CURUSER['id'] . " AND saved = 'yes' ")) or sqlerr(__FILE__, __LINE__);
 $pm_perc = $pmcount[0] ? $pmcount[0] / 50 * 100 : 0;
 $perc_image = $pm_perc > 66 ? 'loadbarred.gif' : ($pm_perc > 33 ? 'loadbaryellow.gif' : 'loadbargreen.gif');
 //$image_width = ($pmcount[0] / 250 * 100);
 $image_width = $pm_perc > 0 ? round($pm_perc * 2.5) : 1;
 if ($image_width > 250) {
     $image_width = 250;
 }
 $HTMLOUT = '';
 $HTMLOUT .= "<!-- <script type='text/javascript' src='js/checkall.js'></script> -->\r\n    <!-- check all -->\r\n    <script type='text/javascript'>\r\n    function checkAll(field) {\r\n       if (field.CheckAll.checked == true) {\r\n          for (i = 0; i < field.length; i++) {\r\n          \r\n                field[i].checked = true;\r\n             }\r\n          \r\n       }\r\n       else {\r\n          for (i = 0; i < field.length; i++) {\r\n          \r\n                field[i].checked = false;\r\n             }\r\n          \r\n       }\r\n    }\r\n    </script>\r\n    <!-- check all -->\r\n\r\n\r\n\r\n    <table style='width: 250px;' cellspacing='1'>\r\n\r\n              <tbody><tr>\r\n                <td colspan='3'>" . sprintf($lang['messages_percent_full'], $pm_perc) . "</td>\r\n              </tr>\r\n              <tr>\r\n                <td colspan='3' nowrap='nowrap' valign='middle'>\r\n                <img src='pic/{$perc_image}' alt='' align='middle' height='10' width='{$image_width}' />\r\n                </td>\r\n              </tr>\r\n              <tr>\r\n                <td valign='middle' width='33%'>0%</td>\r\n\r\n                <td align='center' valign='middle' width='33%'>50%</td>\r\n                <td align='right' valign='middle' width='33%'>100%</td>\r\n              </tr>\r\n            </tbody></table><br />\r\n            \r\n    <table border='0' cellpadding='4' cellspacing='0' width='737'>\r\n    <tr><td align='right'>" . insertJumpTo($mailbox) . "</td></tr>\r\n    </table>\r\n\r\n    <form action='messages.php' method='post' name='mutliact'>\r\n\r\n    <input type='hidden' name='action' value='moveordel' />\r\n    <table border='0' cellpadding='4' cellspacing='0' width='737'>\r\n    <tr>\r\n    <td width='1%' class='colhead'>{$lang['messages_status']}</td>\r\n    <td class='colhead'>Subject </td>";
 if ($mailbox != PM_SENTBOX) {
     $HTMLOUT .= "<td width='35%' class='colhead'>{$lang['messages_sender']}</td>";
 } else {
     $HTMLOUT .= "<td width='35%' class='colhead'>{$lang['messages_receiver']}</td>";
 }
 $HTMLOUT .= "<td width='1%' class='colhead'>{$lang['messages_date']}</td>\r\n    <td width='1%' class='colhead'><input name='CheckAll' id='CheckAll' class='checkbox' value='1' onclick='checkAll(mutliact)' type='checkbox' title='{$lang['messages_checkall']}' />\r\n    </td>\r\n    </tr>";
 if ($mailbox != PM_SENTBOX) {
     $res = sql_query('SELECT * FROM messages WHERE receiver=' . sqlesc($CURUSER['id']) . ' AND location=' . sqlesc($mailbox) . ' ORDER BY id DESC') or sqlerr(__FILE__, __LINE__);
 } else {
     $res = sql_query('SELECT * FROM messages WHERE sender=' . sqlesc($CURUSER['id']) . ' AND saved=\'yes\' ORDER BY id DESC') or sqlerr(__FILE__, __LINE__);
 }
 if (mysql_num_rows($res) == 0) {
     $HTMLOUT .= "<tr><td colspan='5' align='center'>{$lang['messages_no_messages']}</td></tr>\n";
 } else {
     while ($row = mysql_fetch_assoc($res)) {
Esempio n. 3
0
//echo stdhead(htmlsafechars($mailbox_name));
//=== let's make the table
$HTMLOUT .= $h1_thingie . $top_links . '
    <a name="pm"></a>
    <form action="pm_system.php" method="post" name="checkme" onsubmit="return ValidateForm(this,\'pm\')">
    
    <table border="0" cellspacing="0" cellpadding="5" align="center" style="max-width:900px">
    <tr>
        <td class="colhead" align="center" colspan="5"><span class="font_size_1">' . $messages . ' / ' . $maxbox . '</span>
        ' . $spacer . '<span class="font_size_5">' . $mailbox_name . '</span>' . $spacer . '
        <span class="font_size_1">[ ' . $num_messages . '% full ]</span><br />
        ' . $mailbox_pic . '</td>
    </tr>
    <tr>
    <td class="one" align="right" colspan="5">
    ' . insertJumpTo($mailbox) . $other_box_info . ($perpage < $messages ? $menu . '' : '') . '
    </td>
    </tr>
    <tr>
        <td class="colhead" width="1%">&nbsp;&nbsp;
        
        <input type="hidden" name="action" value="move_or_delete_multi" /></td>
        <td class="colhead" align="left"><a class="altlink" href="pm_system.php?action=view_mailbox&amp;box=' . $mailbox . ($perpage == 20 ? '' : '&amp;perpage=' . $perpage) . ($perpage < $messages ? '&amp;page=' . $page : '') . '&amp;order_by=subject' . $desc_asc . '#pm" title="order by subject ' . $desc_asc_2 . '">Subject</a></td>
        <td class="colhead" align="left"><a class="altlink" href="pm_system.php?action=view_mailbox&amp;box=' . $mailbox . ($perpage == 20 ? '' : '&amp;perpage=' . $perpage) . ($perpage < $messages ? '&amp;page=' . $page : '') . '&amp;order_by=username' . $desc_asc . '#pm" title="order by member name ' . $desc_asc_2 . '">' . ($mailbox === PM_SENTBOX ? 'Sent to' : 'Sender') . '</a></td>
        <td class="colhead" align="left"><a class="altlink" href="pm_system.php?action=view_mailbox&amp;box=' . $mailbox . ($perpage == 20 ? '' : '&amp;perpage=' . $perpage) . ($perpage < $messages ? '&amp;page=' . $page : '') . '&amp;order_by=added' . $desc_asc . '#pm" title="order by date ' . $desc_asc_2 . '">Date</a></td>
        <td class="colhead" width="1%"></td>
    </tr>';
if (mysqli_num_rows($res) === 0) {
    $HTMLOUT .= '
        <tr>
            <td class="two" align="center" colspan="5"><span style="font-weight: bold;">No Messages. in ' . $mailbox_name . '</span></td>
Esempio n. 4
0
 $pages = floor($messages / $perpage);
 if ($pages * $perpage < $messages) {
     ++$pages;
 }
 $page = $page < 1 ? 1 : $page;
 $page = $page > $pages ? $pages : $page;
 for ($i = 1; $i <= $pages; ++$i) {
     $page_num .= $i == $page ? ' <b>' . $i . '</b> ' : ' <a class=altlink href=?action=viewdrafts&page=' . $i . ($_GET['order_by'] ? '&order_by=' . $order_by : '') . ($_GET['DESC'] ? '&DESC=1' : ($_GET['ASC'] ? '&ASC=1' : '')) . '><b>' . $i . '</b></a> ';
 }
 $menu = ($page == 1 ? ' <p align=center><b><img src=pic/arrow_prev.gif =alt="&lt;&lt;"> Prev</b> ' : ' <p align=center><a class=altlink href=?action=viewdrafts&page=' . ($page - 1) . ($_GET['order_by'] ? '&order_by=' . $order_by : '') . ($_GET['DESC'] ? '&DESC=1' : ($_GET['ASC'] ? '&ASC=1' : '')) . '><b><img src=pic/arrow_prev.gif =alt="&lt;&lt;"> Prev</b></a>') . '&nbsp;&nbsp;&nbsp;' . $page_num . '&nbsp;&nbsp;&nbsp;' . ($page == $pages ? '<b>Next <img src=pic/arrow_next.gif =alt="&gt;&gt;"></b> ' : ' <a class=altlink href=?action=viewdrafts&page=' . ($page + 1) . ($_GET['order_by'] ? '&order_by=' . $order_by : '') . ($_GET['DESC'] ? '&DESC=1' : ($_GET['ASC'] ? '&ASC=1' : '')) . '><b>Next <img src=pic/arrow_next.gif =alt="&gt;&gt;"></b></a></p>');
 $offset = $page * $perpage - $perpage;
 $LIMIT = $messages > 0 ? "LIMIT {$offset},{$perpage}" : '';
 // === change ASC to DESC and back for sort by
 $desc_asc = $_GET['ASC'] ? '&DESC=1' : '&ASC=1';
 // === let's make the table
 echo '<table width=95%><tr><td colspan=5 class=colhead align=center><font size=1>' . $messages . ' / ' . maxboxes($CURUSER['class']) . '</font>&nbsp;&nbsp;&nbsp;&nbsp;<font size=4>' . $mailbox_name . '</font>&nbsp;&nbsp;&nbsp;&nbsp;<font size=1>[ ' . $num_messages . '% full ]</font><br>' . $mailbox_pic . '</td></tr><tr><td colspan=5 class=clearalt6 align=right>' . insertJumpTo($mailbox) . ($pages > 1 ? $menu : '') . '<p align=center><br>' . $h1_thingie . '<br></p><form action=?action=move_or_delete_multi method=post name=messages onSubmit="return ValidateForm(this,\'pm\')"><input type=hidden name=action value=move_or_delete_multi><input type=hidden name=draft_section value=1>' . '<tr><td width=1% class=colhead>&nbsp;&nbsp;</td><td class=colhead><a class=altlink href=?action=viewdrafts' . ($page > 1 ? '&page=' . $page : '') . '&order_by=subject' . $desc_asc . ' title="order by subject ' . ($_GET['DESC'] ? 'ascending' : 'descending') . '">Subject</a> </td><td width=1% class=colhead><a class=altlink href=?action=viewdrafts' . ($page > 1 ? '&page=' . $page : '') . '&order_by=added' . $desc_asc . ' title="order by date ' . ($_GET['DESC'] ? 'ascending' : 'descending') . '">Date</td><td width=1% class=colhead>&nbsp;&nbsp;</td></tr>';
 // === get draft info to list it
 $res = sql_query("SELECT id,added,subject FROM messages WHERE sender=" . $CURUSER['id'] . " AND draft = 'yes' ORDER BY " . $order_by . " " . ($_GET['ASC'] ? 'ASC ' : ($_GET['DESC'] ? 'DESC ' : 'DESC ')) . $LIMIT) or sqlerr(__FILE__, __LINE__);
 if (mysql_num_rows($res) === 0) {
     echo '<td colspan=5 align=center class=clearalt7><b>No messages in Drafts.</b><br><a class=altlink href=/sendmessage.php?receiver=' . $CURUSER['id'] . '&draft=1>write new draft</a></td>';
 } else {
     while ($row = mysql_fetch_assoc($res)) {
         // =======change colors
         $count = ++$count % 2;
         $class = 'clearalt' . ($count == 0 ? 6 : 7);
         $class2 = 'clearalt' . ($count == 0 ? 7 : 6);
         // === print the damn thing :P
         echo '<tr><td class=' . $class . '><img src=pic/outbox.gif alt=Read></td><td class=' . $class . '>' . '<a class=altlink href=?action=viewmessage&id=' . $row['id'] . '>' . ($row['subject'] !== '' ? htmlspecialchars($row['subject']) : 'No Subject') . '</a> [ <a class=altlink href=sendmessage.php?receiver=' . $CURUSER['id'] . '&draft=1&edit_draft=' . $row['id'] . ' title="edit this draft">e</a> ]</td>' . '<td nowrap class=' . $class . '>' . $row['added'] . '</td>' . ($_GET['check'] === 'yes' ? '<td class=' . $class . '><input type=checkbox name="pm[]" value=' . $row['id'] . ' /></td></tr>' : '<td class=' . $class . '><input type=checkbox name="pm[]" value=' . $row['id'] . ' /></td></tr>');
     }
 }
 // === per page drop down ONCHANGE="location = this.options[this.selectedIndex].value;"
Esempio n. 5
0
    $arr_box_name = mysqli_fetch_row($res_box_name);
    if (mysqli_num_rows($res) === 0) {
        stderr($lang['pm_error'], $lang['pm_mailbox_invalid']);
    }
    $mailbox_name = htmlsafechars($arr_box_name[0]);
    $other_box_info = '<p class="text-center"><span style="color: red;">' . $lang['pm_mailbox_asterisc'] . '</span><span style="font-weight: bold;">' . $lang['pm_mailbox_note'] . '</span>
                                           ' . $lang['pm_mailbox_max'] . '<span style="font-weight: bold;">' . $maxbox . '</span>' . $lang['pm_mailbox_either'] . '
                                            <span style="font-weight: bold;">' . $lang['pm_mailbox_inbox'] . '</span>' . $lang['pm_mailbox_or'] . '<span style="font-weight: bold;">' . $lang['pm_mailbox_sentbox'] . '</span>.</p>';
}
//=== Display the message already!
$HTMLOUT .= $h1_thingie . ($message['draft'] === 'yes' ? '<h1>' . $lang['pm_viewmsg_tdraft'] . '</h1>' : '<h1>' . $lang['pm_viewmsg_mailbox'] . '' . $mailbox_name . '</h1>') . $top_links . '
    <table class="table table-bordered">
    <tr>
        <td class="text-center" colspan="2" class="colhead"><h1>' . $lang['pm_send_subject'] . '
        <span style="font-weight: bold;">' . ($message['subject'] !== '' ? htmlsafechars($message['subject']) : $lang['pm_search_nosubject']) . '</span></h1></td>
        </tr>
    <tr>
        <td colspan="2" class="text-left"><span style="font-weight: bold;">' . ($message['sender'] === $CURUSER['id'] ? $lang['pm_viewmsg_to'] : $lang['pm_viewmsg_from']) . ':</span>
        ' . ($arr_user_stuff['id'] == 0 ? $lang['pm_viewmsg_sys'] : print_user_stuff($arr_user_stuff)) . $spacer . $friends . $spacer . $spacer . '
        <span style="font-weight: bold;">sent:</span> ' . get_date($message['added'], '') . $spacer . ($message['sender'] === $CURUSER['id'] && $message['unread'] == 'yes' ? '' . $lang['pm_mailbox_char1'] . '<span style="font-weight: bold;color:red;">' . $lang['pm_mailbox_unread'] . '</span>' . $lang['pm_mailbox_char2'] . '' : '') . ($message['urgent'] === 'yes' ? '<span style="font-weight: bold;color:red;">' . $lang['pm_mailbox_urgent'] . '</span>' : '') . '</td>
    </tr>
    <tr>
        <td class="text-center" valign="top" width="0px" id="photocol">' . $avatar . '</td>
        <td class="text-left text-resize">' . format_comment($message['msg']) . '</td>
    </tr>
   <tr>
        <td class="textright" colspan="2">     
<form class="form-horizontal" role="form" action="pm_system.php" method="post">        
<input class="form-control" type="hidden" name="id" value="' . $pm_id . '">
<input class="form-control" type="hidden" name="action" value="move">' . get_all_boxes() . '<br>' . $the_buttons . insertJumpTo(0) . '</td></tr></table>';
    if (mysqli_num_rows($res) === 0) {
        stderr($lang['pm_error'], $lang['pm_mailbox_invalid']);
    }
    $mailbox_name = htmlsafechars($arr_box_name[0]);
    $other_box_info = '<p align="center"><span style="color: red;">' . $lang['pm_mailbox_asterisc'] . '</span><span style="font-weight: bold;">' . $lang['pm_mailbox_note'] . '</span>
                                           ' . $lang['pm_mailbox_max'] . '<span style="font-weight: bold;">' . $maxbox . '</span>' . $lang['pm_mailbox_either'] . '
                                            <span style="font-weight: bold;">' . $lang['pm_mailbox_inbox'] . '</span>' . $lang['pm_mailbox_or'] . '<span style="font-weight: bold;">' . $lang['pm_mailbox_sentbox'] . '</span>.</p>';
}
//=== Display the message already!
$HTMLOUT .= $h1_thingie . ($message['draft'] === 'yes' ? '<h1>' . $lang['pm_viewmsg_tdraft'] . '</h1>' : '<h1>' . $lang['pm_viewmsg_mailbox'] . '' . $mailbox_name . '</h1>') . $top_links . '
    <table border="0" cellspacing="0" cellpadding="5" align="center" style="max-width:800px">
    <tr>
        <td align="center" colspan="2" class="colhead"><h1>' . $lang['pm_send_subject'] . '
        <span style="font-weight: bold;">' . ($message['subject'] !== '' ? htmlsafechars($message['subject']) : $lang['pm_search_nosubject']) . '</span></h1></td>
        </tr>
    <tr>
        <td align="left" colspan="2" class="one"><span style="font-weight: bold;">' . ($message['sender'] === $CURUSER['id'] ? $lang['pm_viewmsg_to'] : $lang['pm_viewmsg_from']) . ':</span>   
        ' . ($arr_user_stuff['id'] == 0 ? $lang['pm_viewmsg_sys'] : print_user_stuff($arr_user_stuff)) . $spacer . $friends . $spacer . $spacer . '
        <span style="font-weight: bold;">sent:</span> ' . get_date($message['added'], '') . $spacer . ($message['sender'] === $CURUSER['id'] && $message['unread'] == 'yes' ? '' . $lang['pm_mailbox_char1'] . '<span style="font-weight: bold;color:red;">' . $lang['pm_mailbox_unread'] . '</span>' . $lang['pm_mailbox_char2'] . '' : '') . ($message['urgent'] === 'yes' ? '<span style="font-weight: bold;color:red;">' . $lang['pm_mailbox_urgent'] . '</span>' : '') . '</td>
    </tr>
    <tr>
        <td align="center" valign="top" class="one" width="0px" id="photocol">' . $avatar . '</td>
        <td class="two" style="min-width:400px;padding:10px;vertical-align: top;text-align: left;">' . format_comment($message['msg']) . '</td>
    </tr>
    <tr>
        <td class="one" align="right" colspan="2">
        <form action="pm_system.php" method="post">
        <input type="hidden" name="id" value="' . $pm_id . '" />
        <input type="hidden" name="action" value="' . $lang['pm_viewmsg_to'] . '" /><span style="font-weight: bold;">' . $lang['pm_search_move_to'] . '</span> ' . get_all_boxes() . $the_buttons . '</td>
    </tr></table><br />' . insertJumpTo(0);