Zeile 12 | Zeile 12 |
---|
define("IGNORE_CLEAN_VARS", "sid"); define('THIS_SCRIPT', 'private.php');
|
define("IGNORE_CLEAN_VARS", "sid"); define('THIS_SCRIPT', 'private.php');
|
$templatelist = "private_send,private_send_buddyselect,private_read,private_tracking,private_tracking_readmessage,private_tracking_unreadmessage,private_orderarrow,usercp_nav_attachments,usercp_nav_messenger_compose,private_tracking_readmessage_stop"; $templatelist .= ",private_folders,private_folders_folder,private_folders_folder_unremovable,private,usercp_nav,private_empty_folder,private_empty,private_archive_txt,private_archive_csv,private_archive_html,private_tracking_unreadmessage_stop"; $templatelist .= ",usercp_nav_messenger,usercp_nav_changename,usercp_nav_profile,usercp_nav_misc,multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start,usercp_nav_editsignature,posticons_icon"; $templatelist .= ",private_messagebit,codebuttons,smilieinsert,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,posticons,private_send_autocomplete,private_messagebit_denyreceipt,private_read_to,postbit_online,postbit_warninglevel_formatted,postbit_iplogged_hiden";
| $templatelist = "private_send,private_send_buddyselect,private_tracking,private_tracking_readmessage,private_tracking_unreadmessage,usercp_nav_attachments,usercp_nav_messenger_compose,private_tracking_readmessage_stop"; $templatelist .= ",private_folders,private_folders_folder,private_folders_folder_unremovable,private,usercp_nav,private_empty_folder,private_archive_txt,private_archive_csv,private_archive_html,private_tracking_unreadmessage_stop"; $templatelist .= ",usercp_nav_messenger,usercp_nav_changename,multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start"; $templatelist .= ",private_messagebit,codebuttons,posticons,private_send_autocomplete,private_messagebit_denyreceipt,postbit_warninglevel_formatted,private_emptyexportlink,postbit_purgespammer,postbit_gotopost,private_read";
|
$templatelist .= ",postbit_delete_pm,postbit,private_tracking_nomessage,private_nomessages,postbit_author_guest,private_multiple_recipients_user,private_multiple_recipients_bcc,private_multiple_recipients,usercp_nav_messenger_folder";
|
$templatelist .= ",postbit_delete_pm,postbit,private_tracking_nomessage,private_nomessages,postbit_author_guest,private_multiple_recipients_user,private_multiple_recipients_bcc,private_multiple_recipients,usercp_nav_messenger_folder";
|
$templatelist .= ",private_search_messagebit,private_search_results_nomessages,private_search_results,private_advanced_search,previewpost,private_send_tracking,private_send_signature,private_read_bcc,private_composelink,postbit_purgespammer"; $templatelist .= ",private_archive,private_quickreply,private_pmspace,private_limitwarning,postbit_groupimage,postbit_offline,postbit_www,postbit_replyall_pm,postbit_signature,postbit_classic,postbit_gotopost,postbit_userstar,postbit_reputation_formatted_link,postbit_icon"; $templatelist .= ",private_archive_folders_folder,private_archive_folders,postbit_warninglevel,postbit_author_user,postbit_reply_pm,postbit_forward_pm,private_messagebit_icon,private_jump_folders_folder,private_advanced_search_folders"; $templatelist .= ",private_jump_folders,postbit_avatar,postbit_warn,postbit_rep_button,postbit_email,postbit_reputation,private_move,private_read_action,postbit_away,postbit_pm,usercp_nav_messenger_tracking,postbit_find,private_emptyexportlink";
| $templatelist .= ",private_search_messagebit,private_search_results_nomessages,private_search_results,private_advanced_search,previewpost,private_send_tracking,private_send_signature,private_read_bcc,private_composelink"; $templatelist .= ",private_archive,private_quickreply,private_pmspace,private_limitwarning,postbit_groupimage,postbit_offline,postbit_www,postbit_replyall_pm,postbit_signature,postbit_classic,postbit_reputation_formatted_link"; $templatelist .= ",private_archive_folders_folder,private_archive_folders,postbit_warninglevel,postbit_author_user,postbit_forward_pm,private_messagebit_icon,private_jump_folders_folder,private_advanced_search_folders,usercp_nav_home"; $templatelist .= ",private_jump_folders,postbit_avatar,postbit_warn,postbit_rep_button,postbit_email,postbit_reputation,private_move,private_read_action,postbit_away,postbit_pm,usercp_nav_messenger_tracking,postbit_find"; $templatelist .= ",usercp_nav_editsignature,posticons_icon,postbit_icon,postbit_iplogged_hiden,usercp_nav_profile,usercp_nav_misc,postbit_userstar,private_read_to,postbit_online,private_empty,private_orderarrow,postbit_reply_pm";
|
require_once "./global.php"; require_once MYBB_ROOT."inc/functions_post.php";
| require_once "./global.php"; require_once MYBB_ROOT."inc/functions_post.php";
|
Zeile 39 | Zeile 40 |
---|
if($mybb->user['uid'] == '/' || $mybb->user['uid'] == 0 || $mybb->usergroup['canusepms'] == 0) { error_no_permission();
|
if($mybb->user['uid'] == '/' || $mybb->user['uid'] == 0 || $mybb->usergroup['canusepms'] == 0) { error_no_permission();
|
}
if(!$mybb->user['pmfolders']) { $mybb->user['pmfolders'] = "1**$%%$2**$%%$3**$%%$4**";
$sql_array = array( "pmfolders" => $mybb->user['pmfolders'] ); $db->update_query("users", $sql_array, "uid = ".$mybb->user['uid']); }
// On a random occassion, recount the user's pms just to make sure everything is in sync. $rand = my_rand(0, 9); if($rand == 5) { update_pm_count();
| |
}
$mybb->input['fid'] = $mybb->get_input('fid', MyBB::INPUT_INT);
|
}
$mybb->input['fid'] = $mybb->get_input('fid', MyBB::INPUT_INT);
|
$folder_id = $folder_name = '';
| $folder_id = $folder_name = $folderjump_folder = $folderoplist_folder = $foldersearch_folder ='';
|
$foldernames = array(); $foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
| $foldernames = array(); $foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
|
Zeile 70 | Zeile 54 |
---|
if($mybb->input['fid'] == $folderinfo[0]) { $sel = ' selected="selected"';
|
if($mybb->input['fid'] == $folderinfo[0]) { $sel = ' selected="selected"';
|
}
| }
|
else { $sel = ''; } $folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]); $foldernames[$folderinfo[0]] = $folderinfo[1];
|
else { $sel = ''; } $folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]); $foldernames[$folderinfo[0]] = $folderinfo[1];
|
|
|
$folder_id = $folderinfo[0]; $folder_name = $folderinfo[1];
eval("\$folderjump_folder .= \"".$templates->get("private_jump_folders_folder")."\";");
|
$folder_id = $folderinfo[0]; $folder_name = $folderinfo[1];
eval("\$folderjump_folder .= \"".$templates->get("private_jump_folders_folder")."\";");
|
eval("\$folderoplist_folder .= \"".$templates->get("private_jump_folders_folder")."\";"); eval("\$foldersearch_folder .= \"".$templates->get("private_jump_folders_folder")."\";");
| // Manipulate search folder selection & move selector to omit "Unread" if($folder_id != 1) { if($folder_id == 0) { $folder_id = 1; } eval("\$folderoplist_folder .= \"".$templates->get("private_jump_folders_folder")."\";"); eval("\$foldersearch_folder .= \"".$templates->get("private_jump_folders_folder")."\";"); }
|
}
|
}
|
| $from_fid = $mybb->input['fid'];
|
eval("\$folderjump = \"".$templates->get("private_jump_folders")."\";"); eval("\$folderoplist = \"".$templates->get("private_move")."\";");
| eval("\$folderjump = \"".$templates->get("private_jump_folders")."\";"); eval("\$folderoplist = \"".$templates->get("private_move")."\";");
|
Zeile 214 | Zeile 209 |
---|
$plugins->run_hooks("private_do_search_process");
$db->insert_query("searchlog", $searcharray);
|
$plugins->run_hooks("private_do_search_process");
$db->insert_query("searchlog", $searcharray);
|
|
|
// Sender sort won't work yet $sortby = array('subject', 'sender', 'dateline');
| // Sender sort won't work yet $sortby = array('subject', 'sender', 'dateline');
|
Zeile 282 | Zeile 277 |
---|
{ $mybb->settings['threadsperpage'] = 20; }
|
{ $mybb->settings['threadsperpage'] = 20; }
|
| $query = $db->simple_select("privatemessages", "COUNT(*) AS total", "pmid IN(".$db->escape_string($search['querycache']).")"); $pmscount = $db->fetch_field($query, "total");
|
// Work out pagination, which page we're at, as well as the limits. $perpage = $mybb->settings['threadsperpage'];
| // Work out pagination, which page we're at, as well as the limits. $perpage = $mybb->settings['threadsperpage'];
|
Zeile 289 | Zeile 287 |
---|
if($page > 0) { $start = ($page-1) * $perpage;
|
if($page > 0) { $start = ($page-1) * $perpage;
|
}
| $pages = ceil($pmscount / $perpage); if($page > $pages) { $start = 0; $page = 1; } }
|
else { $start = 0;
| else { $start = 0;
|
Zeile 307 | Zeile 311 |
---|
}
// Do Multi Pages
|
}
// Do Multi Pages
|
$query = $db->simple_select("privatemessages", "COUNT(*) AS total", "pmid IN(".$db->escape_string($search['querycache']).")"); $pmscount = $db->fetch_array($query);
| |
if($upper > $pmscount) { $upper = $pmscount; }
|
if($upper > $pmscount) { $upper = $pmscount; }
|
$multipage = multipage($pmscount['total'], $perpage, $page, "private.php?action=results&sid=".htmlspecialchars_uni($mybb->get_input('sid'))."&sortby={$sortby}&order={$order}");
| $multipage = multipage($pmscount, $perpage, $page, "private.php?action=results&sid=".htmlspecialchars_uni($mybb->get_input('sid'))."&sortby={$sortby}&order={$order}");
|
$messagelist = '';
$icon_cache = $cache->read("posticons");
| $messagelist = '';
$icon_cache = $cache->read("posticons");
|
Zeile 326 | Zeile 327 |
---|
while($row = $db->fetch_array($users_query)) { $recipients = my_unserialize($row['recipients']);
|
while($row = $db->fetch_array($users_query)) { $recipients = my_unserialize($row['recipients']);
|
if(is_array($recipients['to']) && count($recipients['to']))
| if(isset($recipients['to']) && is_array($recipients['to']) && count($recipients['to']))
|
{ $get_users = array_merge($get_users, $recipients['to']); }
| { $get_users = array_merge($get_users, $recipients['to']); }
|
Zeile 360 | Zeile 361 |
---|
"); while($message = $db->fetch_array($query)) {
|
"); while($message = $db->fetch_array($query)) {
|
$msgalt = $msgsuffix = $msgprefix = '';
| $msgalt = $msgstatus = '';
|
// Determine Folder Icon if($message['status'] == 0) {
|
// Determine Folder Icon if($message['status'] == 0) {
|
$msgfolder = 'new_pm.png';
| $msgstatus = 'new_pm';
|
$msgalt = $lang->new_pm;
|
$msgalt = $lang->new_pm;
|
$msgprefix = "<strong>"; $msgsuffix = "</strong>";
| |
}
|
}
|
elseif($message['status'] == 1)
| else if($message['status'] == 1)
|
{
|
{
|
$msgfolder = 'old_pm.png';
| $msgstatus = 'old_pm';
|
$msgalt = $lang->old_pm; }
|
$msgalt = $lang->old_pm; }
|
elseif($message['status'] == 3)
| else if($message['status'] == 3)
|
{
|
{
|
$msgfolder = 're_pm.png';
| $msgstatus = 're_pm';
|
$msgalt = $lang->reply_pm; } else if($message['status'] == 4) {
|
$msgalt = $lang->reply_pm; } else if($message['status'] == 4) {
|
$msgfolder = 'fw_pm.png';
| $msgstatus = 'fw_pm';
|
$msgalt = $lang->fwd_pm; }
| $msgalt = $lang->fwd_pm; }
|
Zeile 394 | Zeile 393 |
---|
// Sent Items or Drafts Folder Check $recipients = my_unserialize($message['recipients']); $to_users = $bcc_users = '';
|
// Sent Items or Drafts Folder Check $recipients = my_unserialize($message['recipients']); $to_users = $bcc_users = '';
|
if(count($recipients['to']) > 1 || (count($recipients['to']) == 1 && isset($recipients['bcc']) && count($recipients['bcc']) > 0))
| if( isset($recipients['to']) && (count($recipients['to']) > 1 || (count($recipients['to']) == 1 && isset($recipients['bcc']) && count($recipients['bcc']) > 0)) )
|
{ foreach($recipients['to'] as $uid) { $profilelink = get_profile_link($uid); $user = $cached_users[$uid];
|
{ foreach($recipients['to'] as $uid) { $profilelink = get_profile_link($uid); $user = $cached_users[$uid];
|
| $user['username'] = htmlspecialchars_uni($user['username']);
|
$username = format_name($user['username'], $user['usergroup'], $user['displaygroup']); eval("\$to_users .= \"".$templates->get("private_multiple_recipients_user")."\";"); }
| $username = format_name($user['username'], $user['usergroup'], $user['displaygroup']); eval("\$to_users .= \"".$templates->get("private_multiple_recipients_user")."\";"); }
|
Zeile 410 | Zeile 413 |
---|
{ $profilelink = get_profile_link($uid); $user = $cached_users[$uid];
|
{ $profilelink = get_profile_link($uid); $user = $cached_users[$uid];
|
| $user['username'] = htmlspecialchars_uni($user['username']);
|
$username = format_name($user['username'], $user['usergroup'], $user['displaygroup']); eval("\$bcc_users .= \"".$templates->get("private_multiple_recipients_user")."\";"); }
| $username = format_name($user['username'], $user['usergroup'], $user['displaygroup']); eval("\$bcc_users .= \"".$templates->get("private_multiple_recipients_user")."\";"); }
|
Zeile 419 | Zeile 423 |
---|
} else if($message['toid']) {
|
} else if($message['toid']) {
|
$tofromusername = $message['tousername'];
| $tofromusername = htmlspecialchars_uni($message['tousername']);
|
$tofromuid = $message['toid']; } else
| $tofromuid = $message['toid']; } else
|
Zeile 429 | Zeile 433 |
---|
} else {
|
} else {
|
$tofromusername = $message['fromusername'];
| $tofromusername = htmlspecialchars_uni($message['fromusername']);
|
$tofromuid = $message['fromid']; if($tofromuid == 0) {
| $tofromuid = $message['fromid']; if($tofromuid == 0) {
|
Zeile 479 | Zeile 483 |
---|
$senddate = $lang->not_sent; }
|
$senddate = $lang->not_sent; }
|
$foldername = $foldernames[$message['folder']];
| $fid = "0"; if((int)$message['folder'] > 1) { $fid = $message['folder']; } $foldername = $foldernames[$fid];
|
// What we do here is parse the post using our post parser, then strip the tags from it $parser_options = array(
| // What we do here is parse the post using our post parser, then strip the tags from it $parser_options = array(
|
Zeile 494 | Zeile 503 |
---|
{ $message['message'] = my_substr($message['message'], 0, 200)."..."; }
|
{ $message['message'] = my_substr($message['message'], 0, 200)."..."; }
|
|
|
eval("\$messagelist .= \"".$templates->get("private_search_messagebit")."\";"); }
if($db->num_rows($query) == 0)
|
eval("\$messagelist .= \"".$templates->get("private_search_messagebit")."\";"); }
if($db->num_rows($query) == 0)
|
{
| {
|
eval("\$messagelist = \"".$templates->get("private_search_results_nomessages")."\";"); }
| eval("\$messagelist = \"".$templates->get("private_search_results_nomessages")."\";"); }
|
Zeile 537 | Zeile 546 |
---|
if(!empty($mybb->input['ajax'])) { echo 1;
|
if(!empty($mybb->input['ajax'])) { echo 1;
|
exit; } else
| exit; } else
|
{ header("Location: index.php"); exit;
| { header("Location: index.php"); exit;
|
Zeile 547 | Zeile 556 |
---|
}
$send_errors = '';
|
}
$send_errors = '';
|
|
|
if($mybb->input['action'] == "do_send" && $mybb->request_method == "post") { if($mybb->usergroup['cansendpms'] == 0) { error_no_permission(); }
|
if($mybb->input['action'] == "do_send" && $mybb->request_method == "post") { if($mybb->usergroup['cansendpms'] == 0) { error_no_permission(); }
|
|
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
$plugins->run_hooks("private_send_do_send");
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
$plugins->run_hooks("private_send_do_send");
|
|
|
// Attempt to see if this PM is a duplicate or not
|
// Attempt to see if this PM is a duplicate or not
|
| $to = array_map("trim", explode(",", $mybb->get_input('to'))); $to = array_unique($to); // Filter out any duplicates $to_escaped = implode("','", array_map(array($db, 'escape_string'), array_map('my_strtolower', $to)));
|
$time_cutoff = TIME_NOW - (5 * 60 * 60); $query = $db->query(" SELECT pm.pmid FROM ".TABLE_PREFIX."privatemessages pm LEFT JOIN ".TABLE_PREFIX."users u ON(u.uid=pm.toid)
|
$time_cutoff = TIME_NOW - (5 * 60 * 60); $query = $db->query(" SELECT pm.pmid FROM ".TABLE_PREFIX."privatemessages pm LEFT JOIN ".TABLE_PREFIX."users u ON(u.uid=pm.toid)
|
WHERE LOWER(u.username)='".$db->escape_string(my_strtolower($mybb->get_input('to')))."' AND pm.dateline > {$time_cutoff} AND pm.fromid='{$mybb->user['uid']}' AND pm.subject='".$db->escape_string($mybb->get_input('subject'))."' AND pm.message='".$db->escape_string($mybb->get_input('message'))."' AND pm.folder!='3'
| WHERE LOWER(u.username) IN ('{$to_escaped}') AND pm.dateline > {$time_cutoff} AND pm.fromid='{$mybb->user['uid']}' AND pm.subject='".$db->escape_string($mybb->get_input('subject'))."' AND pm.message='".$db->escape_string($mybb->get_input('message'))."' AND pm.folder!='3' LIMIT 0, 1
|
");
|
");
|
$duplicate_check = $db->fetch_field($query, "pmid"); if($duplicate_check)
| if($db->num_rows($query) > 0)
|
{ error($lang->error_pm_already_submitted); }
| { error($lang->error_pm_already_submitted); }
|
Zeile 588 | Zeile 600 |
---|
);
// Split up any recipients we have
|
);
// Split up any recipients we have
|
$pm['to'] = explode(",", $mybb->get_input('to')); $pm['to'] = array_map("trim", $pm['to']);
| $pm['to'] = $to;
|
if(!empty($mybb->input['bcc'])) { $pm['bcc'] = explode(",", $mybb->get_input('bcc'));
| if(!empty($mybb->input['bcc'])) { $pm['bcc'] = explode(",", $mybb->get_input('bcc'));
|
Zeile 641 | Zeile 652 |
---|
$pm_errors = $pmhandler->get_friendly_errors(); $send_errors = inline_error($pm_errors); $mybb->input['action'] = "send";
|
$pm_errors = $pmhandler->get_friendly_errors(); $send_errors = inline_error($pm_errors); $mybb->input['action'] = "send";
|
} else {
| } else {
|
$pminfo = $pmhandler->insert_pm(); $plugins->run_hooks("private_do_send_end");
| $pminfo = $pmhandler->insert_pm(); $plugins->run_hooks("private_do_send_end");
|
Zeile 657 | Zeile 668 |
---|
} } }
|
} } }
|
|
|
if($mybb->input['action'] == "send") { if($mybb->usergroup['cansendpms'] == 0) { error_no_permission();
|
if($mybb->input['action'] == "send") { if($mybb->usergroup['cansendpms'] == 0) { error_no_permission();
|
}
$plugins->run_hooks("private_send_start");
| }
$plugins->run_hooks("private_send_start");
|
$smilieinserter = $codebuttons = '';
if($mybb->settings['bbcodeinserter'] != 0 && $mybb->settings['pmsallowmycode'] != 0 && $mybb->user['showcodebuttons'] != 0)
| $smilieinserter = $codebuttons = '';
if($mybb->settings['bbcodeinserter'] != 0 && $mybb->settings['pmsallowmycode'] != 0 && $mybb->user['showcodebuttons'] != 0)
|
Zeile 675 | Zeile 686 |
---|
if($mybb->settings['pmsallowsmilies'] != 0) { $smilieinserter = build_clickable_smilies();
|
if($mybb->settings['pmsallowsmilies'] != 0) { $smilieinserter = build_clickable_smilies();
|
} }
$lang->post_icon = $lang->message_icon;
| } }
$lang->post_icon = $lang->message_icon;
|
$posticons = get_post_icons(); $message = htmlspecialchars_uni($parser->parse_badwords($mybb->get_input('message'))); $subject = htmlspecialchars_uni($parser->parse_badwords($mybb->get_input('subject')));
| $posticons = get_post_icons(); $message = htmlspecialchars_uni($parser->parse_badwords($mybb->get_input('message'))); $subject = htmlspecialchars_uni($parser->parse_badwords($mybb->get_input('subject')));
|
Zeile 706 | Zeile 717 |
---|
{ $optionschecked['readreceipt'] = 'checked="checked"'; }
|
{ $optionschecked['readreceipt'] = 'checked="checked"'; }
|
$to = htmlspecialchars_uni($mybb->get_input('to')); $bcc = htmlspecialchars_uni($mybb->get_input('bcc'));
| $to = htmlspecialchars_uni(implode(', ', array_unique(array_map('trim', explode(',', $mybb->get_input('to')))))); $bcc = htmlspecialchars_uni(implode(', ', array_unique(array_map('trim', explode(',', $mybb->get_input('bcc'))))));
|
}
$preview = '';
| }
$preview = '';
|
Zeile 824 | Zeile 835 |
---|
}
if(isset($recipients['bcc']) && is_array($recipients['bcc']))
|
}
if(isset($recipients['bcc']) && is_array($recipients['bcc']))
|
{
| {
|
foreach($recipients['bcc'] as $recipient) { $recipient_list['bcc'][] = $recipient;
| foreach($recipients['bcc'] as $recipient) { $recipient_list['bcc'][] = $recipient;
|
Zeile 926 | Zeile 937 |
---|
if($send_errors) {
|
if($send_errors) {
|
$to = htmlspecialchars_uni($mybb->get_input('to')); $bcc = htmlspecialchars_uni($mybb->get_input('bcc'));
| $to = htmlspecialchars_uni(implode(', ', array_unique(array_map('trim', explode(',', $mybb->get_input('to')))))); $bcc = htmlspecialchars_uni(implode(', ', array_unique(array_map('trim', explode(',', $mybb->get_input('bcc'))))));
|
}
// 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")."\";");
|
$pmid = $mybb->get_input('pmid', MyBB::INPUT_INT);
| $pmid = $mybb->get_input('pmid', MyBB::INPUT_INT);
|
$do = $mybb->get_input('do'); if($do != "forward" && $do != "reply" && $do != "replyall") {
| $do = $mybb->get_input('do'); if($do != "forward" && $do != "reply" && $do != "replyall") {
|
Zeile 999 | Zeile 1010 |
---|
'namestyle' => 'namestyle' );
|
'namestyle' => 'namestyle' );
|
foreach($data_key as $field => $key)
| if(isset($groupscache[$pm['usergroup']]))
|
{
|
{
|
$pm[$key] = $groupscache[$pm['usergroup']][$field];
| foreach($data_key as $field => $key) { $pm[$key] = $groupscache[$pm['usergroup']][$field]; }
|
}
if($pm['receipt'] == 1) { if($mybb->usergroup['candenypmreceipts'] == 1 && $mybb->get_input('denyreceipt', MyBB::INPUT_INT) == 1)
|
}
if($pm['receipt'] == 1) { if($mybb->usergroup['candenypmreceipts'] == 1 && $mybb->get_input('denyreceipt', MyBB::INPUT_INT) == 1)
|
{
| {
|
$receiptadd = 0; } else
|
$receiptadd = 0; } else
|
{
| {
|
$receiptadd = 2;
|
$receiptadd = 2;
|
} }
| } }
|
$action_time = ''; if($pm['status'] == 0) {
| $action_time = ''; if($pm['status'] == 0) {
|
Zeile 1024 | Zeile 1038 |
---|
'status' => 1, 'readtime' => $time );
|
'status' => 1, 'readtime' => $time );
|
|
|
if(isset($receiptadd)) { $updatearray['receipt'] = $receiptadd;
|
if(isset($receiptadd)) { $updatearray['receipt'] = $receiptadd;
|
}
| }
|
$db->update_query('privatemessages', $updatearray, "pmid='{$pmid}'");
| $db->update_query('privatemessages', $updatearray, "pmid='{$pmid}'");
|
Zeile 1042 | Zeile 1056 |
---|
"pmnotice" => 1 ); $db->update_query("users", $updated_user, "uid='{$mybb->user['uid']}'");
|
"pmnotice" => 1 ); $db->update_query("users", $updated_user, "uid='{$mybb->user['uid']}'");
|
} }
| } }
|
// Replied PM? else if($pm['status'] == 3 && $pm['statustime']) {
| // Replied PM? else if($pm['status'] == 3 && $pm['statustime']) {
|
Zeile 1089 | Zeile 1103 |
---|
// Fetch the recipients for this message $pm['recipients'] = my_unserialize($pm['recipients']);
|
// Fetch the recipients for this message $pm['recipients'] = my_unserialize($pm['recipients']);
|
if(is_array($pm['recipients']['to']))
| if(isset($pm['recipients']['to']) && is_array($pm['recipients']['to']))
|
{ $uid_sql = implode(',', $pm['recipients']['to']); }
| { $uid_sql = implode(',', $pm['recipients']['to']); }
|
Zeile 1109 | Zeile 1123 |
---|
}
// Fetch recipient names from the database
|
}
// Fetch recipient names from the database
|
$bcc_recipients = $to_recipients = array();
| $bcc_recipients = $to_recipients = $bcc_form_val = array();
|
$query = $db->simple_select('users', 'uid, username', "uid IN ({$uid_sql})"); while($recipient = $db->fetch_array($query)) { // User is a BCC recipient
|
$query = $db->simple_select('users', 'uid, username', "uid IN ({$uid_sql})"); while($recipient = $db->fetch_array($query)) { // User is a BCC recipient
|
| $recipient['username'] = htmlspecialchars_uni($recipient['username']);
|
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']);
|
| $bcc_form_val[] = $recipient['username'];
|
} // User is a normal recipient else if(in_array($recipient['uid'], $pm['recipients']['to']))
| } // User is a normal recipient else if(in_array($recipient['uid'], $pm['recipients']['to']))
|
Zeile 1129 | Zeile 1145 |
---|
if(count($bcc_recipients) > 0) { $bcc_recipients = implode(', ', $bcc_recipients);
|
if(count($bcc_recipients) > 0) { $bcc_recipients = implode(', ', $bcc_recipients);
|
| $bcc_form_val = implode(',', $bcc_form_val);
|
eval("\$bcc = \"".$templates->get("private_read_bcc")."\";");
|
eval("\$bcc = \"".$templates->get("private_read_bcc")."\";");
|
| } else { $bcc_form_val = '';
|
}
$replyall = false;
| }
$replyall = false;
|
Zeile 1140 | Zeile 1161 |
---|
if(count($to_recipients) > 0) {
|
if(count($to_recipients) > 0) {
|
$to_recipients = implode(", ", $to_recipients);
| $to_recipients = implode($lang->comma, $to_recipients);
|
} else {
| } else {
|
Zeile 1158 | Zeile 1179 |
---|
{ $trow = alt_trow();
|
{ $trow = alt_trow();
|
$optionschecked = array('savecopy' => 'checked="checked"');
| $optionschecked = array('savecopy' => 'checked="checked"', 'signature' => '', 'disablesmilies' => '');
|
if(!empty($mybb->user['signature'])) { $optionschecked['signature'] = 'checked="checked"';
| if(!empty($mybb->user['signature'])) { $optionschecked['signature'] = 'checked="checked"';
|
Zeile 1202 | Zeile 1223 |
---|
eval("\$private_send_tracking = \"".$templates->get("private_send_tracking")."\";"); }
|
eval("\$private_send_tracking = \"".$templates->get("private_send_tracking")."\";"); }
|
eval("\$quickreply = \"".$templates->get("private_quickreply")."\";"); }
| $postoptionschecked = $optionschecked; // Backwards compatability instead of correcting variable used in template
if(!isset($collapsedthead['quickreply'])) { $collapsedthead['quickreply'] = ''; } if(!isset($collapsedimg['quickreply'])) { $collapsedimg['quickreply'] = ''; } if(!isset($collapsed['quickreply_e'])) { $collapsed['quickreply_e'] = ''; }
$expaltext = (in_array("quickreply", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse; eval("\$quickreply = \"".$templates->get("private_quickreply")."\";"); }
|
$plugins->run_hooks("private_read_end");
eval("\$read = \"".$templates->get("private_read")."\";"); output_page($read); }
|
$plugins->run_hooks("private_read_end");
eval("\$read = \"".$templates->get("private_read")."\";"); output_page($read); }
|
|
|
if($mybb->input['action'] == "tracking") { if(!$mybb->usergroup['cantrackpms'])
| if($mybb->input['action'] == "tracking") { if(!$mybb->usergroup['cantrackpms'])
|
Zeile 1225 | Zeile 1262 |
---|
if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1) { $mybb->settings['postsperpage'] = 20;
|
if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1) { $mybb->settings['postsperpage'] = 20;
|
}
| }
|
// Figure out if we need to display multiple pages. $perpage = $mybb->settings['postsperpage'];
| // Figure out if we need to display multiple pages. $perpage = $mybb->settings['postsperpage'];
|
Zeile 1236 | Zeile 1273 |
---|
$page = $mybb->get_input('read_page', MyBB::INPUT_INT); $pages = $postcount / $perpage; $pages = ceil($pages);
|
$page = $mybb->get_input('read_page', MyBB::INPUT_INT); $pages = $postcount / $perpage; $pages = ceil($pages);
|
|
|
if($mybb->get_input('read_page') == "last")
|
if($mybb->get_input('read_page') == "last")
|
{ $page = $pages; }
if($page > $pages || $page <= 0) { $page = 1; }
if($page) { $start = ($page-1) * $perpage; } else { $start = 0; $page = 1; }
$read_multipage = multipage($postcount, $perpage, $page, "private.php?action=tracking&read_page={page}");
$query = $db->query("
| { $page = $pages; }
if($page > $pages || $page <= 0) { $page = 1; }
if($page) { $start = ($page-1) * $perpage; } else { $start = 0; $page = 1; }
$read_multipage = multipage($postcount, $perpage, $page, "private.php?action=tracking&read_page={page}");
$query = $db->query("
|
SELECT pm.pmid, pm.subject, pm.toid, pm.readtime, u.username as tousername FROM ".TABLE_PREFIX."privatemessages pm LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=pm.toid)
| SELECT pm.pmid, pm.subject, pm.toid, pm.readtime, u.username as tousername FROM ".TABLE_PREFIX."privatemessages pm LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=pm.toid)
|
Zeile 1270 | Zeile 1307 |
---|
while($readmessage = $db->fetch_array($query)) { $readmessage['subject'] = htmlspecialchars_uni($parser->parse_badwords($readmessage['subject']));
|
while($readmessage = $db->fetch_array($query)) { $readmessage['subject'] = htmlspecialchars_uni($parser->parse_badwords($readmessage['subject']));
|
| $readmessage['tousername'] = htmlspecialchars_uni($readmessage['tousername']);
|
$readmessage['profilelink'] = build_profile_link($readmessage['tousername'], $readmessage['toid']); $readdate = my_date('relative', $readmessage['readtime']); eval("\$readmessages .= \"".$templates->get("private_tracking_readmessage")."\";");
| $readmessage['profilelink'] = build_profile_link($readmessage['tousername'], $readmessage['toid']); $readdate = my_date('relative', $readmessage['readtime']); eval("\$readmessages .= \"".$templates->get("private_tracking_readmessage")."\";");
|
Zeile 1326 | Zeile 1364 |
---|
while($unreadmessage = $db->fetch_array($query)) { $unreadmessage['subject'] = htmlspecialchars_uni($parser->parse_badwords($unreadmessage['subject']));
|
while($unreadmessage = $db->fetch_array($query)) { $unreadmessage['subject'] = htmlspecialchars_uni($parser->parse_badwords($unreadmessage['subject']));
|
| $unreadmessage['tousername'] = htmlspecialchars_uni($unreadmessage['tousername']);
|
$unreadmessage['profilelink'] = build_profile_link($unreadmessage['tousername'], $unreadmessage['toid']); $senddate = my_date('relative', $unreadmessage['dateline']); eval("\$unreadmessages .= \"".$templates->get("private_tracking_unreadmessage")."\";");
| $unreadmessage['profilelink'] = build_profile_link($unreadmessage['tousername'], $unreadmessage['toid']); $senddate = my_date('relative', $unreadmessage['dateline']); eval("\$unreadmessages .= \"".$templates->get("private_tracking_unreadmessage")."\";");
|
Zeile 1362 | Zeile 1401 |
---|
if(!empty($mybb->input['readcheck'])) { foreach($mybb->input['readcheck'] as $key => $val)
|
if(!empty($mybb->input['readcheck'])) { foreach($mybb->input['readcheck'] as $key => $val)
|
{ $sql_array = array( "receipt" => 0 ); $db->update_query("privatemessages", $sql_array, "pmid=".(int)$key." AND fromid=".$mybb->user['uid']); } } $plugins->run_hooks("private_do_tracking_end"); redirect("private.php?action=tracking", $lang->redirect_pmstrackingstopped);
| { $sql_array = array( "receipt" => 0 ); $db->update_query("privatemessages", $sql_array, "pmid=".(int)$key." AND fromid=".$mybb->user['uid']); } } $plugins->run_hooks("private_do_tracking_end"); redirect("private.php?action=tracking", $lang->redirect_pmstrackingstopped);
|
} elseif(!empty($mybb->input['stoptrackingunread']))
|
} elseif(!empty($mybb->input['stoptrackingunread']))
|
{ $mybb->input['unreadcheck'] = $mybb->get_input('unreadcheck', MyBB::INPUT_ARRAY);
| { $mybb->input['unreadcheck'] = $mybb->get_input('unreadcheck', MyBB::INPUT_ARRAY);
|
if(!empty($mybb->input['unreadcheck'])) { foreach($mybb->input['unreadcheck'] as $key => $val)
|
if(!empty($mybb->input['unreadcheck'])) { foreach($mybb->input['unreadcheck'] as $key => $val)
|
{
| {
|
$sql_array = array( "receipt" => 0 ); $db->update_query("privatemessages", $sql_array, "pmid=".(int)$key." AND fromid=".$mybb->user['uid']);
|
$sql_array = array( "receipt" => 0 ); $db->update_query("privatemessages", $sql_array, "pmid=".(int)$key." AND fromid=".$mybb->user['uid']);
|
}
| }
|
} $plugins->run_hooks("private_do_tracking_end"); redirect("private.php?action=tracking", $lang->redirect_pmstrackingstopped);
| } $plugins->run_hooks("private_do_tracking_end"); redirect("private.php?action=tracking", $lang->redirect_pmstrackingstopped);
|
Zeile 1396 | Zeile 1435 |
---|
foreach($mybb->input['unreadcheck'] as $pmid => $val) { $pmids[$pmid] = (int)$pmid;
|
foreach($mybb->input['unreadcheck'] as $pmid => $val) { $pmids[$pmid] = (int)$pmid;
|
}
| }
|
$pmids = implode(",", $pmids); $query = $db->simple_select("privatemessages", "uid", "pmid IN ($pmids) AND fromid='".$mybb->user['uid']."'"); while($pm = $db->fetch_array($query)) { $pmuids[$pm['uid']] = $pm['uid'];
|
$pmids = implode(",", $pmids); $query = $db->simple_select("privatemessages", "uid", "pmid IN ($pmids) AND fromid='".$mybb->user['uid']."'"); while($pm = $db->fetch_array($query)) { $pmuids[$pm['uid']] = $pm['uid'];
|
}
| }
|
$db->delete_query("privatemessages", "pmid IN ($pmids) AND receipt='1' AND status='0' AND fromid='".$mybb->user['uid']."'"); foreach($pmuids as $uid) {
| $db->delete_query("privatemessages", "pmid IN ($pmids) AND receipt='1' AND status='0' AND fromid='".$mybb->user['uid']."'"); foreach($pmuids as $uid) {
|
Zeile 1431 | Zeile 1470 |
---|
$plugins->run_hooks("private_stopalltracking_end"); redirect("private.php?action=tracking", $lang->redirect_allpmstrackingstopped);
|
$plugins->run_hooks("private_stopalltracking_end"); redirect("private.php?action=tracking", $lang->redirect_allpmstrackingstopped);
|
}
| }
|
if($mybb->input['action'] == "folders") {
| if($mybb->input['action'] == "folders") {
|
Zeile 1446 | Zeile 1485 |
---|
$fid = $folderinfo[0]; $foldername = get_pm_folder_name($fid, $foldername);
|
$fid = $folderinfo[0]; $foldername = get_pm_folder_name($fid, $foldername);
|
if($folderinfo[0] == "1" || $folderinfo[0] == "2" || $folderinfo[0] == "3" || $folderinfo[0] == "4")
| if((int)$folderinfo[0] < 5)
|
{ $foldername2 = get_pm_folder_name($fid); eval("\$folderlist .= \"".$templates->get("private_folders_folder_unremovable")."\";");
| { $foldername2 = get_pm_folder_name($fid); eval("\$folderlist .= \"".$templates->get("private_folders_folder_unremovable")."\";");
|
Zeile 1501 | Zeile 1540 |
---|
$fid = (int)$key; // Use default language strings if empty or value is language string
|
$fid = (int)$key; // Use default language strings if empty or value is language string
|
switch($fid) { case 1: if($val == $lang->folder_inbox || trim($val) == '') { $val = ''; } break; case 2: if($val == $lang->folder_sent_items || trim($val) == '') { $val = ''; } break; case 3: if($val == $lang->folder_drafts || trim($val) == '') { $val = ''; } break; case 4: if($val == $lang->folder_trash || trim($val) == '') { $val = ''; } break; } }
if($val != '' && trim($val) == '' && !($key >= 1 && $key <= 4))
| if($val == get_pm_folder_name($fid) || trim($val) == '') { $val = ''; } }
if($val != '' && trim($val) == '' && !(is_numeric($key) && $key <= 4))
|
{ // If the name only contains whitespace and it's not a default folder, print an error error($lang->error_emptypmfoldername);
|
{ // If the name only contains whitespace and it's not a default folder, print an error error($lang->error_emptypmfoldername);
|
}
if($val != '' || ($key >= 1 && $key <= 4))
| }
if($val != '' || (is_numeric($key) && $key <= 4))
|
{ // If there is a name or if this is a default folder, save it $foldername = $db->escape_string(htmlspecialchars_uni($val));
|
{ // If there is a name or if this is a default folder, save it $foldername = $db->escape_string(htmlspecialchars_uni($val));
|
|
|
if(my_strpos($foldername, "$%%$") === false) { if($folders != '')
| if(my_strpos($foldername, "$%%$") === false) { if($folders != '')
|
Zeile 1566 | Zeile 1582 |
---|
"pmfolders" => $folders ); $db->update_query("users", $sql_array, "uid='".$mybb->user['uid']."'");
|
"pmfolders" => $folders ); $db->update_query("users", $sql_array, "uid='".$mybb->user['uid']."'");
|
// Update PM count
| // Update PM count
|
update_pm_count();
$plugins->run_hooks("private_do_folders_end");
| update_pm_count();
$plugins->run_hooks("private_do_folders_end");
|
Zeile 1580 | Zeile 1596 |
---|
if($mybb->user['totalpms'] == 0) { error($lang->error_nopms);
|
if($mybb->user['totalpms'] == 0) { error($lang->error_nopms);
|
}
| }
|
$plugins->run_hooks("private_empty_start");
$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
| $plugins->run_hooks("private_empty_start");
$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
|
Zeile 1589 | Zeile 1605 |
---|
foreach($foldersexploded as $key => $folders) { $folderinfo = explode("**", $folders, 2);
|
foreach($foldersexploded as $key => $folders) { $folderinfo = explode("**", $folders, 2);
|
| $unread = '';
|
$fid = $folderinfo[0];
|
$fid = $folderinfo[0];
|
$foldername = get_pm_folder_name($fid, $folderinfo[1]); $query = $db->simple_select("privatemessages", "COUNT(*) AS pmsinfolder", " folder='$fid' AND uid='".$mybb->user['uid']."'");
| if($folderinfo[0] == "1") { $fid = "1"; $unread = " AND status='0'"; } if($folderinfo[0] == "0") { $fid = "1"; } $foldername = get_pm_folder_name($folderinfo[0], $folderinfo[1]); $query = $db->simple_select("privatemessages", "COUNT(*) AS pmsinfolder", " folder='$fid'$unread AND uid='".$mybb->user['uid']."'");
|
$thing = $db->fetch_array($query); $foldercount = my_number_format($thing['pmsinfolder']); eval("\$folderlist .= \"".$templates->get("private_empty_folder")."\";"); }
|
$thing = $db->fetch_array($query); $foldercount = my_number_format($thing['pmsinfolder']); eval("\$folderlist .= \"".$templates->get("private_empty_folder")."\";"); }
|
|
|
$plugins->run_hooks("private_empty_end");
eval("\$folders = \"".$templates->get("private_empty")."\";");
| $plugins->run_hooks("private_empty_end");
eval("\$folders = \"".$templates->get("private_empty")."\";");
|
Zeile 1604 | Zeile 1630 |
---|
}
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 incoming POST request
|
verify_post_check($mybb->get_input('my_post_key'));
$plugins->run_hooks("private_do_empty_start");
| verify_post_check($mybb->get_input('my_post_key'));
$plugins->run_hooks("private_do_empty_start");
|
Zeile 1658 | Zeile 1684 |
---|
} elseif(!empty($mybb->input['moveto'])) {
|
} elseif(!empty($mybb->input['moveto'])) {
|
$mybb->input['check'] = $mybb->get_input('check', MyBB::INPUT_ARRAY); if(!empty($mybb->input['check']))
| $pms = array_map('intval', array_keys($mybb->get_input('check', MyBB::INPUT_ARRAY))); if(!empty($pms))
|
{
|
{
|
foreach($mybb->input['check'] as $key => $val)
| if(!$mybb->input['fid'])
|
{
|
{
|
$sql_array = array( "folder" => $mybb->input['fid'] ); $db->update_query("privatemessages", $sql_array, "pmid='".(int)$key."' AND uid='".$mybb->user['uid']."'");
| $mybb->input['fid'] = 1; }
if(array_key_exists($mybb->input['fid'], $foldernames)) { $db->update_query("privatemessages", array("folder" => $mybb->input['fid']), "pmid IN (".implode(",", $pms).") AND uid='".$mybb->user['uid']."'"); update_pm_count(); } else { error($lang->error_invalidmovefid);
|
} }
|
} }
|
// Update PM count update_pm_count();
| |
if(!empty($mybb->input['fromfid'])) {
| if(!empty($mybb->input['fromfid'])) {
|
Zeile 1772 | Zeile 1803 |
---|
$plugins->run_hooks("private_export_start");
$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
|
$plugins->run_hooks("private_export_start");
$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
|
$folder_name = $folder_id = '';
| $folderlist_folder = '';
|
foreach($foldersexploded as $key => $folders) { $folderinfo = explode("**", $folders, 2);
| foreach($foldersexploded as $key => $folders) { $folderinfo = explode("**", $folders, 2);
|
Zeile 1787 | Zeile 1818 |
---|
eval("\$folderlist = \"".$templates->get("private_archive_folders")."\";");
$plugins->run_hooks("private_export_end");
|
eval("\$folderlist = \"".$templates->get("private_archive_folders")."\";");
$plugins->run_hooks("private_export_end");
|
|
|
eval("\$archive = \"".$templates->get("private_archive")."\";");
output_page($archive); }
|
eval("\$archive = \"".$templates->get("private_archive")."\";");
output_page($archive); }
|
|
|
if($mybb->input['action'] == "do_export" && $mybb->request_method == "post") { // Verify incoming POST request
| if($mybb->input['action'] == "do_export" && $mybb->request_method == "post") { // Verify incoming POST request
|
Zeile 1800 | Zeile 1831 |
---|
$plugins->run_hooks("private_do_export_start");
|
$plugins->run_hooks("private_do_export_start");
|
$lang->private_messages_for = $lang->sprintf($lang->private_messages_for, $mybb->user['username']);
| $lang->private_messages_for = $lang->sprintf($lang->private_messages_for, htmlspecialchars_uni($mybb->user['username']));
|
$exdate = my_date($mybb->settings['dateformat'], TIME_NOW, 0, 0); $extime = my_date($mybb->settings['timeformat'], TIME_NOW, 0, 0); $lang->exported_date = $lang->sprintf($lang->exported_date, $exdate, $extime); $foldersexploded = explode("$%%$", $mybb->user['pmfolders']); foreach($foldersexploded as $key => $folders)
|
$exdate = my_date($mybb->settings['dateformat'], TIME_NOW, 0, 0); $extime = my_date($mybb->settings['timeformat'], TIME_NOW, 0, 0); $lang->exported_date = $lang->sprintf($lang->exported_date, $exdate, $extime); $foldersexploded = explode("$%%$", $mybb->user['pmfolders']); foreach($foldersexploded as $key => $folders)
|
{
| {
|
$folderinfo = explode("**", $folders, 2); $folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]); $foldersexploded[$key] = implode("**", $folderinfo);
|
$folderinfo = explode("**", $folders, 2); $folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]); $foldersexploded[$key] = implode("**", $folderinfo);
|
}
| }
|
if($mybb->get_input('pmid', MyBB::INPUT_INT)) {
| if($mybb->get_input('pmid', MyBB::INPUT_INT)) {
|
Zeile 1823 | Zeile 1854 |
---|
$datecut = TIME_NOW-($mybb->get_input('daycut', MyBB::INPUT_INT) * 86400); $wsql = "pm.dateline"; if($mybb->get_input('dayway') == "older")
|
$datecut = TIME_NOW-($mybb->get_input('daycut', MyBB::INPUT_INT) * 86400); $wsql = "pm.dateline"; if($mybb->get_input('dayway') == "older")
|
{
| {
|
$wsql .= "<="; } else
| $wsql .= "<="; } else
|
Zeile 1948 | Zeile 1979 |
---|
$message['subject'] = $parser->parse_badwords($message['subject']); if($message['folder'] != "3") {
|
$message['subject'] = $parser->parse_badwords($message['subject']); if($message['folder'] != "3") {
|
$senddate = my_date($mybb->settings['dateformat'], $message['dateline']); $sendtime = my_date($mybb->settings['timeformat'], $message['dateline']);
| $senddate = my_date($mybb->settings['dateformat'], $message['dateline'], "", false); $sendtime = my_date($mybb->settings['timeformat'], $message['dateline'], "", false);
|
$senddate .= " $lang->at $sendtime"; } else
| $senddate .= " $lang->at $sendtime"; } else
|
Zeile 1981 | Zeile 2012 |
---|
if($mybb->input['exporttype'] == "csv") {
|
if($mybb->input['exporttype'] == "csv") {
|
$message['message'] = addslashes($message['message']); $message['subject'] = addslashes($message['subject']); $message['tousername'] = addslashes($message['tousername']); $message['fromusername'] = addslashes($message['fromusername']);
| $message['message'] = my_escape_csv($message['message']); $message['subject'] = my_escape_csv($message['subject']); $message['tousername'] = my_escape_csv($message['tousername']); $message['fromusername'] = my_escape_csv($message['fromusername']);
|
}
if(empty($donefolder[$message['folder']]))
| }
if(empty($donefolder[$message['folder']]))
|
Zeile 2006 | Zeile 2037 |
---|
} else {
|
} else {
|
$foldername = addslashes($folderinfo[1]);
| $foldername = my_escape_csv($folderinfo[1]);
|
} $donefolder[$message['folder']] = 1; }
| } $donefolder[$message['folder']] = 1; }
|
Zeile 2020 | Zeile 2051 |
---|
if($mybb->input['exporttype'] == "html") { // Gather global stylesheet for HTML
|
if($mybb->input['exporttype'] == "html") { // Gather global stylesheet for HTML
|
$query = $db->simple_select("themestylesheets", "stylesheet", "sid = '1'", array('limit' => 1));
| $css_tid = empty($theme['tid']) ? '' : "'". (int)$theme['tid'] ."',"; $query = $db->simple_select("themestylesheets", "stylesheet", "tid in ({$css_tid}'2','1') AND name = 'global.css'", array('order_by' => 'tid', 'order_dir' => 'DESC', 'limit' => 1));
|
$css = $db->fetch_field($query, "stylesheet"); }
| $css = $db->fetch_field($query, "stylesheet"); }
|
Zeile 2060 | Zeile 2092 |
---|
} else {
|
} else {
|
| echo "\xEF\xBB\xBF"; // UTF-8 BOM
|
echo $archived; } }
| echo $archived; } }
|
Zeile 2070 | Zeile 2103 |
---|
if(!$mybb->input['fid'] || !array_key_exists($mybb->input['fid'], $foldernames)) {
|
if(!$mybb->input['fid'] || !array_key_exists($mybb->input['fid'], $foldernames)) {
|
$mybb->input['fid'] = 1;
| $mybb->input['fid'] = 0;
|
}
|
}
|
$folder = $mybb->input['fid']; $foldername = $foldernames[$folder];
| $fid = (int)$mybb->input['fid']; $folder = !$fid ? 1 : $fid; $foldername = $foldernames[$fid];
|
if($folder == 2 || $folder == 3) { // Sent Items Folder
| if($folder == 2 || $folder == 3) { // Sent Items Folder
|
Zeile 2125 | Zeile 2159 |
---|
eval("\$orderarrow['$sortby'] = \"".$templates->get("private_orderarrow")."\";");
// Do Multi Pages
|
eval("\$orderarrow['$sortby'] = \"".$templates->get("private_orderarrow")."\";");
// Do Multi Pages
|
$query = $db->simple_select("privatemessages", "COUNT(*) AS total", "uid='".$mybb->user['uid']."' AND folder='$folder'"); $pmscount = $db->fetch_array($query);
| $selective = ""; if($fid == 1) { $selective = " AND status='0'"; }
$query = $db->simple_select("privatemessages", "COUNT(*) AS total", "uid='".$mybb->user['uid']."' AND folder='$folder'$selective"); $pmscount = $db->fetch_field($query, "total");
|
if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1) { $mybb->settings['threadsperpage'] = 20;
|
if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1) { $mybb->settings['threadsperpage'] = 20;
|
}
| }
|
$perpage = $mybb->settings['threadsperpage']; $page = $mybb->get_input('page', MyBB::INPUT_INT);
if($page > 0) { $start = ($page-1) *$perpage;
|
$perpage = $mybb->settings['threadsperpage']; $page = $mybb->get_input('page', MyBB::INPUT_INT);
if($page > 0) { $start = ($page-1) *$perpage;
|
| $pages = ceil($pmscount / $perpage); if($page > $pages) { $start = 0; $page = 1; }
|
} else {
| } else {
|
Zeile 2151 | Zeile 2197 |
---|
$upper = $end;
if($upper > $pmscount)
|
$upper = $end;
if($upper > $pmscount)
|
{
| {
|
$upper = $pmscount; }
|
$upper = $pmscount; }
|
if($mybb->input['order'] || ($sortby && $sortby != "dateline")) { $page_url = "private.php?fid={$folder}&sortby={$sortby}&order={$mybb->input['order']}"; } else { $page_url = "private.php?fid={$folder}"; }
$multipage = multipage($pmscount['total'], $perpage, $page, $page_url); $messagelist = '';
| if($mybb->input['order'] || ($sortby && $sortby != "dateline")) { $page_url = "private.php?fid={$fid}&sortby={$sortby}&order={$sortordernow}"; } else { $page_url = "private.php?fid={$fid}"; }
$multipage = multipage($pmscount, $perpage, $page, $page_url); $selective = $messagelist = '';
|
$icon_cache = $cache->read("posticons");
| $icon_cache = $cache->read("posticons");
|
Zeile 2188 | Zeile 2234 |
---|
FROM ".TABLE_PREFIX."privatemessages pm LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=pm.toid) WHERE pm.folder='{$folder}' AND pm.uid='{$mybb->user['uid']}'
|
FROM ".TABLE_PREFIX."privatemessages pm LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=pm.toid) WHERE pm.folder='{$folder}' AND pm.uid='{$mybb->user['uid']}'
|
ORDER BY {$u}{$sortfield} {$mybb->input['order']}
| ORDER BY {$u}{$sortfield} {$sortordernow}
|
LIMIT {$start}, {$perpage} "); while($row = $db->fetch_array($users_query)) { $recipients = my_unserialize($row['recipients']);
|
LIMIT {$start}, {$perpage} "); while($row = $db->fetch_array($users_query)) { $recipients = my_unserialize($row['recipients']);
|
if(is_array($recipients['to']) && count($recipients['to']))
| if(isset($recipients['to']) && is_array($recipients['to']) && count($recipients['to']))
|
{ $get_users = array_merge($get_users, $recipients['to']); }
| { $get_users = array_merge($get_users, $recipients['to']); }
|
Zeile 2202 | Zeile 2248 |
---|
if(isset($recipients['bcc']) && is_array($recipients['bcc']) && count($recipients['bcc'])) { $get_users = array_merge($get_users, $recipients['bcc']);
|
if(isset($recipients['bcc']) && is_array($recipients['bcc']) && count($recipients['bcc'])) { $get_users = array_merge($get_users, $recipients['bcc']);
|
}
| }
|
}
$get_users = implode(',', array_unique($get_users));
| }
$get_users = implode(',', array_unique($get_users));
|
Zeile 2215 | Zeile 2261 |
---|
{ $cached_users[$user['uid']] = $user; }
|
{ $cached_users[$user['uid']] = $user; }
|
} }
| } }
|
if($folder == 2 || $folder == 3)
|
if($folder == 2 || $folder == 3)
|
{ if($sortfield == "username")
| { if($sortfield == "username")
|
{ $pm = "tu.";
|
{ $pm = "tu.";
|
} else
| } else
|
{ $pm = "pm."; } } else {
|
{ $pm = "pm."; } } else {
|
| if($fid == 1) { $selective = " AND pm.status='0'"; }
|
if($sortfield == "username") { $pm = "fu."; }
|
if($sortfield == "username") { $pm = "fu."; }
|
else { $pm = "pm."; }
| else { $pm = "pm."; }
|
}
|
}
|
|
|
$query = $db->query(" SELECT pm.*, fu.username AS fromusername, tu.username as tousername FROM ".TABLE_PREFIX."privatemessages pm LEFT JOIN ".TABLE_PREFIX."users fu ON (fu.uid=pm.fromid) LEFT JOIN ".TABLE_PREFIX."users tu ON (tu.uid=pm.toid)
|
$query = $db->query(" SELECT pm.*, fu.username AS fromusername, tu.username as tousername FROM ".TABLE_PREFIX."privatemessages pm LEFT JOIN ".TABLE_PREFIX."users fu ON (fu.uid=pm.fromid) LEFT JOIN ".TABLE_PREFIX."users tu ON (tu.uid=pm.toid)
|
WHERE pm.folder='$folder' AND pm.uid='".$mybb->user['uid']."'
| WHERE pm.folder='$folder' AND pm.uid='".$mybb->user['uid']."'{$selective}
|
ORDER BY {$pm}{$sortfield} {$sortordernow} LIMIT $start, $perpage ");
if($db->num_rows($query) > 0) {
|
ORDER BY {$pm}{$sortfield} {$sortordernow} LIMIT $start, $perpage ");
if($db->num_rows($query) > 0) {
|
| $bgcolor = alt_trow(true);
|
while($message = $db->fetch_array($query)) {
|
while($message = $db->fetch_array($query)) {
|
$msgalt = $msgsuffix = $msgprefix = '';
| $msgalt = $msgstatus = '';
|
// Determine Folder Icon if($message['status'] == 0) {
|
// Determine Folder Icon if($message['status'] == 0) {
|
$msgfolder = 'new_pm.png';
| $msgstatus = 'new_pm';
|
$msgalt = $lang->new_pm;
|
$msgalt = $lang->new_pm;
|
$msgprefix = "<strong>"; $msgsuffix = "</strong>";
| |
}
|
}
|
elseif($message['status'] == 1)
| else if($message['status'] == 1)
|
{
|
{
|
$msgfolder = 'old_pm.png';
| $msgstatus = 'old_pm';
|
$msgalt = $lang->old_pm; }
|
$msgalt = $lang->old_pm; }
|
elseif($message['status'] == 3)
| else if($message['status'] == 3)
|
{
|
{
|
$msgfolder = 're_pm.png';
| $msgstatus = 're_pm';
|
$msgalt = $lang->reply_pm; }
|
$msgalt = $lang->reply_pm; }
|
elseif($message['status'] == 4)
| else if($message['status'] == 4)
|
{
|
{
|
$msgfolder = 'fw_pm.png';
| $msgstatus = 'fw_pm';
|
$msgalt = $lang->fwd_pm; }
| $msgalt = $lang->fwd_pm; }
|
Zeile 2285 | Zeile 2336 |
---|
{ // Sent Items or Drafts Folder Check $recipients = my_unserialize($message['recipients']); $to_users = $bcc_users = '';
|
{ // Sent Items or Drafts Folder Check $recipients = my_unserialize($message['recipients']); $to_users = $bcc_users = '';
|
if(count($recipients['to']) > 1 || (count($recipients['to']) == 1 && isset($recipients['bcc']) && count($recipients['bcc']) > 0))
| if(isset($recipients['to']) && count($recipients['to']) > 1 || (isset($recipients['to']) && count($recipients['to']) == 1 && isset($recipients['bcc']) && count($recipients['bcc']) > 0))
|
{ foreach($recipients['to'] as $uid) {
|
{ foreach($recipients['to'] as $uid) {
|
| if(!isset($cached_users[$uid])) { continue; }
|
$profilelink = get_profile_link($uid); $user = $cached_users[$uid];
|
$profilelink = get_profile_link($uid); $user = $cached_users[$uid];
|
| $user['username'] = htmlspecialchars_uni($user['username']);
|
$username = format_name($user['username'], $user['usergroup'], $user['displaygroup']); if(!$user['username']) {
| $username = format_name($user['username'], $user['usergroup'], $user['displaygroup']); if(!$user['username']) {
|
Zeile 2303 | Zeile 2359 |
---|
eval("\$bcc_users = \"".$templates->get("private_multiple_recipients_bcc")."\";"); foreach($recipients['bcc'] as $uid) {
|
eval("\$bcc_users = \"".$templates->get("private_multiple_recipients_bcc")."\";"); foreach($recipients['bcc'] as $uid) {
|
| if(!isset($cached_users[$uid])) { continue; }
|
$profilelink = get_profile_link($uid); $user = $cached_users[$uid];
|
$profilelink = get_profile_link($uid); $user = $cached_users[$uid];
|
| $user['username'] = htmlspecialchars_uni($user['username']);
|
$username = format_name($user['username'], $user['usergroup'], $user['displaygroup']); if(!$user['username']) {
| $username = format_name($user['username'], $user['usergroup'], $user['displaygroup']); if(!$user['username']) {
|
Zeile 2318 | Zeile 2379 |
---|
} else if($message['toid']) {
|
} else if($message['toid']) {
|
$tofromusername = $message['tousername'];
| $tofromusername = htmlspecialchars_uni($message['tousername']);
|
$tofromuid = $message['toid']; } else
| $tofromuid = $message['toid']; } else
|
Zeile 2328 | Zeile 2389 |
---|
} else {
|
} else {
|
$tofromusername = $message['fromusername'];
| $tofromusername = htmlspecialchars_uni($message['fromusername']);
|
$tofromuid = $message['fromid']; if($tofromuid == 0) {
| $tofromuid = $message['fromid']; if($tofromuid == 0) {
|
Zeile 2340 | Zeile 2401 |
---|
$tofromuid = 0; $tofromusername = $lang->na; }
|
$tofromuid = 0; $tofromusername = $lang->na; }
|
}
| }
|
$tofromusername = build_profile_link($tofromusername, $tofromuid);
if($mybb->usergroup['candenypmreceipts'] == 1 && $message['receipt'] == '1' && $message['folder'] != '3' && $message['folder'] != 2) { eval("\$denyreceipt = \"".$templates->get("private_messagebit_denyreceipt")."\";");
|
$tofromusername = build_profile_link($tofromusername, $tofromuid);
if($mybb->usergroup['candenypmreceipts'] == 1 && $message['receipt'] == '1' && $message['folder'] != '3' && $message['folder'] != 2) { eval("\$denyreceipt = \"".$templates->get("private_messagebit_denyreceipt")."\";");
|
}
| }
|
else { $denyreceipt = ''; }
if($message['icon'] > 0 && $icon_cache[$message['icon']])
|
else { $denyreceipt = ''; }
if($message['icon'] > 0 && $icon_cache[$message['icon']])
|
{
| {
|
$icon = $icon_cache[$message['icon']]; $icon['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']); $icon['path'] = htmlspecialchars_uni($icon['path']);
| $icon = $icon_cache[$message['icon']]; $icon['path'] = str_replace("{theme}", $theme['imgdir'], $icon['path']); $icon['path'] = htmlspecialchars_uni($icon['path']);
|
Zeile 2384 | Zeile 2445 |
---|
$plugins->run_hooks("private_message");
eval("\$messagelist .= \"".$templates->get("private_messagebit")."\";");
|
$plugins->run_hooks("private_message");
eval("\$messagelist .= \"".$templates->get("private_messagebit")."\";");
|
| $bgcolor = alt_trow();
|
} } else
| } } else
|
Zeile 2392 | Zeile 2454 |
---|
}
$pmspacebar = '';
|
}
$pmspacebar = '';
|
if($mybb->usergroup['pmquota'] != '0' && $mybb->usergroup['cancp'] != 1)
| if($mybb->usergroup['pmquota'] != 0)
|
{ $query = $db->simple_select("privatemessages", "COUNT(*) AS total", "uid='".$mybb->user['uid']."'"); $pmscount = $db->fetch_array($query);
| { $query = $db->simple_select("privatemessages", "COUNT(*) AS total", "uid='".$mybb->user['uid']."'"); $pmscount = $db->fetch_array($query);
|
Zeile 2426 | Zeile 2488 |
---|
{ $spaceused_severity = "high"; }
|
{ $spaceused_severity = "high"; }
|
|
|
$overhalf = round($spaceused, 0)."%"; if((int)$overhalf > 100) {
| $overhalf = round($spaceused, 0)."%"; if((int)$overhalf > 100) {
|
Zeile 2456 | Zeile 2518 |
---|
}
$limitwarning = '';
|
}
$limitwarning = '';
|
if($mybb->usergroup['pmquota'] != "0" && $pmscount['total'] >= $mybb->usergroup['pmquota'] && $mybb->usergroup['cancp'] != 1)
| if($mybb->usergroup['pmquota'] != 0 && $pmscount['total'] >= $mybb->usergroup['pmquota'])
|
{ eval("\$limitwarning = \"".$templates->get("private_limitwarning")."\";"); }
| { eval("\$limitwarning = \"".$templates->get("private_limitwarning")."\";"); }
|