function send_msgc($msg, $isNotify = true) { global $db; if (!is_array($msg)) { return; } $uid = $sql = $mc_sql = array(); $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ foreach ($msg as $k => $v) { $username = $userService->getUserNameByUserId($v[0]); if (!$username) { continue; } M::sendNotice(array($username), array('title' => $v[6], 'content' => $v[7])); } }
$sqlarray = array('fupid' => $actuid, 'tid' => $tid, 'uid' => $memberdb['uid'], 'actmid' => $memberdb['actmid'], 'username' => $memberdb['username'], 'totalcash' => $refund_fee, 'signuptime' => $timestamp, 'isrefund' => 1, 'refundreason' => $memberdb['refundreason']); $db->update("INSERT INTO pw_activitymembers SET " . S::sqlSingle($sqlarray)); $db->update("UPDATE {$defaultValueTableName} SET updatetime=" . S::sqlEscape($timestamp) . " WHERE tid=" . S::sqlEscape($tid)); //报名列表动态时间 $newactuid = $db->insert_id(); /*支付成功费用流通日志 退款成功 */ $data = array(); L::loadClass('ActivityForBbs', 'activity', false); $postActForBbs = new PW_ActivityForBbs($data); $statusValue = $postActForBbs->getActivityStatusValue($tid); $postActForBbs->UpdatePayLog($tid, $newactuid, $statusValue); /*支付成功费用流通日志*/ /*短消息通知 退款 发起人*/ $msgContentText = $memberdb['isadditional'] ? 'activity_refund2_content' : 'activity_refund_content'; M::sendNotice(array($memberdb['author']), array('title' => getLangInfo('writemsg', 'activity_refund_title', array('uid' => $memberdb['uid'], 'username' => $memberdb['username'], 'tid' => $tid, 'subject' => $memberdb['subject'], 'totalcash' => $refund_fee)), 'content' => getLangInfo('writemsg', $msgContentText, array('uid' => $memberdb['uid'], 'username' => $memberdb['username'], 'tid' => $tid, 'subject' => $memberdb['subject'], 'totalcash' => $refund_fee))), 'notice_active', 'notice_active'); /*短消息通知 退款 参与人*/ $msgContentText = $memberdb['isadditional'] ? 'activity_refund2_signuper_content' : 'activity_refund_signuper_content'; M::sendNotice(array($memberdb['username']), array('title' => getLangInfo('writemsg', 'activity_refund_signuper_title', array('uid' => $memberdb['authorid'], 'username' => $memberdb['author'], 'tid' => $tid, 'subject' => $memberdb['subject'], 'totalcash' => $refund_fee)), 'content' => getLangInfo('writemsg', $msgContentText, array('uid' => $memberdb['authorid'], 'username' => $memberdb['author'], 'tid' => $tid, 'subject' => $memberdb['subject'], 'totalcash' => $refund_fee))), 'notice_active', 'notice_active'); paymsg("read.php?tid={$tid}", 'act_refund_success'); } else { paymsg("index.php", 'undefined_action'); } function paymsg($url, $msg, $notify = 'success') { if (empty($_POST)) { refreshto($url, $msg); } exit($notify); }
<?php !function_exists('readover') && exit('Forbidden'); $g = $db->get_one("SELECT p.gid,p.rvalue AS allowbuy,u.grouptitle FROM pw_permission p LEFT JOIN pw_usergroups u ON p.gid=u.gid WHERE p.uid='0' AND p.fid='0' AND p.gid=" . S::sqlEscape($rt['paycredit']) . " AND p.rkey='allowbuy' AND u.gptype='special'"); if ($g && $g['allowbuy']) { $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ if ($rt['extra_1'] == 1) { if ($rt['groupid'] == '-1') { $userService->update($rt['uid'], array('groupid' => $g['gid'])); } else { $groups = $rt['groups'] ? $rt['groups'] . $rt['groupid'] . ',' : ",{$rt['groupid']},"; $userService->update($rt['uid'], array('groupid' => $g['gid'], 'groups' => $groups)); } } else { $groups = $rt['groups'] ? $rt['groups'] . $g['gid'] . ',' : ",{$g['gid']},"; $userService->update($rt['uid'], array('groups' => $groups)); } $db->pw_update("SELECT uid FROM pw_extragroups WHERE uid=" . S::sqlEscape($rt['uid']) . " AND gid=" . S::sqlEscape($g['gid']), "UPDATE pw_extragroups SET " . S::sqlSingle(array('togid' => $rt['groupid'], 'startdate' => $timestamp, 'days' => $rt['number'])) . " WHERE uid=" . S::sqlEscape($rt['uid']) . " AND gid=" . S::sqlEscape($g['gid']), "INSERT INTO pw_extragroups SET " . S::sqlSingle(array('uid' => $rt['uid'], 'togid' => $rt['groupid'], 'gid' => $g['gid'], 'startdate' => $timestamp, 'days' => $rt['number']))); M::sendNotice(array($rt['username']), array('title' => getLangInfo('writemsg', 'groupbuy_title'), 'content' => getLangInfo('writemsg', 'groupbuy_content', array('fee' => $fee, 'gname' => $g['grouptitle'], 'number' => $rt['number'])))); $ret_url = 'profile.php?action=buy'; }
S::gp(array('password')); S::gp(array('newmanager'), 'GP', 2); if (!threadSetCheckOwnerPassword($winduid, $password)) { Showmsg('您输入的密码不正确!'); } $userdb = $db->get_one("SELECT m.username,m.groupid,m.memberid FROM pw_cmembers c LEFT JOIN pw_members m ON c.uid=m.uid WHERE c.ifadmin='1' AND c.colonyid=" . S::sqlEscape($cyid) . ' AND c.uid=' . S::sqlEscape($newmanager)); if (empty($userdb)) { Showmsg('请选择要转让的用户!'); } $userdb['groupid'] == '-1' && ($userdb['groupid'] = $userdb['memberid']); if ($o_groups && strpos($o_groups, ',' . $userdb['groupid'] . ',') === false) { Showmsg('您选择的用户没有接受的权限!'); } //* $db->update("UPDATE pw_colonys SET admin=" . S::sqlEscape($userdb['username']) . ' WHERE id=' . S::sqlEscape($cyid)); pwQuery::update('pw_colonys', 'id=:id', array($cyid), array('admin' => $userdb['username'])); M::sendNotice(array($userdb['username']), array('title' => getLangInfo('writemsg', 'group_attorn_title'), 'content' => getLangInfo('writemsg', 'group_attorn_content', array('username' => $windid, 'cyid' => $cyid, 'cname' => $colony['cname'], 'descrip' => $colony['descrip'])))); refreshto("thread.php?cyid={$cyid}", '转让群组成功!'); } } elseif ($t == 'disband') { if (!($windid == $colony['admin'] && $groupRight['allowdisband'] || $groupid == '3')) { Showmsg('colony_out_right'); } if (empty($_POST['step'])) { require_once PrintEot('thread_set'); footer(); } else { S::gp(array('password')); if (!threadSetCheckOwnerPassword($winduid, $password)) { Showmsg('您输入的密码不正确!'); } if ($db->get_value("SELECT COUNT(*) as sum FROM pw_cnalbum WHERE atype=1 AND ownerid=" . S::sqlEscape($cyid)) > 0) {
!function_exists('readover') && exit('Forbidden'); require_once R_P . 'require/functions.php'; PwNewDB(); $friendServer = L::loadClass('Friend', 'friend'); if ($hash == appkey($o_u, $app) && $winduid && $o_u !== $winduid) { $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $ckuser = $userService->get($o_u); $iffriend = $friendServer->getFriendByUidAndFriendid($winduid, $o_u); if ($ckuser && empty($iffriend)) { $friendcheck = getstatus($ckuser['userstatus'], PW_USERSTATUS_CFGFRIEND, 3); if (!$friendcheck) { $db->query("DELETE FROM pw_attention WHERE uid=" . S::sqlEscape($winduid) . " AND friendid=" . S::sqlEscape($o_u)); addSingleFriend(true, $winduid, $o_u, $timestamp, 0); addSingleFriend(true, $o_u, $winduid, $timestamp, 0); M::sendNotice(array($ckuser['username']), array('title' => getLangInfo('writemsg', 'friend_add_title_1', array('username' => $windid)), 'content' => getLangInfo('writemsg', 'friend_add_content_1', array('uid' => $winduid, 'username' => $windid)))); } elseif ($friendcheck == 1) { $db->query("DELETE FROM pw_attention WHERE uid=" . S::sqlEscape($winduid) . " AND friendid=" . S::sqlEscape($touid)); addSingleFriend(false, $winduid, $o_u, $timestamp, 1); M::sendRequest($winduid, array($ckuser['username']), array('create_uid' => $winduid, 'create_username' => $windid, 'title' => getLangInfo('writemsg', 'friend_add_title_2', array('username' => $windid)), 'content' => getLangInfo('writemsg', 'friend_add_content_2', array('uid' => $winduid, 'username' => $windid, 'msg' => stripslashes($checkmsg)))), 'request_friend', 'request_friend'); } Cookie('o_invite', ''); } } function addSingleFriend($updatemem, $winduid, $frienduid, $timestamp, $status, $friendtype = 0, $checkmsg = '') { global $db; $pwSQL = S::sqlSingle(array('uid' => $winduid, 'friendid' => $frienduid, 'joindate' => $timestamp, 'status' => $status, 'descrip' => $checkmsg, 'ftid' => $friendtype)); $attentionService = L::loadClass('Attention', 'friend'); /* @var $attentionService PW_Attention */ if ($isAttention = $attentionService->isFollow($winduid, $frienduid)) {
$buyer_config['starttime'] = get_date($begintime, 'Y-m-d H:i'); $buyer_config['endtime'] = get_date($begintime + $buyer_config['days'] * 86400, 'Y-m-d H:i'); $lasttime = $begintime + $buyer_config['days'] * 86400; } else { $buyer_config['starttime'] = get_date($timestamp, 'Y-m-d H:i'); $buyer_config['endtime'] = get_date($timestamp + $buyer_config['days'] * 86400, 'Y-m-d H:i'); $lasttime = $timestamp + $buyer_config['days'] * 86400; } $creditype = $config['creditype']; $creditypename = $credit->cType[$config['creditype']]; $creditnum = $config['price']; $buyer_config['link'] = str_replace(array('=', '&'), array('=', '&'), $buyer_config['link']); $newconfig = addslashes(serialize($buyer_config)); $credit->set($uid, $creditype, -$price); $db->update("UPDATE pw_buyadvert SET " . S::sqlSingle(array('ifcheck' => 1, 'lasttime' => $lasttime, 'config' => $newconfig)) . "WHERE id=" . S::sqlEscape($id) . "AND uid=" . S::sqlEscape($uid)); M::sendNotice(array($buyer['username']), array('title' => getLangInfo('writemsg', 'advert_buy_title'), 'content' => getLangInfo('writemsg', 'advert_buy_content', array('creditnum' => $creditnum, 'creditypename' => $creditypename, 'days' => $buyer_config['days'])))); updatecache_c(); $basename = "{$amind_file}?adminjob=hack&hackset=advert&job=check&id={$id}"; adminmsg('operate_success'); } include_once PrintEot('setadvert'); exit; } elseif ($action == 'cate') { require_once R_P . 'require/credit.php'; if (empty($job)) { S::gp(array('ifshow', 'ifhire', 'keyword', 'page')); $pwSQL = ''; if (!empty($ifshow)) { $pwSQL .= $ifshow == 2 ? " AND ifshow=0 " : " AND ifshow=1 "; } if (!empty($ifhire)) {
<?php !function_exists('readover') && exit('Forbidden'); $rmbrate = $db_creditpay[$rt['paycredit']]['rmbrate']; !$rmbrate && ($rmbrate = 10); $currency = round($rt['price'] * $rmbrate); require_once R_P . 'require/credit.php'; $credit->addLog('main_olpay', array($rt['paycredit'] => $currency), array('uid' => $rt['uid'], 'username' => $rt['username'], 'ip' => $onlineip, 'number' => $rt['price'])); $credit->set($rt['uid'], $rt['paycredit'], $currency); M::sendNotice(array($rt['username']), array('title' => getLangInfo('writemsg', 'olpay_title'), 'content' => getLangInfo('writemsg', 'olpay_content_2', array('currency' => $currency, 'cname' => $credit->cType[$rt['paycredit']], 'number' => $rt['price']))));
require_once R_P . 'require/header.php'; require_once PrintEot('reward'); footer(); } else { PostCheck(); require_once R_P . 'require/credit.php'; //* include_once pwCache::getPath(D_P . 'data/bbscache/forum_cache.php'); pwCache::getData(D_P . 'data/bbscache/forum_cache.php'); if ($type == '1') { //$db->update("UPDATE pw_threads SET state='2' WHERE tid=" . S::sqlEscape($tid)); pwQuery::update('pw_threads', 'tid=:tid', array($tid), array('state' => 2)); $credit->addLog('reward_return', array($rt['cbtype'] => $rt['cbval'] * 2), array('uid' => $authorid, 'username' => $author, 'ip' => $onlineip, 'fname' => $forum[$fid]['name'])); $credit->set($authorid, $rt['cbtype'], $rt['cbval'] * 2); } else { if ($timestamp < $rt['timelimit'] && $groupid != '3' && $groupid != '4') { Showmsg('reward_time_limit'); } //$db->update("UPDATE pw_threads SET state='3' WHERE tid=" . S::sqlEscape($tid)); pwQuery::update('pw_threads', 'tid=:tid', array($tid), array('state' => 3)); } return_value($tid, $rt['catype'], $rt['caval']); if ($ifmsg) { if ($type == '1') { $affect = $credit->cType[$rt['cbtype']] . ":" . $rt['cbval'] * 2; } else { $affect = ''; } M::sendNotice(array($rt['author']), array('title' => getLangInfo('writemsg', 'endreward_title_' . $type), 'content' => getLangInfo('writemsg', 'endreward_content_' . $type, array('manager' => $windid, 'fid' => $fid, 'tid' => $tid, 'subject' => $rt['subject'], 'postdate' => get_date($rt['postdate']), 'forum' => $forum[$fid]['name'], 'affect' => $affect, 'admindate' => get_date($timestamp), 'reason' => 'None')))); } refreshto("read.php?tid={$tid}&ds=1", 'operate_success'); }
<?php !function_exists('readover') && exit('Forbidden'); /**** @name:生日卡 @type:会员类 @effect:对特定用户使用。 ****/ S::gp(array('uid'), 'GP', 2); if ($tooldb['type'] != 2) { Showmsg('tooluse_type_error'); // 判断道具类型是否设置错误 } if (!$uid) { Showmsg('tooluse_nobirther'); } $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $userName = $userService->getUserNameByUserId($uid); if (!$userName) { Showmsg('tooluse_nobirther'); } $db->update("UPDATE pw_usertool SET nums=nums-1 WHERE uid=" . S::sqlEscape($winduid) . "AND toolid=" . S::sqlEscape($toolid)); M::sendNotice(array($userName), array('title' => getLangInfo('writemsg', 'birth_title', array('userName' => $userName)), 'content' => getLangInfo('writemsg', 'birth_content', array('fromUsername' => $windid)))); $logdata = array('type' => 'use', 'descrip' => 'tool_16_descrip', 'uid' => $winduid, 'username' => $windid, 'toname' => $userName, 'ip' => $onlineip, 'time' => $timestamp, 'toolname' => $tooldb['name'], 'subject' => $subject); writetoollog($logdata); Showmsg("已向您的好友发送了生日贺卡");
function SendAppmsg($toname, $fromname, $subject, $content) { $userService = $this->_getUserService(); M::sendNotice(array($toname), array('title' => Char_cv(stripslashes($subject)), 'content' => Char_cv(stripslashes($content))), 'notice_apps', 'notice_apps'); return new ApiResponse(true); }
$pass = array_values($pass); $pw_posts = GetPtable($ptable); //if ($type == 'pass') { if (is_array($pass)) { $fids = $tids = array(); $query = $db->query("SELECT fid,tid FROM {$pw_posts} WHERE {$sql} AND pid IN(" . S::sqlImplode($pass) . ")"); while ($rt = $db->fetch_array($query)) { $tids[$rt['tid']]++; $fids[$rt['fid']]++; } foreach ($tids as $key => $value) { $rt = $db->get_one("SELECT postdate,author FROM {$pw_posts} WHERE tid=" . S::sqlEscape($key) . " ORDER BY postdate DESC LIMIT 1"); //$db->update("UPDATE pw_threads SET replies=replies+".S::sqlEscape($value) . ",lastpost=" . S::sqlEscape($rt['postdate'],false) . ",lastposter =" . S::sqlEscape($rt['author'],false) . "WHERE tid=" . S::sqlEscape($key)); $db->update(pwQuery::buildClause('UPDATE :pw_table SET replies = replies + :replies, lastpost = :lastpost, lastposter = :lastposter WHERE tid = :tid', array('pw_threads', $value, $rt['postdate'], $rt['author'], $key))); # memcache refresh M::sendNotice(array($rt['author']), array('title' => getLangInfo('writemsg', 'post_pass_title'), 'content' => getLangInfo('writemsg', 'post_pass_content', array('tid' => $key)))); /* $threadList = L::loadClass("threadlist", 'forum'); $threadList->updateThreadIdsByForumId($fid,$key); $thread = L::loadClass("Threads", 'forum'); $thread->clearThreadByThreadId($key); */ Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $fid)); } foreach ($fids as $key => $value) { /** $db->update("UPDATE pw_forumdata SET article=article+".S::sqlEscape($value).",tpost=tpost+".S::sqlEscape($value,false)."WHERE fid=".S::sqlEscape($key)); **/ $db->update(pwQuery::buildClause("UPDATE :pw_table SET article=article+:article,tpost=tpost+:tpost WHERE fid=:fid", array('pw_forumdata', $value, $value, $key))); } $db->update("UPDATE {$pw_posts} SET ifcheck='1',ifwordsfb='{$db_wordsfb}' WHERE {$sql} AND pid IN(" . S::sqlImplode($pass) . ")");
} if ($rgyz == 1) { Cookie("winduser", StrCode($winduid . "\t" . PwdCode($windpwd) . "\t" . $safecv)); Cookie("ck_info", $db_ckpath . "\t" . $db_ckdomain); Cookie('lastvisit', '', 0); //将$lastvist清空以将刚注册的会员加入今日到访会员中 /*连续登录天数*/ if ($db_md_ifopen) { require_once R_P . 'require/functions.php'; doMedalBehavior($winduid, 'continue_login'); } } //发送短消息 if ($rg_config['rg_regsendmsg']) { $rg_config['rg_welcomemsg'] = str_replace('$rg_name', $regname, $rg_config['rg_welcomemsg']); M::sendNotice(array($windid), array('title' => "Welcome To[{$db_bbsname}]!", 'content' => $rg_config['rg_welcomemsg'])); } //发送邮件 //* @include_once pwCache::getPath(D_P.'data/bbscache/mail_config.php'); pwCache::getData(D_P . 'data/bbscache/mail_config.php'); if ($rg_config['rg_emailcheck']) { if ($rg_config['rg_regsendemail'] && $ml_mailifopen) { require_once R_P . 'require/sendemail.php'; sendemail($regemail, 'email_welcome_subject', 'email_welcome_content', 'email_additional'); } $verifyhash = GetVerify(); $rgyz = md5($rgyz . substr(md5($db_sitehash), 0, 5) . substr(md5($regname), 0, 5)); require_once R_P . 'require/sendemail.php'; $sendinfo = sendemail($regemail, 'email_check_subject', 'email_check_content', 'email_additional'); if ($sendinfo === true) { ObHeader("{$db_registerfile}?step=finish&email={$regemail}&verify={$verifyhash}");
/** * @desc 发消息通知用户帖子被封 * * @param string $user -- 收件人用户名 * @param array $L -- 消息内容信息 * @param string $type -- 帖子类型:t=>主题;p=>回复 */ function sendMsg($user, $L, $type = 't') { if ($type == 't') { $title = getLangInfo('cpmsg', 'filtermsg_thread_title'); $content = getLangInfo('cpmsg', 'filtermsg_thread_content', $L); } else { $title = getLangInfo('cpmsg', 'filtermsg_post_title'); $content = getLangInfo('cpmsg', 'filtermsg_post_content', $L); } M::sendNotice(array($user), array('title' => $title, 'content' => $content)); }
require_once R_P . 'require/common.php'; $msg_title = trim($subject); $atc_content = trim($atc_content); if (empty($atc_content) || empty($msg_title)) { Showmsg('msg_empty'); } elseif (strlen($msg_title) > 75 || strlen($atc_content) > 1500) { Showmsg('msg_subject_limit'); } require_once R_P . 'require/bbscode.php'; $wordsfb = L::loadClass('FilterUtil', 'filter'); if (($banword = $wordsfb->comprise($msg_title)) !== false) { Showmsg('title_wordsfb'); } if (($banword = $wordsfb->comprise($atc_content, false)) !== false) { Showmsg('content_wordsfb'); } $query = $db->query("SELECT uid FROM pw_pcmember WHERE tid=" . S::sqlEscape($tid) . " GROUP BY uid"); while ($rt = $db->fetch_array($query)) { $uiddb[] = $rt['uid']; } $messageType = $pcid == 1 ? 'notice_postcate' : 'notice_active'; $ifuids = $sqladd = $msglog = array(); if ($uiddb) { $userNames = array(); $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $userNames = $userService->getUserNamesByUserIds($uiddb); M::sendNotice($userNames, array('create_uid' => $winduid, 'create_username' => $windid, 'title' => $msg_title, 'content' => $atc_content), $messageType, $messageType); } Showmsg('send_success'); }
<?php !defined('P_W') && exit('Forbidden'); !$db_ifselfshare && Showmsg("sharelink_colse"); if (empty($_POST['step'])) { require_once PrintEot('ajax'); ajax_footer(); } else { PostCheck(); S::gp(array('linkname', 'linkurl', 'username', 'linkdescrip', 'linklogo'), 'P'); (!$linkname || !$linkurl) && Showmsg('sharelink_link_empty'); !$linkdescrip && ($linkdescrip = ''); $username = !$username ? $windid : $username . '(' . $windid . ')'; !$linklogo && ($linklogo = ''); $linkurl = strtolower($linkurl); strncmp($linkurl, 'http://', 7) != 0 && Showmsg('sharelink_link_error'); $rs = $db->get_one("SELECT sid FROM pw_sharelinks WHERE username="******"INSERT INTO pw_sharelinks SET {$pwSQL}"); M::sendNotice(array($manager), array('title' => getLangInfo('writemsg', 'sharelink_apply_title'), 'content' => getLangInfo('writemsg', 'sharelink_apply_content', array('username' => $windid, 'time' => get_date($timestamp))))); Showmsg("sharelink_success"); }
$sendmessage = S::escapeChar($atc_content); $percount = 1; empty($nexto) && ($nexto = 1); $uids = explode(',', $uids); $count = count($uids); if ($uids) { $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $members = $userService->getByUserIds($uids); foreach ($members as $member) { @extract($member); $sendmessage = str_replace("\$email", $email, $atc_content); $sendmessage = str_replace("\$windid", $username, $sendmessage); $userNames[] = $username; } M::sendNotice($userNames, array('title' => $subject, 'content' => $sendmessage), 'notice_active', 'notice_active'); } $havesend = $step * $percount; if ($count > $nexto * $percount) { $nexto++; $j_url = "{$basename}&action={$action}&step=2&nexto={$nexto}&subject=" . rawurlencode($subject); adminmsg("sendmsg_step", EncodeUrl($j_url), 1); } else { //* P_unlink($cache_file); pwCache::deleteData($cache_file); adminmsg('operate_success', "{$basename}&action=topic"); } } } elseif ($action == 'delthreads') { S::gp(array('selid')); !$selid && adminmsg('operate_error');
$query = $db->query("SELECT tid,pid,fid,aid,author,authorid,postdate,subject,content FROM {$pw_posts} WHERE fid='{$fid}' AND pid IN(" . S::sqlImplode($pidArr) . ")"); while ($rt = $db->fetch_array($query)) { $rt['fid'] != $fid && Showmsg('admin_forum_right'); $deluids[$rt['authorid']] = isset($deluids[$rt['authorid']]) ? $deluids[$rt['authorid']] + 1 : 1; //积分操作 $credit->addLog("topic_{$creditOpKey}", $creditset[$creditOpKey], array('uid' => $rt['authorid'], 'username' => $rt['author'], 'ip' => $onlineip, 'fname' => strip_tags($foruminfo['name']), 'operator' => $windid)); $credit->sets($rt['authorid'], $creditset[$creditOpKey], false); if ($rt['aid']) { $_tids[$rt['tid']] = $rt['tid']; $_pids[$rt['pid']] = $rt['pid']; } if ($_POST['ifmsg']) { if (!$rt['subject']) { $rt['subject'] = substrs($rt['content'], 35); } M::sendNotice(array($rt['author']), array('title' => getLangInfo('writemsg', 'delrp_title'), 'content' => getLangInfo('writemsg', 'delrp_content', array('manager' => $windid, 'fid' => $fid, 'tid' => $rt['tid'], 'subject' => substrs($rt['subject'], 28), 'postdate' => get_date($rt['postdate']), 'forum' => strip_tags($forum[$fid]['name']), 'affect' => "{$db_rvrcname}:-{$msg_delrvrc},{$db_moneyname}:-{$msg_delmoney}", 'admindate' => get_date($timestamp), 'reason' => stripslashes($atc_content))))); } } $credit->runsql(); //$db->update("DELETE FROM $pw_posts WHERE pid IN($tids)"); pwQuery::delete($pw_posts, 'pid IN(:pid)', array($pidArr)); if ($_tids && $_pids) { $pw_attachs = L::loadDB('attachs', 'forum'); $attachdb = $pw_attachs->getByTid($_tids, $_pids); require_once R_P . 'require/updateforum.php'; delete_att($attachdb); pwFtpClose($ftp); } $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ foreach ($deluids as $uid => $value) {
*/ default: exit('error'); } } elseif ($action == 'send') { S::gp(array('oid', 'logistics', 'orderid')); $order = $db->get_one("SELECT td.*,m.username FROM pw_tradeorder td LEFT JOIN pw_members m ON td.buyer=m.uid WHERE td.oid=" . S::sqlEscape($oid)); if (empty($order) || $order['seller'] != $winduid || $order['ifpay'] != 1 || $order['payment'] != 1) { Showmsg('data_error'); } if (empty($logistics) || empty($orderid)) { Showmsg('onlinepay_logistics'); } $descrip = getLangInfo('writemsg', 'onlinepay_logistics', array('logistics' => $logistics, 'orderid' => $orderid)); $db->update("UPDATE pw_tradeorder SET " . S::sqlSingle(array('ifpay' => 2, 'tradedate' => $timestamp, 'tradeinfo' => $descrip)) . " WHERE oid=" . S::sqlEscape($oid)); M::sendNotice(array($order['username']), array('title' => getLangInfo('writemsg', 'goods_send_title'), 'content' => getLangInfo('writemsg', 'goods_send_content', array('goodsname' => $order['subject'], 'buydate' => get_date($order['buydate']), 'seller' => $windid, 'tid' => $order['tid'], 'descrip' => $descrip)))); refreshto("apps.php?q=article&a=goods&job=saled", 'operate_success'); } elseif ($action == 'get') { S::gp(array('oid')); $order = $db->get_one("SELECT * FROM pw_tradeorder WHERE oid=" . S::sqlEscape($oid)); if (empty($order) || $order['buyer'] != $winduid || $order['ifpay'] != 2) { Showmsg('data_error'); } $db->update("UPDATE pw_tradeorder SET " . S::sqlSingle(array('ifpay' => 3, 'tradedate' => $timestamp)) . " WHERE oid=" . S::sqlEscape($oid)); $order['quantity'] = (int) $order['quantity']; $db->update("UPDATE pw_trade SET salenum=salenum+" . $order['quantity'] . " WHERE tid=" . S::sqlEscape($order['tid'])); //$db->update("UPDATE pw_trade SET salenum=salenum+1 WHERE tid=".S::sqlEscape($order['tid'])); refreshto("apps.php?q=article&a=goods", 'operate_success'); } elseif ($action == 'pcalipay') { S::gp(array('tid', 'pcmid', 'pcid'), GP, 2); $pcvaluetable = GetPcatetable($pcid);
$subject = S::escapeChar($subject); $sendmessage = S::escapeChar($atc_content); $percount = 1; empty($nexto) && ($nexto = 1); $uids = explode(',', $uids); $count = count($uids); if ($uids) { $msg_a = array(); $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $members = $userService->getByUserIds($uids); foreach ($members as $member) { @extract($member); $sendmessage = str_replace("\$email", $email, $atc_content); $sendmessage = str_replace("\$windid", $username, $sendmessage); M::sendNotice(array($username), array('title' => $subject, 'content' => $sendmessage)); } } $havesend = $step * $percount; if ($count > $nexto * $percount) { $nexto++; $j_url = "{$basename}&action={$action}&step=2&nexto={$nexto}&subject=" . rawurlencode($subject); adminmsg("sendmsg_step", EncodeUrl($j_url), 1); } else { pwCache::deleteData($cache_file); adminmsg('operate_success', "{$basename}&action=topic"); } } } elseif ($action == 'delthreads') { S::gp(array('selid')); !$selid && adminmsg('operate_error');
function sendKmdMessages($uid, $title, $content, $paramsTitle = array(), $paramsContent = array()) { $uid = intval($uid); if ($uid < 1 || !$title || !$content) { return false; } $userService = L::loadClass('userservice', 'user'); /* @var $userService PW_UserService */ $userInfo = $userService->get($uid); if (!$userInfo) { return false; } M::sendNotice(array($userInfo['username']), array('title' => getLangInfo('writemsg', $title, $paramsTitle), 'content' => getLangInfo('writemsg', $content, $paramsContent))); }
} # 更新版块文章数 /** $sql = "UPDATE pw_forumdata SET article=article-".S::sqlEscape($forum_count)." WHERE fid=".S::sqlEscape($fid); $db->update($sql); **/ $db->update(pwQuery::buildClause("UPDATE :pw_table SET article=article-:article WHERE fid=:fid", array('pw_forumdata', $forum_count, $fid))); } foreach ($db_threads as $tid => $thread) { $toUser = array(); foreach ($thread as $post) { $toUser[] = $post['author']; } $sql = "SELECT subject FROM pw_threads WHERE tid =" . S::sqlEscape($tid); $subject = $db->get_value($sql); M::sendNotice($toUser, array('title' => getLangInfo('writemsg', 'filtermsg_post_del_title'), 'content' => getLangInfo('writemsg', 'filtermsg_post_del_content', array('subject' => $subject)))); } } $delarticle->delReply($replydb, $db_recycle); if (is_array($objid)) { $filter_id = implode(',', $objid); if ($filter_id) { //更改审核状态,更新审核人员信息 $sql = "UPDATE pw_filter SET state=2,assessor=" . S::sqlEscape($admin_name) . ",updated_at=" . S::sqlEscape($timestamp) . " WHERE id IN (" . $filter_id . ")"; $db->update($sql); } } else { $filter_id = $objid; if ($filter_id) { //更改审核状态,更新审核人员信息 $sql = "UPDATE pw_filter SET state=2,assessor=" . S::sqlEscape($admin_name) . ",updated_at=" . S::sqlEscape($timestamp) . " WHERE pid IN (" . $filter_id . ")";
'receiver' => $tousername, )), 'content' => getLangInfo('writemsg','o_board_success_cotent',array( 'formuid' => $winduid, 'formname' => $windid, 'touid' => $uid, 'content' => $data['title'], 'sender' => $windid, 'receiver' => $tousername, )), ), 'sms_message', 'sms_guestbook' ); */ M::sendNotice(array($tousername), array('create_uid' => $winduid, 'create_username' => $windid, 'title' => getLangInfo('writemsg', 'o_board_success_title', array('formname' => $windid, 'sender' => $windid, 'receiver' => $tousername)), 'content' => getLangInfo('writemsg', 'o_board_success_cotent', array('formuid' => $winduid, 'formname' => $windid, 'touid' => $uid, 'content' => $data['title'], 'sender' => $windid, 'receiver' => $tousername))), 'notice_guestbook', 'notice_guestbook'); countPosts('+1'); require_once R_P . 'require/showimg.php'; list($myface) = showfacedesign($winddb['icon'], 1, 'm'); //require_once(R_P.'require/bbscode.php'); if (strpos($title, '[s:') !== false) { $title = showface($title); } //require_once(R_P.'require/bbscode.php'); $title = convert(stripslashes($title), $db_windpost); $postdate = get_date($timestamp); require_once printEOT('m_ajax'); ajax_footer(); } else { Showmsg('undefined_action'); }
adminmsg('operate_success'); } } elseif ($_POST['pass']) { S::gp(array('deiaid'), 'P'); if (!$deiaid) { adminmsg('operate_error'); } foreach ($deiaid as $sid) { $db->update("UPDATE pw_sharelinks SET ifcheck=1 WHERE sid=" . S::sqlEscape($sid)); } $temp = array(); $rs = $db->query("SELECT username FROM pw_sharelinks WHERE sid IN(" . S::sqlImplode($deiaid) . ")"); while ($rt = $db->fetch_array($rs)) { $temp[] = $rt['username']; } M::sendNotice($temp, array('title' => getLangInfo('writemsg', 'sharelink_pass_title'), 'content' => getLangInfo('writemsg', 'sharelink_pass_content'))); updatecache_i(); adminmsg('operate_success'); } elseif ($_POST['unpass']) { S::gp(array('deiaid'), 'P'); if (!$deiaid) { adminmsg('operate_error'); } foreach ($deiaid as $sid) { $db->update("UPDATE pw_sharelinks SET ifcheck=0 WHERE sid=" . S::sqlEscape($sid)); } updatecache_i(); adminmsg('operate_success'); } elseif ($_POST['delete']) { S::gp(array('deiaid'), 'P'); if (!$deiaid) {
function userRegister($username, $password, $email) { list($username, $password, $email, $timestamp) = array(trim($username), trim($password), trim($email), time()); if (empty($username) || empty($password) || empty($email)) { return $this->buildResponse(USER_INVALID_PARAMS); } $rgConfig = L::reg(); if ($rgConfig['rg_allowregister'] == 0 || $rgConfig['rg_registertype'] == 1 && date('j', $timestamp) != $rgConfig['rg_regmon'] || $rgConfig['rg_registertype'] == 2 && date('w', $timestamp) != $rgConfig['rg_regweek']) { return $this->buildResponse(USER_REGISTER_CLOSE); } if (L::reg('rg_npdifferf') && $username == $password) { return $this->buildResponse(USER_REGISTER_SAME_USERNAME_PASSWORD); } $register = L::loadClass('Register', 'user'); /* @var $register PW_Register */ $register->setStatus(11); $register->setName($username); $register->setPwd($password, $password); $register->setEmail($email); $register->execute(); list($uid, $rgyz, $safecv) = $register->getRegUser(); if ($uid < 1) { return $this->buildResponse(USER_REGISTER_FAIL); } if ($rgConfig['rg_regsendmsg']) { $rgConfig['rg_welcomemsg'] = str_replace('$rg_name', $username, $rgConfig['rg_welcomemsg']); M::sendNotice(array($uid), array('title' => "Welcome To[{$GLOBALS[db_bbsname]}]!", 'content' => $rgConfig['rg_welcomemsg'])); } return $this->buildResponse(0, array('uid' => $uid)); }
function sendMawholeMessages($msgdb) { foreach ($msgdb as $key => $val) { M::sendNotice(array($val['toUser']), array('title' => $val['title'], 'content' => $val['content'])); } }
} else { $db = pwNewDBForInstall(); } $db_htmdir = 'html'; if ($_GET['app'] == '1') { M::sendNotice(array($manager['0']), array('title' => $lang['app_subject'], 'content' => $lang['app_content2'])); } $steptitle = '!'; if (!is_writeable($basename)) { $lang['success_install'] .= "<br /><small><font color=\"red\">{$lang['error_delinstall']}</font></small>"; } $lang['success_install'] = preg_replace("/{#(.+?)}/eis", '$\\1', $lang['success_install']); $ceversion = defined('CE') ? 1 : 0; require_once R_P . 'admin/cache.php'; if (defined('CE')) { M::sendNotice($manager, array('title' => $lang['log_unionmsgt'], 'content' => $lang['log_unionmsgc'])); } setConfig('db_server_url', 'http://apps.phpwind.net'); //updatemedal_list(); updatecache(); updatecache_cnc_s(); updatecache_conf('area', true); updatecache_conf('o', true); // $ipindex = L::loadClass('iptable', 'utility'); // $ipindex->createIpIndex(); $db_htmdir = 'html'; $db_bbsurl = $bbsurl; ob_start(); define('A_P', R_P . "apps/stopic/"); $stopic_service = L::loadClass('stopicservice', 'stopic'); $stopic_service->creatStopicHtml(1);
function updateUserInfo($type, $add, $content = '') { global $db_creditset, $credit, $db_upgrade, $timestamp, $db_tcheck; if ($this->groupid != 'guest') { require_once R_P . 'require/credit.php'; $this->user['todaypost']++; $this->user['monthpost']++; $this->user['postnum']++; $this->user['lastpost'] = $timestamp; $credit->addLog('topic_' . $type, $add, array('uid' => $this->uid, 'username' => $this->username, 'ip' => $GLOBALS['onlineip'], 'fname' => $this->forum->name)); $credit->sets($this->uid, $add, false); $this->user['rvrc'] += $add['rvrc']; $this->user['money'] += $add['money']; $this->user['credit'] += $add['credit']; $this->user['currency'] += $add['currency']; $usercredit = array('postnum' => $this->user['postnum'], 'digests' => $this->user['digests'], 'rvrc' => $this->user['rvrc'], 'money' => $this->user['money'], 'credit' => $this->user['credit'], 'currency' => $this->user['currency'], 'onlinetime' => $this->user['onlinetime']); $upgradeset = unserialize($db_upgrade); foreach ($upgradeset as $key => $val) { if (is_numeric($key) && $val) { foreach ($credit->get($this->user['uid'], 'CUSTOM') as $key => $value) { $usercredit[$key] = $value; } break; } } require_once R_P . 'require/functions.php'; $memberid = getmemberid(CalculateCredit($usercredit, $upgradeset)); $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ if ($this->user['memberid'] != $memberid) { $userService->update($this->user['uid'], array('memberid' => $memberid)); $membername = getMembername($memberid); $upmemberid = getNextMemberid($memberid); $upmembername = getMembername($upmemberid); $upneedcredit = getmemberNeed($upmemberid); $userneed = $upneedcredit - CalculateCredit($usercredit, $upgradeset); M::sendNotice(array($this->user['username']), array('title' => getLangInfo('writemsg', 'user_update_title', array('username' => $windid)), 'content' => getLangInfo('writemsg', 'user_update_content', array('membername' => $membername, 'upmembername' => $upmembername, 'username' => $this->user['username'], 'userneed' => $userneed)))); //$data=array('uid'=>$this->user['uid'],'behavior'=>5,'lastday'=>$GLOBALS['tdtime'],'num'=>$memberid); //$data=array('uid'=>1,'behavior'=>5,'lastday'=>123,'num'=>1); $this->elementUpdate($this->user['uid']); /*升级记录排行*/ } $pwSQL = array('postnum' => $this->user['postnum'], 'todaypost' => $this->user['todaypost'], 'monthpost' => $this->user['monthpost'], 'lastpost' => $this->user['lastpost'], 'uploadtime' => $this->user['uploadtime'], 'uploadnum' => $this->user['uploadnum']); if ($db_tcheck) { $postcheck = unserialize($this->user['postcheck']); $this->fromGroup ? $postcheck['group'] = PwPost::tcheck($content) : ($postcheck['post'] = PwPost::tcheck($content)); $pwSQL['postcheck'] = serialize($postcheck); } $userService->update($this->uid, array(), $pwSQL); $credit->runsql(); /** if (!array_sum($add)) { $_cache = getDatastore(); $_cache->delete('UID_'.$this->uid); } **/ } else { Cookie('userlastptime', $timestamp); } }
Showmsg('password_error'); } if (procLock('userpay', $winduid)) { $tax = round($paynum * $db_virerate / 100); $needpay = $paynum + $tax; if ($credit->get($winduid, $vmcredit) < $needpay) { procUnLock('userpay', $winduid); Showmsg('noenough_currency'); } $credit->addLog('main_virefrom', array($vmcredit => -$needpay), array('uid' => $winduid, 'username' => $windid, 'ip' => $onlineip, 'toname' => stripslashes($pwuser))); $credit->addLog('main_vireto', array($vmcredit => $paynum), array('uid' => $touid, 'username' => stripslashes($pwuser), 'ip' => $onlineip, 'fromname' => $windid)); $credit->set($winduid, $vmcredit, -$needpay, false); $credit->set($touid, $vmcredit, $paynum, false); $credit->runsql(); //fclose($fp); M::sendNotice(array($pwuser), array('title' => getLangInfo('writemsg', 'vire_title'), 'content' => getLangInfo('writemsg', 'vire_content', array('windid' => $windid, 'paynum' => $paynum, 'cname' => $credit->cType[$vmcredit])))); procUnLock('userpay', $winduid); refreshto('userpay.php?action=virement', getLangInfo('msg', 'virement_success')); } else { Showmsg('virement_lock'); } } } elseif ($action == 'change') { require_once R_P . 'require/credit.php'; $rt = $db->get_one("SELECT db_value FROM pw_config WHERE db_name='jf_A'"); $jf_A = $rt['db_value'] ? unserialize($rt['db_value']) : array(); if (empty($_POST['step'])) { $creditdb = $credit->get($winduid, 'CUSTOM'); $jf = array(); foreach ($jf_A as $key => $value) { if ($value[2]) {
Showmsg('colony_manager'); } $rt['ifadmin'] != -1 && $trueMemberCount++; $toUsers[] = $rt['username']; } //* $db->update("DELETE FROM pw_cmembers WHERE colonyid=" . S::sqlEscape($cyid) . " AND uid IN(" . S::sqlImplode($selid) . ")"); pwQuery::delete('pw_cmembers', 'colonyid=:colonyid AND uid IN (:uid)', array($cyid, $selid)); $newColony->updateInfoCount(array('members' => -$trueMemberCount)); $colony['members'] -= $trueMemberCount; updateGroupLevel($colony['id'], $colony); break; default: Showmsg('undefined_action'); } if ($toUsers) { M::sendNotice($toUsers, array('title' => getLangInfo('writemsg', 'o_' . $operateStep . '_title', array('cname' => S::escapeChar($colony['cname']))), 'content' => getLangInfo('writemsg', 'o_' . $operateStep . '_content', array('cname' => S::escapeChar($colony['cname']), 'curl' => "{$db_bbsurl}/{$basename}cyid={$cyid}")))); } refreshto("{$basename}", 'operate_success'); } } elseif ($a == 'fanoutmsg') { define('AJAX', 1); !$ifadmin && Showmsg('undefined_action'); if (empty($_POST['step'])) { S::gp(array('selid', 'group'), null, 2); $uids = $usernames = array(); if ($selid) { $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ foreach ($userService->getByUserIds($selid) as $rt) { $uids[] = $rt['uid']; $usernames[] = $rt['username'];
$log = array( 'type' => 'credit', 'username1' => $read['author'], 'username2' => $windid, 'field1' => $fid, 'field2' => '', 'field3' => '', 'descrip' => 'credit_descrip', 'timestamp' => $timestamp, 'ip' => $onlineip, 'tid' => $tid, 'forum' => strip_tags($foruminfo['name']), 'subject' => $read['subject'], 'affect' => "$name:$addpoint", 'reason' => $atc_content ); writelog($log); } }*/ if ($ifmsg && $read['author'] != $windid) { $messageInfo = array('title' => getLangInfo('writemsg', $action == 'pushto' ? 'pushto_title' : 'recommend_title'), 'content' => getLangInfo('writemsg', $action == 'pushto' ? 'pushto_content' : 'recommend_content', array('manager' => $windid, 'fid' => $read['fid'], 'tid' => $read['tid'], 'subject' => $read['subject'], 'postdate' => get_date($read['postdate']), 'forum' => strip_tags($forum[$fid]['name']), 'affect' => '', 'admindate' => get_date($timestamp), 'reason' => stripslashes($atc_content)))); M::sendNotice(array($read['author']), $messageInfo, 'sms_ratescore'); } //$credit->runsql(); } function pingfenMsg($msg_info) { global $baseUrl, $action, $tid; $msg_info = getLangInfo('msg', $msg_info); refreshto($baseUrl . 'action=' . $action . '&selid=' . $tid . '&', $msg_info, 3); }