本文整理汇总了PHP中messages函数的典型用法代码示例。如果您正苦于以下问题:PHP messages函数的具体用法?PHP messages怎么用?PHP messages使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了messages函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: iroffer
function iroffer($bot)
{
global $_CONFIG;
try {
$conn = new IROFFER($bot->host(), $bot->port(), $bot->password(), $_CONFIG['iroffer_timeout']);
} catch (IROFFER_ERROR $error) {
messages()->error($error->getMessage());
header("Location: " . view('main'));
exit(0);
}
return $conn;
}
示例2: display
function display($page)
{
global $tpl, $_PARAMS, $_ACTION, $_CONFIG;
$tpl->assign('action', $_ACTION);
$tpl->assign('ROOT', ROOT);
$tpl->assign('subpage', '');
$tpl->assign('params', $_PARAMS);
$tpl->assign('config', $_CONFIG);
$tpl->assign('messages', messages());
$tpl->assign('user', user());
$tpl->inheritance_merge_compiled_includes = false;
$tpl->display($page);
}
示例3: create
public static function create($name, $host, $port, $password, $user_id)
{
if (db()->query("INSERT INTO bots (name, host, port, password) VALUES (" . db()->quote($name) . "," . db()->quote($host) . "," . db()->quote($port) . "," . db()->quote($password) . ")")) {
$id = db()->lastInsertId();
db()->query("INSERT INTO `bot_user` (`bot_id`, `user_id`) VALUES (" . db()->quote($id) . "," . db()->quote($user_id) . ")") or die(dberror());
} else {
$query = db()->query("SELECT id FROM bots WHERE " . "host=" . db()->quote($host) . " AND " . "port=" . db()->quote($port) . " AND " . "password=" . db()->quote($password)) or die(dberror());
if ($data = $query->fetch()) {
db()->query("INSERT INTO `bot_user` (`bot_id`, `user_id`) VALUES (" . db()->quote($data['id']) . "," . db()->quote($user_id) . ")") or die(dberror());
} else {
messages()->error(_('couple (host, port) already used and wrong password'));
}
}
}
示例4: prepareViewResponse
/**
* @param $request
* @param $response
*
* @return View
*/
protected function prepareViewResponse($request, $response)
{
$controllerClassName = $request->route()->getAction()['controller'];
$controllerClassName = substr($controllerClassName, 0, strpos($controllerClassName, '@'));
$controller = app()->make($controllerClassName);
$layout = $controller->getLayout();
/** @var View $response */
list($response, $sections) = $response->render(function ($view, $contents) use($layout) {
return [view($layout, ['html' => $contents, '_originalTemplateName' => $view->getName()], $view->getData()), $view->getFactory()->getSections()];
});
if (is_array($sections)) {
foreach ($sections as $sectionId => $sectionContent) {
$response->getFactory()->startSection($sectionId, $sectionContent);
}
}
if ($request instanceof Request && ($request->wantsJson() || $request->has('callback'))) {
$response = ['messages' => messages()->all(), 'title' => !empty($response['title']) ? $response['title'] : null, 'data' => array_except($response->getData(), 'html'), 'response' => ['html' => $response['html'], 'sections' => array_except(array_merge((array) $sections, $response->renderSections()), '__content')]];
if ($request->has('callback')) {
$response = $request->get('callback') . '(' . json_encode($response) . ')';
}
}
return $response;
}
示例5: overlay
/**
* @param $message
* @param $title
* @param string $class
*
* @return \PortOneFive\Essentials\Messaging\MessageManager
*/
function overlay($message, $title, $class = 'info')
{
return messages()->overlay($message, $title, $class);
}
示例6: changed_location
$('#point_select').show();
$('#route_select').hide();
};
}
function changed_location() {
$('#route1').load('ajax/ajax_routes.php?lid='+$('#location_id').val());
$('#sp1').load('ajax/ajax_points.php?type=sp&lid='+$('#location_id').val());
$('#ep1').load('ajax/ajax_points.php?type=ep&lid='+$('#location_id').val());
}
</script>
<h1>{t t='Request a Ride'}</h1>
<?php
messages($msgs, $errors);
?>
<form action="request.php" method="get">
<fieldset>
<legend>{t t='Main Info'}</legend>
<ol>
<li>
<label for="user_number_id">{t t='Phone number'}</label>
<?php
global $user;
echo c2r_getHmtlSelectUserNumbers($user->id);
?>
示例7: iroffer
<?php
/*
* This file is part of phpIrofferAdmin.
*
* (c) 2013 Valentin Samir
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require "includes/controler.php";
if ($_PARAMS['bot'] !== false) {
$conn = iroffer($_PARAMS['bot']);
$tpl->assign('groups', $conn->xdl($group_only = true));
$files = $conn->listul($_PARAMS['path']);
if (is_array($files)) {
$tpl->assign('files', $files);
} else {
if (preg_match('/Can\'t Access Directory: (.*) Not a directory/', $files, $match)) {
messages()->error(sprintf(_('%s is not a directory'), str_replace('//', '/', $match[1])));
} else {
messages()->error($files);
}
$_PARAMS['path'] = dirname($_PARAMS['path']);
header('Location: ' . view('files_listing', $_PARAMS));
die;
}
display("templates/bot_listul.tpl");
} else {
header("Location: " . view('main'));
}
示例8: user_load
<?php
if ($_SESSION['uid']) {
$user = user_load($_SESSION['uid']);
messages('Hello ' . $user->name);
}
示例9: function
require 'config/db.php';
require 'model/user.php';
require 'model/message.php';
$app = new Slim\App();
$app->get('/', function ($request, $response, $args) {
$response->write("Welcome to Slim!");
return $response;
});
$app->get('/hello[/{name}]', function ($request, $response, $args) {
$response->write("Hello, " . $args['name']);
return $response;
})->setArgument('name', 'World!');
$app->get('/user/{id}', function ($request, $response, $args) {
$newResponse = $response->withHeader('Content-type', 'application/json');
$newResponse->write(json_encode(getUser(getDbConnection(), $args['id'])));
return $newResponse;
});
$app->get('/messages', function ($request, $response, $args) {
$newResponse = $response->withHeader('Content-type', 'application/json');
$queryParams = $request->getQueryParams();
if (isset($queryParams['lat']) || isset($queryParams['lng'])) {
$lat = $queryParams['lat'];
$lng = $queryParams['lng'];
$messages = messagesWithLatLng(getDbConnection(), $lat, $lng);
} else {
$messages = messages(getDbConnection());
}
$newResponse->write(json_encode($messages));
return $newResponse;
});
$app->run();
示例10: messages
<li><?php
echo " UserID: " . $userID . "";
?>
</li>
<li><?php
echo "Logged in as: " . $username . "";
?>
</ul>
</div>
<!-- END NAV -->
<div id="content">
<?php
//show any messages if there are any.
messages();
?>
<h1>Manage Events</h1>
<table>
<tr>
<th><strong>Title</strong></th>
<th><strong>Action</strong></th>
</tr>
<?php
// Query här: Matcha pages på user inloggad.
$sql = mysqli_query($conn, "SELECT * FROM pages WHERE userID='{$userID}' ORDER BY pageID");
while ($row = mysqli_fetch_object($sql)) {
echo "<tr>";
示例11: skin_include
// -------------------------- BODY HEADER INCLUDED HERE --------------------------
skin_include('_body_header.inc.php');
// Note: You can customize the default BODY header by copying the generic
// /skins/_body_header.inc.php file into the current skin folder.
// -------------------------------- END OF BODY HEADER ---------------------------
// -------------------------- LEFT NAVIGATION BAR INCLUDED HERE ------------------
skin_include('_left_navigation_bar.inc.php');
// -------------------------------- END OF LEFT NAVIGATION BAR -------------------
?>
<!-- =================================== START OF MAIN AREA =================================== -->
<div class="bPosts">
<?php
// ------------------------- MESSAGES GENERATED FROM ACTIONS -------------------------
messages(array('block_start' => '<div class="action_messages">', 'block_end' => '</div>'));
// --------------------------------- END OF MESSAGES ---------------------------------
?>
<?php
// ------------------------ TITLE FOR THE CURRENT REQUEST ------------------------
request_title(array('title_before' => '<h1 class="page_title">', 'title_after' => '</h1>', 'title_single_disp' => false, 'title_page_disp' => false, 'format' => 'htmlbody', 'edit_text_create' => T_('Post a new topic'), 'edit_text_update' => T_('Edit post'), 'category_text' => '', 'categories_text' => '', 'catdir_text' => ''));
// ----------------------------- END OF REQUEST TITLE ----------------------------
?>
<?php
// Display message if no post:
display_if_empty();
echo '<div id="styled_content_block">';
// Beginning of posts display
if ($Item =& mainlist_get_item()) {
示例12: deletionHasSucceed
/**
* Response when content deletion has succeed.
*
* @param \Orchestra\Story\Model\Content $content
*
* @return mixed
*/
public function deletionHasSucceed(Content $content)
{
messages('success', 'Post has been deleted.');
return redirect(handles('orchestra::storycms/posts'));
}
示例13: userHasLoggedOut
/**
* Response to user has logged out successfully.
*
* @return mixed
*/
public function userHasLoggedOut()
{
messages('success', trans('orchestra/foundation::response.credential.logged-out'));
return Redirect::intended(handles(Input::get('redirect', 'orchestra::login')));
}
示例14: admin_messages_admin_main
function admin_messages_admin_main($var)
{
$op = pnVarCleanFromInput('op');
if (!pnSecAuthAction(0, 'Messages::', '::', ACCESS_EDIT)) {
include 'header.php';
echo _MESSAGESNOAUTH;
include 'footer.php';
} else {
switch ($op) {
case "messages":
messages();
break;
case "editmsg":
editmsg();
break;
case "addmsg":
addmsg();
break;
case "deletemsg":
deletemsg();
break;
case "savemsg":
savemsg();
break;
default:
messages();
break;
}
}
}
示例15: usersMenus
include_once('ressources/class.ldap.inc');
include_once('ressources/class.users.menus.inc');
include_once('ressources/class.artica.inc');
include_once('ressources/class.ini.inc');
include_once('ressources/class.spamassassin.inc');
include_once('ressources/class.mime.parser.inc');
include_once(dirname(__FILE__).'/ressources/class.rfc822.addresses.inc');
$user=new usersMenus();
if($user->AsPostfixAdministrator==false){
$tpl=new templates();
echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');";
die();exit();
}
if(isset($_GET["tabs"])){tabs();exit;}
if(isset($_GET["messages"])){messages();exit;}
if(isset($_GET["add"])){messages_add();exit;}
if(isset($_POST["upload-message"])){message_upload();exit;}
if(isset($_GET["messages-list"])){messages_list();exit;}
if(isset($_GET["show-results"])){message_results();exit;}
if(isset($_GET["analyze-message"])){message_analyze();exit;}
if(isset($_GET["delete-message"])){message_delete();exit;}
js();
function js(){
$tpl=new templates();
$page=CurrentPageName();