Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: private.php 4031 2008-07-20 20:56:39Z Tikitiki $
| * $Id: private.php 4267 2008-11-10 21:28:36Z Tikitiki $
|
*/
define("IN_MYBB", 1);
|
*/
define("IN_MYBB", 1);
|
| define('THIS_SCRIPT', 'private.php');
|
$templatelist = "private_send,private_send_buddyselect,private_read,private_tracking,private_tracking_readmessage,private_tracking_unreadmessage"; $templatelist .= ",private_folders,private_folders_folder,private_folders_folder_unremovable,private,usercp_nav_changename,usercp_nav,private_empty_folder,private_empty,posticons";
| $templatelist = "private_send,private_send_buddyselect,private_read,private_tracking,private_tracking_readmessage,private_tracking_unreadmessage"; $templatelist .= ",private_folders,private_folders_folder,private_folders_folder_unremovable,private,usercp_nav_changename,usercp_nav,private_empty_folder,private_empty,posticons";
|
Zeile 60 | Zeile 61 |
---|
foreach($foldersexploded as $key => $folders) { $folderinfo = explode("**", $folders, 2);
|
foreach($foldersexploded as $key => $folders) { $folderinfo = explode("**", $folders, 2);
|
if($fid == $folderinfo[0])
| if($mybb->input['fid'] == $folderinfo[0])
|
{ $sel = ' selected="selected"'; }
| { $sel = ' selected="selected"'; }
|
Zeile 346 | Zeile 347 |
---|
// Get list of recipients $recipients = unserialize($pm['recipients']); $comma = '';
|
// Get list of recipients $recipients = unserialize($pm['recipients']); $comma = '';
|
$recipientids = $pm['fromid'];
| |
if(isset($recipients['to']) && is_array($recipients['to'])) { foreach($recipients['to'] as $recipient)
| if(isset($recipients['to']) && is_array($recipients['to'])) { foreach($recipients['to'] as $recipient)
|
Zeile 356 | Zeile 356 |
---|
$comma = ','; } }
|
$comma = ','; } }
|
|
|
if(isset($recipients['bcc']) && is_array($recipients['bcc']))
|
if(isset($recipients['bcc']) && is_array($recipients['bcc']))
|
{
| {
|
foreach($recipients['bcc'] as $recipient)
|
foreach($recipients['bcc'] as $recipient)
|
{
| {
|
$recipient_list['bcc'][] = $recipient; $recipientids .= $comma.$recipient; $comma = ',';
| $recipient_list['bcc'][] = $recipient; $recipientids .= $comma.$recipient; $comma = ',';
|
Zeile 373 | Zeile 373 |
---|
if(isset($recipients['bcc']) && is_array($recipients['bcc']) && in_array($user['uid'], $recipient_list['bcc'])) { $bcc .= htmlspecialchars_uni($user['username']).', ';
|
if(isset($recipients['bcc']) && is_array($recipients['bcc']) && in_array($user['uid'], $recipient_list['bcc'])) { $bcc .= htmlspecialchars_uni($user['username']).', ';
|
} else
| } else
|
{ $to .= htmlspecialchars_uni($user['username']).', '; }
| { $to .= htmlspecialchars_uni($user['username']).', '; }
|
Zeile 386 | Zeile 386 |
---|
$postdate = my_date($mybb->settings['dateformat'], $pm['dateline']); $posttime = my_date($mybb->settings['timeformat'], $pm['dateline']); $message = "[quote={$pm['quotename']}]\n$message\n[/quote]";
|
$postdate = my_date($mybb->settings['dateformat'], $pm['dateline']); $posttime = my_date($mybb->settings['timeformat'], $pm['dateline']); $message = "[quote={$pm['quotename']}]\n$message\n[/quote]";
|
$quoted['message'] = preg_replace('#^/me (.*)$#im', "* ".$pm['quotename']." \\1", $quoted['message']);
| $pm['message'] = preg_replace('#^/me (.*)$#im', "* ".$pm['quotename']." \\1", $pm['message']);
|
if($mybb->input['do'] == 'forward') { $subject = "Fw: $subject"; } elseif($mybb->input['do'] == 'reply')
|
if($mybb->input['do'] == 'forward') { $subject = "Fw: $subject"; } elseif($mybb->input['do'] == 'reply')
|
{
| {
|
$subject = "Re: $subject"; $uid = $pm['fromid']; if($mybb->user['uid'] == $uid)
| $subject = "Re: $subject"; $uid = $pm['fromid']; if($mybb->user['uid'] == $uid)
|
Zeile 413 | Zeile 413 |
---|
// Get list of recipients $recipients = unserialize($pm['recipients']);
|
// Get list of recipients $recipients = unserialize($pm['recipients']);
|
$recipientids = $pm['fromid'];
| |
if(isset($recipients['to']) && is_array($recipients['to'])) { foreach($recipients['to'] as $recipient)
| if(isset($recipients['to']) && is_array($recipients['to'])) { foreach($recipients['to'] as $recipient)
|
Zeile 467 | Zeile 466 |
---|
// See if it's actually worth showing the buddylist icon. if($mybb->user['buddylist'] != '')
|
// See if it's actually worth showing the buddylist icon. if($mybb->user['buddylist'] != '')
|
{
| {
|
$buddy_select = 'to'; eval("\$buddy_select_to = \"".$templates->get("private_send_buddyselect")."\";"); $buddy_select = 'bcc'; eval("\$buddy_select_bcc = \"".$templates->get("private_send_buddyselect")."\";"); }
|
$buddy_select = 'to'; eval("\$buddy_select_to = \"".$templates->get("private_send_buddyselect")."\";"); $buddy_select = 'bcc'; eval("\$buddy_select_bcc = \"".$templates->get("private_send_buddyselect")."\";"); }
|
|
|
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");
$pmid = intval($mybb->input['pmid']);
|
if($mybb->input['action'] == "read") { $plugins->run_hooks("private_read");
$pmid = intval($mybb->input['pmid']);
|
|
|
$query = $db->query(" SELECT pm.*, u.*, f.*, g.title AS grouptitle, g.usertitle AS groupusertitle, g.stars AS groupstars, g.starimage AS groupstarimage, g.image AS groupimage, g.namestyle FROM ".TABLE_PREFIX."privatemessages pm
| $query = $db->query(" SELECT pm.*, u.*, f.*, g.title AS grouptitle, g.usertitle AS groupusertitle, g.stars AS groupstars, g.starimage AS groupstarimage, g.image AS groupimage, g.namestyle FROM ".TABLE_PREFIX."privatemessages pm
|
Zeile 499 | Zeile 498 |
---|
{ header("Location: private.php?action=send&pmid={$pm['pmid']}"); exit;
|
{ header("Location: private.php?action=send&pmid={$pm['pmid']}"); exit;
|
}
| }
|
if(!$pm['pmid']) { error($lang->error_invalidpm);
|
if(!$pm['pmid']) { error($lang->error_invalidpm);
|
}
| }
|
if($pm['receipt'] == 1) { if($mybb->usergroup['cantrackpms'] == 1 && $mybb->usergroup['candenypmreceipts'] == 1 && $mybb->input['denyreceipt'] == 1)
| if($pm['receipt'] == 1) { if($mybb->usergroup['cantrackpms'] == 1 && $mybb->usergroup['candenypmreceipts'] == 1 && $mybb->input['denyreceipt'] == 1)
|
Zeile 552 | Zeile 551 |
---|
if($reply_date == $lang->today || $reply_date == $lang->yesterday) {
|
if($reply_date == $lang->today || $reply_date == $lang->yesterday) {
|
$reply_data .= ', '.my_date($mybb->settings['timeformat'], $pm['statustime']);
| $reply_date .= ', '.my_date($mybb->settings['timeformat'], $pm['statustime']);
|
$actioned_on = $lang->sprintf($lang->you_replied, $reply_date); } else {
|
$actioned_on = $lang->sprintf($lang->you_replied, $reply_date); } else {
|
$reply_data .= ', '.my_date($mybb->settings['timeformat'], $pm['statustime']);
| $reply_date .= ', '.my_date($mybb->settings['timeformat'], $pm['statustime']);
|
$actioned_on = $lang->sprintf($lang->you_replied_on, $reply_date); }
| $actioned_on = $lang->sprintf($lang->you_replied_on, $reply_date); }
|
Zeile 567 | Zeile 566 |
---|
{ $forward_date = my_date($mybb->settings['dateformat'], $pm['statustime']);
|
{ $forward_date = my_date($mybb->settings['dateformat'], $pm['statustime']);
|
if(strpos($forward_date, $lang->today) !== false || strpos($forward_date, $lang->yesturday) !== false)
| if(strpos($forward_date, $lang->today) !== false || strpos($forward_date, $lang->yesterday) !== false)
|
{ $forward_date .= ', '.my_date($mybb->settings['timeformat'], $pm['statustime']); $actioned_on = $lang->sprintf($lang->you_forwarded, $forward_date);
| { $forward_date .= ', '.my_date($mybb->settings['timeformat'], $pm['statustime']); $actioned_on = $lang->sprintf($lang->you_forwarded, $forward_date);
|
Zeile 599 | Zeile 598 |
---|
{ $uid_sql = $pm['toid']; $pm['recipients']['to'] = array($pm['toid']);
|
{ $uid_sql = $pm['toid']; $pm['recipients']['to'] = array($pm['toid']);
|
}
| }
|
$show_bcc = 0;
// If we have any BCC recipients and this user is an Administrator, add them on to the query if(count($pm['recipients']['bcc']) > 0 && $mybb->usergroup['cancp'] == 1)
|
$show_bcc = 0;
// If we have any BCC recipients and this user is an Administrator, add them on to the query if(count($pm['recipients']['bcc']) > 0 && $mybb->usergroup['cancp'] == 1)
|
{
| {
|
$show_bcc = 1; $uid_sql .= ','.implode(',', $pm['recipients']['bcc']); }
| $show_bcc = 1; $uid_sql .= ','.implode(',', $pm['recipients']['bcc']); }
|
Zeile 619 | Zeile 618 |
---|
if($show_bcc && in_array($recipient['uid'], $pm['recipients']['bcc'])) { $bcc_recipients[] = build_profile_link($recipient['username'], $recipient['uid']);
|
if($show_bcc && in_array($recipient['uid'], $pm['recipients']['bcc'])) { $bcc_recipients[] = build_profile_link($recipient['username'], $recipient['uid']);
|
}
| }
|
// User is a normal recipient else if(in_array($recipient['uid'], $pm['recipients']['to'])) { $to_recipients[] = build_profile_link($recipient['username'], $recipient['uid']); }
|
// User is a normal recipient else if(in_array($recipient['uid'], $pm['recipients']['to'])) { $to_recipients[] = build_profile_link($recipient['username'], $recipient['uid']); }
|
}
| }
|
if(count($bcc_recipients) > 0)
|
if(count($bcc_recipients) > 0)
|
{
| {
|
$bcc_recipients = implode(', ', $bcc_recipients); eval("\$bcc = \"".$templates->get("private_read_bcc")."\";"); }
| $bcc_recipients = implode(', ', $bcc_recipients); eval("\$bcc = \"".$templates->get("private_read_bcc")."\";"); }
|
Zeile 637 | Zeile 636 |
---|
if(count($to_recipients) > 1) { $replyall = true;
|
if(count($to_recipients) > 1) { $replyall = true;
|
}
| }
|
if(count($to_recipients) > 0)
|
if(count($to_recipients) > 0)
|
{
| {
|
$to_recipients = implode(", ", $to_recipients);
|
$to_recipients = implode(", ", $to_recipients);
|
}
| }
|
else { $to_recipients = $lang->nobody;
| else { $to_recipients = $lang->nobody;
|
Zeile 655 | Zeile 654 |
---|
eval("\$read = \"".$templates->get("private_read")."\";"); $plugins->run_hooks("private_read_end"); output_page($read);
|
eval("\$read = \"".$templates->get("private_read")."\";"); $plugins->run_hooks("private_read_end"); output_page($read);
|
}
| }
|
if($mybb->input['action'] == "tracking") {
| if($mybb->input['action'] == "tracking") {
|
Zeile 763 | Zeile 762 |
---|
$pmuids[$pm['uid']] = $pm['uid']; }
|
$pmuids[$pm['uid']] = $pm['uid']; }
|
$db->delete_query("privatemessages", "pmid IN ($pmids) AND fromid='".$mybb->user['uid']."'");
| $db->delete_query("privatemessages", "pmid IN ($pmids) AND receipt='1' AND status='0' AND fromid='".$mybb->user['uid']."'");
|
foreach($pmuids as $uid) { // Message is canceled, update PM count for this user
|
foreach($pmuids as $uid) { // Message is canceled, update PM count for this user
|
update_pm_count($pm['uid']);
| update_pm_count($uid);
|
} } $plugins->run_hooks("private_do_tracking_end");
| } } $plugins->run_hooks("private_do_tracking_end");
|
Zeile 952 | Zeile 951 |
---|
foreach($mybb->input['empty'] as $key => $val) { if($val == 1)
|
foreach($mybb->input['empty'] as $key => $val) { if($val == 1)
|
{
| {
|
$key = intval($key); if($emptyq) {
| $key = intval($key); if($emptyq) {
|
Zeile 1133 | Zeile 1132 |
---|
{ $wsql .= "<="; }
|
{ $wsql .= "<="; }
|
elseif($mybb->input['dayway'] == "newer")
| else
|
{ $wsql .= ">="; }
| { $wsql .= ">="; }
|
Zeile 1177 | Zeile 1176 |
---|
else { error($lang->error_pmnoarchivefolders);
|
else { error($lang->error_pmnoarchivefolders);
|
}
| }
|
if($mybb->input['exportunread'] != 1) {
| if($mybb->input['exportunread'] != 1) {
|
Zeile 1220 | Zeile 1219 |
---|
$tofromusername = $lang->not_sent; } $tofrom = $lang->to;
|
$tofromusername = $lang->not_sent; } $tofrom = $lang->to;
|
}
| }
|
else { $tofromuid = $message['fromid'];
| else { $tofromuid = $message['fromid'];
|
Zeile 1248 | Zeile 1247 |
---|
if(!$message['toid'] && $message['folder'] == 3) { $message['tousername'] = $lang->not_sent;
|
if(!$message['toid'] && $message['folder'] == 3) { $message['tousername'] = $lang->not_sent;
|
}
| }
|
$message['subject'] = $parser->parse_badwords($message['subject']); if($message['folder'] != "3")
| $message['subject'] = $parser->parse_badwords($message['subject']); if($message['folder'] != "3")
|
Zeile 1274 | Zeile 1273 |
---|
);
$message['message'] = $parser->parse_message($message['message'], $parser_options);
|
);
$message['message'] = $parser->parse_message($message['message'], $parser_options);
|
| $message['subject'] = htmlspecialchars_uni($message['subject']);
|
} if($mybb->input['exporttype'] == "txt" || $mybb->input['exporttype'] == "csv")
| } if($mybb->input['exporttype'] == "txt" || $mybb->input['exporttype'] == "csv")
|
Zeile 1302 | Zeile 1302 |
---|
$foldername = $folderinfo[1]; if($mybb->input['exporttype'] != "csv") {
|
$foldername = $folderinfo[1]; if($mybb->input['exporttype'] != "csv") {
|
eval("\$pmsdownload .= \"".$templates->get("private_archive_".$nmybb->input['exporttype']."_folderhead", 1, 0)."\";");
| if($mybb->input['exporttype'] != "html") { $mybb->input['exporttype'] == "txt"; } eval("\$pmsdownload .= \"".$templates->get("private_archive_".$mybb->input['exporttype']."_folderhead", 1, 0)."\";");
|
} else {
| } else {
|
Zeile 1342 | Zeile 1346 |
---|
{ $filename = "pm-archive.txt"; $contenttype = "text/plain";
|
{ $filename = "pm-archive.txt"; $contenttype = "text/plain";
|
}
| }
|
$archived = str_replace("\\\'","'",$archived); header("Content-disposition: filename=$filename");
| $archived = str_replace("\\\'","'",$archived); header("Content-disposition: filename=$filename");
|
Zeile 1378 | Zeile 1382 |
---|
$folder = $folderinfo[0]; $foldername = get_pm_folder_name($folder, $folderinfo[1]); }
|
$folder = $folderinfo[0]; $foldername = get_pm_folder_name($folder, $folderinfo[1]); }
|
}
| }
|
$lang->pms_in_folder = $lang->sprintf($lang->pms_in_folder, $foldername); if($folder == 2 || $folder == 3) { // Sent Items Folder $sender = $lang->sentto;
|
$lang->pms_in_folder = $lang->sprintf($lang->pms_in_folder, $foldername); if($folder == 2 || $folder == 3) { // Sent Items Folder $sender = $lang->sentto;
|
}
| }
|
else
|
else
|
{
| {
|
$sender = $lang->sender; }
| $sender = $lang->sender; }
|
Zeile 1397 | Zeile 1401 |
---|
if(!$mybb->settings['threadsperpage']) { $mybb->settings['threadsperpage'] = 20;
|
if(!$mybb->settings['threadsperpage']) { $mybb->settings['threadsperpage'] = 20;
|
}
| }
|
$perpage = $mybb->settings['threadsperpage']; $page = intval($mybb->input['page']);
| $perpage = $mybb->settings['threadsperpage']; $page = intval($mybb->input['page']);
|
Zeile 1415 | Zeile 1419 |
---|
$end = $start + $perpage; $lower = $start+1; $upper = $end;
|
$end = $start + $perpage; $lower = $start+1; $upper = $end;
|
|
|
if($upper > $threadcount) { $upper = $threadcount;
| if($upper > $threadcount) { $upper = $threadcount;
|
Zeile 1430 | Zeile 1434 |
---|
{ // Get all recipients into an array $cached_users = $get_users = array();
|
{ // Get all recipients into an array $cached_users = $get_users = array();
|
$users_query = $db->simple_select("privatemessages", "recipients", "folder='$folder' AND uid='{$mybb->user['uid']}'", array('limit_start' => $start, 'limit' => $per_page));
| $users_query = $db->simple_select("privatemessages", "recipients", "folder='$folder' AND uid='{$mybb->user['uid']}'", array('limit_start' => $start, 'limit' => $perpage));
|
while($row = $db->fetch_array($users_query)) { $recipients = unserialize($row['recipients']);
| while($row = $db->fetch_array($users_query)) { $recipients = unserialize($row['recipients']);
|
Zeile 1452 | Zeile 1456 |
---|
{ $users_query = $db->simple_select("users", "uid, username, usergroup, displaygroup", "uid IN ({$get_users})"); while($user = $db->fetch_array($users_query))
|
{ $users_query = $db->simple_select("users", "uid, username, usergroup, displaygroup", "uid IN ({$get_users})"); while($user = $db->fetch_array($users_query))
|
{
| {
|
$cached_users[$user['uid']] = $user; } }
| $cached_users[$user['uid']] = $user; } }
|
Zeile 1525 | Zeile 1529 |
---|
eval("\$tofromusername = \"".$templates->get("private_multiple_recipients")."\";"); } else if($message['toid'])
|
eval("\$tofromusername = \"".$templates->get("private_multiple_recipients")."\";"); } else if($message['toid'])
|
{
| {
|
$tofromusername = $message['tousername']; $tofromuid = $message['toid'];
|
$tofromusername = $message['tousername']; $tofromuid = $message['toid'];
|
}
| }
|
else
|
else
|
{
| {
|
$tofromusername = $lang->not_sent;
|
$tofromusername = $lang->not_sent;
|
}
| }
|
} else {
| } else {
|
Zeile 1544 | Zeile 1548 |
---|
} }
|
} }
|
if($tofromuid != 0) { $tofromusername = build_profile_link($tofromusername, $tofromuid); }
| $tofromusername = build_profile_link($tofromusername, $tofromuid);
|
if($mybb->usergroup['cantrackpms'] == 1 && $mybb->usergroup['candenypmreceipts'] == 1 && $message['receipt'] == '1' && $message['folder'] != '3' && $message['folder'] != 2) {
| if($mybb->usergroup['cantrackpms'] == 1 && $mybb->usergroup['candenypmreceipts'] == 1 && $message['receipt'] == '1' && $message['folder'] != '3' && $message['folder'] != 2) {
|