Zeile 3 | Zeile 3 |
---|
* MyBB 1.2 * Copyright � 2006 MyBB Group, All Rights Reserved *
|
* MyBB 1.2 * Copyright � 2006 MyBB Group, All Rights Reserved *
|
* Website: http://www.mybboard.com * License: http://www.mybboard.com/eula.html
| * Website: http://www.mybboard.net * License: http://www.mybboard.net/eula.html
|
*
|
*
|
* $Id: private.php 2175 2006-08-31 04:27:16Z Tikitiki $
| * $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 115 | Zeile 115 |
---|
$send_errors = '';
if($mybb->input['action'] == "do_send" && $mybb->request_method == "post")
|
$send_errors = '';
if($mybb->input['action'] == "do_send" && $mybb->request_method == "post")
|
{ $plugins->run_hooks("private_send_do_send");
| { 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 $time_cutoff = time() - (5 * 60 * 60);
| // Attempt to see if this PM is a duplicate or not $time_cutoff = time() - (5 * 60 * 60);
|
Zeile 182 | Zeile 190 |
---|
}
if($mybb->input['action'] == "send")
|
}
if($mybb->input['action'] == "send")
|
{
$plugins->run_hooks("private_send_start");
if($mybb->settings['bbcodeinserter'] != "off" && $mybb->settings['pmsallowmycode'] != "no" && $mybb->user['showcodebuttons'] != 0)
| { 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();
|
{ $codebuttons = build_mycode_inserter();
|
} if($mybb->settings['pmsallowsmilies'] != "no") { $smilieinserter = build_clickable_smilies();
| if($mybb->settings['pmsallowsmilies'] != "no") { $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']);
|
| $subject = $previewsubject = htmlspecialchars_uni($mybb->input['subject']);
|
|
|
if($mybb->input['preview'])
| if($mybb->input['preview'] || $send_errors)
|
{ $options = $mybb->input['options'];
|
{ $options = $mybb->input['options'];
|
$query = $db->query("
| if($options['signature'] == "yes") { $optionschecked['signature'] = "checked=\"checked\""; } if($options['disablesmilies'] == "yes") { $optionschecked['disablesmilies'] = "checked=\"checked\""; } if($options['savecopy'] != "no") { $optionschecked['savecopy'] = "checked=\"checked\""; } if($options['readreceipt'] != "no") { $optionschecked['readreceipt'] = "checked=\"checked\""; } $to = htmlspecialchars_uni($mybb->input['to']); } // Preview if($mybb->input['preview']) { $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 LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
| 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 LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
|
Zeile 213 | Zeile 248 |
---|
$post['userusername'] = $mybb->user['username']; $post['postusername'] = $mybb->user['username']; $post['message'] = $previewmessage;
|
$post['userusername'] = $mybb->user['username']; $post['postusername'] = $mybb->user['username']; $post['message'] = $previewmessage;
|
$post['subject'] = $mybb->input['subject'];
| $post['subject'] = $previewsubject;
|
$post['icon'] = $mybb->input['icon']; $post['smilieoff'] = $options['disablesmilies']; $post['dateline'] = time();
|
$post['icon'] = $mybb->input['icon']; $post['smilieoff'] = $options['disablesmilies']; $post['dateline'] = time();
|
| if(!$options['signature']) { $post['includesig'] = 'no'; } else { $post['includesig'] = 'yes'; } if(!$options['signature']) { $post['includesig'] = 'no'; } else { $post['includesig'] = 'yes'; }
|
$postbit = build_postbit($post, 2); eval("\$preview = \"".$templates->get("previewpost")."\";");
|
$postbit = build_postbit($post, 2); eval("\$preview = \"".$templates->get("previewpost")."\";");
|
if($options['signature'] == "yes") { $optionschecked['signature'] = "checked"; } if($options['disablesmilies'] == "yes") { $optionschecked['disablesmilies'] = "checked"; } if($options['savecopy'] != "no") { $optionschecked['savecopy'] = "checked"; } if($options['readreceipt'] != "no") { $optionschecked['readreceipt'] = "checked"; } $to = htmlspecialchars_uni($mybb->input['to']); $subject = htmlspecialchars_uni($mybb->input['subject']);
| |
}
|
}
|
else
| else if(!$send_errors)
|
{
|
{
|
| // New PM, so load default settings
|
if($mybb->user['signature'] != "") { $optionschecked['signature'] = "checked";
|
if($mybb->user['signature'] != "") { $optionschecked['signature'] = "checked";
|
}
| }
|
if($mybb->usergroup['cantrackpms'] == "yes") { $optionschecked['readreceipt'] = "checked"; } $optionschecked['savecopy'] = "checked";
|
if($mybb->usergroup['cantrackpms'] == "yes") { $optionschecked['readreceipt'] = "checked"; } $optionschecked['savecopy'] = "checked";
|
} if($mybb->input['pmid'] && !$mybb->input['preview'])
| } // Draft, reply, forward if($mybb->input['pmid'] > 0 && !$mybb->input['preview'])
|
{ $query = $db->query(" SELECT pm.*, u.username AS quotename
| { $query = $db->query(" SELECT pm.*, u.username AS quotename
|
Zeile 281 | Zeile 315 |
---|
} } else
|
} } else
|
{
| { // 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']);
|
Zeile 298 | Zeile 332 |
---|
$uid = $pm['fromid']; $query = $db->simple_select(TABLE_PREFIX."users", "username", "uid='".$uid."'"); $user = $db->fetch_array($query);
|
$uid = $pm['fromid']; $query = $db->simple_select(TABLE_PREFIX."users", "username", "uid='".$uid."'"); $user = $db->fetch_array($query);
|
$to = $user['username'];
| $to = htmlspecialchars_uni($user['username']);
|
} } }
|
} } }
|
| // New PM with recipient preset
|
if($mybb->input['uid'] && !$mybb->input['preview']) {
|
if($mybb->input['uid'] && !$mybb->input['preview']) {
|
$query = $db->simple_select(TABLE_PREFIX."users", "username", "uid='".intval($mybb->input['uid'])."'"); $user = $db->fetch_array($query); $to = $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.
| }
// Load the auto complete javascript if it is enabled.
|
Zeile 314 | Zeile 349 |
---|
$pmid = $mybb->input['pmid']; $do = $mybb->input['do'];
|
$pmid = $mybb->input['pmid']; $do = $mybb->input['do'];
|
| if($do != "forward" && $do != "reply") { $do = ""; }
|
eval("\$send = \"".$templates->get("private_send")."\";"); $plugins->run_hooks("private_send_end"); output_page($send);
| eval("\$send = \"".$templates->get("private_send")."\";"); $plugins->run_hooks("private_send_end"); output_page($send);
|
Zeile 375 | 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 426 | 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 519 | 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 528 | Zeile 573 |
---|
if(!$donefolders[$val]) { if(my_substr($key, 0, 3) == "new")
|
if(!$donefolders[$val]) { if(my_substr($key, 0, 3) == "new")
|
{
| {
|
$highestid++; $fid = intval($highestid); }
| $highestid++; $fid = intval($highestid); }
|
Zeile 537 | Zeile 582 |
---|
if($key > $highestid) { $highestid = $key;
|
if($key > $highestid) { $highestid = $key;
|
}
| }
|
$fid = intval($key); switch($fid) {
| $fid = intval($key); switch($fid) {
|
Zeile 555 | Zeile 600 |
---|
break; case 3: if($val == $lang->folder_drafts)
|
break; case 3: if($val == $lang->folder_drafts)
|
{ $val = ''; } break;
| { $val = ''; } break;
|
case 4: if($val == $lang->folder_trash) { $val = ''; } break;
|
case 4: if($val == $lang->folder_trash) { $val = ''; } break;
|
} }
| } }
|
if($val != '' || ($key >= 1 && $key <= 4)) { $foldername = $val;
| if($val != '' || ($key >= 1 && $key <= 4)) { $foldername = $val;
|
Zeile 595 | 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 621 | Zeile 668 |
---|
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 633 | Zeile 683 |
---|
if($emptyq) { $emptyq .= " OR ";
|
if($emptyq) { $emptyq .= " OR ";
|
}
| }
|
$emptyq .= "folder='$key'";
|
$emptyq .= "folder='$key'";
|
}
| }
|
} if($emptyq != '') {
| } if($emptyq != '') {
|
Zeile 644 | Zeile 694 |
---|
$keepunreadq = " AND status!='0'"; } $db->delete_query(TABLE_PREFIX."privatemessages", "($emptyq) AND uid='".$mybb->user['uid']."' $keepunreadq");
|
$keepunreadq = " AND status!='0'"; } $db->delete_query(TABLE_PREFIX."privatemessages", "($emptyq) AND uid='".$mybb->user['uid']."' $keepunreadq");
|
} }
| } }
|
// Update PM count update_pm_count();
|
// Update PM count update_pm_count();
|
|
|
$plugins->run_hooks("private_do_empty_end"); redirect("private.php", $lang->redirect_pmfoldersemptied); }
if($mybb->input['action'] == "do_stuff" && $mybb->request_method == "post") {
|
$plugins->run_hooks("private_do_empty_end"); redirect("private.php", $lang->redirect_pmfoldersemptied); }
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'])
|
{ header("Location: private.php?fid=".$mybb->input['jumpto']);
| { header("Location: private.php?fid=".intval($mybb->input['jumpto']));
|
} elseif($mybb->input['moveto']) {
| } elseif($mybb->input['moveto']) {
|
Zeile 669 | Zeile 722 |
---|
$sql_array = array( "folder" => intval($mybb->input['fid']) );
|
$sql_array = array( "folder" => intval($mybb->input['fid']) );
|
$db->update_query(TABLE_PREFIX."privatemessages", $sql_array, "pmid=".intval($key)." AND uid=".$mybb->user['uid']); } }
| $db->update_query(TABLE_PREFIX."privatemessages", $sql_array, "pmid='".intval($key)."' AND uid='".$mybb->user['uid']."'"); } }
|
// Update PM count update_pm_count();
| // Update PM count update_pm_count();
|
Zeile 721 | 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 755 | 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'] != "txt" && $mybb->input['exporttype'] != "html") { 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 768 | Zeile 832 |
---|
else { if($mybb->input['daycut'] && ($mybb->input['dayway'] != "disregard"))
|
else { if($mybb->input['daycut'] && ($mybb->input['dayway'] != "disregard"))
|
{
| {
|
$datecut = time()-($mybb->input['daycut'] * 86400); $wsql = "pm.dateline"; if($mybb->input['dayway'] == "older")
|
$datecut = time()-($mybb->input['daycut'] * 86400); $wsql = "pm.dateline"; if($mybb->input['dayway'] == "older")
|
{
| {
|
$wsql .= "<="; } elseif($mybb->input['dayway'] == "newer")
| $wsql .= "<="; } elseif($mybb->input['dayway'] == "newer")
|
Zeile 780 | Zeile 844 |
---|
$wsql .= ">="; } $wsql .= "'$datecut'";
|
$wsql .= ">="; } $wsql .= "'$datecut'";
|
} else {
| } else {
|
$wsql = "1=1"; } if(is_array($mybb->input['exportfolders']))
| $wsql = "1=1"; } if(is_array($mybb->input['exportfolders']))
|
Zeile 796 | Zeile 860 |
---|
{ $folderlst = ''; break;
|
{ $folderlst = ''; break;
|
}
| }
|
else { if(!$folderlst)
| else { if(!$folderlst)
|
Zeile 822 | Zeile 886 |
---|
if($mybb->input['exportunread'] != "yes") { $wsql .= " AND pm.status!='0'";
|
if($mybb->input['exportunread'] != "yes") { $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 863 | Zeile 927 |
---|
else { $tofromuid = $message['fromid'];
|
else { $tofromuid = $message['fromid'];
|
if($mybb->input['exporttype'] == "txt") {
| if($mybb->input['exporttype'] == "txt") {
|
$tofromusername = $message['fromusername'];
|
$tofromusername = $message['fromusername'];
|
}
| }
|
else { $tofromusername = build_profile_link($message['fromusername'], $tofromuid); }
|
else { $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 1051 | 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 1093 | 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 1125 | 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")."\";"); }
|
if($mybb->usergroup['pmquota'] != '0')
| if($mybb->usergroup['pmquota'] > 0)
|
{ $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") {
|