本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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('&file=article&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) {
示例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);
}
}
}
}
示例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') {
示例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("/'/", "'", $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);
}
}
示例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));
示例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();
示例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();
示例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);
}
示例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";
示例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)) {
示例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>";
示例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>