Example #1
0
 function SendAppmsg($toname, $fromname, $subject, $content)
 {
     $msg = array('toUser' => $toname, 'fromUid' => '-1', 'fromUser' => $fromname, 'subject' => Char_cv(stripslashes($subject)), 'content' => Char_cv(stripslashes($content)));
     require_once R_P . 'require/msg.php';
     pwSendMsg($msg);
     return new ApiResponse(true);
 }
Example #2
0
 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);
         }
         $msg = array('toUser' => $rt['author'], 'subject' => 'delrp_title', 'content' => 'delrp_content', 'other' => 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)));
         pwSendMsg($msg);
     }
 }
 $credit->runsql();
 $db->update("DELETE FROM {$pw_posts} WHERE pid IN({$tids})");
 if ($_tids && $_pids) {
     $pw_attachs = L::loadDB('attachs');
     $attachdb = $pw_attachs->getByTid($_tids, $_pids);
     require_once R_P . 'require/updateforum.php';
     delete_att($attachdb);
     pwFtpClose($ftp);
 }
 foreach ($deluids as $uid => $value) {
     $db->update("UPDATE pw_memberdata SET postnum=postnum-" . pwEscape($value) . " WHERE uid=" . pwEscape($uid));
 }
 refreshto("forumcp.php?action=edit&type={$type}&fid={$fid}", 'operate_success');
Example #3
0
 while ($rt = $db->fetch_array($query)) {
     $colonydb[] = $rt;
 }
 if ($md_ifopen && $userdb['medals']) {
     include_once D_P . 'data/bbscache/medaldb.php';
     $query = $db->query("SELECT id,awardee,level FROM pw_medalslogs WHERE awardee=" . pwEscape($userdb['username'], false) . " AND action='1' AND state='0' AND timelimit>0 AND {$timestamp}-awardtime>timelimit*2592000");
     if ($db->num_rows($query)) {
         include_once R_P . 'require/msg.php';
         $reason = Char_cv(getLangInfo('other', 'medal_reason'));
         $ids = $medals = $medalslog = array();
         while ($rt = $db->fetch_array($query)) {
             $ids[] = $rt['id'];
             $medals[] = $rt['level'];
             $medalslog[] = array($rt['awardee'], 'SYSTEM', $timestamp, $rt['level'], 2, $reason);
             $message = array('toUser' => $rt['awardee'], 'subject' => 'metal_cancel', 'content' => 'metal_cancel_text', 'other' => array('medalname' => $_MEDALDB[$rt['level']]['name']));
             pwSendMsg($message);
         }
         if ($ids) {
             $db->update("INSERT INTO pw_medalslogs(awardee,awarder,awardtime,level,action,why) VALUES " . pwSqlMulti($medalslog, false));
             $db->update("UPDATE pw_medalslogs SET state='1' WHERE id IN(" . pwImplode($ids) . ")");
             $userdb['medals'] = explode(',', $userdb['medals']);
             $userdb['medals'] = array_diff($userdb['medals'], $medals);
             $userdb['medals'] = implode(',', $userdb['medals']);
             $db->update("UPDATE pw_members SET medals=" . pwEscape($userdb['medals'], false) . " WHERE uid=" . pwEscape($userdb['uid'], false));
             $db->update('DELETE FROM pw_medaluser WHERE uid=' . pwEscape($userdb['uid'], false) . ' AND mid IN(' . pwImplode($medals) . ')');
             updatemedal_list();
         }
     }
     $userdb['medals'] = explode(',', $userdb['medals']);
 }
 $usercredit = array('postnum' => $userdb['postnum'], 'digests' => $userdb['digests'], 'rvrc' => $userdb['rvrc'], 'money' => $userdb['money'], 'credit' => $userdb['credit'], 'currency' => $userdb['currency'], 'onlinetime' => $userdb['onlinetime']);
