當前位置: 首頁>>代碼示例>>PHP>>正文


PHP reply函數代碼示例

本文整理匯總了PHP中reply函數的典型用法代碼示例。如果您正苦於以下問題:PHP reply函數的具體用法?PHP reply怎麽用?PHP reply使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了reply函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: replybotname

/**
* Start function for retrieving bot reply
*
* Checks to see if bot exists, if so calls reply() to get the repons to the user's input.
*
* @uses lookupbotid()
* @uses reply()
*
* @param string $userinput          The user's input
* @param integer $uniqueid          The user's session ID
* @param string $botname            The bot's name, if no name selected the default value is "TestBot".
*
* @return string                    The bot's reply. 
*/
function replybotname($userinput, $uniqueid, $botname = "TestBot")
{
    $botid = lookupbotid($botname);
    if ($botid == -1) {
        print "I don't know that bot: {$botname}<BR>\n";
    } else {
        return reply($userinput, $uniqueid, $botid);
    }
}
開發者ID:aparaschivoiu,項目名稱:webapp,代碼行數:23,代碼來源:respond.php

示例2: broadcast

function broadcast($server, $type, $message, $except_fd, $channel = 'public')
{
    global $app;
    foreach ($app->users->online() as $user) {
        $to_fd = $user['fd'];
        if (is_array($except_fd) && in_array($to_fd, $except_fd) || $except_fd === $to_fd) {
            continue;
        }
        if (is_null($channel) || $user['channel'] !== $channel) {
            continue;
        }
        reply($server, $to_fd, $type, $message);
    }
}
開發者ID:share0307,項目名稱:swoole-chatroom,代碼行數:14,代碼來源:helpers.php

示例3: replybotname

/**
* Start function for retrieving bot reply
*
* Checks to see if bot exists, if so calls reply() to get the repons to the user's input.
*
* @uses lookupbotid()
* @uses reply()
*
* @param string $userinput          The user's input
* @param integer $uniqueid          The user's session ID
* @param string $botname            The bot's name, if no name selected the default value is "octavius".
*
* @return string                    The bot's reply. 
*/
function replybotname($userinput, $uniqueid, $botname = "octavius")
{
    $botid = lookupbotid($botname);
    if ($botid == -1) {
        //print "I don't know that bot: $botname<BR>\n";
    } else {
        return reply($userinput, $uniqueid, $botid);
    }
}
開發者ID:erico-deh,項目名稱:ocPortal,代碼行數:23,代碼來源:respond.php

