<input name=\"touid\" type=\"hidden\" value=\"$_GET[touid]\"> <input name=\"subject\" value=\"\"><br> <textarea name=\"message\" cols=\"30\" rows=\"5\"></textarea> <input type=\"submit\"> </form> "; } break; case 'delete': if(uc_pm_deleteuser($Example_uid, array($_GET['uid']))) { $output .= "短消息已删除。"; } break; case 'addblackls': $user = !empty($_GET['user']) ? $_GET['user'] : (!empty($_POST['user']) ? $_POST['user'] : ''); if(uc_pm_blackls_add($Example_uid, $user)) { $output .= $_GET['user']." 已加入黑名单。"; } break; case 'deleteblackls': if(uc_pm_blackls_delete($Example_uid, $_GET['user'])) { $output .= $_GET['user']." 已从黑名单中移除。"; } break; case 'viewblackls': $data = explode(',', uc_pm_blackls_get($Example_uid)); foreach($data as $ls) { $ls && $output .= "$ls <a href=\"$phpself&action=deleteblackls&user=$ls\">[移除]</a>"; } $output .= " <form method=\"post\" action=\"$phpself&action=addblackls\">
DB::query("UPDATE " . DB::table('common_member_status') . " SET lastpost='{$_G['timestamp']}' WHERE uid='{$_G['uid']}'"); updatecreditbyaction('sendpm'); showmessage('do_success', "home.php?mod=space&do=pm&filter=privatepm", array(), array('msgtype' => $_G['gp_inajax'] ? 3 : 1, 'showmsg' => true)); } else { if (in_array($return, array(-1, -2, -3, -4))) { showmessage('message_can_not_send' . abs($return)); } else { showmessage('message_can_not_send'); } } } } elseif ($_GET['op'] == 'ignore') { if (submitcheck('ignoresubmit')) { $single = intval($_G['gp_single']); if ($single) { uc_pm_blackls_add($_G['uid'], $_POST['ignoreuser']); showmessage('do_success', dreferer(), array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => 1)); } else { uc_pm_blackls_set($_G['uid'], $_POST['ignorelist']); showmessage('do_success', 'home.php?mod=space&do=pm&view=ignore', array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => 1)); } } } else { cknewuser(); if (!checkperm('allowsendpm')) { showmessage('no_privilege'); } $friends = array(); if ($space['friendnum']) { $query = DB::query("SELECT fuid AS uid, fusername AS username FROM " . DB::table('home_friend') . " WHERE uid={$_G['uid']} AND status='1' ORDER BY num DESC, dateline DESC LIMIT 0,100"); while ($value = DB::fetch($query)) {
function submenu_mail_box() { echo '<div class=wrap>'; echo '<h2>' . __('Mail Box', 'ucenter') . '</h2>'; global $current_user; wp_get_current_user(); list($uid, $_, $_) = uc_get_user($current_user->user_login); $timeoffset = get_option('gmt_offset'); $pm_per_page = 10; $max_msg_length = 100; $handler = $_SERVER['PHP_SELF'] . '?page=' . $_GET['page']; $current_handler = $handler . '&tab=' . $_GET['tab']; $action = !empty($_GET['action']) ? $_GET['action'] : ''; $_GET['tab'] = !empty($_GET['tab']) ? $_GET['tab'] : 'inbox'; $menu = array(array('inbox', '', __('Inbox', 'ucenter')), array('uread', 'filter=newpm', __('Unread Mail', 'ucenter')), array('announcepm', 'filter=announcepm', __('Public Message', 'ucenter')), array('systempm', 'filter=systempm', __('System Message', 'ucenter')), array('send', 'action=send', __('Send Message', 'ucenter')), array('blacklist', 'action=blacklist', __('Black List', 'ucenter'))); echo '<ul class="ucenter-ul">'; foreach ($menu as $item) { printf("<li><a href='{$handler}&tab={$item['0']}&{$item['1']}' %s>{$item['2']}</a></li>", $_GET['tab'] == $item[0] ? 'class="current"' : ''); } echo '</ul><br /><hr />'; switch ($action) { case '': $_GET['pageid'] = max(1, intval($_GET['pageid'])); $_GET['filter'] = !empty($_GET['filter']) ? $_GET['filter'] : ''; $data = uc_pm_list($uid, $_GET['pageid'], $pm_per_page, $_GET['folder'], $_GET['filter'], $max_msg_length); foreach ($data['data'] as $pm) { if ($_GET['filter'] == 'announcepm' || $_GET['filter'] == 'systempm') { $output .= "<li><a href='{$current_handler}&action=view&subtab=within3days&daterange=3&pmid={$pm['pmid']}'>{$pm['subject']}</a>"; $output .= '<br /> ' . __('Content:', 'ucenter') . $pm[message] . '</li>'; } else { $output .= "<li><a href='{$current_handler}&action=view&subtab=within3days&daterange=3&touid={$pm['touid']}'>[{$pm['msgfrom']}]</a> (" . gmdate('Y-m-d H:i:s', $pm['dateline'] + $timeoffset * 3600) . ')'; $pm['new'] && ($output .= " New! "); $output .= '<br /> ' . __('Content: ', 'ucenter') . $pm[message] . '</li>'; } } $page_n = $data['count'] / $pm_per_page; if ($page_n > 1) { $output .= '<hr / ><br />'; $output .= __('Page ', 'ucenter'); for ($i = 1; $i <= $page_n; $i++) { $output .= " <a href='{$current_handler}&pageid={$i}'>{$i}</a> "; } } break; case 'view': $pmid = !empty($_GET['pmid']) ? $_GET['pmid'] : ''; $daterange = !empty($_GET['daterange']) ? $_GET['daterange'] : '1'; $data = uc_pm_view($uid, $pmid, $_GET['touid'], $daterange); $dateranges = array(array('within3days', '3', __('Within 3 Days', 'ucenter')), array('within1week', '4', __('Within This Week', 'ucenter')), array('all', '5', __('All', 'ucenter'))); echo '<ul class="ucenter-ul">'; foreach ($dateranges as $item) { printf("<li><a href='{$current_handler}&action=view&touid={$_GET['touid']}&pmid={$pmid}&subtab={$item['0']}&daterange={$item['1']}' %s>{$item['2']}</a></li>", $_GET['subtab'] == $item[0] ? 'class="current"' : ''); } echo '</ul><br /><hr />'; foreach ($data as $pm) { $output .= "<b>{$pm['msgfrom']}</b>"; if ($_GET['touid'] == $pm['msgfromid']) { $output .= "<a href='{$current_handler}&action=addblacklist&user={$pm['msgfrom']}'>" . __(' [ Ban This User ] ', 'ucenter') . "</a>"; } $output .= ' ( ' . gmdate('Y-m-d H:i:s', $pm['dateline'] + $timeoffset * 3600) . ' ) '; $output .= "<br />{$pm['message']}<br /><br />"; } if (empty($_GET['pmid'])) { $output .= "\n\t\t\t\t\t\t<a href='{$current_handler}&action=delete&uid={$_GET['touid']}'>" . __('Delete All Message From This user', 'ucenter') . "</a><br />\n\t\t\t\t\t\tReply:\n\t\t\t\t\t\t<form method='post' action='{$current_handler}&action=send'>\n\t\t\t\t\t\t<input name='touid' type='hidden' value='{$_GET['touid']}'>\n\t\t\t\t\t\t<textarea name='message' cols='30' rows='5'></textarea><br />\n\t\t\t\t\t\t<input type='submit'>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t\t"; } break; case 'delete': if (uc_pm_deleteuser($uid, array($_GET['uid']))) { $output .= __('Deleted', 'ucenter'); } break; case 'addblacklist': $user = !empty($_GET['user']) ? $_GET['user'] : (!empty($_POST['user']) ? $_POST['user'] : ''); if (uc_pm_blackls_add($uid, $user)) { $output .= $_GET['user'] . __('has been added to your black list', 'ucenter'); } break; case 'deleteblacklist': if (uc_pm_blackls_delete($uid, $_GET['user'])) { $output .= $_GET['user'] . __('has been removed from your black list', 'ucenter'); } break; case 'blacklist': $data = explode(',', uc_pm_blackls_get($uid)); foreach ($data as $ls) { $ls && ($output .= "{$ls} <a href='{$current_handler}&action=deleteblacklist&user={$ls}'>" . __('Remove', 'ucenter') . "</a>"); } $output .= "\n\t\t\t\t\t<form method='post' action='{$current_handler}&action=addblacklist'>\n\t\t\t\t\t<input type='input' name='user' value=''>\n\t\t\t\t\t<input type='submit'>\n\t\t\t\t\t</form>\n\t\t\t\t\t"; break; case 'send': if (!empty($_POST)) { if (!empty($_POST['touser'])) { $msgto = $_POST['touser']; $isusername = 1; } else { $msgto = $_POST['touid']; $isusername = 0; } if (uc_pm_send($uid, $msgto, $_POST['subject'], $_POST['message'], 1, 0, $isusername)) { $output .= __('Sended', 'ucenter'); } else { $output .= __('Failed', 'ucenter'); } } else { $output .= "\n\t\t\t\t\t\t<form method='post' action='{$current_handler}&action=send'>\n\t\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr><td>" . __('to', 'ucenter') . ":</td><td><input name='touser' value='{$_GET['touser']}'></td></tr>\n\t\t\t\t\t\t<tr><td>" . __('subject', 'ucenter') . ":</td><td><input name='subject' value=''><br></td></tr>\n\t\t\t\t\t\t<tr><td>" . __('content', 'ucenter') . ":</td><td><textarea name='message' cols='30' rows='5'></textarea></td></tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<input type='submit'>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t\t"; } break; } echo $output; echo '</div>'; }
$output .= "<a href=\"{$phpself}&action=addblackls&user={$pm['msgfrom']}\">[屏蔽]</a>"; } $output .= "<br>{$pm['message']}<br><br>"; } if (empty($_GET['pmid'])) { $output .= "\r\n\t\t\t\t<a href=\"{$phpself}&action=delete&uid={$_GET['touid']}\">删除</a>\r\n\t\t\t\t<form method=\"post\" action=\"{$phpself}&action=send\">\r\n\t\t\t\t<input name=\"touid\" type=\"hidden\" value=\"{$_GET['touid']}\">\r\n\t\t\t\t<input name=\"subject\" value=\"\"><br>\r\n\t\t\t\t<textarea name=\"message\" cols=\"30\" rows=\"5\"></textarea>\r\n\t\t\t\t<input type=\"submit\">\r\n\t\t\t\t</form>\r\n\t\t\t\t"; } break; case 'delete': if (uc_pm_deleteuser($Cta_uid, array($_GET['uid']))) { $output .= "短消息已删除。"; } break; case 'addblackls': $user = !empty($_GET['user']) ? $_GET['user'] : (!empty($_POST['user']) ? $_POST['user'] : ''); if (uc_pm_blackls_add($Cta_uid, $user)) { $output .= $_GET['user'] . " 已加入黑名单。"; } break; case 'deleteblackls': if (uc_pm_blackls_delete($Cta_uid, $_GET['user'])) { $output .= $_GET['user'] . " 已从黑名单中移除。"; } break; case 'viewblackls': $data = explode(',', uc_pm_blackls_get($Cta_uid)); foreach ($data as $ls) { $ls && ($output .= "{$ls} <a href=\"{$phpself}&action=deleteblackls&user={$ls}\">[移除]</a>"); } $output .= "\r\n\t\t\t<form method=\"post\" action=\"{$phpself}&action=addblackls\">\r\n\t\t\t<input name=\"user\" value=\"\">\r\n\t\t\t<input type=\"submit\">\r\n\t\t\t</form>\r\n\t\t\t"; break;
if ($pmid) { uc_pm_delete($discuz_uid, 'inbox', $pmid); } showmessage('pm_delete_succeed', "pm.php?filter={$filter}&page={$page}"); } else { uc_pm_readstatus($discuz_uid, $uid, $pmid, $readopt == 1 ? 0 : 1); showmessage($readopt == 1 ? 'pm_mark_read_succeed' : 'pm_mark_unread_succeed', "pm.php?filter={$filter}&page={$page}"); } } else { showmessage('pm_nonexistence', "pm.php?filter={$filter}&page={$page}"); } } elseif ($action == 'addblack') { if ($formhash != FORMHASH) { showmessage('undefined_action', NULL, 'HALTED'); } uc_pm_blackls_add($discuz_uid, $user); if ($user != '{ALL}') { showmessage('pm_addblack_succeed', 'pm.php?action=viewblack'); } else { showmessage('pm_addblackall_succeed', 'pm.php?action=viewblack'); } } elseif ($action == 'delblack') { if ($formhash != FORMHASH) { showmessage('undefined_action', NULL, 'HALTED'); } uc_pm_blackls_delete($discuz_uid, $user); showmessage('pm_delblack_succeed', 'pm.php?action=viewblack'); } elseif ($action == 'viewblack') { $blackls = explode(',', uc_pm_blackls_get($discuz_uid)); $blackall = in_array('{ALL}', $blackls); }
foreach ($pmreportuser as $key => $value) { notification_add($value, 'pmreport', 'pmreportcontent', array('pmreportcontent' => $pmreportcontent), 0); } showmessage('do_success', dreferer(), array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); } } elseif ($_GET['op'] == 'pm_ignore') { $waittime = interval_check('post'); if ($waittime > 0) { showmessage('operating_too_fast', '', array('waittime' => $waittime), array('return' => true)); } $username = $_GET['username']; if (!$username) { showmessage('pm_ignore_error_nopm'); } if (submitcheck('pmignoresubmit')) { uc_pm_blackls_add($_G['uid'], addslashes($username)); showmessage('do_success', dreferer(), array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); } } elseif ($_GET['op'] == 'kickmember') { $memberuid = intval($_GET['memberuid']); if (!$memberuid) { showmessage('pm_kickmember_error_nopm'); } if (submitcheck('pmkickmembersubmit')) { uc_pm_kickchatpm($plid, $_G['uid'], $memberuid); showmessage('do_success', dreferer(), array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true, 'locationtime' => 3)); } } elseif ($_GET['op'] == 'appendmember') { $memberusername = trim($_GET['memberusername']); $members = array(); if ($memberusername) {
notification_add($value, 'pmreport', 'pmreportcontent', array('pmreportcontent' => $pmreportcontent), 0); } showmessage('do_success', dreferer(), array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); } } elseif ($_GET['op'] == 'pm_ignore') { $waittime = interval_check('post'); if ($waittime > 0) { showmessage('operating_too_fast', '', array('waittime' => $waittime), array('return' => true)); } $username = $_GET['username']; if (!$username) { showmessage('pm_ignore_error_nopm'); } if (submitcheck('pmignoresubmit')) { $username = stripslashes($username); uc_pm_blackls_add($_G['uid'], $username); showmessage('do_success', dreferer(), array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true)); } } elseif ($_GET['op'] == 'kickmember') { $memberuid = intval($_GET['memberuid']); if (!$memberuid) { showmessage('pm_kickmember_error_nopm'); } if (submitcheck('pmkickmembersubmit')) { uc_pm_kickchatpm($plid, $_G['uid'], $memberuid); showmessage('do_success', dreferer(), array(), array('showdialog' => 1, 'showmsg' => true, 'closetime' => true, 'locationtime' => 3)); } } elseif ($_GET['op'] == 'appendmember') { $memberusername = trim($_GET['memberusername']); $members = array(); if ($memberusername) {