Example #4
0
                $db->update("INSERT INTO pw_memberinfo SET " . pwSqlSingle(array('uid' => $winduid, 'credit' => $newcreditdb), false));
            } elseif (!$mcredit['credit']) {
                $db->update('UPDATE pw_memberinfo SET credit=' . pwEscape($newcreditdb, false) . ' WHERE uid=' . pwEscape($winduid));
            }
        }
        !$read['subject'] && ($read['subject'] = substrs(strip_tags(convert($read['content'])), 35));
        $credit->addLog('credit_showping', array($cid => $addpoint), array('uid' => $read['authorid'], 'username' => $read['author'], 'ip' => $onlineip, 'operator' => $windid, 'tid' => $tid, 'subject' => $read['subject'], 'reason' => $atc_content));
        $credit->set($read['authorid'], $cid, $addpoint, false);
        $db->update("UPDATE pw_threads SET ifmark=ifmark+" . pwEscape($addpoint) . " WHERE tid=" . pwEscape($tid));
        $rpid = 0;
        $pwSQL = pwSqlSingle(array('fid' => $fid, 'tid' => $tid, 'pid' => $rpid, 'name' => $name, 'point' => $addpoint, 'pinger' => $windid, 'record' => $atc_content, 'pingdate' => $timestamp));
        $db->update("INSERT INTO pw_pinglog SET {$pwSQL}");
        update_markinfo($fid, $tid, $rpid);
        $threadobj = L::loadClass("threads");
        $threadobj->clearTmsgsByThreadId($tid);
        if (!$read['anonymous']) {
            $msg = array('toUser' => $read['author'], 'fromUid' => $winduid, 'fromUser' => $windid, 'subject' => 'ping_title', 'content' => 'ping_content', 'other' => array('manager' => $windid, 'fid' => $read['fid'], 'tid' => $tid, 'pid' => 'tpc', 'subject' => $read['subject'], 'postdate' => get_date($read['postdate']), 'forum' => strip_tags($foruminfo['name']), 'affect' => "{$name}:{$addpoint}", 'admindate' => get_date($timestamp), 'reason' => stripslashes($atc_content)));
            pwSendMsg($msg);
        }
        if ($gp_gptype == 'system') {
            require_once R_P . 'require/writelog.php';
            $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) {
        $msgdb = array('toUser' => $read['author'], 'subject' => 'pushto_title', 'content' => 'pushto_content', 'other' => array('manager' => $windid, 'fid' => $read['fid'], 'tid' => $read['tid'], 'subject' => $read['subject'], 'postdate' => get_date($read['postdate']), 'forum' => strip_tags($forum[$fid]['name']), 'admindate' => get_date($timestamp), 'reason' => stripslashes($atc_content)));
        pwSendMsg($msgdb);
    }
    $credit->runsql();
}
Example #5
0
    foreach ($readdb as $key => $read) {
        $read['fid'] != $fid && wap_msg('admin_forum_right');
        if ($ifmsg) {
            $msgdb[] = array('toUser' => $read['author'], 'subject' => getLangInfo('writemsg', 'del_title'), 'content' => getLangInfo('writemsg', 'del_content', array('manager' => $windid, 'fid' => $read['fid'], 'tid' => $read['tid'], 'subject' => $read['subject'] ? $read['subject'] : $tpcdb['subject'], 'postdate' => get_date($read['postdate']), 'forum' => strip_tags($forum[$fid]['name']), 'affect' => "{$db_rvrcname}:-{$msg_delrvrc},{$db_moneyname}:-{$msg_delmoney}", 'admindate' => get_date($timestamp), 'reason' => stripslashes($atc_content))));
        }
    }
    $jurl = "index.php?a=forum&fid=" . $fid;
    if ($selpid) {
        $delarticle->delReply($readdb, $db_recycle, $ifdel, true, array('reason' => $atc_content));
        $jurl = "index.php?a=read&tid={$seltid}";
    } else {
        $delarticle->delTopic($readdb, $db_recycle, $ifdel, array('reason' => $atc_content));
    }
    $credit->runsql();
    foreach ($msgdb as $key => $val) {
        pwSendMsg($val);
    }
    if ($db_ifpwcache ^ 1) {
        $db->update("DELETE FROM pw_elements WHERE type !='usersort' AND id IN(" . pwImplode($delids) . ')');
    }
    P_unlink(D_P . 'data/bbscache/c_cache.php');
    wap_msg("wap_post_del", $jurl);
} else {
    $sql = "SELECT * FROM pw_threads WHERE tid = " . pwEscape($seltid);
    $threadb = $db->get_one($sql);
    if (!$threadb) {
        wap_msg('data_error');
    }
    $threadb['postdate'] = get_date($threadb['postdate'], "m-d H:i");
    //获取回复信息
    if ($selpid) {
Example #6
0
        default:
            exit('error');
    }
} elseif ($action == 'send') {
    InitGP(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=" . pwEscape($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 " . pwSqlSingle(array('ifpay' => 2, 'tradedate' => $timestamp, 'tradeinfo' => $descrip)) . " WHERE oid=" . pwEscape($oid));
    require_once R_P . 'require/msg.php';
    pwSendMsg(array('toUser' => $order['username'], 'subject' => 'goods_send_title', 'content' => 'goods_send_content', 'other' => array('goodsname' => $order['subject'], 'buydate' => get_date($order['buydate']), 'seller' => $windid, 'tid' => $order['tid'], 'descrip' => $descrip)));
    refreshto("u.php?action=trade&type=saled", 'operate_success');
} elseif ($action == 'get') {
    InitGP(array('oid'));
    $order = $db->get_one("SELECT * FROM pw_tradeorder WHERE oid=" . pwEscape($oid));
    if (empty($order) || $order['buyer'] != $winduid || $order['ifpay'] != 2) {
        Showmsg('data_error');
    }
    $db->update("UPDATE pw_tradeorder SET " . pwSqlSingle(array('ifpay' => 3, 'tradedate' => $timestamp)) . " WHERE oid=" . pwEscape($oid));
    $db->update("UPDATE pw_trade SET salenum=salenum+1 WHERE tid=" . pwEscape($order['tid']));
    refreshto("u.php?action=trade", 'operate_success');
} elseif ($action == 'pcalipay') {
    InitGP(array('tid', 'pcmid', 'pcid'), 2);
    $pcvaluetable = GetPcatetable($pcid);
    $order = $db->get_one("SELECT pv.price,pv.deposit,pm.username,pm.nums,pm.phone,pm.mobile,pm.address,pm.ifpay,pm.totalcash,t.author,t.authorid,t.subject FROM pw_pcmember pm LEFT JOIN {$pcvaluetable} pv ON pm.tid=pv.tid LEFT JOIN pw_threads t ON pv.tid=t.tid WHERE pm.tid=" . pwEscape($tid) . " AND pm.pcmid=" . pwEscape($pcmid) . " AND pm.uid=" . pwEscape($winduid));
    $order['zip'] = '100000';
Example #7
0
 function updatamsg()
 {
     $time = date("YmdHis");
     $ntime = date("Y-m-d");
     if ($this->help == "eat") {
         $this->things;
         if ($this->row4['health'] > 50) {
             showmsg('你的朋友目前并不饿,谢谢你的好意!');
         } elseif ($this->row['foodname'] == '') {
             showmsg('你没有食物可以救济你的朋友,赶紧去买吧!');
         } else {
             $msg = "{$this->tname} 请我吃了一顿{$this->showfood} ,太感谢他了! ━ {$ntime}";
             $health = $this->food;
             $mexecl = "update pw_gold set msg='{$msg}',health='{$health}',time='{$time}' where id='{$this->repairid}' ";
             $this->db->query($mexecl);
             $mexecl = "update pw_gold set foodname='' where id='{$this->tgid}' ";
             $this->db->query($mexecl);
             pwSendMsg(array('toUser' => $this->row4[name], 'fromUid' => $this->tgid, 'fromUser' => $this->tname, 'subject' => '淘金消息', 'content' => $msg));
         }
     } elseif ($this->help == "mend") {
         $this->things();
         if ($this->row4['tool'] > 10) {
             showmsg('你的朋友工具目前不需要修理,谢谢你的好意!');
         } elseif ($this->row4['toolname'] == '') {
             showmsg('你的朋友没有工具,无法修理!');
         } else {
             $tool = $this->tool - $this->row4['tool'];
             //$jjhealth=$tool*2;
             $jhealth = $this->row['health'] - $tool;
             if ($jhealth > 0) {
                 $xltoolname = $this->row4['toolname'];
                 $msg = "{$this->tname} 消耗了{$tool} 点体力帮我修理了{$xltoolname} ,太感谢他了! ━ {$ntime}";
                 $mexecl = "update pw_gold set msg='{$msg}',tool='{$tool}',time='{$time}' where id='{$this->repairid}' ";
                 $this->db->query($mexecl);
                 $mexecl = "update pw_gold set health='{$jhealth}' where id='{$this->tgid}' ";
                 $this->db->query($mexecl);
                 pwSendMsg(array('toUser' => $this->row4[name], 'fromUid' => $this->tgid, 'fromUser' => $this->tname, 'subject' => '淘金消息', 'content' => $msg));
             } else {
                 showmsg('你的体力不足以帮他修理工具');
             }
         }
     } else {
         $thetime = $time - $this->row['time'];
         $stime = 60 - $thetime;
         if ($thetime > 60) {
             $this->getmsg();
             $health = $this->row['health'] - 1;
             $thismsg = $this->getmsg . ' ━ ' . $ntime;
             $mexecl = "update pw_gold set msg='{$thismsg}',health='{$health}',time='{$time}' where id='{$this->tgid}'";
             $this->db->query($mexecl);
         } else {
             echo "<div class=\"nomoney\"><span>提示信息:</span><span class=\"buy\">请休息{$stime}秒后再呐喊!</span></div>";
         }
     }
 }
Example #8
0
         require_once R_P . 'require/o_invite.php';
     }
     Cookie('o_invite', '');
 }
 if ($rg_yz == 1) {
     Cookie("winduser", StrCode($winduid . "\t" . PwdCode($windpwd) . "\t" . $safecv));
     Cookie("ck_info", $db_ckpath . "\t" . $db_ckdomain);
     Cookie('lastvisit', '', 0);
     //将$lastvist清空以将刚注册的会员加入今日到访会员中
 }
 // 发送短消息
 if ($rg_regsendmsg) {
     require_once R_P . 'require/msg.php';
     $rg_welcomemsg = str_replace('$rg_name', $regname, $rg_welcomemsg);
     $messageinfo = array('toUser' => $windid, 'subject' => "Welcome To[{$db_bbsname}]!", 'content' => $rg_welcomemsg);
     pwSendMsg($messageinfo);
 }
 // 发送邮件
 @(include_once D_P . 'data/bbscache/mail_config.php');
 if ($rg_emailcheck) {
     $verifyhash = GetVerify();
     $rg_yz = md5($rg_yz . 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}");
     } else {
         wap_msg(is_string($sendinfo) ? $sendinfo : 'reg_email_fail', $basename);
     }
 } elseif ($rg_regsendemail && $ml_mailifopen) {
     require_once R_P . 'require/sendemail.php';