function space_open($uid, $username, $gid = 0, $email = '') { global $_SGLOBAL, $_SCONFIG; if (empty($uid) || empty($username)) { return array(); } //验证空间是否被管理员删除 $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('spacelog') . " WHERE uid='{$uid}' AND flag='-1'"); if ($value = $_SGLOBAL['db']->fetch_array($query)) { showmessage('the_space_has_been_closed'); } $space = array('uid' => $uid, 'username' => $username, 'dateline' => $_SGLOBAL['timestamp'], 'groupid' => $gid); inserttable('space', $space, 0, true); inserttable('spacefield', array('uid' => $uid, 'email' => $email), 0, true); //发送PM if ($_SGLOBAL['supe_uid'] && $_SGLOBAL['supe_uid'] != $uid) { include_once S_ROOT . './uc_client/client.php'; uc_pm_send($_SGLOBAL['supe_uid'], $uid, cplang('space_open_subject'), cplang('space_open_message', array(getsiteurl())), 1, 0, 0); } //产生feed include_once S_ROOT . './source/function_cp.php'; $_uid = $_SGLOBAL['supe_uid']; $_username = $_SGLOBAL['supe_username']; $_SGLOBAL['supe_uid'] = $uid; $_SGLOBAL['supe_username'] = addslashes($username); feed_add('profile', cplang('feed_space_open')); $_SGLOBAL['supe_uid'] = $_uid; $_SGLOBAL['supe_username'] = $_username; return $space; }
public static function sendpm($toid, $subject, $message, $fromid = '', $replypmid = 0, $isusername = 0, $type = 0) { global $_G; if ($fromid === '') { $fromid = $_G['uid']; } $author = ''; if ($fromid) { if ($fromid == $_G['uid']) { $sendpmmaxnum = $_G['group']['allowsendpmmaxnum']; $author = $_G['username']; } else { $user = getuserbyuid($fromid); $author = $user['username']; loadcache('usergroup_' . $user['groupid']); $sendpmmaxnum = $_G['cache']['usergroup_' . $user['groupid']]['allowsendpmmaxnum']; } $currentnum = C::t('common_member_action_log')->count_day_hours(getuseraction('pmid'), $fromid); if ($sendpmmaxnum && $currentnum >= $sendpmmaxnum) { return -16; } } loaducenter(); $return = uc_pm_send($fromid, $toid, addslashes($subject), addslashes($message), 1, $replypmid, $isusername, $type); if ($return > 0 && $fromid) { if ($_G['setting']['cloud_status']) { $msgService = Cloud::loadClass('Cloud_Service_Client_Message'); if (is_numeric($toid)) { $tospace = getuserbyuid($toid); if ($tospace['conisbind']) { $msgService->add($toid, $fromid, $author, $_G['timestamp']); } } else { $senduids = array(); foreach (C::t('common_member')->fetch_all_by_username(explode(',', $toid)) as $touser) { if ($touser['conisbind']) { $senduids[$touser['uid']] = $touser['uid']; } } if ($senduids) { $msgService->add($senduids, $fromid, $author, $_G['timestamp']); } } } foreach (explode(',', $fromid) as $v) { useractionlog($fromid, 'pmid'); } } return $return; }
/** * 发送短消息 * * @param integer $fromuid 发件人用户 ID,0 为系统消息 * @param string $msgto 收件人用户名,多个用逗号分割 * @param string $subject 消息标题 * @param string $message 消息内容 * @param integer $replypmid 回复的消息 ID 大于 0:回复指定的短消息 0:(默认值) 发送新的短消息 * @return integer {大于 0:发送成功的最后一条消息 ID 0:发送失败 -1:超出了24小时最大允许发送短消息数目 * -2:不满足两次发送短消息最短间隔 -3:不能给非好友批量发送短消息 * -4:目前还不能使用发送短消息功能(注册多少日后才可以使用发短消息限制)} */ public function uc_pm_send($fromuid, $msgto, $subject, $message, $replypmid) { return uc_pm_send($fromuid, $msgto, $subject, $message, $instantly = 1, $replypmid = 0, $isusername = 1); }
function sendpm($toid, $subject, $message, $fromid = '') { extract($GLOBALS, EXTR_SKIP); include language('pms'); require_once DISCUZ_ROOT . './uc_client/client.php'; if (isset($language[$subject])) { eval("\$subject = addslashes(\"" . $language[$subject] . "\");"); } if (isset($language[$message])) { eval("\$message = addslashes(\"" . $language[$message] . "\");"); } if ($fromid === '') { $fromid = $discuz_uid; } uc_pm_send($fromid, $toid, $subject, $message); }
function sendpm($toid, $subject, $message, $fromid = '') { global $_G; if ($fromid === '') { $fromid = $_G['uid']; } loaducenter(); uc_pm_send($fromid, $toid, $subject, $message); }
function API_SendMsg($uid, $ti, $co) { global $userid; include_once ONEZ_ROOT . './uc_client/client.php'; return uc_pm_send($userid, $uid, $ti, $co); }
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>'; }
} else { //发送短信 if (!regcode_pass('pm', empty($regcode) ? '' : trim($regcode))) { mcmessage(lang('regcodeerror'), M_REFERER); } $pmnew['title'] = trim($pmnew['title']); $pmnew['tonames'] = trim($pmnew['tonames']); $pmnew['content'] = trim($pmnew['content']); if (empty($pmnew['content']) || empty($pmnew['tonames'])) { mcmessage(lang('pmdatamiss'), M_REFERER); } $tos = array_filter(explode(',', $pmnew['tonames'])); $count = 0; $pmnew['title'] = $pmnew['title'] ? $pmnew['title'] : ($pmnew['content'] ? $pmnew['content'] : ''); foreach ($tos as $to) { if (uc_pm_send($uid, $to, $pmnew['title'], $pmnew['content'], 1, 0, 1)) { $count++; } } $count ? mcmessage($count . lang('pmsendfinish'), "?action=pmbox&box={$box}&page={$page}") : mcmessage(lang('pmsenderr'), M_REFERER); } } elseif (empty($fid) && empty($pmid)) { if (!submitcheck('bpmbox')) { //各收件箱 $ucpm = uc_pm_list($uid, $page, $mrowpp, 'inbox', $box, 30); tabheader(lang('pmlist'), 'pmsedit', "?action=pmbox&box={$box}&page={$page}", 6); trcategory(array($box == 'announcepm' ? '' : "<input class=\"checkbox\" type=\"checkbox\" name=\"chkall\" class=\"category\" onclick=\"checkall(this.form, '', 'chkall')\">" . lang('del'), array(lang('title'), 'left'), lang('senduser'), lang('state'), lang('senddate'), lang('content'))); if ($ucpm['data']) { foreach ($ucpm['data'] as $pm) { echo "<tr title=\"" . mhtmlspecialchars($pm['message']) . "\">\n<td align=\"left\" width=\"40\">" . ($box == 'announcepm' ? '' : "<input class=\"checkbox\" type=\"checkbox\" name=\"" . ($pm['msgformid'] ? "fids[{$pm['msgformid']}]\" value=\"{$pm['msgform']}" : "pmids[{$pm['pmid']}]\" value=\"{$pm['pmid']}") . '">') . "</td>\n" . "<td class=\"item2\">" . mhtmlspecialchars($pm['subject']) . "</td>\n" . "<td align=\"center\" width=\"120\">" . ($pm['msgfromid'] ? $pm['msgfrom'] : lang('syspm')) . "</td>\n" . "<td align=\"center\" width=\"40\">" . ($box == 'announcepm' ? '-' : lang($pm['new'] ? 'noread' : 'read')) . "</td>\n" . "<td align=\"center\" width=\"80\">" . date($dateformat, $pm['dateline']) . "</td>\n" . "<td align=\"center\" width=\"40\"><a href=\"?action=pmbox&box={$box}&page={$page}&" . ($pm['msgfromid'] ? "fid={$pm['msgfromid']}" : "pmid={$pm['pmid']}") . "\">" . lang('look') . "</a></td></tr>\n"; }
function sendpm($toid, $subject, $message, $fromid = '') { if ($fromid === '') { require_once DISCUZ_ROOT . './uc_client/client.php'; $fromid = $discuz_uid; } if ($fromid) { uc_pm_send($fromid, $toid, $subject, $message); } else { global $promptkeys; if (in_array($subject, $promptkeys)) { $type = $subject; } else { extract($GLOBALS, EXTR_SKIP); require_once DISCUZ_ROOT . './include/discuzcode.func.php'; $message = str_replace(array('{', '}', '"'), ' ', $message); eval("\$message = addslashes(\"" . $message . "\");"); $type = 'systempm'; $message = '<div>' . $subject . ' {time}<br />' . discuzcode($message, 1, 0) . '</div>'; } sendnotice($toid, $message, $type); } }
if ($iauth_type == 'RP') { //如果是api,则更新api信息,同时同步api信息至iauth $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('api') . " WHERE appid={$appsid}"); if ($value = $_SGLOBAL['db']->fetch_array($query)) { $api_id = $value['id']; $iauth_api_name = $value['iauth_api_name']; $api['appid'] = $iauth_arr['id']; $api['url'] = $value['url']; //print_r($value); //print_r($api); } $api['iauthAPIid'] = IAUTH_new_API($api['appid'], $iauth_api_name, $api['url']); updatetable('api', $api, array('id' => $api_id)); } $pmContent = "【应用开发信息】(请妥善保管,勿轻易泄漏,否则由此造成的一切后果由应用申请者负责)\n中文名称【" . $name . "】\n英文名称【" . $iauth_name . "】\napp id【" . $iauth_arr['id'] . "】不含括号\napp secret【" . $iauth_arr['secret'] . "】不含括号\n应用访问链接:http://i.buaa.edu.cn/plugin.php?pluginid=apps&ac=detail&appsid=" . $iauth_arr['id'] . "\n应用开发讨论区:http://i.buaa.edu.cn/space.php?do=mtag&tagid=1822\n祝开发愉快! ihome团队敬上"; uc_pm_send(0, $_GET['applyuid'], '应用已通过审核', $pmContent); $notes = '管理员审核通过了应用【<a href="/plugin.php?pluginid=apps&ac=detail&appsid=' . $iauth_arr['id'] . '">' . $name . '</a>】,详见<a href="/space.php?do=pm&filter=systempm">系统消息</a><br/>【附加说明】' . $notes; } } //更新本地app信息 //print_r($app_arr); updatetable('apps', $app_arr, array('id' => $appsid)); //通知申请者 $applyuid = $_GET['applyuid']; notification_add($applyuid, 'systemnote', $notes); header("Location:admincp.php?ac=apps"); exit; } else { $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('apps') . " WHERE id={$appsid}"); if ($value = $_SGLOBAL['db']->fetch_array($query)) { $logo = $value['logo'] ? $_SC['attachurl'] . $value['logo'] : 'plugin/apps/images/app.gif';
$shop['letter'] = getletter(trim($_POST['subject'])); $shop['address'] = $_POST['address']; $shop['catid'] = $_POST['catid']; $shop['validity_end'] = mktime(0, 0, 0, date('m', $_G['timestamp']), date('d', $_G['timestamp']), date('Y', $_G['timestamp']) + 10); // 自動為用戶加商店 $shopid = inserttable('shopitems', $shop, 1); $itemmessage['itemid'] = $shopid; $itemmessage['postip'] = $_G['clientip']; inserttable('shopmessage', $itemmessage); $_BCACHE->deltype('sitelist', 'shop', $_G['uid']); if (!pkperm('isadmin')) { DB::query('UPDATE ' . tname('members') . " SET myshopid='{$shopid}' WHERE uid='{$_G['uid']}'"); } if ($_G['setting']['auditnewshops']) { uc_pm_send(0, $_SC['founder'], $lang['apm_admin_title'], $lang['apm_admin_msg']); uc_pm_send(0, $_G['uid'], $lang['apm_panel_title'], $lang['apm_panel_msg']); showmessage('apm_panel_msg', 'index.php'); } else { DB::query('UPDATE ' . tname('shopitems') . " SET grade='3', groupid='{$_G['setting']['defaultshopgroup']}' WHERE itemid='{$shopid}'"); showmessage('attend_register_success', 'index.php'); } exit; } else { showmessage('no_submit', geturl('attend.php')); } } elseif ($do && $do == "attend") { //第二步,填寫基本信息 $uid = $_G['uid']; $ucurl = avatar($uid); if (postget('refer')) { $refer = postget('refer');
function pm_msgbox($array) { global $db, $pre, $timestamp, $webdb, $TB_pre, $TB, $userDB, $db_modes; $array[content] = addslashes($array[content]); $array[title] = addslashes($array[title]); if (ereg("^pwbbs", $webdb[passport_type]) && !is_array($db_modes)) { if (strlen($array[title]) > 130) { showerr("±êÌâ²»ÄÜ´óÓÚ65¸öºº×Ö"); } if (is_table("{$TB_pre}msgc")) { $db->query("INSERT INTO {$TB_pre}msg (`touid`,`fromuid`, `username`, `type`, `ifnew`, `mdate`) VALUES ('{$array['touid']}','{$array['fromuid']}', '{$array['fromer']}', 'rebox', '1', '{$timestamp}')"); $mid = $db->insert_id(); $db->query("INSERT INTO {$TB_pre}msgc (`mid`, `title`, `content`) VALUES ('{$mid}','{$array['title']}','{$array['content']}')"); } else { $db->query("INSERT INTO {$TB_pre}msg (`touid`,`fromuid`, `username`, `type`, `ifnew`, `title`, `mdate`, `content`) VALUES ('{$array['touid']}','{$array['fromuid']}', '{$array['fromer']}', 'rebox', '1', '{$array['title']}', '{$timestamp}', '{$array['content']}')"); } $array = array('uid' => $array[touid], 'newpm' => 1); $userDB->edit_pw_member($array); } elseif (defined("UC_CONNECT")) { if (strlen($array[title]) > 75) { showerr("±êÌâ²»ÄÜ´óÓÚ32¸öºº×Ö"); } uc_pm_send('$array[fromuid]', '$array[touid]', '$array[title]', '$array[content]', 1, 0, 1); } else { if (strlen($array[title]) > 130) { showerr("±êÌâ²»ÄÜ´óÓÚ65¸öºº×Ö"); } $db->query("INSERT INTO `{$pre}pm` (`touid`,`fromuid`, `username`, `type`, `ifnew`, `title`, `mdate`, `content`) VALUES ('{$array['touid']}','{$array['fromuid']}', '{$array['fromer']}', 'rebox', '1', '{$array['title']}', '{$timestamp}', '{$array['content']}')"); } }
show_message('user_nologin', ''); exit; } } elseif ($command == 'sendmsg') { if (!$cyask_user) { $backurl = 'member.php?uid=' . $uid; show_message('user_nologin', ''); exit; } if ($cyask_uid == $uid) { $url = 'member.php?uid=' . $uid; show_message('sendmsg_self', $url); exit; } if (check_submit($_POST['sendmsg'], $_POST['formhash'])) { $num = uc_pm_send($cyask_uid, $uid, $_POST['title'], $_POST['content'], 1, 0, 0); if ($num > 0) { $url = 'member.php?uid=' . $uid; show_message('sendmsg_succeed', $url); } else { $url = 'member.php?uid=' . $uid; show_message('sendmsg_error', $url); } /* if($passport=='discuz5.0.0') { $dblink->query("insert into $dbprefix"."pms set msgfrom='$cyask_user',msgfromid='$cyask_uid',msgtoid='$uid',folder='inbox',new=1,subject='$_POST[title]',dateline='$timestamp',message='$_POST[content]'"); } elseif($passport=='discuz5.5.0') { $dblink->query("insert into $dbprefix"."pms set msgfrom='$cyask_user',msgfromid='$cyask_uid',msgtoid='$uid',folder='inbox',new=1,subject='$_POST[title]',dateline='$timestamp',message='$_POST[content]'");
function gradechange($items = '', $opcheck = 3, $check_txt = '', $model = 'shop') { global $_G, $_SGLOBAL; require_once B_ROOT . './uc_client/client.php'; if ($model != 'shop') { $query = DB::query('SELECT shopid,itemid,subject FROM ' . tname($model . 'items') . ' WHERE itemid IN (' . $items . ')'); while ($result = DB::fetch($query)) { $shopids[] = $result['shopid']; $itemsinfo[$result['itemid']] = $result; } //echo 'SELECT shopid FROM '.tname($model.'items').' WHERE itemid IN ('.$items.')'; //print_r($shopids); $items = implode(",", $shopids); } $query = DB::query('SELECT uid, username, subject, itemid as shopid FROM ' . tname('shopitems') . ' WHERE itemid IN (' . $items . ')'); while ($value = DB::fetch($query)) { $passuids .= $value['uid'] . ', '; $passuidarr[$value['shopid']] = $value; } if ($passuidarr) { if ($model == 'shop') { $passuids = substr($passuids, 0, -2); $pmcont = !empty($check_txt) ? $check_txt : lang('mod_checktxt_change'); switch ($opcheck) { case 1: $pmtitle = lang('mod_checktitle_fail'); //if($model == 'shop') DB::query('UPDATE '.tname('members')." SET myshopstatus='unverified' WHERE uid IN ('$passuids')");//審核後將狀態更新至members表 break; case 2: $pmtitle = lang('mod_checktitle_close'); //if($model == 'shop') DB::query('UPDATE '.tname('members')." SET myshopstatus='verified' WHERE uid IN ('$passuids')"); break; case 3: $pmtitle = lang('mod_checktitle_pass'); //if($model == 'shop') DB::query('UPDATE '.tname('members')." SET myshopstatus='verified' WHERE uid IN ('$passuids')"); break; case 4: $pmtitle = lang('mod_checktitle_recommend'); //if($model == 'shop') DB::query('UPDATE '.tname('members')." SET myshopstatus='verified' WHERE uid IN ('$passuids')"); break; default: $pmtitle = lang('mod_checktitle_change'); //if($model == 'shop') DB::query('UPDATE '.tname('members')." SET myshopstatus='unverified' WHERE uid IN ('$passuids')"); break; } foreach ($passuidarr as $eachuid) { $tmpcont = trim(strip_tags(str_replace(array('USERNAME', 'SHOPTITLE', 'GRADENOW'), array(saddslashes($eachuid['username']), saddslashes($eachuid['subject']), $_SGLOBAL['shopgrade'][$opcheck]), $pmcont))); //$_G['uid'] . $eachuid['uid'] . $pmtitle . $tmpcont; uc_pm_send(0, $eachuid['uid'], $pmtitle, $tmpcont); } } else { $pmtitle = $opcheck; $pmcont = !empty($check_txt) ? $check_txt : lang('mod_checktxt_change_' . $model); foreach ($itemsinfo as $itemid => $iteminfo) { $eachuid = $passuidarr[$iteminfo['shopid']]; $tmpcont = trim(strip_tags(str_replace(array('USERNAME', 'SUBJECT'), array($eachuid['username'], '[url=' . B_URL . '/store.php?id=' . $iteminfo['shopid'] . '&action=' . $model . '&xid=' . $itemid . ']' . $iteminfo['subject'] . '[/url]'), $pmcont))); uc_pm_send(0, $eachuid['uid'], $pmtitle, $tmpcont); } } } //grade_s店舖狀態信息數據冗余到相冊、消費券等各個物件表中 if ($model == 'shop') { $models = array('album', 'consume', 'good', 'groupbuy', 'notice', 'photo'); foreach ($models as $m) { DB::query("UPDATE " . tname($m . 'items') . " i INNER JOIN " . tname('shopitems') . " si ON i.shopid=si.itemid SET i.grade_s = si.grade WHERE i.shopid IN ({$items})", 'UNBUFFERED'); } } }
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']; $username = $user['username']; } // 發送操作 } elseif ($act == 'send') { if (submitcheck('pmsubmit')) { $subject = $_POST['subject']; $message = $_POST['message']; @(include_once B_ROOT . './uc_client/client.php'); $send_result = uc_pm_send($_G['uid'], $msgto, $subject, $message); } else { showmessage('FORMHASH ERROR', 'index.php'); } } } } include template('templates/site/default/pm.html.php', 1);
if (!$_g_xid || !$_g_uid) { showmessagee('system_error'); } $c_groupby = loadClass('groupbuy'); $sql = "update " . tname('groupbuyjoin') . " set status = 1 WHERE itemid = " . $_g_xid . " AND uid=" . $_g_uid . ";"; $query = DB::query($sql); $c_groupby->update_groupby_join_num($_g_xid); $_BCACHE->deltype('detail', 'groupbuy', $_GET['id'], $_g_xid); $username = DB::result_first("SELECT username FROM " . tname('members') . " WHERE uid=" . $_g_uid); if (isset($lang['groupbuy_join_finalsuccess_title'])) { eval("\$pm_title = \"" . $lang['groupbuy_join_finalsuccess_title'] . "\";"); } if (isset($lang['groupbuy_join_finalsuccess_message'])) { eval("\$pm_message = \"" . $lang['groupbuy_join_finalsuccess_message'] . "\";"); } uc_pm_send($shop['uid'], $_g_uid, $pm_title, $pm_message); header("location: store.php?id=" . $_GET['id'] . "&action=groupbuy&do=groupbuy_attend_detail&xid=" . $_g_xid); exit; } elseif ($_GET['do'] == 'groupbuy_attend_detail') { $groupbuy['date'] = date('Y' . $lang['year'] . 'm' . $lang['mon'] . 'd' . $lang['day'], $groupbuy['dateline']); $groupbuy['days'] = ceil(($_G['timestamp'] - $groupbuy['dateline']) / 86400); $groupbuy['join_total_num'] = DB::fetch(DB::query("SELECT count(*) as count FROM " . tname("groupbuyjoin") . " WHERE itemid = " . $_g_xid . "")); $groupbuy['join_total_num'] = $groupbuy['join_total_num']['count']; $groupbuyattr = loadClass('attr')->get_groupby_user_attr(); $sql = "SELECT * FROM " . tname('groupbuyjoin') . " WHERE itemid = " . $_g_xid; $query = DB::query($sql); while ($res = DB::fetch($query)) { $groupbuy_join_list[] = $res; } //導出 Excel if ($_GET['exportexcel'] == 1) {
} $msgto = $uid; } } if ($discuz_uid == $msgto) { showmessage('pm_send_self_ignore'); } if (trim($message) === '') { showmessage('pm_send_empty'); } include_once './forumdata/cache/cache_bbcodes.php'; foreach ($_DCACHE['smilies']['replacearray'] as $key => $smiley) { $_DCACHE['smilies']['replacearray'][$key] = '[img]' . $boardurl . 'images/smilies/' . $_DCACHE['smileytypes'][$_DCACHE['smilies']['typearray'][$key]]['directory'] . '/' . $smiley . '[/img]'; } $message = preg_replace($_DCACHE['smilies']['searcharray'], $_DCACHE['smilies']['replacearray'], $message); $pmid = uc_pm_send($discuz_uid, $msgto, '', $message, 1, 0, 0); if ($pmid > 0) { !($exempt & 1) && updatecredits($discuz_uid, $creditspolicy['sendpm'], -1); if (empty($sendnew)) { $pm = uc_pm_viewnode($discuz_uid, 0, $pmid); $dateline = $pm['dateline'] + $timeoffset * 3600; $pm['daterange'] = gmdate($dateformat, $dateline); $pm['daterange'] = $pm['daterange'] != $lastdaterange ? $pm['daterange'] : ''; $pm['dateline'] = gmdate("{$dateformat} {$timeformat}", $dateline); include template('header_ajax'); include template('pm_node'); include template('footer_ajax'); exit; } else { showmessage('pm_send_succeed', '', 1); exit;
$result['status'] = 0; $result['msg'] = '很悲桑的说,你大概被拉黑了。。'; echo json_encode($result); exit; } } if (empty($content)) { $result['status'] = 0; $result['msg'] = '这条可怜的消息木有了,再来一发吧'; echo json_encode($result); exit; } $subject = ''; $return = 0; if ($touid) { $return = uc_pm_send($_SGLOBAL['supe_uid'], $touid, $subject, $content, 1, $pmid, 0); if ($return > 0) { require 'Predis/Autoloader.php'; Predis\Autoloader::register(); $client = new Predis\Client(); $keyT = 'ihome_T' . $touid; if ($client->exists($keyT)) { $keyR = 'ihome_R' . $touid; if ($client->exists($keyR)) { $value = intval($client->get($keyR)); $return = $value > $return ? $value : $return; } $client->set($keyR, $return); } smail($touid, '', cplang('friend_pm', array($_SN[$space['uid']], getsiteurl() . 'space.php?do=pm')), '', 'friend_pm'); }
function space_open($uid, $username, $gid = 0, $email = '') { global $_SGLOBAL, $_SCONFIG; if (empty($uid) || empty($username)) { return array(); } //验证 space 是否被管理员 delete $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('spacelog') . " WHERE uid='{$uid}' AND flag='-1'"); if ($value = $_SGLOBAL['db']->fetch_array($query)) { showmessage('the_space_has_been_closed'); } $space = array('uid' => $uid, 'username' => $username, 'dateline' => $_SGLOBAL['timestamp'], 'groupid' => $gid, 'regip' => getonlineip()); // Bonus Points $reward = getreward('register', 0, $uid); if ($reward['credit']) { $space['credit'] = $reward['credit']; } if ($reward['experience']) { $space['experience'] = $reward['experience']; } inserttable('space', $space, 0, true); inserttable('spacefield', array('uid' => $uid, 'email' => $email), 0, true); //发送PM if ($_SGLOBAL['supe_uid'] && $_SGLOBAL['supe_uid'] != $uid) { include_once S_ROOT . './uc_client/client.php'; uc_pm_send($_SGLOBAL['supe_uid'], $uid, cplang('space_open_subject'), cplang('space_open_message', array(getsiteurl())), 1, 0, 0); } //发送邮箱验证邮件 include_once S_ROOT . './source/function_cp.php'; emailcheck_send($uid, $email); //产生feed $_uid = $_SGLOBAL['supe_uid']; $_username = $_SGLOBAL['supe_username']; $_SGLOBAL['supe_uid'] = $uid; $_SGLOBAL['supe_username'] = addslashes($username); if (ckprivacy('spaceopen', 1)) { feed_add('profile', cplang('feed_space_open')); } // update 最新会员 if ($_SCONFIG['newspacenum'] > 0) { $newspacelist = array(); $wherearr = array('1'); if ($_SCONFIG['newspaceavatar']) { $wherearr[] = "avatar='1'"; } if ($_SCONFIG['newspacerealname']) { $wherearr[] = "namestatus='1'"; } if ($_SCONFIG['newspacevideophoto']) { $wherearr[] = "videostatus='1'"; } $query = $_SGLOBAL['db']->query("SELECT uid,username,name,namestatus,videostatus,dateline FROM " . tname('space') . " WHERE " . implode(' AND ', $wherearr) . " ORDER BY uid DESC LIMIT 0,{$_SCONFIG['newspacenum']}"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { $newspacelist[] = $value; } data_set('newspacelist', $newspacelist); } //Statistics update include_once S_ROOT . './source/function_cp.php'; updatestat('register'); $_SGLOBAL['supe_uid'] = $_uid; $_SGLOBAL['supe_username'] = $_username; return $space; }
<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)) { echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?example=pmlist&pmsend=yes"> 发送到: <br /><input name="msgto" /><br /> 标题: <br /><input name="subject" /><br /> 消息内容: <br /><textarea name="message" cols="40" rows="10" /></textarea><br /> <input type="submit" value="发送" /></form>'; exit; } else { if (uc_pm_send($Example_uid, $_POST['msgto'], $_POST['subject'], $_POST['message'], 1, $_POST['replypmid'], 1)) { echo '<br />短消息已发送<br />'; } else { echo '<br />短消息发送失败,<a href="###" onclick="history.back()">返回</a><br />'; exit; } } } 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 />
$q_msgtype = 'event_comment_reply'; break; } if (empty($comment)) { //非引用评论 if ($tospace['uid'] != $_SGLOBAL['supe_uid']) { //事件发布 if (ckprivacy('comment', 1)) { feed_add($fs['icon'], $fs['title_template'], $fs['title_data'], $fs['body_template'], $fs['body_data'], $fs['body_general'], $fs['images'], $fs['image_links'], $fs['target_ids'], $fs['friend']); } //发送通知 notification_add($tospace['uid'], $note_type, $note); //留言发送短消息 if ($_POST['idtype'] == 'uid' && $tospace['updatetime'] == $tospace['dateline']) { include_once S_ROOT . './uc_client/client.php'; uc_pm_send($_SGLOBAL['supe_uid'], $tospace['uid'], cplang('wall_pm_subject'), cplang('wall_pm_message', array(addslashes(getsiteurl() . $n_url))), 1, 0, 0); } //发送邮件通知 smail($tospace['uid'], '', cplang($msgtype, array($_SN[$space['uid']], shtmlspecialchars(getsiteurl() . $n_url))), '', $msgtype); } } elseif ($comment['authorid'] != $_SGLOBAL['supe_uid']) { //发送邮件通知 smail($comment['authorid'], '', cplang($q_msgtype, array($_SN[$space['uid']], shtmlspecialchars(getsiteurl() . $n_url))), '', $q_msgtype); notification_add($comment['authorid'], $note_type, $q_note); } //统计 if ($stattype) { updatestat($stattype); } //积分 if ($tospace['uid'] != $_SGLOBAL['supe_uid']) {
function sendpm($toid, $subject, $message, $fromid = '', $replypmid = 0, $isusername = 0, $type = 0) { global $_G; if ($fromid === '') { $fromid = $_G['uid']; } loaducenter(); return uc_pm_send($fromid, $toid, $subject, $message, 1, $replypmid, $isusername, $type); }
$return = uc_pm_send($_SGLOBAL['supe_uid'], $touid, $subject, $message, 1, $pmid, 0); //发送邮件通知 if ($return > 0) { smail($touid, '', cplang('friend_pm', array($_SN[$space['uid']], getsiteurl() . 'space.php?do=pm')), '', 'friend_pm'); } } elseif ($username) { $newusers = array(); $users = explode(',', $username); foreach ($users as $value) { $value = trim($value); if ($value) { $newusers[] = $value; } } if ($newusers) { $return = uc_pm_send($_SGLOBAL['supe_uid'], implode(',', $newusers), $subject, $message, 1, $pmid, 1); } //发送邮件通知 $touid = 0; if ($return > 0) { $query = $_SGLOBAL['db']->query('SELECT uid FROM ' . tname('space') . ' WHERE username IN (' . simplode($users) . ')'); while ($value = $_SGLOBAL['db']->fetch_array($query)) { if (empty($touid)) { $touid = $value['uid']; } smail($value['uid'], '', cplang('friend_pm', array($_SN[$space['uid']], getsiteurl() . 'space.php?do=pm')), '', 'friend_pm'); } } } if ($return > 0) { //更新最后发布时间
} if ($action == "post") { $floginid = 'admin'; $fromid = 0; $toid = 0; $tologinid = 0; $sendtime = time(); $writetime = time(); $subject = cn_substrR(HtmlReplace($subject), 70); $message = cn_substrR(HtmlReplace($message), 1000); if (!isset($subject) || empty($subject)) { ShowMsg('短信标题不能为空!', '-1'); exit; } else { if (!isset($message) || empty($message)) { ShowMsg('请填写短信内容!', '-1'); exit; } } #api{{ if (defined('UC_API') && @(include_once DEDEROOT . '/uc_client/client.php')) { uc_pm_send(0, '', $subject, $message); ShowMsg('短信已成功发送', '-1'); exit; } #/aip}} $rs = $dsql->ExecuteNoneQuery("INSERT INTO #@__member_pms(floginid,fromid,toid,tologinid,folder,hasview,subject,sendtime,writetime,message,isadmin) VALUES('{$floginid}','{$fromid}','{$toid}','{$tologinid}','outbox','0','{$subject}','{$sendtime}','{$writetime}','{$message}','1');"); ShowMsg('短信已成功发送', '-1'); exit; } require_once DEDEADMIN . "/templets/member_pmall.htm";
<form method=\"post\" action=\"$phpself&action=addblackls\"> <input name=\"user\" value=\"\"> <input type=\"submit\"> </form> "; 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($Example_uid, $msgto, $_POST['subject'], $_POST['message'], 1, 0, $isusername)) { $output .= "短消息已发送"; } else { $output .= "短消息发送失败,<a href=\"###\" onclick=\"history.back()\">返回</a>"; } } else { $output .= " <form method=\"post\" action=\"$phpself&action=send\"> 发送给:<input name=\"touser\" value=\"\"><br> 标题:<input name=\"subject\" value=\"\"><br> 内容:<textarea name=\"message\" cols=\"30\" rows=\"5\"></textarea> <input type=\"submit\"> </form> "; } break;
echo "<script>location.href='" . $_SERVER["HTTP_REFERER"] . "';</script>"; } elseif ($op == 'negate') { $appuid = $_GET['appuid'] ? trim($_GET['appuid']) : ''; //echo $_SGLOBAL['supe_uid']; $setarr = array('ruthed' => -1, 'adminuid' => $_SGLOBAL['supe_uid']); //表明拒绝接受 updatetable('publicapply', $setarr, array('appid' => $appid)); /*$cid = inserttable('mailcron', array('email'=>$email), 1); $setarr = array( 'cid' => $cid, 'subject' => '公共主页申请受理', 'message' => '非常抱歉的的通知您,您申请的公共主页'.$name.'管理员认为不适合开通,感谢您对本网站的支持!如有疑问,请EMAIL至ihome@buaa.edu.cn,再次感谢您对本网站的支持', 'dateline' => $_GLOBAL['timestamp'] ); //放入邮件队列 inserttable('mailqueue', $setarr);*/ $subject = '公共主页申请受理'; $message = '非常抱歉的的通知您,您申请的公共主页' . $name . '管理员认为不适合开通,如有疑问,请EMAIL至ihome@buaa.edu.cn,或私信给ihome公共主页。'; uc_pm_send(0, $appuid, $subject, $message, 1, 0, 0); echo "<script>location.href='" . $_SERVER["HTTP_REFERER"] . "';</script>"; } function random_pw($length) { $conso = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'); $password = ""; srand((double) microtime() * 1000000); for ($i = 1; $i <= $length; $i++) { $password .= $conso[rand(0, 35)]; } return $password; }
} } tabfooter(); tabheader(lang('pmcontentset')); trbasic(lang('pmtitle'), 'pmnew[title]'); trbasic(lang('pmcontent'), 'pmnew[content]', '', 'textarea'); tabfooter('bbatchpms'); a_guide('pmsbatch'); } else { if (empty($pmnew['title']) || empty($pmnew['content'])) { amessage('pmmiss', '?entry=pms&action=batchpms'); } if ($enable_uc) { require_once M_ROOT . './include/ucenter/config.inc.php'; require_once M_ROOT . './uc_client/client.php'; uc_pm_send(0, $pmnew['tonames'], $pmnew['title'], $pmnew['content'], 1, 0, 1) ? amessage(lang('pmsendfin'), '?entry=pms&action=batchpms') : amessage(lang('pmsenderr'), M_REFERER); } $wheresql = ''; if (!empty($pmnew['toids'])) { $toids = array_filter(explode(',', $pmnew['toids'])); $toids = mimplode($toids); $wheresql = empty($toids) ? "" : "mid IN ({$toids})"; } if (!empty($pmnew['tonames'])) { $tonames = array_filter(explode(',', $pmnew['tonames'])); $tonames = mimplode($tonames); $wheresql .= empty($tonames) ? "" : (empty($wheresql) ? "" : " OR ") . "mname IN ({$tonames})"; } !empty($wheresql) && ($wheresql = "(" . $wheresql . ")"); foreach ($grouptypes as $gtid => $grouptype) { if (!empty($pmnew['limit' . $gtid]) && !empty($pmnew['ugids' . $gtid])) {
$result = $_SGLOBAL['db']->query("select uid,username,name from " . tname('space') . " where uid={$UserId}"); if ($rs = $_SGLOBAL['db']->fetch_array($result)) { $realname = $rs['name']; if (empty($realname)) { $realname = $rs['username']; } //调用检查函数将@后的内容进行验证,为UID对应的姓名相同则返回@与姓名,不相同则继续判断下一个@,没有找到匹配的最终将返回false $ValidValue = getAtName($TmpString, $TmpName, $realname); $ValidValue = trim($ValidValue); $at_friend = "space.php?uid=" . $UserId; if ($ValidValue != false) { $Message = str_replace($ValidValue, "<a href={$at_friend}>@" . $realname . "</a> ", $Message); $UserIds[] = $UserId; } } } //Add by Add by am 2013-12-07 end //直接给一个用户发PM $return = uc_pm_send($MsgFromId, $touid, $Subject, $Message, 1, $Pmid, 0); if ($return) { $arrs = array('flag' => 'success'); } else { $arrs = array('flag' => 'fail'); } } } } $result = json_encode($arrs); $result = preg_replace("#\\\\u([0-9a-f]{4})#ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '\\1'))", $result); echo $result; exit;
while ($value = DB::fetch($query)) { $newusers[$value['uid']] = $value['username']; } } if (empty($newusers)) { showmessage('message_bad_touser', dreferer()); } if (isset($newusers[$_G['uid']])) { showmessage('message_can_not_send_to_self', dreferer()); } foreach ($newusers as $key => $value) { if (isblacklist($key)) { showmessage('is_blacklist', dreferer()); } } $return = uc_pm_send($_G['uid'], implode(',', $newusers), $subject, $message, 1, $pmid, 1); } if ($return > 0) { 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')) {
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']); $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') {