Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/eula.html *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/eula.html *
|
* $Id: private.php 3171 2007-06-29 04:57:39Z chris $
| * $Id: private.php 3596 2008-01-20 08:27:39Z Tikitiki $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 48 | Zeile 48 |
---|
$db->update_query(TABLE_PREFIX."users", $sql_array, "uid = ".$mybb->user['uid']); }
|
$db->update_query(TABLE_PREFIX."users", $sql_array, "uid = ".$mybb->user['uid']); }
|
// On a random occassion, recount the users pm's just to make sure everything is in sync. if($rand == 5) { update_pm_count(); }
| $timecut = time()-(60*60*24*7); $db->delete_query(TABLE_PREFIX."privatemessages", "dateline <= $timecut AND folder='4' AND uid='".$mybb->user['uid']."'");
|
|
|
$timecut = time()-(60*60*24*7); $db->delete_query(TABLE_PREFIX."privatemessages", "dateline <= $timecut AND folder='4' AND uid='".$mybb->user['uid']."'");
| // On a random occassion, recount the users pm's just to make sure everything is in sync. if($rand == 5 || $db->affected_rows() > 0) { update_pm_count(); }
|
$folderjump = "<select name=\"jumpto\">\n"; $folderoplist = "<select name=\"fid\">\n";
| $folderjump = "<select name=\"jumpto\">\n"; $folderoplist = "<select name=\"fid\">\n";
|
Zeile 68 | Zeile 68 |
---|
if($fid == $folderinfo[0]) { $sel = "selected";
|
if($fid == $folderinfo[0]) { $sel = "selected";
|
} else
| } else
|
{ $sel = ""; }
| { $sel = ""; }
|
Zeile 116 | Zeile 116 |
---|
if($mybb->input['action'] == "do_send" && $mybb->request_method == "post") {
|
if($mybb->input['action'] == "do_send" && $mybb->request_method == "post") {
|
| if($mybb->usergroup['cansendpms'] == "no") { error_no_permission(); } // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$plugins->run_hooks("private_send_do_send");
// Attempt to see if this PM is a duplicate or not
| $plugins->run_hooks("private_send_do_send");
// Attempt to see if this PM is a duplicate or not
|
Zeile 156 | Zeile 164 |
---|
$pm['saveasdraft'] = 1; } $pmhandler->set_data($pm);
|
$pm['saveasdraft'] = 1; } $pmhandler->set_data($pm);
|
|
|
// Now let the pm handler do all the hard work. if(!$pmhandler->validate_pm()) {
| // Now let the pm handler do all the hard work. if(!$pmhandler->validate_pm()) {
|
Zeile 183 | Zeile 191 |
---|
if($mybb->input['action'] == "send") {
|
if($mybb->input['action'] == "send") {
|
| if($mybb->usergroup['cansendpms'] == "no") { error_no_permission(); }
|
$plugins->run_hooks("private_send_start");
if($mybb->settings['bbcodeinserter'] != "off" && $mybb->settings['pmsallowmycode'] != "no" && $mybb->user['showcodebuttons'] != 0) { $codebuttons = build_mycode_inserter(); if($mybb->settings['pmsallowsmilies'] != "no")
|
$plugins->run_hooks("private_send_start");
if($mybb->settings['bbcodeinserter'] != "off" && $mybb->settings['pmsallowmycode'] != "no" && $mybb->user['showcodebuttons'] != 0) { $codebuttons = build_mycode_inserter(); if($mybb->settings['pmsallowsmilies'] != "no")
|
{
| {
|
$smilieinserter = build_clickable_smilies(); } }
|
$smilieinserter = build_clickable_smilies(); } }
|
|
|
$posticons = get_post_icons(); $previewmessage = $mybb->input['message']; $message = htmlspecialchars_uni($mybb->input['message']);
| $posticons = get_post_icons(); $previewmessage = $mybb->input['message']; $message = htmlspecialchars_uni($mybb->input['message']);
|
Zeile 202 | Zeile 214 |
---|
if($mybb->input['preview'] || $send_errors) {
|
if($mybb->input['preview'] || $send_errors) {
|
| $options = $mybb->input['options'];
|
if($options['signature'] == "yes") {
|
if($options['signature'] == "yes") {
|
$optionschecked['signature'] = "checked";
| $optionschecked['signature'] = "checked=\"checked\"";
|
} if($options['disablesmilies'] == "yes") {
|
} if($options['disablesmilies'] == "yes") {
|
$optionschecked['disablesmilies'] = "checked";
| $optionschecked['disablesmilies'] = "checked=\"checked\"";
|
} if($options['savecopy'] != "no") {
|
} if($options['savecopy'] != "no") {
|
$optionschecked['savecopy'] = "checked";
| $optionschecked['savecopy'] = "checked=\"checked\"";
|
} if($options['readreceipt'] != "no") {
|
} if($options['readreceipt'] != "no") {
|
$optionschecked['readreceipt'] = "checked";
| $optionschecked['readreceipt'] = "checked=\"checked\"";
|
} $to = htmlspecialchars_uni($mybb->input['to']); }
| } $to = htmlspecialchars_uni($mybb->input['to']); }
|
Zeile 224 | Zeile 237 |
---|
// Preview if($mybb->input['preview']) {
|
// Preview if($mybb->input['preview']) {
|
$options = $mybb->input['options'];
| |
$query = $db->query(" SELECT u.username AS userusername, u.*, f.*, g.title AS grouptitle, g.usertitle AS groupusertitle, g.namestyle, g.stars AS groupstars, g.starimage AS groupstarimage, g.image AS groupimage, g.usereputationsystem FROM ".TABLE_PREFIX."users u
| $query = $db->query(" SELECT u.username AS userusername, u.*, f.*, g.title AS grouptitle, g.usertitle AS groupusertitle, g.namestyle, g.stars AS groupstars, g.starimage AS groupstarimage, g.image AS groupimage, g.usereputationsystem FROM ".TABLE_PREFIX."users u
|
Zeile 330 | Zeile 342 |
---|
$query = $db->simple_select(TABLE_PREFIX."users", "username", "uid='".intval($mybb->input['uid'])."'"); $user = $db->fetch_array($query); $to = htmlspecialchars_uni($user['username']);
|
$query = $db->simple_select(TABLE_PREFIX."users", "username", "uid='".intval($mybb->input['uid'])."'"); $user = $db->fetch_array($query); $to = htmlspecialchars_uni($user['username']);
|
}
| }
|
// Load the auto complete javascript if it is enabled. eval("\$autocompletejs = \"".$templates->get("private_send_autocomplete")."\";");
| // Load the auto complete javascript if it is enabled. eval("\$autocompletejs = \"".$templates->get("private_send_autocomplete")."\";");
|
Zeile 344 | Zeile 356 |
---|
eval("\$send = \"".$templates->get("private_send")."\";"); $plugins->run_hooks("private_send_end"); output_page($send);
|
eval("\$send = \"".$templates->get("private_send")."\";"); $plugins->run_hooks("private_send_end"); output_page($send);
|
}
| }
|
if($mybb->input['action'] == "read") { $plugins->run_hooks("private_read");
| if($mybb->input['action'] == "read") { $plugins->run_hooks("private_read");
|
Zeile 376 | Zeile 388 |
---|
if($mybb->usergroup['cantrackpms'] == 'yes' && $mybb->usergroup['candenypmreceipts'] == 'yes' && $mybb->input['denyreceipt'] == "yes") { $receiptadd = "0";
|
if($mybb->usergroup['cantrackpms'] == 'yes' && $mybb->usergroup['candenypmreceipts'] == 'yes' && $mybb->input['denyreceipt'] == "yes") { $receiptadd = "0";
|
}
| }
|
else { $receiptadd = "2";
| else { $receiptadd = "2";
|
Zeile 402 | Zeile 414 |
---|
} $pm['userusername'] = $pm['username']; $pm['subject'] = htmlspecialchars_uni($parser->parse_badwords($pm['subject']));
|
} $pm['userusername'] = $pm['username']; $pm['subject'] = htmlspecialchars_uni($parser->parse_badwords($pm['subject']));
|
if($pm['fromid'] == -2)
| if($pm['fromid'] == 0)
|
{ $pm['username'] = "MyBB Engine"; }
| { $pm['username'] = "MyBB Engine"; }
|
Zeile 421 | Zeile 433 |
---|
$unreadmessages = ''; $query = $db->query(" SELECT pm.*, u.username as tousername
|
$unreadmessages = ''; $query = $db->query(" SELECT pm.*, u.username as tousername
|
FROM ".TABLE_PREFIX."privatemessages pm LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=pm.toid)
| FROM ".TABLE_PREFIX."privatemessages pm LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=pm.toid)
|
WHERE receipt='2' AND status!='0' AND fromid='".$mybb->user['uid']."' ORDER BY pm.readtime DESC ");
| WHERE receipt='2' AND status!='0' AND fromid='".$mybb->user['uid']."' ORDER BY pm.readtime DESC ");
|
Zeile 453 | Zeile 465 |
---|
} if($mybb->input['action'] == "do_tracking" && $mybb->request_method == "post") {
|
} if($mybb->input['action'] == "do_tracking" && $mybb->request_method == "post") {
|
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$plugins->run_hooks("private_do_tracking_start"); if($mybb->input['stoptracking']) {
| $plugins->run_hooks("private_do_tracking_start"); if($mybb->input['stoptracking']) {
|
Zeile 546 | Zeile 561 |
---|
if($mybb->input['action'] == "do_folders" && $mybb->request_method == "post") {
|
if($mybb->input['action'] == "do_folders" && $mybb->request_method == "post") {
|
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$plugins->run_hooks("private_do_folders_start"); $highestid = 2; $folders = '';
| $plugins->run_hooks("private_do_folders_start"); $highestid = 2; $folders = '';
|
Zeile 567 | Zeile 585 |
---|
} $fid = intval($key); switch($fid)
|
} $fid = intval($key); switch($fid)
|
{
| {
|
case 1: if($val == $lang->folder_inbox) {
| case 1: if($val == $lang->folder_inbox) {
|
Zeile 582 | Zeile 600 |
---|
break; case 3: if($val == $lang->folder_drafts)
|
break; case 3: if($val == $lang->folder_drafts)
|
{
| {
|
$val = ''; } break;
| $val = ''; } break;
|
Zeile 605 | Zeile 623 |
---|
$folders .= "$%%$"; } $folders .= "$fid**$foldername";
|
$folders .= "$%%$"; } $folders .= "$fid**$foldername";
|
} else {
| } else {
|
error($lang->error_invalidpmfoldername); }
|
error($lang->error_invalidpmfoldername); }
|
}
| }
|
else { $db->delete_query(TABLE_PREFIX."privatemessages", "folder='$fid' AND uid='".$mybb->user['uid']."'");
|
else { $db->delete_query(TABLE_PREFIX."privatemessages", "folder='$fid' AND uid='".$mybb->user['uid']."'");
|
} } }
| } } }
|
$sql_array = array( "pmfolders" => $folders ); $db->update_query(TABLE_PREFIX."users", $sql_array, "uid='".$mybb->user['uid']."'");
|
$sql_array = array( "pmfolders" => $folders ); $db->update_query(TABLE_PREFIX."users", $sql_array, "uid='".$mybb->user['uid']."'");
|
| // Update PM count update_pm_count();
|
$plugins->run_hooks("private_do_folders_end"); redirect("private.php", $lang->redirect_pmfoldersupdated); }
| $plugins->run_hooks("private_do_folders_end"); redirect("private.php", $lang->redirect_pmfoldersupdated); }
|
Zeile 644 | Zeile 664 |
---|
eval("\$folders = \"".$templates->get("private_empty")."\";"); $plugins->run_hooks("private_empty_end"); output_page($folders);
|
eval("\$folders = \"".$templates->get("private_empty")."\";"); $plugins->run_hooks("private_empty_end"); output_page($folders);
|
}
| }
|
if($mybb->input['action'] == "do_empty" && $mybb->request_method == "post") {
|
if($mybb->input['action'] == "do_empty" && $mybb->request_method == "post") {
|
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$plugins->run_hooks("private_do_empty_start"); $emptyq = ''; if(is_array($mybb->input['empty']))
| $plugins->run_hooks("private_do_empty_start"); $emptyq = ''; if(is_array($mybb->input['empty']))
|
Zeile 662 | Zeile 685 |
---|
$emptyq .= " OR "; } $emptyq .= "folder='$key'";
|
$emptyq .= " OR "; } $emptyq .= "folder='$key'";
|
} }
| } }
|
if($emptyq != '') { if($mybb->input['keepunread'] == "yes")
| if($emptyq != '') { if($mybb->input['keepunread'] == "yes")
|
Zeile 682 | Zeile 705 |
---|
if($mybb->input['action'] == "do_stuff" && $mybb->request_method == "post") {
|
if($mybb->input['action'] == "do_stuff" && $mybb->request_method == "post") {
|
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$plugins->run_hooks("private_do_stuff"); if($mybb->input['hop']) {
| $plugins->run_hooks("private_do_stuff"); if($mybb->input['hop']) {
|
Zeile 748 | Zeile 774 |
---|
if($mybb->input['action'] == "delete") {
|
if($mybb->input['action'] == "delete") {
|
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$plugins->run_hooks("private_delete_start");
$sql_array = array(
| $plugins->run_hooks("private_delete_start");
$sql_array = array(
|
Zeile 782 | Zeile 811 |
---|
if($mybb->input['action'] == "do_export" && $mybb->request_method == "post") {
|
if($mybb->input['action'] == "do_export" && $mybb->request_method == "post") {
|
if($mybb->input['exporttype'] != "csv" && $mybb->input['exporttype'] != "text" && $mybb->input['exporttype'] != "html") {
| if($mybb->input['exporttype'] != "csv" && $mybb->input['exporttype'] != "txt" && $mybb->input['exporttype'] != "html") {
|
exit; }
|
exit; }
|
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$plugins->run_hooks("private_do_export_start"); $lang->private_messages_for = sprintf($lang->private_messages_for, $mybb->user['username']); $exdate = my_date($mybb->settings['dateformat'], time(), 0, 0);
| $plugins->run_hooks("private_do_export_start"); $lang->private_messages_for = sprintf($lang->private_messages_for, $mybb->user['username']); $exdate = my_date($mybb->settings['dateformat'], time(), 0, 0);
|
Zeile 817 | Zeile 850 |
---|
$wsql = "1=1"; } if(is_array($mybb->input['exportfolders']))
|
$wsql = "1=1"; } if(is_array($mybb->input['exportfolders']))
|
{
| {
|
$folderlst = ''; reset($mybb->input['exportfolders']); foreach($mybb->input['exportfolders'] as $key => $val)
| $folderlst = ''; reset($mybb->input['exportfolders']); foreach($mybb->input['exportfolders'] as $key => $val)
|
Zeile 883 | Zeile 916 |
---|
else { $tofromusername = build_profile_link($message['tousername'], $tofromuid);
|
else { $tofromusername = build_profile_link($message['tousername'], $tofromuid);
|
} } else
| } } else
|
{ $tofromusername = $lang->not_sent; }
| { $tofromusername = $lang->not_sent; }
|
Zeile 895 | Zeile 928 |
---|
{ $tofromuid = $message['fromid']; if($mybb->input['exporttype'] == "txt")
|
{ $tofromuid = $message['fromid']; if($mybb->input['exporttype'] == "txt")
|
{
| {
|
$tofromusername = $message['fromusername'];
|
$tofromusername = $message['fromusername'];
|
}
| }
|
else { $tofromusername = build_profile_link($message['fromusername'], $tofromuid); }
|
else { $tofromusername = build_profile_link($message['fromusername'], $tofromuid); }
|
if($tofromuid == -2)
| if($tofromuid == 0)
|
{ $tofromusername = "MyBB Engine"; } $tofrom = $lang->from; }
|
{ $tofromusername = "MyBB Engine"; } $tofrom = $lang->from; }
|
if($tofromuid == -2)
| if($tofromuid == 0)
|
{ $message['fromusername'] = "MyBB Engine"; }
| { $message['fromusername'] = "MyBB Engine"; }
|
Zeile 1082 | Zeile 1116 |
---|
{ while($message = $db->fetch_array($query)) {
|
{ while($message = $db->fetch_array($query)) {
|
$msgalt = '';
| $msgalt = $msgsuffix = $msgprefix = '';
|
// Determine Folder Icon if($message['status'] == 0) { $msgfolder = 'new_pm.gif'; $msgalt = $lang->new_pm;
|
// Determine Folder Icon if($message['status'] == 0) { $msgfolder = 'new_pm.gif'; $msgalt = $lang->new_pm;
|
$doneunread = 1;
| $msgprefix = "<strong>"; $msgsuffix = "</strong>";
|
} elseif($message['status'] == 1) { $msgfolder = 'old_pm.gif'; $msgalt = $lang->old_pm;
|
} elseif($message['status'] == 1) { $msgfolder = 'old_pm.gif'; $msgalt = $lang->old_pm;
|
$doneread = 1;
| |
} elseif($message['status'] == 3) { $msgfolder = 're_pm.gif'; $msgalt = $lang->reply_pm;
|
} elseif($message['status'] == 3) { $msgfolder = 're_pm.gif'; $msgalt = $lang->reply_pm;
|
$doneread = 1;
| |
} elseif($message['status'] == 4) { $msgfolder = 'fw_pm.gif'; $msgalt = $lang->fwd_pm;
|
} elseif($message['status'] == 4) { $msgfolder = 'fw_pm.gif'; $msgalt = $lang->fwd_pm;
|
$doneread = 1;
| |
} if($folder == 2 || $folder == 3) { // Sent Items or Drafts Folder Check
| } if($folder == 2 || $folder == 3) { // Sent Items or Drafts Folder Check
|
Zeile 1124 | Zeile 1156 |
---|
{ $tofromusername = $message['fromusername']; $tofromuid = $message['fromid'];
|
{ $tofromusername = $message['fromusername']; $tofromuid = $message['fromid'];
|
if($tofromuid == -2)
| if($tofromuid == 0)
|
{ $tofromusername = 'MyBB Engine'; }
| { $tofromusername = 'MyBB Engine'; }
|
Zeile 1156 | Zeile 1188 |
---|
else { $senddate = $lang->not_sent;
|
else { $senddate = $lang->not_sent;
|
} if($doneunread && $doneread) { eval("\$messagelist .= \"".$templates->get("private_messagebit_sep")."\";"); $doneunread = 0; $doneread = 0;
| |
} eval("\$messagelist .= \"".$templates->get("private_messagebit")."\";");
|
} eval("\$messagelist .= \"".$templates->get("private_messagebit")."\";");
|
} }
| } }
|
else
|
else
|
{
| {
|
eval("\$messagelist .= \"".$templates->get("private_nomessages")."\";"); }
|
eval("\$messagelist .= \"".$templates->get("private_nomessages")."\";"); }
|
if($mybb->usergroup['pmquota'] != '0')
| if($mybb->usergroup['pmquota'] > 0)
|
{ $query = $db->simple_select(TABLE_PREFIX."privatemessages", "COUNT(*) AS total", "uid='".$mybb->user['uid']."'"); $pmscount = $db->fetch_array($query);
|
{ $query = $db->simple_select(TABLE_PREFIX."privatemessages", "COUNT(*) AS total", "uid='".$mybb->user['uid']."'"); $pmscount = $db->fetch_array($query);
|
$spaceused = $pmscount['total'] / $mybb->usergroup['pmquota'] * 100;
| if($pmscount['total'] == 0) { $spaceused = 0; } else { $spaceused = $pmscount['total'] / $mybb->usergroup['pmquota'] * 100; }
|
$spaceused2 = 100 - $spaceused; if($spaceused <= "50") {
| $spaceused2 = 100 - $spaceused; if($spaceused <= "50") {
|