private function _pmDel($res, $data, $isPlid = 0) { global $_G; $delpmid = (int) $data['pmid']; $delplid = (int) $data['plid']; if (empty($delpmid) && empty($delplid)) { return $this->makeErrorInfo($res, lang('message', 'delete_pm_error_option')); } $flag = true; if (!empty($delpmid) && !$isPlid) { $return = uc_pm_delete($_G['uid'], 'inbox', $delpmid); if ($return <= 0) { $flag = false; } } if (!empty($delplid) && $isPlid) { $delplid = array($delplid); $return = uc_pm_deletechat($_G['uid'], $delplid, 1); if (!$return) { $flag = false; } } if ($flag) { return $this->makeErrorInfo($res, lang('message', 'delete_pm_success'), array('noError' => 1)); } else { return $this->makeErrorInfo($res, lang('message', 'this_message_could_note_be_option')); } return $res; }
} elseif (!empty($_G['gp_pid'])) { $thread = DB::fetch_first("SELECT t.tid, t.subject, p.pid FROM " . DB::table('forum_post') . " p\n\t\t\tLEFT JOIN " . DB::table('forum_thread') . " t ON t.tid=p.tid WHERE p.pid='{$_G['gp_pid']}'"); if ($thread) { $messageappend = htmlspecialchars('[url=' . $_G['siteurl'] . 'forum.php?mod=redirect&goto=findpost&pid=' . $thread['pid'] . '&ptid=' . $thread['tid'] . '][b]' . lang('spacecp', 'pm_thread_about', array('subject' => $thread['subject'])) . '[/b][/url]'); } } } elseif ($_GET['op'] == 'delete') { $pmid = empty($_G['gp_pmid']) ? 0 : floatval($_G['gp_pmid']); $deluid = empty($_G['gp_deluid']) ? 0 : floatval($_G['gp_deluid']); $folder = $_G['gp_folder'] == 'inbox' ? 'inbox' : 'outbox'; if (submitcheck('deletesubmit')) { if ($deluid) { $retrun = uc_pm_deleteuser($_G['uid'], array($deluid)); $pmid = $deluid; } else { $retrun = uc_pm_delete($_G['uid'], $folder, array($pmid)); } if ($retrun > 0) { showmessage('do_success', dreferer(), array('pmid' => $pmid), array('showdialog' => 1, 'showmsg' => true, 'closetime' => 1)); } else { showmessage('this_message_could_not_be_deleted'); } } } elseif ($_GET['op'] == 'send') { $waittime = interval_check('post'); if ($waittime > 0) { showmessage('operating_too_fast', '', 1, array($waittime)); } cknewuser(); if ($touid) { if (isblacklist($touid)) {
include_once S_ROOT . './uc_client/client.php'; if ($_GET['op'] == 'checknewpm') { //检查当前用户 if ($_SGLOBAL['supe_uid']) { $ucnewpm = uc_pm_checknew($_SGLOBAL['supe_uid']); if ($_SGLOBAL['member']['newpm'] != $ucnewpm) { updatetable('space', array('newpm' => $ucnewpm), array('uid' => $_SGLOBAL['supe_uid'])); } } ssetcookie('checkpm', 1, 30); exit; } elseif ($_GET['op'] == 'delete') { $pmid = empty($_GET['pmid']) ? 0 : floatval($_GET['pmid']); $folder = $_GET['folder'] == 'inbox' ? 'inbox' : 'outbox'; if (submitcheck('deletesubmit')) { $retrun = uc_pm_delete($_SGLOBAL['supe_uid'], $folder, array($pmid)); if ($retrun > 0) { showmessage('do_success', $_POST['refer'], 0); } else { showmessage('this_message_could_not_be_deleted'); } } } elseif ($_GET['op'] == 'send') { //判断是否发布太快 $waittime = interval_check('post'); if ($waittime > 0) { showmessage('operating_too_fast', '', 1, array($waittime)); } //新用户见习 cknewuser(); //黑名单
} } else { echo '<tr class="item2" height="50"><td align="center" colspan="6">' . lang('nonepm') . '</td></tr>'; } echo multi($ucpm['count'], $mrowpp, $page, "?action=pmbox"); $box == 'announcepm' ? tabfooter() : tabfooter('bpmbox', lang('delete')); } else { //删除 empty($fids) && empty($pmids) && mcmessage(lang('choosedeltem'), "?action=pmbox&box={$box}&page={$page}"); is_array($fids) || ($fids = array($fids)); is_array($pmids) || ($pmids = array($pmids)); if ($fids) { uc_pm_deleteuser($uid, $fids); } if ($pmids) { uc_pm_delete($uid, 'inbox', $pmids); } mcmessage(lang('pm delete operate finish'), "?action=pmbox&box={$box}&page={$page}"); } } else { //阅读短信 $days = array(1 => lang('today'), 3 => lang('near3days'), 4 => lang('thisweek'), 5 => lang('all')); $day = isset($day) && array_key_exists($day, $days) ? $day : 3; $ucpm = empty($fid) ? uc_pm_view($uid, $pmid, 0, $day) : uc_pm_view($uid, '', $fid, $day); //$ucpm=uc_pm_view($uid, $pmid, 0, 3); // exit(var_export($ucpm)); empty($ucpm) && mcmessage(lang('nonenewpm')); $fuser = ''; foreach ($ucpm as $pm) { if ($pm['msgfrom'] != $curuser->info['mname']) { $fuser = $pm['msgfrom'];
showmessage('pm_send_batnotfriend_error'); } elseif ($pmid == -4) { showmessage('pm_send_pmsendregdays_error'); } else { showmessage('pm_send_invalid'); } } elseif ($action == 'del') { $uid = !empty($uid) ? !is_array($uid) ? array($uid) : $uid : array(); $pmid = !empty($pmid) ? !is_array($pmid) ? array($pmid) : $pmid : array(); if ($uid || $pmid) { if (!$readopt) { if ($uid) { uc_pm_deleteuser($discuz_uid, $uid); } 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}') {
if (!empty($gpmid)) { $return = C::t('common_member_grouppm')->update($_G['uid'], $gpmid, array('status' => -1)); $returnurl = 'home.php?mod=space&do=pm&filter=announcepm'; if (!$return) { $flag = false; } } if (!empty($deluid)) { $return = uc_pm_deleteuser($_G['uid'], $deluid); $returnurl = 'home.php?mod=space&do=pm&filter=privatepm'; if ($return <= 0) { $flag = false; } } if (!empty($delpmid)) { $return = uc_pm_delete($_G['uid'], 'inbox', $delpmid[0]); $returnurl = 'home.php?mod=space&do=pm&subop=view&touid=' . $touid; if ($return <= 0) { $flag = false; } } if (!empty($delplid)) { $return = uc_pm_deletechat($_G['uid'], $delplid, 1); $returnurl = 'home.php?mod=space&do=pm&filter=privatepm'; if (!$return) { $flag = false; } } if (!empty($quitplid)) { $return = uc_pm_deletechat($_G['uid'], $quitplid); $returnurl = 'home.php?mod=space&do=pm&filter=privatepm';
} else { $return_url = 'pm.php?act=list&msgtype=systempm'; if ($_GET['inajax'] == 1) { $return_url .= '&inajax=1'; } } $url = 'pm.php?act=view&msgtype=systempm'; if ($_GET['inajax'] == 1) { $url .= '&inajax=1'; } } else { if ($act == 'del') { if (intval($_GET['pmid']) != 0) { $pmids = array($_GET['pmid']); @(include_once B_ROOT . './uc_client/client.php'); $num = uc_pm_delete($_G['uid'], 'inbox', $pmids); header("location: " . $_SERVER['HTTP_REFERER']); } } else { $msgto = intval($_REQUEST['msgto']); if (intval($_G['uid']) == $msgto) { // 不能給自己發消息 $send_result = 'notallowtomyself'; } elseif ($_G['uid'] < 1) { // 沒有 LOGIN $send_result = 'notlogin'; // 發送窗口 } elseif ($act == 'sendbox') { if (empty($send_result)) { $user = DB::fetch(DB::query('SELECT uid,username FROM ' . tname('members') . " WHERE uid='{$msgto}'")); $uid = $user['uid'];
<?php /** * UCenter 应用程序开发 Example * * 自制短消息平台的 Example 代码 */ $timeoffset = 8; $ppp = 10; if (!empty($_GET['pmdel']) && !empty($_POST['delete'])) { if (uc_pm_delete($Example_uid, $_GET['folder'], $_POST['delete'])) { echo '<br />短消息已删除<br />'; } } $_GET['folder'] = !empty($_GET['folder']) ? $_GET['folder'] : 'inbox'; if (!empty($_GET['pmignore'])) { uc_pm_ignore($Example_uid); $newpm = 0; } echo ($newpm ? '<font color="red">New!</font> <a href="' . $_SERVER['PHP_SELF'] . '?example=pmlist&pmignore=yes">忽略提示</a><br />' : '') . '<br /> <a href="' . $_SERVER['PHP_SELF'] . '?example=pmlist&folder=inbox">收件箱</a> <a href="' . $_SERVER['PHP_SELF'] . '?example=pmlist&folder=outbox">发件箱</a> <a href="' . $_SERVER['PHP_SELF'] . '?example=pmlist&folder=newbox&filter=newpm">未读消息</a> <a href="' . $_SERVER['PHP_SELF'] . '?example=pmlist&folder=inbox&filter=newpm">未读收件箱</a> <a href="' . $_SERVER['PHP_SELF'] . '?example=pmlist&folder=outbox&filter=newpm">未读发件箱</a> <a href="' . $_SERVER['PHP_SELF'] . '?example=pmlist&folder=inbox&filter=systempm">系统消息</a> <a href="' . $_SERVER['PHP_SELF'] . '?example=pmlist&folder=inbox&filter=announcepm">公共消息</a> <a href="' . $_SERVER['PHP_SELF'] . '?example=pmlist&pmsend=yes">发送消息</a> <a href="' . $_SERVER['PHP_SELF'] . '?example=pmlist&blackls=yes">黑名单</a><br />'; if (!empty($_GET['pmsend'])) { if (empty($_POST)) {
} else { show_message('sendmsg_error', $backurl); } exit; } elseif ($command == 'delcollect') { $id = intval($_GET['id']); $page = intval($_GET['page']); $query = $dblink->query("DELETE FROM {$dbprefix}collect where uid={$cyask_uid} AND id={$id}"); $backurl = 'my.php?command=mycollect&page=' . $page; show_message('delcollect_succeed', $backurl); exit; } elseif ($command == 'delmessage') { $page = intval($_GET['page']); $mid = intval($_GET['mid']); if ($_GET['type'] == 'receive') { uc_pm_delete($cyask_uid, 'inbox', array($mid)); } elseif ($_GET['type'] == 'send') { uc_pm_delete($cyask_uid, 'outbox', array($mid)); } $backurl = 'my.php?command=mymessage&type=' . $_GET['type'] . '&page=' . $page; show_message('delmessage_succeed', $backurl); exit; } else { show_message('action_error', './'); exit; } include template('my'); ?>