Esempio n. 1
0
 if (strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']) == false) {
     stderr('Error', 'So, thou common dog, didst thou disgorge thy glutton bosom?');
 }
 /*
 //=== allow suspended users to PM / forward to staff only
 	if ($CURUSER['suspended'] === 'yes')
 	{
 	$res = sql_query('SELECT id FROM users WHERE class >='.UC_MODERATOR) or sqlerr(__FILE__, __LINE__);
         $row = mysql_fetch_assoc($res);
         if (!in_array(0 + $_POST['receiver'], $row)) stderr('Error', 'Your account is suspended, you may only forward PMs to staff!');
 	}
 */
 // === make sure they have space
 $res_count = sql_query('SELECT COUNT(*) FROM messages WHERE receiver = ' . $receiver . ' AND location = 1') or sqlerr(__FILE__, __LINE__);
 $arr_count = mysql_fetch_row($res_count);
 if ($arr_count[0] >= maxbox($arr_receiver['class']) && $CURUSER['class'] < UC_MODERATOR) {
     stderr('Sorry', 'Members PM box is full.');
 }
 // This code restricts PM sending to a set limit
 if (!($CURUSER['pm_count'] < $CURUSER['pm_max'])) {
     stderr('Notice', 'You have reached your PM limit. Please wait 15 minutes before retrying.');
 }
 // === Make sure recipient wants this message
 if (get_user_class() < UC_MODERATOR) {
     switch (true) {
         case $arr_receiver['acceptpms'] == 'yes':
             $res2 = sql_query('SELECT * FROM blocks WHERE userid=' . $receiver . ' AND blockid=' . $CURUSER['id']) or sqlerr(__FILE__, __LINE__);
             if (mysql_num_rows($res2) == 1) {
                 stderr('Refused', $arr_receiver['username'] . ' has blocked PMs from you.');
             }
             break;
Esempio n. 2
0
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if ($action === 'editmailboxes') {
    $res = sql_query('SELECT * FROM pmboxes WHERE userid=' . sqlesc($CURUSER['id']) . ' ORDER BY name ASC') or sqlerr(__FILE__, __LINE__);
    // === get all PM boxes for editing
    while ($row = mysql_fetch_assoc($res)) {
        // ==== get count from PM boxes
        $res_count = sql_query('SELECT COUNT(*) FROM messages WHERE  location =' . (0 + $row['boxnumber']) . ' AND receiver=' . $CURUSER['id']) or sqlerr(__FILE__, __LINE__);
        $arr_count = mysql_fetch_row($res_count);
        $messages = $arr_count[0];
        $all_my_boxes .= '<tr><td class=clearalt6 align=right width=110>Box # ' . ($row['boxnumber'] - 1) . ' <b>' . htmlspecialchars($row['name']) . ':</b> </td><td class=clearalt6 align=left><input type=text name=edit' . (0 + $row['id']) . ' value="' . htmlspecialchars($row['name']) . '" size=40 maxlength=14> [ contains ' . $messages . ' messages ]</td></tr>';
    }
    $all_my_boxes .= $all_my_boxes == '' ? '<tr><td class=clearalt6 colspan=2 align=left><b>There are currently no PM boxes to edit.</b><br></td></tr>' : '<tr><td class=clearalt6 colspan=2 align=left>You may edit the names of your PM boxes here.<br>If you wish to delete 1 or more PM boxes, remove the name from the text field leaving it blank.</td></tr><tr><td class=clearalt6 align=left width colspan=2><b>Please note!!!</b> if you delete the name of one or more boxes,  all messages in that directory will be sent to your inbox!!!<li>If you wish to delete the messages as well, you can do that from the main page.</li></td></tr><tr><td class=clearalt6 align=center width colspan=2><input class=button type=submit value=Edit></td></tr>';
    // === per page drop down
    $iii = 20;
    while ($iii <= (maxbox($CURUSER['class']) > 200 ? 200 : maxbox($CURUSER['class']))) {
        $per_page_drop_down .= '<option value=' . $iii . ' ' . ($CURUSER['pms_per_page'] == $iii ? ' selected' : '') . '>' . $iii . ' PMs per page</option>';
        $iii = $iii + 10;
    }
    // === make up page
    stdhead('Editing PM boxes');
    echo '<font size="+2">Editing PM boxes</font>' . $h1_thingie . '<table><tr><td class=colhead2 colspan=2 align=left>Add PM boxes</td></tr><tr>' . '<td class=clearalt6 colspan=2 align=left>As a ' . get_user_class_name($CURUSER['class']) . ' you may have up to ' . maxboxes($CURUSER['class']) . ' PM box' . (maxboxes($CURUSER['class']) !== 1 ? 'es' : '') . ' other then your in, sent and draft boxes.<br>' . 'Currently you have ' . mysql_num_rows($res) . ' custom box' . (mysql_num_rows($res) !== 1 ? 'es' : '') . ' <br>You may add up to ' . (maxboxes($CURUSER['class']) - mysql_num_rows($res)) . ' more extra mailboxes.<br>' . '<br><b>The following characters can be used: </b> a-z, A-Z, 1-9, - and _ [ all other characters will be ignored ]<br></td></tr>' . '<form action=?action=editmailboxes2&action2=add method=post>';
    // === make loop for oh let's say 5 boxes...
    for ($ii = 1; $ii < 6; $ii++) {
        echo '<tr><td class=clearalt6 align=right width=110><b>add ' . $ii . ' more box' . ($ii !== 1 ? 'es' : '') . ':</b> </td><td class=clearalt6 align=left><input type=text name="new[]" size=40 maxlength=14></td></tr>';
    }
    echo '<tr><td class=clearalt6 colspan=2 align=left><br>only fill in add as many boxes that you would like to add and click <input class=button type=submit value=Add> [ blank entries will be ignored ]</form><br><br></td></tr>' . '<tr><td class=colhead2 colspan=2 align=left>Edit / Delete PM boxes</td></tr>' . '<form action=?action=editmailboxes2 method=post><input type=hidden name=action2 value=edit_boxes>' . $all_my_boxes . '</form>' . '<tr><td class=colhead2 colspan=2 align=left>PM settings</td></tr><tr><td class=clearalt6 colspan=2 align=left><b>Set the default number of messages to be viewed per page.</b>' . '<form action=? method=get> <select name=change_pm_number>' . $per_page_drop_down . '</select> please select how many PMs you would like to see per page, and click change.' . '<input class=button type=submit value=change><input type=hidden name=edit_mail_boxes value=1></form><br><b>Show avatars on PM list?</b>' . '<form action=? method=get><select name=show_pm_avatar><option value=yes ' . ($CURUSER['show_pm_avatar'] === 'yes' ? ' selected' : '') . '>show avatars on PM list</option>' . '<option value=no ' . ($CURUSER['show_pm_avatar'] === 'no' ? ' selected' : '') . '>don\'t show avatars on PM list</option></select> please select if you would like to see avatars in your PM listings and click ' . '<input type=hidden name=edit_mail_boxes value=1><input class=button type=submit value=change></form><br><br></td></tr></table>';
    stdfoot();
}
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////