当前位置: 首页>>代码示例>>PHP>>正文


PHP sendMessage函数代码示例

本文整理汇总了PHP中sendMessage函数的典型用法代码示例。如果您正苦于以下问题:PHP sendMessage函数的具体用法?PHP sendMessage怎么用?PHP sendMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sendMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: convertToName

function convertToName($chatId)
{
    if ($chatId < 0) {
        //is Group
        switch ($chatId) {
            case 'groupID1':
                return "group1";
                break;
            case 'groupID2':
                return "group2";
                break;
            default:
                sendMessage("me", $chatId . "群組使用了我");
                return $chatId;
                break;
        }
    } else {
        if ($chatId > 0) {
            //is Personal
            switch ($chatId) {
                case 'me':
                    return "me";
                    break;
                case '1':
                    return "1";
                    break;
                default:
                    sendMessage("me", $chatId . "是" . $senderName);
                    return $chatId;
                    break;
            }
        }
    }
}
开发者ID:Oschangkai,项目名称:Telebot,代码行数:34,代码来源:Telebot_configWithFuncs.php

示例2: optimalpayments_3dsecure

function optimalpayments_3dsecure($params)
{
    $cardtype = optimalpayments_cardtype($params['cardtype']);
    $xml = "<ccEnrollmentLookupRequestV1\nxmlns=\"http://www.optimalpayments.com/creditcard/xmlschema/v1\"\nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\nxsi:schemaLocation=\"http://www.optimalpayments.com/creditcard/xmlschema/v1\">\n<merchantAccount>\n<accountNum>" . $params['accountnumber'] . "</accountNum>\n<storeID>" . $params['merchantid'] . "</storeID>\n<storePwd>" . $params['merchantpw'] . "</storePwd>\n</merchantAccount>\n<merchantRefNum>" . $params['invoiceid'] . "</merchantRefNum>\n<amount>" . $params['amount'] . "</amount>\n<card>\n<cardNum>" . $params['cardnum'] . "</cardNum>\n<cardExpiry>\n<month>" . substr($params['cardexp'], 0, 2) . "</month>\n<year>20" . substr($params['cardexp'], 2, 2) . "</year>\n</cardExpiry>\n<cardType>" . $cardtype . "</cardType>\n</card>\n</ccEnrollmentLookupRequestV1>";
    $url = "https://webservices.optimalpayments.com/creditcardWS/CreditCardServlet/v1";
    if ($params['testmode']) {
        $url = "https://webservices.test.optimalpayments.com/creditcardWS/CreditCardServlet/v1";
    }
    $query_str = "txnMode=ccTDSLookup&txnRequest=" . urlencode($xml);
    $data = curlCall($url, $query_str);
    $xmldata = XMLtoArray($data);
    $xmldata = $xmldata['CCTXNRESPONSEV1'];
    if ($xmldata['CODE'] == "0") {
        logTransaction("Optimal Payments 3D Auth", $data, "Lookup Successful");
        $_SESSION['optimalpaymentsconfirmationnumber'] = $xmldata['CONFIRMATIONNUMBER'];
        if ($xmldata['TDSRESPONSE']['ENROLLMENTSTATUS'] == "Y") {
            $code = "<form method=\"post\" action=\"" . $xmldata['TDSRESPONSE']['ACSURL'] . "\">\n<input type=hidden name=\"PaReq\" value=\"" . $xmldata['TDSRESPONSE']['PAYMENTREQUEST'] . "\">\n<input type=hidden name=\"TermUrl\" value=\"" . $params['systemurl'] . "/modules/gateways/callback/optimalpayments.php\">\n<input type=hidden name=\"MD\" value=\"" . $params['invoiceid'] . "\">\n<noscript>\n<div class=\"errorbox\"><b>JavaScript is currently disabled or is not supported by your browser.</b><br />Please click the continue button to proceed with the processing of your transaction.</div>\n<p align=\"center\"><input type=\"submit\" value=\"Continue >>\" /></p>\n</noscript>\n</form>";
            return $code;
        }
        $captureresult = optimalpayments_capture($params);
        if ($captureresult['status'] == "success") {
            addInvoicePayment($params['invoiceid'], $captureresult['transid'], "", "", "optimalpayments", "on");
            sendMessage("Credit Card Payment Confirmation", $invoiceid);
        }
        logTransaction("Optimal Payments Non 3d Processed", $captureresult['rawdata'], ucfirst($captureresult['status']));
        return $captureresult['status'];
    }
    logTransaction("Optimal Payments 3D Auth", $data, "Failed");
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:29,代码来源:optimalpayments.php

示例3: onMessage

 function onMessage($from, $channel, $msg)
 {
     //Only trigger on !botlog
     if (stringStartsWith($msg, "{$this->config['trigger']}botlog")) {
         //Get hold of number of rows to show and possible password
         $tmp = explode(" ", $msg);
         $pass = '';
         if (count($tmp) == 3) {
             $pass = $tmp[1];
             $limit = $tmp[2];
         } else {
             if (count($tmp) == 2) {
                 $limit = $tmp[1];
             }
         }
         if (!is_numeric($limit)) {
             $limit = 10;
         }
         if (strlen($this->config['adminPass']) > 0 && $pass != $this->config['adminPass']) {
             sendMessage($this->socket, $channel, "{$from}: Wrong password");
         } else {
             //Password auth ok, display log data
             sendMessage($this->socket, $channel, "{$from}: Last {$limit} entries from bot log:");
             $logdata = file('logs/vikingbot.log');
             $rows = count($logdata);
             for ($i = $rows - $limit; $i < $rows; $i++) {
                 sendMessage($this->socket, $channel, "{$logdata[$i]}");
                 //Avoid Excess flood kick from server
                 usleep(500000);
             }
             sendMessage($this->socket, $channel, "------------");
         }
     }
 }
开发者ID:fathkay,项目名称:VikingBot,代码行数:34,代码来源:botLogPlugin.php

示例4: runBountyExchange

 public static function runBountyExchange($username, $defender)
 {
     //  *** BOUNTY EQUATION ***
     $user = Player::findByName($username);
     $defender = Player::findByName($defender);
     if ($defender->bounty > 0) {
         $user->set_gold($user->gold + $defender->bounty);
         $user->save();
         $defender->set_bounty(0);
         $defender->save();
         // *** Reward bounty whenever available. ***
         return "You have received the {$defender->bounty} gold bounty on {$defender}'s head for your deeds!";
         $bounty_msg = "You have valiantly slain the wanted criminal, {$defender}! For your efforts, you have been awarded {$defender->bounty} gold!";
         sendMessage("Village Doshin", $username, $bounty_msg);
     } else {
         // *** Bounty Increase equation: (attacker's level - defender's level) / an increment, rounded down ***
         $levelRatio = floor(($user->level - $defender->level) / 10);
         $bountyIncrease = min(25, max($levelRatio * 25, 0));
         //Avoids negative increases, max of 30 gold, min of 0
         if ($bountyIncrease > 0) {
             // *** If Defender has no bounty and there was a level difference. ***
             $user->set_bounty($user->bounty + $bountyIncrease);
             $user->save();
             return "Your victim was much weaker than you. The townsfolk are angered. A bounty of {$bountyIncrease} gold has been placed on your head!";
         } else {
             return null;
         }
     }
 }
开发者ID:NinjaWars,项目名称:ninjawars,代码行数:29,代码来源:Combat.php

示例5: doUnsubscribe

/**
 *
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
function doUnsubscribe($email, $key)
{
    global $whmcs;
    global $_LANG;
    $whmcs->get_hash();
    if (!$email) {
        return $_LANG['pwresetemailrequired'];
    }
    $result = select_query("tblclients", "id,email,emailoptout", array("email" => $email));
    $data = mysql_fetch_array($result);
    $userid = $data['id'];
    $email = $data['email'];
    $emailoptout = $data['emailoptout'];
    $newkey = sha1($email . $userid . $cc_encryption_hash);
    if ($newkey == $key) {
        if (!$userid) {
            return $_LANG['unsubscribehashinvalid'];
        }
        if ($emailoptout == 1) {
            return $_LANG['alreadyunsubscribed'];
        }
        update_query("tblclients", array("emailoptout" => "1"), array("id" => $userid));
        sendMessage("Unsubscribe Confirmation", $userid);
        logActivity("Unsubscribed From Marketing Emails - User ID:" . $userid, $userid);
        return null;
    }
    return $_LANG['unsubscribehashinvalid'];
}
开发者ID:billyprice1,项目名称:whmcs,代码行数:38,代码来源:unsubscribe.php

示例6: send_kill_mails

function send_kill_mails($username, $target, $attacker_id, $article, $item, $today, $loot)
{
    $target_email_msg = "You have been killed by {$attacker_id} with {$article} {$item} at {$today} and lost {$loot} gold.";
    sendMessage($attacker_id, $target, $target_email_msg);
    $user_email_msg = "You have killed {$target} with {$article} {$item} at {$today} and received {$loot} gold.";
    sendMessage($target, $username, $user_email_msg);
}
开发者ID:ninjajerry,项目名称:ninjawars,代码行数:7,代码来源:lib_inventory.php

示例7: updateCheck

 /**
  * 
  * update check value 
  * @param type $id  curr id
  * @param type $status   status: 0 or 1 
  */
 public function updateCheck()
 {
     if (!v_islogin()) {
         $this->error('请登录', U("Admin/User/Login"));
     } else {
         $status = I('param.status');
         $id = I('param.cork-id');
         $canid = I('param.canid');
         $content = I('param.content');
         $cork = M('cork')->where(array("id" => $id))->select();
         if ($cork) {
             $cork[0]['check'] = $status;
             $cork[0]['content'] = $content;
             $cork[0]['canid'] = $canid;
             M('cork')->data($cork[0])->save();
             if ($status == 1) {
                 self::delete($id);
                 sendMessage($cork[0]['openid'], "您的作品未通过审核,请按规则重新上传,如有疑问请联系客服。\n原因:" . $content . "\n点击链接重新上传:http://wx.mynow.net/?s=/Home/Oauth2/index/type/index");
             } else {
                 if ($status == 2) {
                     sendMessage($cork[0]['openid'], "您的作品已通过审核,详情请点击:http://wx.mynow.net/?s=/Home/Oauth2/index/type/index");
                 }
             }
             $this->success('审核成功', U("Admin/Activity/cork"), 3);
         } else {
             //no change
             $this->error('参数错误,ID未找到', U("Admin/Activity/cork"), 5);
         }
     }
 }
开发者ID:actcms,项目名称:wechat-1,代码行数:36,代码来源:ActivityController.class.php

示例8: sendFormatedMessage

function sendFormatedMessage($msgInfo)
{
    $msgInfo['reqTime'] = number_format(1000 * time(), 0, '', '');
    $content = $msgInfo['memberCode'] . $msgInfo['customerName'] . $msgInfo['customerPhone'] . $msgInfo['customerAddress'] . $msgInfo['customerMemo'] . $msgInfo['msgDetail'] . $msgInfo['deviceNo'] . $msgInfo['msgNo'] . $msgInfo['reqTime'] . FEYIN_KEY;
    $msgInfo['securityCode'] = md5($content);
    $msgInfo['mode'] = 1;
    return sendMessage($msgInfo);
}
开发者ID:eduNeusoft,项目名称:weixin,代码行数:8,代码来源:FeyinAPI.php

示例9: newFiles

 public static function newFiles()
 {
     $this->setDefaults();
     foreach ($this->plugin->storage->newFiles as $fileName) {
         MessageM . sendMessage(null, "%TAG%WCouldn't find '%A%fileName%.yml%W' creating new one.", "fileName-" . $fileName);
     }
     $this->plugin->storage->newFiles = [];
 }
开发者ID:survicraft,项目名称:pocketmine-BlockHunt,代码行数:8,代码来源:ConfigM.php

示例10: onMessage

 public function onMessage($from, $channel, $msg)
 {
     if (stringEndsWith($msg, "{$this->config['trigger']}memory")) {
         $usedMem = round(memory_get_usage() / 1024 / 1024, 2);
         $freeMem = round($this->config['memoryLimit'] - $usedMem, 2);
         sendMessage($this->socket, $channel, $from . ": Memory status: {$usedMem} MB used, {$freeMem} MB free.");
         $usedMem = null;
         $freeMem = null;
     }
 }
开发者ID:nask0,项目名称:VikingBot,代码行数:10,代码来源:memoryPlugin.php

示例11: onMessage

 public function onMessage($from, $channel, $msg)
 {
     global $config;
     if ($from != '' || $channel != '') {
         global $irc;
         $data = $irc->processIncomingMessage(array('message' => iconv($config['encoding'], 'UTF-8', $msg), 'from' => iconv($config['encoding'], 'UTF-8', $from), 'channel' => iconv($config['encoding'], 'UTF-8', $channel)));
         if ($data && $data != 1) {
             sendMessage($this->socket, $channel, $from . ': ' . iconv('UTF-8', $config['encoding'], $data));
         }
     }
 }
开发者ID:sergejey,项目名称:majordomo-app_ircbot,代码行数:11,代码来源:majordomoPlugin.php

示例12: loginMail

function loginMail()
{
    $errMsg = '';
    if (!isset($_GET['email'])) {
        $errMsg .= 'email';
    }
    if (!isset($_GET['password'])) {
        if (strlen($errMsg) > 0) {
            $errMsg .= ', ';
        }
        $errMsg .= 'password';
    }
    if (strlen($errMsg) > 0) {
        // At least one of the fields is not set, so return an error
        sendMessage(ERR, 'The following required parameters are not set: [' . $errMsg . ']');
        return;
    }
    $email = $_GET['email'];
    $password = $_GET['password'];
    // Check if user exists
    $db = acquireDatabase();
    $loader = new User($db);
    try {
        $res = $loader->loadWhere('email=?', [$email]);
        if (sizeof($res) > 0) {
            $user = $res[0];
            // Check if password is correct
            $validPassword = $user->getPassword();
            $password = User::encryptPassword($password);
            if ($validPassword == $password) {
                // Login successful -> return session id
                session_start();
                $_SESSION['uid'] = $user->getId();
                $_SESSION['email'] = $user->getEmail();
                if ($user->getState() == 'FILL_DATA') {
                    sendMessage(WARN, 'Login successful. Please complete your registration.');
                } else {
                    $_SESSION['name'] = $user->getName();
                    sendMessage(OK, 'Login successful.');
                }
            } else {
                sendMessage(ERR, 'Password invalid.');
            }
        } else {
            // User doesn't exist
            sendMessage(ERR, 'User invalid.');
        }
    } catch (DbException $e) {
        sendMessage(ERR, $e->getMessage());
    }
    $db->close();
}
开发者ID:Tucaen,项目名称:Karlsfeld-Volleyball-App,代码行数:52,代码来源:login.php

示例13: register

 public function register($username = '', $nickname = '', $password = '', $repassword = '', $email = '', $verify = '', $type = 'start')
 {
     $type = op_t($type);
     if (!C('USER_ALLOW_REGISTER')) {
         $this->error('注册已关闭');
     }
     $verifyarr = explode(',', C('VERIFY_OPEN'));
     if (in_array('1', $verifyarr)) {
         $this->assign('isverify', 1);
     } else {
         $this->assign('isverify', 0);
     }
     if (IS_POST) {
         //注册用户
         /* 检测验证码 TODO: */
         if (in_array('1', $verifyarr)) {
             if (!$this->check_verify($verify)) {
                 $this->error('验证码输入错误!');
             }
         }
         if ($password != $repassword) {
             $this->error('两次密码输入不一致');
         }
         /* 调用注册接口注册用户 */
         $User = new UserApi();
         $uid = $User->register($username, $nickname, $password, $email);
         if (0 < $uid) {
             //注册成功
             sendMessage($uid, 0, '注册成功', '恭喜您!您已经注册成功,请尽快<a href="' . U('Ucenter/yzmail') . '">验证邮箱地址</a>,第一时间获取网站动态!', 0);
             $uid = $User->login($username, $password);
             //通过账号密码取到uid
             D('Member')->login($uid, false);
             //登陆
             asyn_sendmail($email, 2);
             setuserscore($uid, C('REGSCORE'));
             $this->success('注册成功并登陆!', cookie('referurl'));
         } else {
             //注册失败,显示错误信息
             $this->error($this->showRegError($uid));
         }
     } else {
         //显示注册表单
         if (is_login()) {
             redirect(cookie('referurl'));
         }
         if (cookie('referurl') == '') {
             cookie('referurl', $_SERVER['HTTP_REFERER']);
         }
         $this->display();
     }
 }
开发者ID:Willshon,项目名称:OLCS,代码行数:51,代码来源:UserController.class.php

示例14: telCode

 public function telCode()
 {
     //手机号码
     $tel = I('post.phone');
     //发送验证码
     $telcode = rand(100000, 999999);
     $res = sendMessage($tel, $telcode);
     //存入session中
     if ($res) {
         session('telcode', $telcode);
         //将telcode返回到js
         $this->ajaxReturn($telcode);
     }
 }
开发者ID:noikiy,项目名称:lagou,代码行数:14,代码来源:RegisterController.class.php

示例15: mass

/**
 * 群聊
 * 
 * @param  swoole_server $server  
 * @param  array|mixed   $content 消息内容
 * @param  int           $from_fd 发送人
 * @param  string        $channel 频道,如果没有指定,默认为公共频道
 */
function mass($server, $content, $from_fd, $channel = 'public')
{
    global $app;
    foreach ($app->users->online() as $user) {
        $to_fd = $user['fd'];
        if ($from_fd === $to_fd) {
            continue;
        }
        if (is_null($channel) || $user['channel'] !== $channel) {
            continue;
        }
        sendMessage($server, 'chat', $content, $from_fd, $to_fd);
    }
}
开发者ID:share0307,项目名称:swoole-chatroom,代码行数:22,代码来源:helpers.php


注:本文中的sendMessage函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。