示例4: cpg_error

        cpg_error($rated, _ARTICLERATING, URL::index('News&file=article&sid=' . $sid));
    } else {
        cpg_error(_DIDNTRATE, _ARTICLERATING);
    }
}
$sid = isset($_POST['sid']) ? intval($_POST['sid']) : (isset($_GET['sid']) ? intval($_GET['sid']) : 0);
if ((isset($_POST['postreply']) || isset($_POST['preview']) || isset($_GET['reply']) || isset($_GET['comment'])) && (!$MAIN_CFG['global']['articlecomm'] || $db->sql_count($prefix . '_stories', "sid={$sid} AND acomm=0"))) {
    URL::redirect(URL::index('&amp;file=article&amp;sid=' . $sid));
}
require_once "modules/{$module_name}/comments.php";
if (isset($_POST['postreply'])) {
    replyPost($sid);
    // store the reply
} else {
    if (isset($_GET['reply'])) {
        reply($sid);
        // reply to comment
    } elseif (isset($_POST['preview'])) {
        replyPreview($sid);
        // Preview the reply before storage
    } else {
        if (isset($_GET['comment'])) {
            // Show comment X
            if (!isset($_GET['pid'])) {
                singlecomment(intval($_GET['comment']), $sid);
            } else {
                DisplayComments($sid, '', intval($_GET['pid']), intval($_GET['comment']));
            }
        } else {
            $storynum = is_user() && $userinfo['storynum'] && $MAIN_CFG['member']['user_news'] ? $userinfo['storynum'] : $MAIN_CFG['global']['storyhome'];
            if (isset($_GET['page']) && intval($_GET['page']) > 1) {
開發者ID:cbsistem,項目名稱:nexos,代碼行數:31,代碼來源:index.php

示例5: addTicket

    function addTicket($sujet, $corps, $cat, $notify)
    {
        global $lvlUser, $nuked, $user;
        if (is_nan($cat) or is_null(getCatName($cat))) {
            ?>
 <div style="text-align:center;"><h2><?php 
            echo _UNKNCAT;
            ?>
</h2></div><?php 
            redirect("index.php?file=Support", 3);
        } else {
            if (empty($sujet) or empty($corps)) {
                ?>
 <div style="text-align:center;"><h2><?php 
                echo _UNKSUJETCORPS;
                ?>
</h2></div><?php 
                redirect("index.php?file=Support", 3);
            } else {
                $time = time();
                $sql = mysql_query("INSERT INTO " . mysql_real_escape_string($nuked["prefix"]) . "_support_threads (titre, date, closed, auteur, auteur_id, cat_id, notify) VALUES ('" . mysql_real_escape_string(secu_html(html_entity_decode($sujet, ENT_QUOTES))) . "', '" . $time . "', '0', '" . mysql_real_escape_string(secu_html(html_entity_decode($user[2], ENT_QUOTES))) . "', '" . mysql_real_escape_string($user[0]) . "', '" . mysql_real_escape_string($cat) . "', '" . $notify . "') ");
                if (!$sql) {
                    ?>
 <div style="text-align:center;"><h2><?php 
                    echo _ERREUR . "   " . mysql_error($sql);
                    ?>
</h2></div><?php 
                } else {
                    $sql = mysql_query("SELECT id FROM " . mysql_real_escape_string($nuked["prefix"]) . "_support_threads WHERE date = '" . $time . "' AND closed = '0' AND auteur_id = '" . $user[0] . "' LIMIT 0,1 ");
                    $sql = mysql_fetch_assoc($sql);
                    if ($sql) {
                        reply($sql["id"], $corps, 1);
                    } else {
                        die(_ERREUR);
                    }
                    ?>
<div style="text-align:center;">
    <h2><?php 
                    echo _SUPPORT;
                    ?>
</h2>
    <h3><?php 
                    echo $thread["titre"];
                    ?>
</h3>
    <br /><br />
    <?php 
                    echo _TICKETSUCCESS;
                    ?>
    <br /><br /><a href="javascript:history.back()"><b>[ <?php 
                    echo _BACK;
                    ?>
 ]</b></a><br />
</div>

        <?php 
                    redirect("javascript:history.back()", 2);
                }
            }
        }
    }
開發者ID:Rbeuque74,項目名稱:nkhelp_moduleSupport,代碼行數:61,代碼來源:index.php

示例6: define

<?php

define('PIGCMS_PATH', dirname(dirname(__FILE__)) . '/');
require_once PIGCMS_PATH . 'source/init.php';
$t_configs = D('Config')->field('`name`,`value`')->select();
foreach ($t_configs as $key => $value) {
    $t_config[$value['name']] = $value['value'];
}
$_G['config'] = $t_config;
$action = isset($_GET['a']) ? addslashes($_GET['a']) : 'index';
import("source.class.Wechat");
$wechat = new Wechat($t_config);
if ($action == 'index') {
    $data = $wechat->request();
    list($content, $type) = reply($data);
    $wechat->response($content, $type);
} elseif ($action == 'get_ticket') {
    //獲取 component_verify_ticket 每十分鍾微信服務本服務器請求一次
    $data = $wechat->request();
    if (isset($data['InfoType'])) {
        if ($data['InfoType'] == 'component_verify_ticket') {
            if (isset($data['ComponentVerifyTicket']) && $data['ComponentVerifyTicket']) {
                if ($config = D('Config')->where("`name`='wx_componentverifyticket'")->find()) {
                    D('Config')->where("`name`='wx_componentverifyticket'")->data(array('value' => $data['ComponentVerifyTicket']))->save();
                } else {
                    D('Config')->data(array('name' => 'wx_componentverifyticket', 'value' => $data['ComponentVerifyTicket'], 'type' => 'type=text', 'gid' => 0, 'tab_id' => 0))->add();
                }
                F('config', null);
                exit('success');
            }
        } elseif ($data['InfoType'] == 'unauthorized') {
開發者ID:fkssei,項目名稱:pigcms10,代碼行數:31,代碼來源:weixin.php

示例7: replybotname

/**
* Start function for retrieving bot reply
*
* Checks to see if bot exists, if so calls reply() to get the repons to the user's input.
*
* @uses lookupbotid()
* @uses reply()
*
* @param string $userinput          The user's input
* @param integer $uniqueid          The user's session ID
* @param string $botname            The bot's name, if no name selected the default value is "TestBot".
*
* @return string                    The bot's reply.
*/
function replybotname($userinput, $uniqueid, $botname)
{
    /*
      $userinput = eregi_replace("^\/to L_PRIV_PM", "", $userinput);      // removes not necessary chars from the input of private messages helps the bot to make sense?
      $userinput = eregi_replace("^\/msg L_PRIV_PM", "", $userinput);      // removes not necessary chars from the input of private messages helps the bot to make sense?
      $userinput = eregi_replace("^\/wisp L_PRIV_WISP", "", $userinput);      // removes not necessary chars from the input of private messages helps the bot to make sense?
      $userinput = eregi_replace("^\/whisp L_PRIV_WISP", "", $userinput);      // removes not necessary chars from the input of private messages helps the bot to make sense?
      $userinput = eregi_replace("^\/to  Re: ", "", $userinput);      // removes not necessary chars from the input of private messages helps the bot to make sense?
      $userinput = eregi_replace("^\/msg  Re: ", "", $userinput);      // removes not necessary chars from the input of private messages helps the bot to make sense?
      $userinput = eregi_replace("^\/wisp  Re: ", "", $userinput);      // removes not necessary chars from the input of private messages helps the bot to make sense?
      $userinput = eregi_replace("^\/whisp  Re: ", "", $userinput);      // removes not necessary chars from the input of private messages helps the bot to make sense?
      $userinput = eregi_replace("^\/to  ", "", $userinput);      // removes not necessary chars from the input of private messages helps the bot to make sense?
      $userinput = eregi_replace("^\/msg  ", "", $userinput);      // removes not necessary chars from the input of private messages helps the bot to make sense?
      $userinput = eregi_replace("^\/wisp  ", "", $userinput);      // removes not necessary chars from the input of private messages helps the bot to make sense?
      $userinput = eregi_replace("^\/whisp  ", "", $userinput);      // removes not necessary chars from the input of private messages helps the bot to make sense?
      $userinput = eregi_replace("^\/Re: ", "", $userinput);      // removes not necessary chars from the input of private messages helps the bot to make sense?
      $userinput = ereg_replace("^\> ", "", $userinput);      // removes not necessary chars from the input of private messages helps the bot to make sense?
    */
    $userinput = preg_replace("/^\\/to L_PRIV_PM/i", "", $userinput);
    // removes not necessary chars from the input of private messages helps the bot to make sense?
    $userinput = preg_replace("/^\\/msg L_PRIV_PM/i", "", $userinput);
    // removes not necessary chars from the input of private messages helps the bot to make sense?
    $userinput = preg_replace("/^\\/wisp L_PRIV_WISP/i", "", $userinput);
    // removes not necessary chars from the input of private messages helps the bot to make sense?
    $userinput = preg_replace("/^\\/whisp L_PRIV_WISP/i", "", $userinput);
    // removes not necessary chars from the input of private messages helps the bot to make sense?
    $userinput = preg_replace("/^\\/to Re: /i", "", $userinput);
    // removes not necessary chars from the input of private messages helps the bot to make sense?
    $userinput = preg_replace("/^\\/msg Re: /i", "", $userinput);
    // removes not necessary chars from the input of private messages helps the bot to make sense?
    $userinput = preg_replace("/^\\/wisp Re: /i", "", $userinput);
    // removes not necessary chars from the input of private messages helps the bot to make sense?
    $userinput = preg_replace("/^\\/whisp Re: /i", "", $userinput);
    // removes not necessary chars from the input of private messages helps the bot to make sense?
    $userinput = preg_replace("/^\\/to /i", "", $userinput);
    // removes not necessary chars from the input of private messages helps the bot to make sense?
    $userinput = preg_replace("/^\\/msg /i", "", $userinput);
    // removes not necessary chars from the input of private messages helps the bot to make sense?
    $userinput = preg_replace("/^\\/wisp /i", "", $userinput);
    // removes not necessary chars from the input of private messages helps the bot to make sense?
    $userinput = preg_replace("/^\\/whisp /i", "", $userinput);
    // removes not necessary chars from the input of private messages helps the bot to make sense?
    $userinput = preg_replace("/^\\/Re: /i", "", $userinput);
    // removes not necessary chars from the input of private messages helps the bot to make sense?
    $userinput = preg_replace("/^\\> /", "", $userinput);
    // removes not necessary chars from the input of private messages helps the bot to make sense?
    $userinput = preg_replace("/&#39;/", "'", $userinput);
    // removes not necessary chars from the input of private messages helps the bot to make sense?
    $botid = lookupbotid($botname);
    if ($botid == -1) {
        #		print "There is no such a bot: $botname<br />\n";
        return reply("There is no such a bot <b>{$botname}</b> loaded in the database.<br />\nPlease make sure the bot is fully loaded into the database.<br />\nNotify the chat administrator about this message!", $uniqueid, $botid);
    } else {
        return reply($userinput, $uniqueid, $botid);
    }
}
開發者ID:pradyumnasagar,項目名稱:pratechsha,代碼行數:70,代碼來源:respond_talk.php

示例8: stat_sms_received

//}
//$phones = array();
//while($row = mysql_fetch_row($result)) {
//    $phones[] = $row[0];
//}
//mysql_free_result($result);
//
//$new_status = WAITING_CODE;
//if (count($phones) >= ANTIFRAUD_MAX_PHONES_PER_WM_PER_HOUR)
//    if (!in_array($user_phone, $phones)) {
//        $new_status = REJECTED_FRAUD;
//    }
//
//if ($ran <= 3 and $new_status == WAITING_CODE) {
//    $new_status = MANUAL_TRANSFER;
//}
/************************************************************************************
 Сохранение информации об СМСке
************************************************************************************/
$partner = $session->partner;
if ($parner) {
    $sms->partner_earning = $partner->earning_percent / 100.0 * $sms->service_earning;
}
$sms->status = SMS_STATUS_OK;
$sms->put();
stat_sms_received($session->id, $session->test_id, $session->partner_id, $session->day, $session->paid, $sms->service_earning, $sms->partner_earning);
/************************************************************************************
 Готово
************************************************************************************/
reply(sprintf(SMS_REPLY_OK, $session->sms_resp));
開發者ID:andreyvit,項目名稱:retester,代碼行數:30,代碼來源:x-sms-a1.php

示例9: delete

    case "write":
        $showWrite = true;
        break;
    case "delete":
        $showList = true;
        delete($smarty);
        display($smarty);
        break;
    case "send":
        send($smarty);
        $showList = true;
        display($smarty);
        break;
    case "reply":
        $showWrite = true;
        reply($smarty);
        break;
    default:
        $showList = true;
        display($smarty);
        break;
}
$smarty->assign('showList', $showList);
$smarty->assign('showRead', $showRead);
$smarty->assign('showCompose', $showWrite);
$smarty->assign('msg', 'There is no message in your inbox.');
//================ Function
function display(&$smarty)
{
    $usn = $_SESSION['usn'];
    $message_fact = new message_factory();
開發者ID:bryanbacus,項目名稱:skripsi-martin,代碼行數:31,代碼來源:message.php

示例10: elseif

            $seller_name = $seller["username"];
        }
        for ($i = 1; $i <= 5; $i++) {
            $speaker_var = "speaker" . $i;
            $output .= "<h3>";
            if ($messages["{$speaker_var}"] == 'b') {
                //instead of printing who is the buyer and seller, print out the name of the buyer and seller based on who is what
                $output .= $buyer_name;
            } elseif ($messages["{$speaker_var}"] == 's') {
                $output .= $seller_name;
            }
            $output .= "</h3>";
            $message_var = "message" . $i;
            $output .= $messages["{$message_var}"];
        }
    }
    echo $header_output;
    echo $output;
    echo "<br /><br />";
    echo make_field_and_button($messages_id, $action);
    //the textfield and the correct button (add message or reply) will be made depending on the action
    add_message($messages_id, $action);
    //if the user clicks on the button, one of these functions will run
    reply($messages_id, $action);
}
?>
</div>
</body>
</html>
<?php 
ob_end_flush();
開發者ID:Windrill,項目名稱:SMICTrades,代碼行數:31,代碼來源:messages.php

示例11: listen_on

/**
 * 端口
 * @param $address
 * @param $port
 * @param $pairs
 */
function listen_on($address, $port, $pairs, $use_ip = false)
{
    /**
     * 創建一個SOCKET
     * AF_INET=是ipv4 如果用ipv6,則參數為 AF_INET6
     * SOCK_STREAM為socket的tcp類型,如果是UDP則使用SOCK_DGRAM
     */
    $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP) or die("socket_create() 失敗的原因是:" . socket_strerror(socket_last_error()) . "/n");
    // 阻塞模式
    socket_set_block($sock) or die("socket_set_block() 失敗的原因是:" . socket_strerror(socket_last_error()) . "/n");
    // 綁定到socket端口
    $result = socket_bind($sock, $address, $port) or die("socket_bind() 失敗的原因是:" . socket_strerror(socket_last_error()) . "/n");
    //開始監聽
    $result = socket_listen($sock, 4) or die("socket_listen() 失敗的原因是:" . socket_strerror(socket_last_error()) . "/n");
    echo "Binding the socket on {$address}:{$port} ... ";
    echo "OK\nListening on the socket {$address}:{$port} ... \n";
    do {
        // never stop the daemon
        // 它接收連接請求並調用一個子連接Socket來處理客戶端和服務器間的信息
        $msgsock = socket_accept($sock) or die("socket_accept() failed: reason: " . socket_strerror(socket_last_error()) . "/n");
        // 讀取客戶端數據
        while (save_relet_file($msgsock, $pairs, $use_ip) !== -1) {
            echo "ok\n";
        }
        // 數據傳送 向客戶端寫入返回結果
        $info = array('code' => 0, 'msg' => 'OK');
        reply($msgsock, $info);
        // 一旦輸出被返回到客戶端,父/子socket都應通過socket_close($msgsock)函數來終止
        socket_close($msgsock);
    } while (true);
    socket_close($sock);
}
開發者ID:noname007,項目名稱:file-sync,代碼行數:38,代碼來源:lib_server.php

示例12: session_start

    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Program E; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
/**
 * Flash User Interface
 * 
 * Contains the basics of Flash communication
 * @author Paul Rydell
 * @copyright 2002
 * @version 0.0.8
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 * @package Interpreter
 * @subpackage Responder
 */
/**
* Include the guts of the program.
*/
include "respond.php";
$numselects = 0;
// Start the session or get the existing session.
session_start();
$myuniqueid = session_id();
// Here is where we get the reply. Make sure you fill in testbot with your bot's name
$botresponse = reply($HTTP_POST_VARS['input'], $myuniqueid, "TestBot");
// Print the results.
print "&bot_name=Test Agent\n";
print "&alice_out=" . $botresponse->response . "\n";
print "&textLoaded=1";
開發者ID:aparaschivoiu,項目名稱:webapp,代碼行數:31,代碼來源:flash.php

示例13: Header

    }
    if (isset($cookie[5])) {
        $options .= "&order={$cookie['5']}";
    } else {
        $options .= "&order=0";
    }
    if (isset($cookie[6])) {
        $options .= "&thold={$cookie['6']}";
    } else {
        $options .= "&thold=0";
    }
    Header("Location: modules.php?name={$module_name}&file=article&sid={$sid}{$options}");
}
switch ($op) {
    case "Reply":
        reply($pid, $sid, $mode, $order, $thold);
        break;
    case "" . _PREVIEW . "":
        replyPreview($pid, $sid, $subject, $comment, $xanonpost, $mode, $order, $thold, $posttype);
        break;
    case "" . _OK . "":
        CreateTopic($xanonpost, $subject, $comment, $pid, $sid, $host_name, $mode, $order, $thold, $posttype);
        break;
    case "moderate":
        if (isset($admin)) {
            include "auth.php";
        } else {
            include "mainfile.php";
        }
        if ($admintest == 1 || $moderate == 2) {
            while (list($tdw, $emp) = each($HTTP_POST_VARS)) {
開發者ID:BackupTheBerlios,項目名稱:domsmod-svn,代碼行數:31,代碼來源:comments.php

示例14: array

 * @version 0.0.8
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 * @package Interpreter
 * @subpackage Responder
 */
/**
* Include the guts of the program.
*/
include "respond.php";
// Read tests.txt into an array, each line a different element.
$tests = array("testatomic", "testdisplayset", "testhide", "testget", "testsetx", "testalter", "testsettopic", "test6a", "test6b", "testsimplecondition", "testsimpleconditiona", "testsimpleconditionmatch", "testconditionlist", "testconditionlistmatch", "testconditionlistdefault", "testconditionlistname", "teststar test passed", "teststar Test passed one and Test passed two and Test passed three and Test passed four", "testunderscore Test passed one and Test passed two and Test passed three and Test passed four", "testrandom", "testwordformat", "testnestedwordformat", "testsimplemultisentencethat", "testarray4multisentencethat", "testarray3multisentencethat", "testarray2multisentencethat", "testarray1multisentencethat", "testthatarray", "testbotproperties", "testconditionsetvalue", "testnestedcondition", "testnestedcondition1", "testnestedcondition2", "testsetcondition", "testversion", "testsrai", "testsr sraisucceeded", "testnestedsrai", "testthinksrai", "teststarset test passed", "testidsizedate", "testgossip", "testname", "testinput", "testinput1", "testinput2", "testinput3", "testgender he", "testthatstar", "testthatstar1", "testmultithatstar", "testmultithatstar1", "testtopicstar", "testmultitopicstar", "test35", "testoldtopic", "test36", "testextremesrai", "testperson i was", "testperson2 with you");
ss_timing_start("alll");
// For each element in the array to a curl request to talk.php.
for ($x = 0; $x < sizeof($tests); $x++) {
    // Start the session or get the existing session.
    session_start();
    $myuniqueid = session_id();
    // Timer will let us know how long it took to get our response.
    ss_timing_start("single");
    // Here is where we get the reply.
    $botresponse = reply($tests[$x], $myuniqueid, 1);
    // Stop the timer.
    ss_timing_stop("single");
    // Print the results.
    print "<B>RESPONSE: " . $botresponse->response . "<BR></b>";
    print "<BR><BR>execution time: " . ss_timing_current("single");
    print "<BR>";
}
ss_timing_stop("alll");
print "<BR><BR>all execution time: " . ss_timing_current("alll");
print "<BR>";
開發者ID:aparaschivoiu,項目名稱:webapp,代碼行數:31,代碼來源:tester.php

示例15: switch

    $site = "";
}
switch ($site) {
    case "eingabe":
        eingabe();
        break;
    case "zeige":
        zeige();
        break;
    case "zeigethread":
        zeigethread();
        break;
    case "register":
        registrieren();
        break;
    case "login":
        login();
        break;
    case "logout":
        raushier();
        break;
    case "reply":
        reply();
        break;
    default:
        ausgabe();
}
?>
</body>
</html>
開發者ID:toreadors,項目名稱:ITFBB,代碼行數:30,代碼來源:index.php


注:本文中的reply函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。