Zeile 42 | Zeile 42 |
---|
error_no_permission(); }
|
error_no_permission(); }
|
| $update = false;
|
if(!$mybb->user['pmfolders']) {
|
if(!$mybb->user['pmfolders']) {
|
$mybb->user['pmfolders'] = "1**$%%$2**$%%$3**$%%$4**";
| $update = true; $mybb->user['pmfolders'] = "0**$%%$1**$%%$2**$%%$3**$%%$4**"; } elseif ((int)my_substr($mybb->user['pmfolders'], 0, 1) != 0) { // Old folder structure. Need to update // Since MyBB 1.8.20 fid[0] represents 'Inbox' and fid[1] represents 'Unread' $update = true; $mybb->user['pmfolders'] = '0'. ltrim(str_replace("$%%$2**", "$%%$1**$%%$2**", $mybb->user['pmfolders']), '1'); }
|
|
|
| // Folder structure update required? if($update) {
|
$sql_array = array( "pmfolders" => $mybb->user['pmfolders'] );
| $sql_array = array( "pmfolders" => $mybb->user['pmfolders'] );
|
Zeile 79 | Zeile 92 |
---|
eval("\$folderoplist_folder .= \"".$templates->get("private_jump_folders_folder")."\";"); eval("\$foldersearch_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")."\";"); }
|
| $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 172 | Zeile 187 |
---|
else { $resulttype = "pmsubjects";
|
else { $resulttype = "pmsubjects";
|
}
| }
|
$search_data = array( "keywords" => $mybb->get_input('keywords'), "subject" => $mybb->get_input('subject', MyBB::INPUT_INT),
| $search_data = array( "keywords" => $mybb->get_input('keywords'), "subject" => $mybb->get_input('subject', MyBB::INPUT_INT),
|
Zeile 181 | Zeile 196 |
---|
"sender" => $mybb->get_input('sender'), "status" => $mybb->get_input('status', MyBB::INPUT_ARRAY), "folder" => $mybb->get_input('folder', MyBB::INPUT_ARRAY)
|
"sender" => $mybb->get_input('sender'), "status" => $mybb->get_input('status', MyBB::INPUT_ARRAY), "folder" => $mybb->get_input('folder', MyBB::INPUT_ARRAY)
|
);
| );
|
if($db->can_search == true) { require_once MYBB_ROOT."inc/functions_search.php";
| if($db->can_search == true) { require_once MYBB_ROOT."inc/functions_search.php";
|
Zeile 206 | Zeile 221 |
---|
"keywords" => $db->escape_string($mybb->get_input('keywords')), ); $plugins->run_hooks("private_do_search_process");
|
"keywords" => $db->escape_string($mybb->get_input('keywords')), ); $plugins->run_hooks("private_do_search_process");
|
|
|
$db->insert_query("searchlog", $searcharray);
// Sender sort won't work yet
| $db->insert_query("searchlog", $searcharray);
// Sender sort won't work yet
|
Zeile 265 | Zeile 280 |
---|
else { $sortby = $query_sortby = "dateline";
|
else { $sortby = $query_sortby = "dateline";
|
}
if($order != "asc") { $order = "desc"; }
| }
if($order != "asc") { $order = "desc"; }
|
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; }
|
| $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 283 | Zeile 301 |
---|
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 {
| } else {
|
Zeile 301 | Zeile 325 |
---|
}
// 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 556 | Zeile 577 |
---|
// Attempt to see if this PM is a duplicate or not $to = array_map("trim", explode(",", $mybb->get_input('to')));
|
// 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("
| $to_escaped = implode("','", array_map(array($db, 'escape_string'), array_map('my_strtolower', $to))); $time_cutoff = TIME_NOW - (5 * 60 * 60); $query = $db->query("
|
Zeile 702 | Zeile 724 |
---|
{ $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 855 | Zeile 877 |
---|
require_once MYBB_ROOT."inc/functions_posting.php";
if($mybb->settings['maxpmquotedepth'] != '0')
|
require_once MYBB_ROOT."inc/functions_posting.php";
if($mybb->settings['maxpmquotedepth'] != '0')
|
{
| {
|
$message = remove_message_quotes($message, $mybb->settings['maxpmquotedepth']); }
| $message = remove_message_quotes($message, $mybb->settings['maxpmquotedepth']); }
|
Zeile 922 | Zeile 944 |
---|
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.
| }
// Load the auto complete javascript if it is enabled.
|
Zeile 1204 | Zeile 1226 |
---|
eval("\$private_send_tracking = \"".$templates->get("private_send_tracking")."\";"); }
|
eval("\$private_send_tracking = \"".$templates->get("private_send_tracking")."\";"); }
|
| $expaltext = (in_array("quickreply", $collapse)) ? "[+]" : "[-]";
|
eval("\$quickreply = \"".$templates->get("private_quickreply")."\";"); }
| eval("\$quickreply = \"".$templates->get("private_quickreply")."\";"); }
|
Zeile 1451 | Zeile 1474 |
---|
$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 1506 | Zeile 1529 |
---|
$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)
| if($val == get_pm_folder_name($fid) || trim($val) == '')
|
{
|
{
|
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;
| $val = '';
|
} }
|
} }
|
if($val != '' && trim($val) == '' && !($key >= 1 && $key <= 4))
| 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));
|
Zeile 1571 | Zeile 1571 |
---|
"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 update_pm_count();
|
Zeile 1627 | Zeile 1627 |
---|
foreach($mybb->input['empty'] as $key => $val) { if($val == 1)
|
foreach($mybb->input['empty'] as $key => $val) { if($val == 1)
|
{
| {
|
$key = (int)$key; if($emptyq) {
| $key = (int)$key; if($emptyq) {
|
Zeile 1665 | Zeile 1665 |
---|
{ $mybb->input['check'] = $mybb->get_input('check', MyBB::INPUT_ARRAY); if(!empty($mybb->input['check']))
|
{ $mybb->input['check'] = $mybb->get_input('check', MyBB::INPUT_ARRAY); if(!empty($mybb->input['check']))
|
{
| {
|
foreach($mybb->input['check'] as $key => $val) { $sql_array = array(
| foreach($mybb->input['check'] as $key => $val) { $sql_array = array(
|
Zeile 1684 | Zeile 1684 |
---|
else { redirect("private.php", $lang->redirect_pmsmoved);
|
else { redirect("private.php", $lang->redirect_pmsmoved);
|
}
| }
|
} elseif(!empty($mybb->input['delete'])) {
| } elseif(!empty($mybb->input['delete'])) {
|
Zeile 1953 | Zeile 1953 |
---|
$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 1986 | Zeile 1986 |
---|
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 2011 | Zeile 2011 |
---|
} else {
|
} else {
|
$foldername = addslashes($folderinfo[1]);
| $foldername = my_escape_csv($folderinfo[1]);
|
} $donefolder[$message['folder']] = 1; }
| } $donefolder[$message['folder']] = 1; }
|
Zeile 2076 | Zeile 2076 |
---|
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 2132 | Zeile 2133 |
---|
// Do Multi Pages $query = $db->simple_select("privatemessages", "COUNT(*) AS total", "uid='".$mybb->user['uid']."' AND folder='$folder'");
|
// Do Multi Pages $query = $db->simple_select("privatemessages", "COUNT(*) AS total", "uid='".$mybb->user['uid']."' AND folder='$folder'");
|
$pmscount = $db->fetch_array($query);
| $pmscount = $db->fetch_field($query, "total");
|
if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1) {
| if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1) {
|
Zeile 2145 | Zeile 2146 |
---|
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 {
| } else {
|
Zeile 2162 | Zeile 2169 |
---|
}
if($mybb->input['order'] || ($sortby && $sortby != "dateline"))
|
}
if($mybb->input['order'] || ($sortby && $sortby != "dateline"))
|
{ $page_url = "private.php?fid={$folder}&sortby={$sortby}&order={$sortordernow}"; } else { $page_url = "private.php?fid={$folder}"; }
$multipage = multipage($pmscount['total'], $perpage, $page, $page_url); $messagelist = '';
| { $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");
// Cache users in multiple recipients for sent & drafts folder
| $icon_cache = $cache->read("posticons");
// Cache users in multiple recipients for sent & drafts folder
|
Zeile 2181 | Zeile 2188 |
---|
if($sortfield == "username") { $u = "u.";
|
if($sortfield == "username") { $u = "u.";
|
}
| }
|
else { $u = "pm.";
| else { $u = "pm.";
|
Zeile 2203 | Zeile 2210 |
---|
if(is_array($recipients['to']) && count($recipients['to'])) { $get_users = array_merge($get_users, $recipients['to']);
|
if(is_array($recipients['to']) && count($recipients['to'])) { $get_users = array_merge($get_users, $recipients['to']);
|
}
| }
|
if(isset($recipients['bcc']) && is_array($recipients['bcc']) && count($recipients['bcc'])) {
| if(isset($recipients['bcc']) && is_array($recipients['bcc']) && count($recipients['bcc'])) {
|
Zeile 2225 | Zeile 2232 |
---|
}
if($folder == 2 || $folder == 3)
|
}
if($folder == 2 || $folder == 3)
|
{
| {
|
if($sortfield == "username")
|
if($sortfield == "username")
|
{
| {
|
$pm = "tu."; } else
|
$pm = "tu."; } 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.";
|
Zeile 2252 | Zeile 2264 |
---|
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)
|
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 ");
| ORDER BY {$pm}{$sortfield} {$sortordernow} LIMIT $start, $perpage ");
|
Zeile 2290 | Zeile 2302 |
---|
{ // 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) {
|
Zeile 2399 | Zeile 2411 |
---|
}
$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 2463 | Zeile 2475 |
---|
}
$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")."\";"); }
|