Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: private.php 5380 2011-02-21 12:04:43Z Tomm $
| * $Id$
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 14 | Zeile 14 |
---|
define('THIS_SCRIPT', 'private.php');
$templatelist = "private_send,private_send_buddyselect,private_read,private_tracking,private_tracking_readmessage,private_tracking_unreadmessage";
|
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 .= "usercp_nav_messenger,usercp_nav_changename,usercp_nav_profile,usercp_nav_misc,usercp_nav_messenger,multipage_nextpage,multipage_page_current,multipage_page,multipage_start,multipage_end,multipage"; $templatelist .= ",private_messagebit,codebuttons,smilieinsert,posticons,private_send_autocomplete,private_messagebit_denyreceipt,private_read_to, postbit_online,postbit_find,postbit_pm, postbit_email,postbit_reputation,postbit_warninglevel,postbit_author_user,postbit_reply_pm,postbit_forward_pm,postbit_delete_pm,postbit,private_tracking_nomessage,private_nomessages";
| $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"; $templatelist .= ",usercp_nav_messenger,usercp_nav_changename,usercp_nav_profile,usercp_nav_misc,multipage_nextpage,multipage_page_current,multipage_page,multipage_start,multipage_end,multipage,usercp_nav_editsignature,private_read_action,postbit_away,postbit_avatar,postbit_warn,postbit_rep_button"; $templatelist .= ",private_messagebit,codebuttons,smilieinsert,smilieinsert_getmore,posticons,private_send_autocomplete,private_messagebit_denyreceipt,private_read_to,postbit_online,postbit_find,postbit_pm,postbit_email,postbit_reputation,postbit_warninglevel,postbit_author_user,postbit_reply_pm,postbit_forward_pm"; $templatelist .= ",postbit_delete_pm,postbit,private_tracking_nomessage,private_nomessages,postbit_author_guest,private_multiple_recipients_user,private_multiple_recipients_bcc,private_multiple_recipients"; $templatelist .= ",private_search_messagebit,private_search_results_nomessages,private_search_results,private_advanced_search,previewpost,private_send_tracking,private_send_signature,private_read_bcc"; $templatelist .= ",private_archive,private_pmspace,private_limitwarning,postbit_groupimage,postbit_offline,postbit_www,postbit_replyall_pm,postbit_signature,postbit_classic,postbit_gotopost,usercp_nav_messenger_tracking,multipage_prevpage";
|
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 122 | Zeile 125 |
---|
$mybb->input['action'] = "send"; }
|
$mybb->input['action'] = "send"; }
|
if(($mybb->input['action'] == "do_search" || $mybb->input['quick_search']) && $mybb->request_method == "post")
| if(($mybb->input['action'] == "do_search" || $mybb->input['action'] == "do_stuff" && ($mybb->input['quick_search'] || !$mybb->input['hop'] && !$mybb->input['moveto'] && !$mybb->input['delete'])) && $mybb->request_method == "post")
|
{ $plugins->run_hooks("private_do_search_start");
| { $plugins->run_hooks("private_do_search_start");
|
Zeile 248 | Zeile 251 |
---|
$plugins->run_hooks("private_results_start");
// Decide on our sorting fields and sorting order.
|
$plugins->run_hooks("private_results_start");
// Decide on our sorting fields and sorting order.
|
$order = my_strtolower(htmlspecialchars($mybb->input['order'])); $sortby = my_strtolower(htmlspecialchars($mybb->input['sortby']));
| $order = my_strtolower(htmlspecialchars_uni($mybb->input['order'])); $sortby = my_strtolower(htmlspecialchars_uni($mybb->input['sortby']));
|
$sortby_accepted = array('subject', 'username', 'dateline');
| $sortby_accepted = array('subject', 'username', 'dateline');
|
Zeile 469 | Zeile 472 |
---|
$senddate = $lang->not_sent; }
|
$senddate = $lang->not_sent; }
|
$foldername = htmlspecialchars_uni($foldernames[$message['folder']]);
| $foldername = $foldernames[$message['folder']];
|
// 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 484 | Zeile 487 |
---|
{ $message['message'] = my_substr($message['message'], 0, 200)."..."; }
|
{ $message['message'] = my_substr($message['message'], 0, 200)."..."; }
|
// For my sanity... $message['message'] = htmlspecialchars_uni($message['message']);
| |
eval("\$messagelist .= \"".$templates->get("private_search_messagebit")."\";"); }
| eval("\$messagelist .= \"".$templates->get("private_search_messagebit")."\";"); }
|
Zeile 542 | Zeile 542 |
---|
$send_errors = '';
if($mybb->input['action'] == "do_send" && $mybb->request_method == "post")
|
$send_errors = '';
if($mybb->input['action'] == "do_send" && $mybb->request_method == "post")
|
{ if($mybb->usergroup['cansendpms'] == 0) { error_no_permission();
| { if($mybb->usergroup['cansendpms'] == 0) { error_no_permission();
|
}
// Verify incoming POST request
| }
// Verify incoming POST request
|
Zeile 586 | Zeile 586 |
---|
{ $pm['bcc'] = explode(",", $mybb->input['bcc']); $pm['bcc'] = array_map("trim", $pm['bcc']);
|
{ $pm['bcc'] = explode(",", $mybb->input['bcc']); $pm['bcc'] = array_map("trim", $pm['bcc']);
|
| }
if(!$mybb->usergroup['cantrackpms']) { $mybb->input['options']['readreceipt'] = false;
|
}
$pm['options'] = array(
| }
$pm['options'] = array(
|
Zeile 603 | Zeile 608 |
---|
// 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())
|
{
| {
|
$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";
|
Zeile 616 | Zeile 621 |
---|
if(isset($pminfo['draftsaved'])) { redirect("private.php", $lang->redirect_pmsaved);
|
if(isset($pminfo['draftsaved'])) { redirect("private.php", $lang->redirect_pmsaved);
|
}
| }
|
else { redirect("private.php", $lang->redirect_pmsent); } } }
|
else { redirect("private.php", $lang->redirect_pmsent); } } }
|
|
|
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 = '';
| $smilieinserter = $codebuttons = '';
|
Zeile 643 | Zeile 648 |
---|
$smilieinserter = build_clickable_smilies(); } }
|
$smilieinserter = build_clickable_smilies(); } }
|
| $lang->post_icon = $lang->message_icon;
|
$posticons = get_post_icons();
|
$posticons = get_post_icons();
|
$previewmessage = $mybb->input['message']; $message = htmlspecialchars_uni($mybb->input['message']); $subject = $previewsubject = htmlspecialchars_uni($mybb->input['subject']);
| $message = htmlspecialchars_uni($parser->parse_badwords($mybb->input['message'])); $subject = htmlspecialchars_uni($parser->parse_badwords($mybb->input['subject']));
|
if($mybb->input['preview'] || $send_errors) {
| if($mybb->input['preview'] || $send_errors) {
|
Zeile 677 | Zeile 683 |
---|
{ $options = $mybb->input['options']; $query = $db->query("
|
{ $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
| SELECT u.username AS userusername, u.*, f.*
|
FROM ".TABLE_PREFIX."users u LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
|
FROM ".TABLE_PREFIX."users u LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
|
LEFT JOIN ".TABLE_PREFIX."usergroups g ON (g.gid=u.usergroup)
| |
WHERE u.uid='".$mybb->user['uid']."' ");
|
WHERE u.uid='".$mybb->user['uid']."' ");
|
|
|
$post = $db->fetch_array($query);
|
$post = $db->fetch_array($query);
|
|
|
$post['userusername'] = $mybb->user['username']; $post['postusername'] = $mybb->user['username'];
|
$post['userusername'] = $mybb->user['username']; $post['postusername'] = $mybb->user['username'];
|
$post['message'] = $previewmessage; $post['subject'] = $previewsubject;
| $post['message'] = $mybb->input['message']; $post['subject'] = htmlspecialchars_uni($mybb->input['subject']);
|
$post['icon'] = $mybb->input['icon']; $post['smilieoff'] = $options['disablesmilies']; $post['dateline'] = TIME_NOW;
|
$post['icon'] = $mybb->input['icon']; $post['smilieoff'] = $options['disablesmilies']; $post['dateline'] = TIME_NOW;
|
|
|
if(!$options['signature'])
|
if(!$options['signature'])
|
{
| {
|
$post['includesig'] = 0;
|
$post['includesig'] = 0;
|
}
| }
|
else
|
else
|
{
| {
|
$post['includesig'] = 1; }
|
$post['includesig'] = 1; }
|
| // Merge usergroup data from the cache $data_key = array( 'title' => 'grouptitle', 'usertitle' => 'groupusertitle', 'stars' => 'groupstars', 'starimage' => 'groupstarimage', 'image' => 'groupimage', 'namestyle' => 'namestyle', 'usereputationsystem' => 'usereputationsystem' );
foreach($data_key as $field => $key) { $post[$key] = $groupscache[$post['usergroup']][$field]; }
|
$postbit = build_postbit($post, 2); eval("\$preview = \"".$templates->get("previewpost")."\";"); } else if(!$send_errors)
|
$postbit = build_postbit($post, 2); eval("\$preview = \"".$templates->get("previewpost")."\";"); } else if(!$send_errors)
|
{
| {
|
// New PM, so load default settings if($mybb->user['signature'] != '') {
| // New PM, so load default settings if($mybb->user['signature'] != '') {
|
Zeile 723 | Zeile 748 |
---|
SELECT pm.*, u.username AS quotename FROM ".TABLE_PREFIX."privatemessages pm LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=pm.fromid)
|
SELECT pm.*, u.username AS quotename FROM ".TABLE_PREFIX."privatemessages pm LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=pm.fromid)
|
WHERE pm.pmid='".intval($mybb->input['pmid'])."' AND pm.uid='".$mybb->user['uid']."'
| WHERE pm.pmid='{$mybb->input['pmid']}' AND pm.uid='{$mybb->user['uid']}'
|
");
|
");
|
$pm = $db->fetch_array($query);
| |
|
|
$message = htmlspecialchars_uni($pm['message']); $subject = htmlspecialchars_uni($pm['subject']);
| $pm = $db->fetch_array($query); $message = htmlspecialchars_uni($parser->parse_badwords($pm['message'])); $subject = htmlspecialchars_uni($parser->parse_badwords($pm['subject']));
|
if($pm['folder'] == "3")
|
if($pm['folder'] == "3")
|
{ // message saved in drafts
| { // message saved in drafts
|
$mybb->input['uid'] = $pm['toid'];
if($pm['includesig'] == 1)
| $mybb->input['uid'] = $pm['toid'];
if($pm['includesig'] == 1)
|
Zeile 739 | Zeile 765 |
---|
$optionschecked['signature'] = 'checked="checked"'; } if($pm['smilieoff'] == 1)
|
$optionschecked['signature'] = 'checked="checked"'; } if($pm['smilieoff'] == 1)
|
{
| {
|
$optionschecked['disablesmilies'] = 'checked="checked"'; } if($pm['receipt']) { $optionschecked['readreceipt'] = 'checked="checked"';
|
$optionschecked['disablesmilies'] = 'checked="checked"'; } if($pm['receipt']) { $optionschecked['readreceipt'] = 'checked="checked"';
|
}
| }
|
// Get list of recipients $recipients = unserialize($pm['recipients']);
| // Get list of recipients $recipients = unserialize($pm['recipients']);
|
Zeile 763 | Zeile 789 |
---|
if(isset($recipients['bcc']) && is_array($recipients['bcc'])) { foreach($recipients['bcc'] as $recipient)
|
if(isset($recipients['bcc']) && is_array($recipients['bcc'])) { foreach($recipients['bcc'] as $recipient)
|
{
| {
|
$recipient_list['bcc'][] = $recipient; $recipientids .= $comma.$recipient; $comma = ',';
| $recipient_list['bcc'][] = $recipient; $recipientids .= $comma.$recipient; $comma = ',';
|
Zeile 782 | Zeile 808 |
---|
else { $to .= htmlspecialchars_uni($user['username']).', ';
|
else { $to .= htmlspecialchars_uni($user['username']).', ';
|
}
| }
|
} } } else
|
} } } else
|
{ // forward/reply
| { // forward/reply
|
$subject = preg_replace("#(FW|RE):( *)#is", '', $subject); $postdate = my_date($mybb->settings['dateformat'], $pm['dateline']); $posttime = my_date($mybb->settings['timeformat'], $pm['dateline']);
|
$subject = preg_replace("#(FW|RE):( *)#is", '', $subject); $postdate = my_date($mybb->settings['dateformat'], $pm['dateline']); $posttime = my_date($mybb->settings['timeformat'], $pm['dateline']);
|
$message = "[quote={$pm['quotename']}]\n$message\n[/quote]";
| $message = "[quote='{$pm['quotename']}']\n$message\n[/quote]";
|
$message = preg_replace('#^/me (.*)$#im', "* ".$pm['quotename']." \\1", $message);
if($mybb->input['do'] == 'forward')
| $message = preg_replace('#^/me (.*)$#im', "* ".$pm['quotename']." \\1", $message);
if($mybb->input['do'] == 'forward')
|
Zeile 803 | Zeile 830 |
---|
$subject = "Re: $subject"; $uid = $pm['fromid']; if($mybb->user['uid'] == $uid)
|
$subject = "Re: $subject"; $uid = $pm['fromid']; if($mybb->user['uid'] == $uid)
|
{
| {
|
$to = $mybb->user['username']; } else
| $to = $mybb->user['username']; } else
|
Zeile 835 | Zeile 862 |
---|
$query = $db->simple_select('users', 'uid, username', "uid IN ({$recipientids})"); while($user = $db->fetch_array($query)) {
|
$query = $db->simple_select('users', 'uid, username', "uid IN ({$recipientids})"); while($user = $db->fetch_array($query)) {
|
$to .= $comma.htmlspecialchars($user['username']);
| $to .= $comma.htmlspecialchars_uni($user['username']);
|
$comma = $lang->comma;
|
$comma = $lang->comma;
|
} } } }
| } } } }
|
// New PM with recipient preset if($mybb->input['uid'] && !$mybb->input['preview'])
|
// New PM with recipient preset if($mybb->input['uid'] && !$mybb->input['preview'])
|
{
| {
|
$query = $db->simple_select('users', 'username', "uid='".$db->escape_string($mybb->input['uid'])."'"); $to = htmlspecialchars_uni($db->fetch_field($query, 'username')).', '; }
$max_recipients = ''; if($mybb->usergroup['maxpmrecipients'] > 0)
|
$query = $db->simple_select('users', 'username', "uid='".$db->escape_string($mybb->input['uid'])."'"); $to = htmlspecialchars_uni($db->fetch_field($query, 'username')).', '; }
$max_recipients = ''; if($mybb->usergroup['maxpmrecipients'] > 0)
|
{
| {
|
$max_recipients = $lang->sprintf($lang->max_recipients, $mybb->usergroup['maxpmrecipients']); }
| $max_recipients = $lang->sprintf($lang->max_recipients, $mybb->usergroup['maxpmrecipients']); }
|
Zeile 859 | Zeile 886 |
---|
{ $to = htmlspecialchars_uni($mybb->input['to']); $bcc = htmlspecialchars_uni($mybb->input['bcc']);
|
{ $to = htmlspecialchars_uni($mybb->input['to']); $bcc = htmlspecialchars_uni($mybb->input['bcc']);
|
}
| }
|
// Load the auto complete javascript if it is enabled. eval("\$autocompletejs = \"".$templates->get("private_send_autocomplete")."\";");
$pmid = $mybb->input['pmid']; $do = $mybb->input['do']; if($do != "forward" && $do != "reply" && $do != "replyall")
|
// Load the auto complete javascript if it is enabled. eval("\$autocompletejs = \"".$templates->get("private_send_autocomplete")."\";");
$pmid = $mybb->input['pmid']; $do = $mybb->input['do']; if($do != "forward" && $do != "reply" && $do != "replyall")
|
{
| {
|
$do = ''; }
| $do = ''; }
|
Zeile 878 | Zeile 905 |
---|
eval("\$buddy_select_to = \"".$templates->get("private_send_buddyselect")."\";"); $buddy_select = 'bcc'; eval("\$buddy_select_bcc = \"".$templates->get("private_send_buddyselect")."\";");
|
eval("\$buddy_select_to = \"".$templates->get("private_send_buddyselect")."\";"); $buddy_select = 'bcc'; eval("\$buddy_select_bcc = \"".$templates->get("private_send_buddyselect")."\";");
|
}
| }
// Hide tracking option if no permission $private_send = $templates->get("private_send"); $tracking = ''; if($mybb->usergroup['cantrackpms']) { $tracking = $templates->get("private_send_tracking"); } eval("\$private_send_tracking = \"".$tracking."\";"); // Hide signature option if no permission $option_signature = ''; if($mybb->usergroup['canusesig'] && !$mybb->user['suspendsignature']) { $option_signature = $templates->get('private_send_signature'); } eval("\$private_send_signature = \"".$option_signature."\";");
|
$plugins->run_hooks("private_send_end");
|
$plugins->run_hooks("private_send_end");
|
eval("\$send = \"".$templates->get("private_send")."\";");
| eval("\$send = \"".$private_send."\";");
|
output_page($send); }
|
output_page($send); }
|
| |
if($mybb->input['action'] == "read") {
| if($mybb->input['action'] == "read") {
|
Zeile 894 | Zeile 937 |
---|
$pmid = intval($mybb->input['pmid']);
$query = $db->query("
|
$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
| SELECT pm.*, u.*, f.*
|
FROM ".TABLE_PREFIX."privatemessages pm LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=pm.fromid) LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
|
FROM ".TABLE_PREFIX."privatemessages pm LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=pm.fromid) LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
|
LEFT JOIN ".TABLE_PREFIX."usergroups g ON (g.gid=u.usergroup)
| |
WHERE pm.pmid='".intval($mybb->input['pmid'])."' AND pm.uid='".$mybb->user['uid']."' "); $pm = $db->fetch_array($query);
| WHERE pm.pmid='".intval($mybb->input['pmid'])."' AND pm.uid='".$mybb->user['uid']."' "); $pm = $db->fetch_array($query);
|
Zeile 911 | Zeile 953 |
---|
if(!$pm['pmid']) { error($lang->error_invalidpm);
|
if(!$pm['pmid']) { error($lang->error_invalidpm);
|
| }
// If we've gotten a PM, attach the group info $data_key = array( 'title' => 'grouptitle', 'usertitle' => 'groupusertitle', 'stars' => 'groupstars', 'starimage' => 'groupstarimage', 'image' => 'groupimage', 'namestyle' => 'namestyle' );
foreach($data_key as $field => $key) { $pm[$key] = $groupscache[$pm['usergroup']][$field];
|
}
if($pm['receipt'] == 1)
| }
if($pm['receipt'] == 1)
|
Zeile 990 | Zeile 1047 |
---|
$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'] == 0) { $pm['username'] = $lang->mybb_engine;
| if($pm['fromid'] == 0) { $pm['username'] = $lang->mybb_engine;
|
Zeile 1073 | Zeile 1131 |
---|
if($mybb->input['action'] == "tracking") {
|
if($mybb->input['action'] == "tracking") {
|
| if(!$mybb->usergroup['cantrackpms']) { error_no_permission(); }
|
$plugins->run_hooks("private_tracking_start"); $readmessages = ''; $unreadmessages = '';
| $plugins->run_hooks("private_tracking_start"); $readmessages = ''; $unreadmessages = '';
|
Zeile 1208 | Zeile 1271 |
---|
} } $plugins->run_hooks("private_do_tracking_end");
|
} } $plugins->run_hooks("private_do_tracking_end");
|
redirect("private.php", $lang->redirect_pmstrackingstopped);
| redirect("private.php?action=tracking", $lang->redirect_pmstrackingstopped);
|
} elseif($mybb->input['stoptrackingunread']) {
| } elseif($mybb->input['stoptrackingunread']) {
|
Zeile 1223 | Zeile 1286 |
---|
} } $plugins->run_hooks("private_do_tracking_end");
|
} } $plugins->run_hooks("private_do_tracking_end");
|
redirect("private.php", $lang->redirect_pmstrackingstopped);
| redirect("private.php?action=tracking", $lang->redirect_pmstrackingstopped);
|
} elseif($mybb->input['cancel']) {
| } elseif($mybb->input['cancel']) {
|
Zeile 1249 | Zeile 1312 |
---|
} } $plugins->run_hooks("private_do_tracking_end");
|
} } $plugins->run_hooks("private_do_tracking_end");
|
redirect("private.php", $lang->redirect_pmstrackingcanceled);
| redirect("private.php?action=tracking", $lang->redirect_pmstrackingcanceled);
|
} }
| } }
|
Zeile 1529 | Zeile 1592 |
---|
"deletetime" => TIME_NOW ); $db->update_query("privatemessages", $sql_array, "pmid='".$key."' AND uid='".$mybb->user['uid']."'");
|
"deletetime" => TIME_NOW ); $db->update_query("privatemessages", $sql_array, "pmid='".$key."' AND uid='".$mybb->user['uid']."'");
|
}
| }
|
} } // Update PM count
| } } // Update PM count
|
Zeile 1572 | Zeile 1635 |
---|
$plugins->run_hooks("private_delete_end"); redirect("private.php", $lang->redirect_pmsdeleted);
|
$plugins->run_hooks("private_delete_end"); redirect("private.php", $lang->redirect_pmsdeleted);
|
}
| }
|
if($mybb->input['action'] == "export") {
| if($mybb->input['action'] == "export") {
|
Zeile 1634 | Zeile 1697 |
---|
$wsql .= ">="; } $wsql .= "'$datecut'";
|
$wsql .= ">="; } $wsql .= "'$datecut'";
|
} else {
| } else {
|
$wsql = "1=1"; }
| $wsql = "1=1"; }
|
Zeile 1679 | Zeile 1742 |
---|
{ $wsql .= " AND pm.status!='0'"; }
|
{ $wsql .= " AND pm.status!='0'"; }
|
}
| }
|
$query = $db->query(" SELECT pm.*, fu.username AS fromusername, tu.username AS tousername FROM ".TABLE_PREFIX."privatemessages pm
| $query = $db->query(" SELECT pm.*, fu.username AS fromusername, tu.username AS tousername FROM ".TABLE_PREFIX."privatemessages pm
|
Zeile 1690 | Zeile 1753 |
---|
"); $numpms = $db->num_rows($query); if(!$numpms)
|
"); $numpms = $db->num_rows($query); if(!$numpms)
|
{
| {
|
error($lang->error_nopmsarchive); }
| error($lang->error_nopmsarchive); }
|
Zeile 1700 | Zeile 1763 |
---|
if($message['folder'] == 2 || $message['folder'] == 3) { // Sent Items or Drafts Folder Check if($message['toid'])
|
if($message['folder'] == 2 || $message['folder'] == 3) { // Sent Items or Drafts Folder Check if($message['toid'])
|
{
| {
|
$tofromuid = $message['toid']; if($mybb->input['exporttype'] == "txt") {
| $tofromuid = $message['toid']; if($mybb->input['exporttype'] == "txt") {
|
Zeile 1818 | Zeile 1881 |
---|
eval("\$pmsdownload .= \"".$templates->get("private_archive_".$mybb->input['exporttype']."_message", 1, 0)."\";"); $ids .= ",'{$message['pmid']}'"; }
|
eval("\$pmsdownload .= \"".$templates->get("private_archive_".$mybb->input['exporttype']."_message", 1, 0)."\";"); $ids .= ",'{$message['pmid']}'"; }
|
$query = $db->simple_select("themestylesheets", "stylesheet", "sid=1", array('limit' => 1)); $css = $db->fetch_field($query, "stylesheet");
| if($mybb->input['exporttype'] == "html") { // Gather global stylesheet for HTML $query = $db->simple_select("themestylesheets", "stylesheet", "sid = '1'", array('limit' => 1)); $css = $db->fetch_field($query, "stylesheet"); }
|
$plugins->run_hooks("private_do_export_end");
eval("\$archived = \"".$templates->get("private_archive_".$mybb->input['exporttype'], 1, 0)."\";");
| $plugins->run_hooks("private_do_export_end");
eval("\$archived = \"".$templates->get("private_archive_".$mybb->input['exporttype'], 1, 0)."\";");
|
Zeile 1830 | Zeile 1897 |
---|
$db->delete_query("privatemessages", "pmid IN ('0'$ids)"); // Update PM count update_pm_count();
|
$db->delete_query("privatemessages", "pmid IN ('0'$ids)"); // Update PM count update_pm_count();
|
}
| }
|
if($mybb->input['exporttype'] == "html")
|
if($mybb->input['exporttype'] == "html")
|
{
| {
|
$filename = "pm-archive.html"; $contenttype = "text/html";
|
$filename = "pm-archive.html"; $contenttype = "text/html";
|
}
| }
|
elseif($mybb->input['exporttype'] == "csv")
|
elseif($mybb->input['exporttype'] == "csv")
|
{
| {
|
$filename = "pm-archive.csv"; $contenttype = "application/octet-stream";
|
$filename = "pm-archive.csv"; $contenttype = "application/octet-stream";
|
}
| }
|
else { $filename = "pm-archive.txt";
| else { $filename = "pm-archive.txt";
|
Zeile 1851 | Zeile 1918 |
---|
$archived = str_replace("\\\'","'",$archived); header("Content-disposition: filename=$filename"); header("Content-type: ".$contenttype);
|
$archived = str_replace("\\\'","'",$archived); header("Content-disposition: filename=$filename"); header("Content-type: ".$contenttype);
|
|
|
if($mybb->input['exporttype'] == "html") { output_page($archived); } else
|
if($mybb->input['exporttype'] == "html") { output_page($archived); } else
|
{
| {
|
echo $archived;
|
echo $archived;
|
}
| }
|
}
if(!$mybb->input['action']) { $plugins->run_hooks("private_start");
|
}
if(!$mybb->input['action']) { $plugins->run_hooks("private_start");
|
|
|
if(!$mybb->input['fid'] || !array_key_exists($mybb->input['fid'], $foldernames)) { $mybb->input['fid'] = 1; } $folder = $mybb->input['fid'];
|
if(!$mybb->input['fid'] || !array_key_exists($mybb->input['fid'], $foldernames)) { $mybb->input['fid'] = 1; } $folder = $mybb->input['fid'];
|
$foldername = htmlspecialchars_uni($foldernames[$folder]);
| $foldername = $foldernames[$folder];
|
$lang->pms_in_folder = $lang->sprintf($lang->pms_in_folder, $foldername); if($folder == 2 || $folder == 3)
| $lang->pms_in_folder = $lang->sprintf($lang->pms_in_folder, $foldername); if($folder == 2 || $folder == 3)
|