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 3520 2007-12-01 00:43:25Z 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(); }
|
$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 161 |
---|
$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 188 |
---|
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 211 |
---|
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 234 |
---|
// 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 339 |
---|
$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 355 |
---|
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 392 |
---|
} } if($pm['status'] == "0")
|
} } if($pm['status'] == "0")
|
{
| {
|
$time = time(); $updatearray = array( 'status' => 1,
| $time = time(); $updatearray = array( 'status' => 1,
|
Zeile 402 | Zeile 411 |
---|
} $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 470 | Zeile 479 |
---|
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 622 | Zeile 631 |
---|
"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 653 | Zeile 664 |
---|
if(is_array($mybb->input['empty'])) { foreach($mybb->input['empty'] as $key => $val)
|
if(is_array($mybb->input['empty'])) { foreach($mybb->input['empty'] as $key => $val)
|
{
| {
|
if($val == "yes")
|
if($val == "yes")
|
{
| {
|
$key = intval($key); if($emptyq) {
| $key = intval($key); if($emptyq) {
|
Zeile 669 | Zeile 680 |
---|
if($mybb->input['keepunread'] == "yes") { $keepunreadq = " AND status!='0'";
|
if($mybb->input['keepunread'] == "yes") { $keepunreadq = " AND status!='0'";
|
}
| }
|
$db->delete_query(TABLE_PREFIX."privatemessages", "($emptyq) AND uid='".$mybb->user['uid']."' $keepunreadq"); } } // Update PM count update_pm_count();
|
$db->delete_query(TABLE_PREFIX."privatemessages", "($emptyq) AND uid='".$mybb->user['uid']."' $keepunreadq"); } } // Update PM count update_pm_count();
|
|
|
$plugins->run_hooks("private_do_empty_end"); redirect("private.php", $lang->redirect_pmfoldersemptied); }
| $plugins->run_hooks("private_do_empty_end"); redirect("private.php", $lang->redirect_pmfoldersemptied); }
|
Zeile 684 | Zeile 695 |
---|
{ $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=".intval($mybb->input['jumpto'])); } elseif($mybb->input['moveto'])
| header("Location: private.php?fid=".intval($mybb->input['jumpto'])); } elseif($mybb->input['moveto'])
|
Zeile 697 | Zeile 708 |
---|
"folder" => intval($mybb->input['fid']) ); $db->update_query(TABLE_PREFIX."privatemessages", $sql_array, "pmid='".intval($key)."' AND uid='".$mybb->user['uid']."'");
|
"folder" => intval($mybb->input['fid']) ); $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();
|
redirect("private.php?fid=".$mybb->input['fid'], $lang->redirect_pmsmoved); }
| redirect("private.php?fid=".$mybb->input['fid'], $lang->redirect_pmsmoved); }
|
Zeile 716 | Zeile 727 |
---|
$pmssql .= ","; } $pmssql .= "'".intval($key)."'";
|
$pmssql .= ","; } $pmssql .= "'".intval($key)."'";
|
}
| }
|
$query = $db->simple_select(TABLE_PREFIX."privatemessages", "pmid, folder", "pmid IN ($pmssql) AND uid='".$mybb->user['uid']."' AND folder='4'", array('order_by' => 'pmid')); while($delpm = $db->fetch_array($query)) {
| $query = $db->simple_select(TABLE_PREFIX."privatemessages", "pmid, folder", "pmid IN ($pmssql) AND uid='".$mybb->user['uid']."' AND folder='4'", array('order_by' => 'pmid')); while($delpm = $db->fetch_array($query)) {
|
Zeile 747 | Zeile 758 |
---|
}
if($mybb->input['action'] == "delete")
|
}
if($mybb->input['action'] == "delete")
|
{
| {
|
$plugins->run_hooks("private_delete_start");
$sql_array = array(
| $plugins->run_hooks("private_delete_start");
$sql_array = array(
|
Zeile 786 | Zeile 797 |
---|
{ exit; }
|
{ exit; }
|
|
|
$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 809 |
---|
$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 843 |
---|
else { if(!$folderlst)
|
else { if(!$folderlst)
|
{
| {
|
$folderlst = " AND pm.folder IN ('$val'"; } else
| $folderlst = " AND pm.folder IN ('$val'"; } else
|
Zeile 865 | Zeile 877 |
---|
"); $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 883 | Zeile 895 |
---|
else { $tofromusername = build_profile_link($message['tousername'], $tofromuid);
|
else { $tofromusername = build_profile_link($message['tousername'], $tofromuid);
|
} } else
| } } else
|
{ $tofromusername = $lang->not_sent; }
| { $tofromusername = $lang->not_sent; }
|
Zeile 895 | Zeile 907 |
---|
{ $tofromuid = $message['fromid']; if($mybb->input['exporttype'] == "txt")
|
{ $tofromuid = $message['fromid']; 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 1082 | Zeile 1095 |
---|
{ 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 1135 |
---|
{ $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 1167 |
---|
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 1180 |
---|
{ $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") {
|