Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/eula.html *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/eula.html *
|
* $Id: private.php 3171 2007-06-29 04:57:39Z chris $
| * $Id: private.php 3596 2008-01-20 08:27:39Z Tikitiki $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 48 | Zeile 48 |
---|
$db->update_query(TABLE_PREFIX."users", $sql_array, "uid = ".$mybb->user['uid']); }
|
$db->update_query(TABLE_PREFIX."users", $sql_array, "uid = ".$mybb->user['uid']); }
|
// On a random occassion, recount the users pm's just to make sure everything is in sync. if($rand == 5) { update_pm_count(); }
| $timecut = time()-(60*60*24*7); $db->delete_query(TABLE_PREFIX."privatemessages", "dateline <= $timecut AND folder='4' AND uid='".$mybb->user['uid']."'");
|
|
|
$timecut = time()-(60*60*24*7); $db->delete_query(TABLE_PREFIX."privatemessages", "dateline <= $timecut AND folder='4' AND uid='".$mybb->user['uid']."'");
| // On a random occassion, recount the users pm's just to make sure everything is in sync. if($rand == 5 || $db->affected_rows() > 0) { update_pm_count(); }
|
$folderjump = "<select name=\"jumpto\">\n"; $folderoplist = "<select name=\"fid\">\n";
| $folderjump = "<select name=\"jumpto\">\n"; $folderoplist = "<select name=\"fid\">\n";
|
Zeile 68 | Zeile 68 |
---|
if($fid == $folderinfo[0]) { $sel = "selected";
|
if($fid == $folderinfo[0]) { $sel = "selected";
|
} else
| } else
|
{ $sel = ""; }
| { $sel = ""; }
|
Zeile 116 | Zeile 116 |
---|
if($mybb->input['action'] == "do_send" && $mybb->request_method == "post") {
|
if($mybb->input['action'] == "do_send" && $mybb->request_method == "post") {
|
| if($mybb->usergroup['cansendpms'] == "no") { error_no_permission(); } // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$plugins->run_hooks("private_send_do_send");
// Attempt to see if this PM is a duplicate or not
| $plugins->run_hooks("private_send_do_send");
// Attempt to see if this PM is a duplicate or not
|
Zeile 156 | Zeile 164 |
---|
$pm['saveasdraft'] = 1; } $pmhandler->set_data($pm);
|
$pm['saveasdraft'] = 1; } $pmhandler->set_data($pm);
|
|
|
// Now let the pm handler do all the hard work. if(!$pmhandler->validate_pm()) {
| // Now let the pm handler do all the hard work. if(!$pmhandler->validate_pm()) {
|
Zeile 183 | Zeile 191 |
---|
if($mybb->input['action'] == "send") {
|
if($mybb->input['action'] == "send") {
|
| if($mybb->usergroup['cansendpms'] == "no") { error_no_permission(); }
|
$plugins->run_hooks("private_send_start");
if($mybb->settings['bbcodeinserter'] != "off" && $mybb->settings['pmsallowmycode'] != "no" && $mybb->user['showcodebuttons'] != 0) { $codebuttons = build_mycode_inserter(); if($mybb->settings['pmsallowsmilies'] != "no")
|
$plugins->run_hooks("private_send_start");
if($mybb->settings['bbcodeinserter'] != "off" && $mybb->settings['pmsallowmycode'] != "no" && $mybb->user['showcodebuttons'] != 0) { $codebuttons = build_mycode_inserter(); if($mybb->settings['pmsallowsmilies'] != "no")
|
{
| {
|
$smilieinserter = build_clickable_smilies(); } }
|
$smilieinserter = build_clickable_smilies(); } }
|
|
|
$posticons = get_post_icons(); $previewmessage = $mybb->input['message']; $message = htmlspecialchars_uni($mybb->input['message']);
| $posticons = get_post_icons(); $previewmessage = $mybb->input['message']; $message = htmlspecialchars_uni($mybb->input['message']);
|
Zeile 202 | Zeile 214 |
---|
if($mybb->input['preview'] || $send_errors) {
|
if($mybb->input['preview'] || $send_errors) {
|
| $options = $mybb->input['options'];
|
if($options['signature'] == "yes") {
|
if($options['signature'] == "yes") {
|
$optionschecked['signature'] = "checked";
| $optionschecked['signature'] = "checked=\"checked\"";
|
} if($options['disablesmilies'] == "yes") {
|
} if($options['disablesmilies'] == "yes") {
|
$optionschecked['disablesmilies'] = "checked";
| $optionschecked['disablesmilies'] = "checked=\"checked\"";
|
} if($options['savecopy'] != "no") {
|
} if($options['savecopy'] != "no") {
|
$optionschecked['savecopy'] = "checked";
| $optionschecked['savecopy'] = "checked=\"checked\"";
|
} if($options['readreceipt'] != "no") {
|
} if($options['readreceipt'] != "no") {
|
$optionschecked['readreceipt'] = "checked";
| $optionschecked['readreceipt'] = "checked=\"checked\"";
|
} $to = htmlspecialchars_uni($mybb->input['to']); }
| } $to = htmlspecialchars_uni($mybb->input['to']); }
|
Zeile 224 | Zeile 237 |
---|
// Preview if($mybb->input['preview']) {
|
// Preview if($mybb->input['preview']) {
|
$options = $mybb->input['options'];
| |
$query = $db->query(" SELECT u.username AS userusername, u.*, f.*, g.title AS grouptitle, g.usertitle AS groupusertitle, g.namestyle, g.stars AS groupstars, g.starimage AS groupstarimage, g.image AS groupimage, g.usereputationsystem FROM ".TABLE_PREFIX."users u
| $query = $db->query(" SELECT u.username AS userusername, u.*, f.*, g.title AS grouptitle, g.usertitle AS groupusertitle, g.namestyle, g.stars AS groupstars, g.starimage AS groupstarimage, g.image AS groupimage, g.usereputationsystem FROM ".TABLE_PREFIX."users u
|
Zeile 330 | Zeile 342 |
---|
$query = $db->simple_select(TABLE_PREFIX."users", "username", "uid='".intval($mybb->input['uid'])."'"); $user = $db->fetch_array($query); $to = htmlspecialchars_uni($user['username']);
|
$query = $db->simple_select(TABLE_PREFIX."users", "username", "uid='".intval($mybb->input['uid'])."'"); $user = $db->fetch_array($query); $to = htmlspecialchars_uni($user['username']);
|
}
| }
|
// Load the auto complete javascript if it is enabled. eval("\$autocompletejs = \"".$templates->get("private_send_autocomplete")."\";");
| // Load the auto complete javascript if it is enabled. eval("\$autocompletejs = \"".$templates->get("private_send_autocomplete")."\";");
|
Zeile 346 | Zeile 358 |
---|
output_page($send); }
|
output_page($send); }
|
|
|
if($mybb->input['action'] == "read")
|
if($mybb->input['action'] == "read")
|
{
| {
|
$plugins->run_hooks("private_read");
$pmid = intval($mybb->input['pmid']);
| $plugins->run_hooks("private_read");
$pmid = intval($mybb->input['pmid']);
|
Zeile 383 | Zeile 395 |
---|
} } if($pm['status'] == "0")
|
} } if($pm['status'] == "0")
|
{
| {
|
$time = time(); $updatearray = array( 'status' => 1,
| $time = time(); $updatearray = array( 'status' => 1,
|
Zeile 402 | Zeile 414 |
---|
} $pm['userusername'] = $pm['username']; $pm['subject'] = htmlspecialchars_uni($parser->parse_badwords($pm['subject']));
|
} $pm['userusername'] = $pm['username']; $pm['subject'] = htmlspecialchars_uni($parser->parse_badwords($pm['subject']));
|
if($pm['fromid'] == -2)
| if($pm['fromid'] == 0)
|
{ $pm['username'] = "MyBB Engine"; }
| { $pm['username'] = "MyBB Engine"; }
|
Zeile 453 | Zeile 465 |
---|
} if($mybb->input['action'] == "do_tracking" && $mybb->request_method == "post") {
|
} if($mybb->input['action'] == "do_tracking" && $mybb->request_method == "post") {
|
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$plugins->run_hooks("private_do_tracking_start"); if($mybb->input['stoptracking']) {
| $plugins->run_hooks("private_do_tracking_start"); if($mybb->input['stoptracking']) {
|
Zeile 470 | Zeile 485 |
---|
redirect("private.php", $lang->redirect_pmstrackingstopped); } elseif($mybb->input['stoptrackingunread'])
|
redirect("private.php", $lang->redirect_pmstrackingstopped); } elseif($mybb->input['stoptrackingunread'])
|
{
| {
|
if(is_array($mybb->input['unreadcheck'])) { foreach($mybb->input['unreadcheck'] as $key => $val)
| if(is_array($mybb->input['unreadcheck'])) { foreach($mybb->input['unreadcheck'] as $key => $val)
|
Zeile 479 | Zeile 494 |
---|
"receipt" => 0 ); $db->update_query(TABLE_PREFIX."privatemessages", $sql_array, "pmid=".intval($key)." AND fromid=".$mybb->user['uid']);
|
"receipt" => 0 ); $db->update_query(TABLE_PREFIX."privatemessages", $sql_array, "pmid=".intval($key)." AND fromid=".$mybb->user['uid']);
|
} }
| } }
|
$plugins->run_hooks("private_do_tracking_end"); redirect("private.php", $lang->redirect_pmstrackingstopped); }
| $plugins->run_hooks("private_do_tracking_end"); redirect("private.php", $lang->redirect_pmstrackingstopped); }
|
Zeile 489 | Zeile 504 |
---|
if(is_array($mybb->input['unreadcheck'])) { foreach($mybb->input['unreadcheck'] as $pmid => $val)
|
if(is_array($mybb->input['unreadcheck'])) { foreach($mybb->input['unreadcheck'] as $pmid => $val)
|
{
| {
|
$pmids[$pmid] = intval($pmid); } $pmids = implode(",", $pmids);
| $pmids[$pmid] = intval($pmid); } $pmids = implode(",", $pmids);
|
Zeile 507 | Zeile 522 |
---|
} $plugins->run_hooks("private_do_tracking_end"); redirect("private.php", $lang->redirect_pmstrackingcancelled);
|
} $plugins->run_hooks("private_do_tracking_end"); redirect("private.php", $lang->redirect_pmstrackingcancelled);
|
} }
| } }
|
if($mybb->input['action'] == "folders") {
| if($mybb->input['action'] == "folders") {
|
Zeile 546 | Zeile 561 |
---|
if($mybb->input['action'] == "do_folders" && $mybb->request_method == "post") {
|
if($mybb->input['action'] == "do_folders" && $mybb->request_method == "post") {
|
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$plugins->run_hooks("private_do_folders_start"); $highestid = 2; $folders = '';
| $plugins->run_hooks("private_do_folders_start"); $highestid = 2; $folders = '';
|
Zeile 622 | Zeile 640 |
---|
"pmfolders" => $folders ); $db->update_query(TABLE_PREFIX."users", $sql_array, "uid='".$mybb->user['uid']."'");
|
"pmfolders" => $folders ); $db->update_query(TABLE_PREFIX."users", $sql_array, "uid='".$mybb->user['uid']."'");
|
| // Update PM count update_pm_count();
|
$plugins->run_hooks("private_do_folders_end"); redirect("private.php", $lang->redirect_pmfoldersupdated); }
| $plugins->run_hooks("private_do_folders_end"); redirect("private.php", $lang->redirect_pmfoldersupdated); }
|
Zeile 644 | Zeile 664 |
---|
eval("\$folders = \"".$templates->get("private_empty")."\";"); $plugins->run_hooks("private_empty_end"); output_page($folders);
|
eval("\$folders = \"".$templates->get("private_empty")."\";"); $plugins->run_hooks("private_empty_end"); output_page($folders);
|
}
| }
|
if($mybb->input['action'] == "do_empty" && $mybb->request_method == "post") {
|
if($mybb->input['action'] == "do_empty" && $mybb->request_method == "post") {
|
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$plugins->run_hooks("private_do_empty_start"); $emptyq = ''; if(is_array($mybb->input['empty']))
| $plugins->run_hooks("private_do_empty_start"); $emptyq = ''; if(is_array($mybb->input['empty']))
|
Zeile 682 | Zeile 705 |
---|
if($mybb->input['action'] == "do_stuff" && $mybb->request_method == "post") {
|
if($mybb->input['action'] == "do_stuff" && $mybb->request_method == "post") {
|
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$plugins->run_hooks("private_do_stuff"); if($mybb->input['hop']) {
| $plugins->run_hooks("private_do_stuff"); if($mybb->input['hop']) {
|
Zeile 748 | Zeile 774 |
---|
if($mybb->input['action'] == "delete") {
|
if($mybb->input['action'] == "delete") {
|
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$plugins->run_hooks("private_delete_start");
$sql_array = array(
| $plugins->run_hooks("private_delete_start");
$sql_array = array(
|
Zeile 782 | Zeile 811 |
---|
if($mybb->input['action'] == "do_export" && $mybb->request_method == "post") {
|
if($mybb->input['action'] == "do_export" && $mybb->request_method == "post") {
|
if($mybb->input['exporttype'] != "csv" && $mybb->input['exporttype'] != "text" && $mybb->input['exporttype'] != "html")
| if($mybb->input['exporttype'] != "csv" && $mybb->input['exporttype'] != "txt" && $mybb->input['exporttype'] != "html")
|
{ exit; }
|
{ exit; }
|
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
$plugins->run_hooks("private_do_export_start"); $lang->private_messages_for = sprintf($lang->private_messages_for, $mybb->user['username']); $exdate = my_date($mybb->settings['dateformat'], time(), 0, 0);
| $plugins->run_hooks("private_do_export_start"); $lang->private_messages_for = sprintf($lang->private_messages_for, $mybb->user['username']); $exdate = my_date($mybb->settings['dateformat'], time(), 0, 0);
|
Zeile 797 | Zeile 830 |
---|
$wsql = "pmid='".intval($mybb->input['pmid'])."' AND uid='".$mybb->user['uid']."'"; } else
|
$wsql = "pmid='".intval($mybb->input['pmid'])."' AND uid='".$mybb->user['uid']."'"; } else
|
{
| {
|
if($mybb->input['daycut'] && ($mybb->input['dayway'] != "disregard")) { $datecut = time()-($mybb->input['daycut'] * 86400);
| if($mybb->input['daycut'] && ($mybb->input['dayway'] != "disregard")) { $datecut = time()-($mybb->input['daycut'] * 86400);
|
Zeile 831 | Zeile 864 |
---|
else { if(!$folderlst)
|
else { if(!$folderlst)
|
{
| {
|
$folderlst = " AND pm.folder IN ('$val'"; } else
| $folderlst = " AND pm.folder IN ('$val'"; } else
|
Zeile 865 | Zeile 898 |
---|
"); $numpms = $db->num_rows($query); if(!$numpms)
|
"); $numpms = $db->num_rows($query); if(!$numpms)
|
{
| {
|
error($lang->error_nopmsarchive); } $pmsdownload = '';
| error($lang->error_nopmsarchive); } $pmsdownload = '';
|
Zeile 874 | Zeile 907 |
---|
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 883 | Zeile 916 |
---|
else { $tofromusername = build_profile_link($message['tousername'], $tofromuid);
|
else { $tofromusername = build_profile_link($message['tousername'], $tofromuid);
|
} } else { $tofromusername = $lang->not_sent;
| } } else { $tofromusername = $lang->not_sent;
|
} $tofrom = $lang->to; }
| } $tofrom = $lang->to; }
|
Zeile 902 | Zeile 935 |
---|
{ $tofromusername = build_profile_link($message['fromusername'], $tofromuid); }
|
{ $tofromusername = build_profile_link($message['fromusername'], $tofromuid); }
|
if($tofromuid == -2)
| if($tofromuid == 0)
|
{ $tofromusername = "MyBB Engine"; } $tofrom = $lang->from; }
|
{ $tofromusername = "MyBB Engine"; } $tofrom = $lang->from; }
|
if($tofromuid == -2)
| if($tofromuid == 0)
|
{ $message['fromusername'] = "MyBB Engine"; }
| { $message['fromusername'] = "MyBB Engine"; }
|
Zeile 1082 | Zeile 1116 |
---|
{ while($message = $db->fetch_array($query)) {
|
{ while($message = $db->fetch_array($query)) {
|
$msgalt = '';
| $msgalt = $msgsuffix = $msgprefix = '';
|
// Determine Folder Icon if($message['status'] == 0) { $msgfolder = 'new_pm.gif'; $msgalt = $lang->new_pm;
|
// Determine Folder Icon if($message['status'] == 0) { $msgfolder = 'new_pm.gif'; $msgalt = $lang->new_pm;
|
$doneunread = 1;
| $msgprefix = "<strong>"; $msgsuffix = "</strong>";
|
} elseif($message['status'] == 1) { $msgfolder = 'old_pm.gif'; $msgalt = $lang->old_pm;
|
} elseif($message['status'] == 1) { $msgfolder = 'old_pm.gif'; $msgalt = $lang->old_pm;
|
$doneread = 1;
| |
} elseif($message['status'] == 3) { $msgfolder = 're_pm.gif'; $msgalt = $lang->reply_pm;
|
} elseif($message['status'] == 3) { $msgfolder = 're_pm.gif'; $msgalt = $lang->reply_pm;
|
$doneread = 1;
| |
} elseif($message['status'] == 4) { $msgfolder = 'fw_pm.gif'; $msgalt = $lang->fwd_pm;
|
} elseif($message['status'] == 4) { $msgfolder = 'fw_pm.gif'; $msgalt = $lang->fwd_pm;
|
$doneread = 1;
| |
} if($folder == 2 || $folder == 3) { // Sent Items or Drafts Folder Check
| } if($folder == 2 || $folder == 3) { // Sent Items or Drafts Folder Check
|
Zeile 1124 | Zeile 1156 |
---|
{ $tofromusername = $message['fromusername']; $tofromuid = $message['fromid'];
|
{ $tofromusername = $message['fromusername']; $tofromuid = $message['fromid'];
|
if($tofromuid == -2)
| if($tofromuid == 0)
|
{ $tofromusername = 'MyBB Engine'; }
| { $tofromusername = 'MyBB Engine'; }
|
Zeile 1156 | Zeile 1188 |
---|
else { $senddate = $lang->not_sent;
|
else { $senddate = $lang->not_sent;
|
} if($doneunread && $doneread) { eval("\$messagelist .= \"".$templates->get("private_messagebit_sep")."\";"); $doneunread = 0; $doneread = 0;
| |
} eval("\$messagelist .= \"".$templates->get("private_messagebit")."\";");
|
} eval("\$messagelist .= \"".$templates->get("private_messagebit")."\";");
|
}
| }
|
} else
|
} else
|
{
| {
|
eval("\$messagelist .= \"".$templates->get("private_nomessages")."\";"); }
| eval("\$messagelist .= \"".$templates->get("private_nomessages")."\";"); }
|
Zeile 1175 | Zeile 1201 |
---|
{ $query = $db->simple_select(TABLE_PREFIX."privatemessages", "COUNT(*) AS total", "uid='".$mybb->user['uid']."'"); $pmscount = $db->fetch_array($query);
|
{ $query = $db->simple_select(TABLE_PREFIX."privatemessages", "COUNT(*) AS total", "uid='".$mybb->user['uid']."'"); $pmscount = $db->fetch_array($query);
|
$spaceused = $pmscount['total'] / $mybb->usergroup['pmquota'] * 100;
| if($pmscount['total'] == 0) { $spaceused = 0; } else { $spaceused = $pmscount['total'] / $mybb->usergroup['pmquota'] * 100; }
|
$spaceused2 = 100 - $spaceused; if($spaceused <= "50") {
| $spaceused2 = 100 - $spaceused; if($spaceused <= "50") {
|