if ($value['new']) { $json[$value['msgfromid']] = "{$value['msgfromid']}:{'uid':{$value['msgfromid']}, 'username':'******'msgfrom']}', 'avatar':'{$value['avatar']}', 'pmid':{$value['pmid']}, 'new':{$value['new']}, 'daterange':{$value['daterange']}}"; } else { $otherpm[$value['msgfromid']] = "{$value['msgfromid']}:{'uid':{$value['msgfromid']}, 'username':'******'msgfrom']}', 'avatar':'{$value['avatar']}', 'pmid':{$value['pmid']}, 'new':{$value['new']}, 'daterange':{$value['daterange']}}"; } } if (!empty($otherpm)) { $json = array_merge($json, $otherpm); } $jsstr = "{'userdata':{" . implode(',', $json) . "}}"; } elseif ($_GET['op'] == 'showmsg') { $msgonly = empty($_G['gp_msgonly']) ? 0 : intval($_G['gp_msgonly']); $pmid = empty($_G['gp_pmid']) ? 0 : intval($_G['gp_pmid']); $touid = empty($_G['gp_touid']) ? 0 : intval($_G['gp_touid']); $daterange = empty($_G['gp_daterange']) ? 1 : intval($_G['gp_daterange']); $result = uc_pm_view($_G['uid'], 0, $touid, $daterange); $msglist = array(); $msguser = $messageappend = ''; $online = 0; foreach ($result as $key => $value) { if ($value['msgfromid'] != $_G['uid']) { $msguser = $value['msgfrom']; } $daykey = dgmdate($value['dateline'], 'Y-m-d'); $msglist[$daykey][$key] = $value; } if ($touid && empty($msguser)) { $member = DB::fetch_first("SELECT username FROM " . DB::table('common_member') . " WHERE uid='{$touid}' LIMIT 1"); $msguser = $member['username']; } if (!$msgonly) {
$data = uc_pm_list($Example_uid, $_GET['page'], $ppp, $_GET['folder'], $_GET['filter'], 100); foreach($data['data'] as $pm) { if($_GET['filter'] != 'announcepm') { $output .= "<li>[$pm[msgfrom]]<a href=\"$phpself&action=view&touid=$pm[touid]\">$pm[subject] (".gmdate('Y-m-d H:i:s', $pm['dateline'] + $timeoffset * 3600).")</a>"; $pm['new'] && $output .= " New! "; $output .= "<br />$pm[message]"; } else { $output .= "<li><a href=\"$phpself&action=view&pmid=$pm[pmid]\">$pm[subject]</a>"; } } break; case 'view': $pmid = !empty($_GET['pmid']) ? $_GET['pmid'] : ''; $data = uc_pm_view($Example_uid, $pmid, $_GET['touid']); foreach($data as $pm) { $output .= "<b>$pm[msgfrom] (".gmdate('Y-m-d H:i:s', $pm['dateline'] + $timeoffset * 3600)."):</b>"; if($_GET['touid'] == $pm['msgfromid']) { $output .= "<a href=\"$phpself&action=addblackls&user=$pm[msgfrom]\">[屏蔽]</a>"; } $output .= "<br>$pm[message]<br><br>"; } if(empty($_GET['pmid'])) { $output .= " <a href=\"$phpself&action=delete&uid=$_GET[touid]\">删除</a> <form method=\"post\" action=\"$phpself&action=send\"> <input name=\"touid\" type=\"hidden\" value=\"$_GET[touid]\"> <input name=\"subject\" value=\"\"><br>
* $Id: space_pm.php 15030 2010-08-18 06:34:38Z zhengqingpeng $ */ if (!defined('IN_DISCUZ')) { exit('Access Denied'); } loaducenter(); $list = array(); $pmid = empty($_GET['pmid']) ? 0 : floatval($_GET['pmid']); $touid = empty($_GET['touid']) ? 0 : intval($_GET['touid']); $daterange = empty($_GET['daterange']) ? 1 : intval($_GET['daterange']); if ($_GET['subop'] == 'view') { if ($touid) { $list = uc_pm_view($_G['uid'], 0, $touid, $daterange); $pmid = empty($list) ? 0 : $list[0]['pmid']; } elseif ($pmid) { $list = uc_pm_view($_G['uid'], $pmid); if (!empty($_G['gp_from']) && $_G['gp_from'] == 'privatepm') { dsetcookie('viewannouncepmid', $pmid, 31536000); } } $actives = array($daterange => ' class="a"'); } elseif ($_GET['subop'] == 'ignore') { $ignorelist = uc_pm_blackls_get($_G['uid']); $actives = array('ignore' => ' class="a"'); } else { $filter = in_array($_GET['filter'], array('newpm', 'privatepm', 'systempm', 'announcepm')) ? $_GET['filter'] : 'privatepm'; $perpage = 10; $perpage = mob_perpage($perpage); $page = empty($_GET['page']) ? 0 : intval($_GET['page']); if ($page < 1) { $page = 1;
private function _getPMMsgList($uid, $fromUid, $startTime = 0, $stopTime = 0, $cacheCount = 0, $pmLimit = 10, $isFilter = false) { $msgList = array(); $hasPrev = false; $plid = 0; loaducenter(); $tempMsgList = array(); if ($stopTime == 0) { // 获取新的消息 if ($startTime == 0) { // 获取新的消息 $count = (int) uc_pm_view_num($uid, $fromUid, 0); $tempMsgList = (array) uc_pm_view($uid, 0, $fromUid, 5, 1, $pmLimit, 0, 0); $count > count($tempMsgList) && ($hasPrev = true); } else { $tempMsgList = (array) uc_pm_view($uid, 0, $fromUid, 5, 1, 50, 0, 0); $lastIndex = count($tempMsgList) - 1; if ($lastIndex >= 0) { $offset = 0; for ($i = $lastIndex; $i >= 0; $i--) { if ($tempMsgList[$i]['dateline'] <= $startTime) { $offset = $i; $offset++; break; } } $tempMsgList = array_slice($tempMsgList, $offset); } } } else { if ($stopTime) { // 获取历史的消息 $count = (int) uc_pm_view_num($uid, $fromUid, 0); $lastPage = (int) (($count - 1) / $pmLimit) + 1; $page = (int) floor($cacheCount / $pmLimit) + 1; $tempList = (array) uc_pm_view($uid, 0, $fromUid, 5, $page, $pmLimit); foreach ($tempList as $pm) { if ($pm['dateline'] < $stopTime) { $tempMsgList[] = $pm; } } $page < $lastPage && ($hasPrev = true); } } foreach ($tempMsgList as $msg) { $msgInfo = array(); $plid = $msg['plid']; if (!$isFilter || $msg['authorid'] != $uid) { $tempMsg = $this->_transMessage($msg['message']); $msgInfo['sender'] = (int) $msg['authorid']; $msgInfo['mid'] = (int) $msg['pmid']; $msgInfo['content'] = (string) $tempMsg['content']; $msgInfo['type'] = $tempMsg['type']; $msgInfo['time'] = $msg['dateline'] . '000'; $msgList[] = $msgInfo; } } return array('list' => $msgList, 'hasPrev' => $hasPrev, 'plid' => $plid); }
<?php if (!defined('iBUAA')) { exit('Access Denied'); } include_once S_ROOT . './uc_client/client.php'; $list = array(); $pmid = empty($_GET['pmid']) ? 0 : floatval($_GET['pmid']); $touid = empty($_GET['touid']) ? 0 : intval($_GET['touid']); $daterange = empty($_GET['daterange']) ? 1 : intval($_GET['daterange']); if ($_GET['subop'] == 'view') { if ($touid) { $list = uc_pm_view($_SGLOBAL['supe_uid'], 0, $touid, $daterange); $pmid = empty($list) ? 0 : $list[0]['pmid']; } elseif ($pmid) { $list = uc_pm_view($_SGLOBAL['supe_uid'], $pmid); } $actives = array($daterange => ' class="active"'); } elseif ($_GET['subop'] == 'ignore') { $ignorelist = uc_pm_blackls_get($_SGLOBAL['supe_uid']); $actives = array('ignore' => ' class="active"'); } else { $filter = in_array($_GET['filter'], array('newpm', 'privatepm', 'systempm', 'announcepm')) ? $_GET['filter'] : ($space['newpm'] ? 'newpm' : 'privatepm'); //分页 $perpage = 10; $perpage = mob_perpage($perpage); $page = empty($_GET['page']) ? 0 : intval($_GET['page']); if ($page < 1) { $page = 1; } $result = uc_pm_list($_SGLOBAL['supe_uid'], $page, $perpage, 'inbox', $filter, 100);
include_once S_ROOT . './uc_client/client.php'; $touid = intval(trim($_POST[touid])); if (empty($touid)) { verifyerror(); } $filter = 'privatepm'; //分页 $perpage = 10; //$perpage = mob_perpage($perpage); $page = empty($_POST['page']) ? 0 : intval($_POST['page']); if ($page < 1) { $page = 1; } //$userid=3; $touid=18; //获取与对方的私信内容 $list = $list = uc_pm_view($userid, 0, $touid, 5); //$count = $result['count']; //$list = $result['data']; $result = array(); //$result['count'] = $count; //获取姓名 foreach ($list as $values) { realname_set($values['msgfromid'], $values['msgfrom']); } realname_get(); //生成数组 foreach ($list as $values) { //将公告中的图片进行绝对路径化。 start<img src=\"image\/face\/24.gif\" class=\"face\"> preg_match_all("#[<]img\\s+src[=]\"(.*)\".*[>]#U", $value['message'], $matches, PREG_SET_ORDER); foreach ($matches as $item) { $TmpString = $item[1];
} } else { if (defined('IN_MOBILE')) { $perpage = 10; } else { $perpage = 50; } $perpage = mob_perpage($perpage); if (!$daterange) { $count = uc_pm_view_num($_G['uid'], $plid, 1); if (!$page) { $page = ceil($count / $perpage); } $list = uc_pm_view($_G['uid'], 0, $plid, 5, ceil($count / $perpage) - $page + 1, $perpage, $type, 1); } else { $list = uc_pm_view($_G['uid'], 0, $plid, 5, ceil($count / $perpage) - $page + 1, $perpage, $type, 1); $chatpmmember = uc_pm_chatpmmemberlist($_G['uid'], $plid); if (!empty($chatpmmember)) { $authorid = $founderuid = $chatpmmember['author']; $query = DB::query("SELECT m.uid, m.username, mfh.recentnote FROM " . DB::table('common_member') . " m LEFT JOIN " . DB::table('common_member_field_home') . " mfh ON m.uid=mfh.uid WHERE m.uid IN (" . dimplode($chatpmmember['member']) . ")"); while ($member = DB::fetch($query)) { $chatpmmemberlist[$member['uid']] = $member; } $query = DB::query("SELECT * FROM " . DB::table('common_session') . " WHERE uid IN (" . dimplode($chatpmmember['member']) . ")"); while ($value = DB::fetch($query)) { if (!$value['magichidden'] && !$value['invisible']) { $ols[$value['uid']] = $value['lastactivity']; } } } $membernum = count($chatpmmemberlist);
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']; break; } } if ($fuser) { $str = ''; foreach ($days as $k => $v) { $str .= ' ' . ($day == $k ? $v : "<a href=\"?action=pmbox&box={$box}&page={$page}&fid={$fid}&day={$k}\">{$v}</a>"); }
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>'; }
dheader('Pragma: no-cache'); dheader('Expires: 0'); include template('pm_archive_html'); exit; } } elseif ($action == 'new') { if (!$allowsendpm) { showmessage('pm_send_disable'); } $username = $subject = $message = ''; if (!empty($uid)) { $username = htmlspecialchars($db->result_first("SELECT username FROM {$tablepre}members WHERE uid='{$uid}'", 0)); } if (!empty($pmid)) { include_once language('misc'); $ucdata = uc_pm_view($discuz_uid, $pmid); $subject = 'Fw: ' . $ucdata[0]['subject']; $message = ($ucdata[0]['msgfromid'] ? $language['pm_from'] . ': ' . $ucdata[0]['msgfrom'] : $lang['pm_system']) . "\n" . $language['pm_to'] . ': ' . $discuz_userss . "\n" . $language['pm_date'] . ': ' . gmdate("{$dateformat} {$timeformat}", $ucdata[0]['dateline'] + $timeoffset * 3600) . "\n\n" . '[quote]' . trim(preg_replace("/(\\[quote])(.*)(\\[\\/quote])/siU", '', $ucdata[0]['message'])) . '[/quote]' . "\n"; } if ($operation == 'trade' && ($tradepid = intval($pid))) { include_once language('misc'); $tradepid = intval($tradepid); $trade = $db->fetch_first("SELECT * FROM {$tablepre}trades WHERE pid='{$tradepid}'"); if ($trade) { $subject = htmlspecialchars($language['post_trade_pm_subject'] . $trade['subject']); $message = '[url=' . $boardurl . 'viewthread.php?do=tradeinfo&tid=' . $trade['tid'] . '&pid=' . $tradepid . ']' . $trade['subject'] . "[/url]\n"; $message .= $trade['costprice'] ? $language['post_trade_costprice'] . ': ' . $trade['costprice'] . "\n" : ''; $message .= $language['post_trade_price'] . ': ' . $trade['price'] . "\n"; $message .= $language['post_trade_transport_type'] . ': '; if ($trade['transport'] == 1) { $message .= $language['post_trade_transport_seller'];
$_GET['folder'] = !empty($_GET['folder']) ? $_GET['folder'] : 'inbox'; $_GET['filter'] = !empty($_GET['filter']) ? $_GET['filter'] : ''; $data = uc_pm_list($Cta_uid, $_GET['page'], $ppp, $_GET['folder'], $_GET['filter'], 100); foreach ($data['data'] as $pm) { if ($_GET['filter'] != 'announcepm') { $output .= "<li>[{$pm['msgfrom']}]<a href=\"{$phpself}&action=view&touid={$pm['touid']}\">{$pm['subject']} (" . gmdate('Y-m-d H:i:s', $pm['dateline'] + $timeoffset * 3600) . ")</a>"; $pm['new'] && ($output .= " New! "); $output .= "<br />{$pm['message']}"; } else { $output .= "<li><a href=\"{$phpself}&action=view&pmid={$pm['pmid']}\">{$pm['subject']}</a>"; } } break; case 'view': $pmid = !empty($_GET['pmid']) ? $_GET['pmid'] : ''; $data = uc_pm_view($Cta_uid, $pmid, $_GET['touid']); foreach ($data as $pm) { $output .= "<b>{$pm['msgfrom']} (" . gmdate('Y-m-d H:i:s', $pm['dateline'] + $timeoffset * 3600) . "):</b>"; if ($_GET['touid'] == $pm['msgfromid']) { $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 .= "短消息已删除。"; }
showmessage('do_success', '', array(), array('msgtype' => 3)); } elseif ($_GET['op'] == 'viewpmid') { $list = uc_pm_view($_G['uid'], $_GET['pmid']); $value = $list[0]; include template('common/header_ajax'); include template('home/space_pm_node'); include template('common/footer_ajax'); exit; } elseif ($_GET['op'] == 'export') { if (!$touid && !$plid) { showmessage('pm_export_touser_not_exists'); } if ($touid) { $list = uc_pm_view($_G['uid'], 0, $touid, 5, 0, 0, 0, 0); } else { $list = uc_pm_view($_G['uid'], 0, $plid, 5, 0, 0, 1, 1); $subject = $list[0]['subject']; } if (count($list) == 0) { showmessage('pm_emport_banned_export'); } $filename = lang('space', 'export_pm') . '.html'; if ($touid) { if ($touser = uc_get_user($touid, 1)) { $tousername = $touser[1]; $filename = $touser[1] . '.html'; } } $contents = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'; $contents .= '<html xmlns="http://www.w3.org/1999/xhtml">'; $contents .= '<head><meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET . '" /><title>' . lang('space', 'pm_export_header') . '</title></head>';
} } } if (!empty($_GET['blackls'])) { if (!empty($_POST)) { uc_pm_blackls_set($Example_uid, $_POST['blackls']); echo '<br />黑名单已保存<br />'; } $blackls = uc_pm_blackls_get($Example_uid); echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?example=pmlist&blackls=yes"> <textarea name="blackls" cols="40" rows="10" />' . htmlspecialchars($blackls) . '</textarea><br /> <input type="submit" value="发送" /></form>'; exit; } if (!empty($_GET['pmid'])) { $pms = uc_pm_view($Example_uid, $_GET['pmid']); echo '<br /><a href="' . $_SERVER['PHP_SELF'] . '?example=pmlist&folder=' . $_GET['folder'] . '&filter=' . $_GET['filter'] . '">返回</a> '; foreach ($pms as $pm) { echo '<hr>标题:' . $pm['subject'] . ' ' . ($pm['new'] ? '<font color="red">New!</font>' : '') . '<br /> 发送日期:' . gmdate('Y-m-d H:i:s', $pm['dateline'] + $timeoffset * 3600) . '<br />发信人:' . $pm['msgfrom'] . '<br /><br />' . $pm['message']; } if ($pms[0]['msgfromid'] && $pms[0]['msgtoid']) { echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?example=pmlist&pmsend=yes"> <br /><input type="hidden" name="replypmid" value="' . $_GET['pmid'] . '" /><br /> 标题: <br /><input name="subject" /><br /> 消息内容: <br /><textarea name="message" cols="40" rows="10" /></textarea><br /> <input type="submit" value="回复" /></form>'; } } else { $_GET['page'] = max(1, intval($_GET['page'])); $list = uc_pm_list($Example_uid, $_GET['page'], $ppp, $_GET['folder'], $_GET['filter'], 100);
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' => true)); } } } elseif ($_GET['op'] == 'viewpmid') { $list = uc_pm_view($_G['uid'], $_GET['pmid']); $value = $list[0]; include template('common/header_ajax'); include template('home/space_pm_node'); include template('common/footer_ajax'); exit; } elseif ($_GET['op'] == 'export') { if (!$touid) { showmessage('pm_export_touser_not_exists'); } $list = uc_pm_view($_G['uid'], 0, $touid, 5); if (count($list) == 0) { showmessage('pm_emport_banned_export'); } $filename = lang('space', 'export_pm') . '.txt'; if ($touser = uc_get_user($touid, 1)) { $tousername = $touser[1]; $filename = $touser[1] . '.txt'; } $contents = lang('space', 'pm_export_header'); $contents .= "\r\n\r\n================================================================\r\n"; if ($touser) { $contents .= lang('space', 'pm_export_touser', array('touser' => $touser[1])); $contents .= "\r\n================================================================\r\n"; } $contents .= "\r\n";
show_message('url_error', './'); exit; } } elseif ($command == 'sendmsg') { } elseif ($command == 'sendmsgsubmit') { $num = uc_pm_send($cyask_uid, $_POST['username'], $_POST['title'], $_POST['content'], 1, 0, 1); if ($num > 0) { $backurl = 'my.php?command=mymessage'; show_message('sendmsg_succeed', $backurl); } else { show_message('sendmsg_error', $backurl); } exit; } elseif ($command == 'readmsg') { $mid = intval($_GET['mid']); $tmp = uc_pm_view($cyask_uid, $mid); $msg = $tmp[0]; unset($tmp); $msg['dateline'] = date("Y-m-d H:i:s", $msg['dateline']); } elseif ($command == 'replymsg') { $msguid = intval($_POST['fromuid']); $num = uc_pm_send($cyask_uid, $_POST['fromuid'], $_POST['title'], $_POST['content'], 1, $_POST['pmid'], 0); if ($num > 0) { $backurl = 'my.php?command=mymessage'; show_message('sendmsg_succeed', $backurl); } else { show_message('sendmsg_error', $backurl); } exit; } elseif ($command == 'delcollect') { $id = intval($_GET['id']);
while ($plid = DB::fetch($query)) { $plids[] = $plid['plid']; } DB::query("DELETE FROM " . UC_DBTABLEPRE . "pm_indexes WHERE plid NOT IN (" . dimplode($plids) . ")"); DB::query("DELETE FROM " . UC_DBTABLEPRE . "pm_members WHERE uid = {$clearpms}"); $rows = 0; for ($i = 0; $i <= 9; $i++) { DB::query("DELETE FROM " . UC_DBTABLEPRE . "pm_messages_" . $i . " WHERE authorid = {$clearpms}"); $rows += DB::affected_rows(); } cpmsg($rows, "action=plugins&pmod=maintain&cp=aboutucenter&operation={$operation}&do={$do}&mod=pm"); } if ($_GET['submit']) { //echo "SELECT * FROM ".UC_DBTABLEPRE."pms $sqlplus GROUP BY dateline, msgtoid ORDER BY dateline DESC LIMIT $startlimit,$ppp";exit; if ($_GET['uid'] && $_GET['touid']) { $data = uc_pm_view($_GET['uid'], 0, $_GET['touid'], 5); //print_r($data); $data = array_reverse($data); showtableheaders(dstripslashes($_GET['username']) . $toolslang['uc_pmhis']); showsubtitle(array($toolslang['uc_pmfrom'], $toolslang['uc_pmtoer'], $toolslang['uc_pmcontent'], $toolslang['uc_pmtime'])); foreach ($data as $key => $value) { $showdata[1] = DB::result_first("SELECT username FROM " . DB::table('common_member') . " WHERE uid = {$value['authorid']}"); $showdata[2] = DB::result_first("SELECT username FROM " . DB::table('common_member') . " WHERE uid = {$value['touid']}"); $showdata[3] = $value['message']; $showdata[4] = date('Y-m-d H:i', $value['dateline']); showtablerow('', array(), $showdata); } showtablerow('', array('class="td25"'), array('', '', '', '', $multipage)); showtablefooter(); } else { $data = uc_pm_list($msgfromid, $page, $ppp, 'inbox', 'privatepm', '', 100);