本文整理汇总了PHP中getMessages函数的典型用法代码示例。如果您正苦于以下问题:PHP getMessages函数的具体用法?PHP getMessages怎么用?PHP getMessages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getMessages函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: sendMessage
function sendMessage($sentMsg, $senderChatId, $senderEmail, $groupId)
{
global $conn;
writeToFile("msg: {$sentMsg}, chat_id: {$senderChatId}, email: {$senderEmail}, group_id: {$groupId}");
//get the current timestamp
$timeStamp = date("Y-m-d H:i:s");
if ($groupId) {
//insert the sent msg to DB
$sql = "INSERT INTO CHATLINETABLE" . "(id, chat_id, user_email, text_line, time_stamp, group_id)" . "VALUES (NULL, {$senderChatId}, '{$senderEmail}', '{$sentMsg}', '{$timeStamp}', {$groupId})";
} else {
//insert the sent msg to DB
$sql = "INSERT INTO CHATLINETABLE" . "(id, chat_id, user_email, text_line, time_stamp, group_id)" . "VALUES (NULL, {$senderChatId}, '{$senderEmail}', '{$sentMsg}', '{$timeStamp}',NULL)";
}
try {
$result = $conn->query($sql);
if ($result) {
if (isset($_COOKIE['groupId'])) {
getGroupData($_COOKIE['groupId']);
} else {
if (isset($_COOKIE['sender']) && isset($_COOKIE['receiver'])) {
getMessages($_COOKIE['sender'], $_COOKIE['receiver'], $_COOKIE['recName']);
}
}
} else {
echo "Error while inserting data to chat table";
}
} catch (Exception $e) {
echo 'Exception in sendMessage() :' . $e->getMessage();
}
}
开发者ID:TalentSourcing,项目名称:web-dev,代码行数:30,代码来源:chat1.php
示例2: newMessage
/**
* Saves a new message and updates the cache.
*/
function newMessage($conn, $cache, $message)
{
// This is great PHP
if ($message == "0" || $message) {
$stmt = $conn->prepare("INSERT INTO messages (message) VALUES (:message);");
$stmt->execute(array(':message' => $message));
$cache->set("messages", getMessages($conn, null));
}
}
开发者ID:dbergqvist,项目名称:k8s_demo,代码行数:12,代码来源:index.php
示例3: render
function render()
{
global $user, $twig;
$this->user = $user;
$this->loadMenu();
$this->campaign = updatesCampaign();
if ($this->user->loggedin and !$this->user->checkRole('miserend')) {
$this->mychurches = feltoltes_block();
}
if ($this->user->checkRole('"any"')) {
$this->chat = chat_load();
}
$this->messages = getMessages();
$this->html = $twig->render($this->template, (array) $this);
}
开发者ID:kolesar-andras,项目名称:miserend.hu,代码行数:15,代码来源:Html.php
示例4: show_messages
function show_messages($target = "_global")
{
$mtypes = array("ERROR" => "danger", "WARN" => "warning", "OK" => "success");
foreach ($mtypes as $mt => $mcl) {
if (hasMessages($mt, $target)) {
$msgs = getMessages($mt, $target);
for ($i = 0; $i < count($msgs); $i++) {
?>
<div class="alert alert-<?php
echo $mcl;
?>
" role="alert"><?php
echo $msgs[$i];
?>
</div>
<?php
}
}
}
clearMessages($target);
}
开发者ID:kamilszewczyk,项目名称:magmi-git,代码行数:21,代码来源:message.php
示例5: run
public function run()
{
parent::run();
$this->getInputJson();
$newuser = new \User();
$validFields = array('username', 'email', 'password', 'nickname', 'name');
$fieldsToSubmit = array();
foreach ($validFields as $field) {
if ($this->input[$field] and $this->input[$field] != '') {
$fieldsToSubmit[$field] = $this->input[$field];
}
}
$success = $newuser->submit($fieldsToSubmit);
$messages = getMessages();
if (!$success) {
$exceptionTexts = array();
foreach ($messages as $message) {
$exceptionTexts[] = $message['text'];
}
throw new \Exception(implode("\n", $exceptionTexts));
}
}
开发者ID:kolesar-andras,项目名称:miserend.hu,代码行数:22,代码来源:Signup.php
示例6: exit
<?php
if (!defined('BASEPATH')) {
exit(__('No direct script access allowed'));
}
?>
<!-- START:: Global Messages | General Helper -->
<?php
echo getMessages();
?>
<!-- END:: Global Messages -->
<?php
/*
* TODO:: Below this is deprecated | To be removed after all file update finish
* Please use above method to get all global messages
*/
/*
if(!isset($error_message) || !is_array($error_message)) {$error_message = array();}
if(!isset($success_message) || !is_array($success_message)) {$success_message = array();}
if(count($success_message) > 0) { ?>
<div class="success"><?php
foreach($success_message as $v) { ?>
<p><?php echo "$v\n"; ?></p><?php
} ?>
</div><?php
}
if(count($error_message) > 0) { ?>
<div class="error"><?php
开发者ID:mashbro,项目名称:Codefight-CMS,代码行数:31,代码来源:message.php
示例7: header
<?php
$page_title = "Postkast";
$file_name = "messages.php";
require_once "../header.php";
require_once "functions.php";
if (!isset($_SESSION["logged_in_user_id"])) {
header("Location: login.php");
}
$messages = getMessages();
?>
<html>
<body>
<table border=1 >
<tr>
<th>Eesnimi</th>
<th>Perekonnanimi</th>
<th>Sõnum</th>
</tr>
<?php
//iga massiivis oleva elemendi kohta
//count($tasks) - massiivi pikkus
for ($i = 0; $i < count($messages); $i++) {
echo "<tr>";
//echo "<td>".$lectures[$i]->id."</td>";
echo "<td align=center>" . $messages[$i]->fname . "</td>";
echo "<td align=center>" . $messages[$i]->lname . "</td>";
echo "<td align=center>" . $messages[$i]->message . "</td>";
//echo "<td align=center>".$lectures[$i]->title."</td>";
//echo "<td><a href='tasks.php?lecture_id=".$messages[$i]->lectureid."'>".$lectures[$i]->lname."</a></td>";
开发者ID:Ken299,项目名称:3.kodutoo-II-ruhm,代码行数:31,代码来源:messages.php
示例8: authed
function authed($username)
{
if (!isset($username)) {
getMessages($_POST["username"], true);
echo "<br>sent msgs:<br>";
getMessages($_POST["username"] . ".sent", true, false);
} else {
getMessages($username, true);
echo "<br>sent msgs:<br>";
getMessages($username . ".sent", true, false);
}
if (isset($_POST["api"])) {
break;
}
include "form.php";
return true;
}
开发者ID:pielover88888,项目名称:account,代码行数:17,代码来源:index.php
示例9: add_photoAction
public function add_photoAction($id = null)
{
$userSession = $this->session->get('userSession');
$id = $userSession['id'];
$member = Members::findFirst($id);
if (!$member) {
$this->response->redirect('biz/add_photo/' . $userSession['id']);
}
$photos = MemberPhotos::find(array('member_id = "' . $id . '"', 'order' => 'id DESC'));
$this->view->setVars(['photos' => $photos, 'member' => $member]);
// POST
if ($this->request->isPost() && $this->request->hasFiles() == true) {
//ini_set('upload_max_filesize', '64M');
set_time_limit(1200);
$uploads = $this->request->getUploadedFiles();
$isUploaded = false;
#do a loop to handle each file individually
foreach ($uploads as $upload) {
#define a “unique” name and a path to where our file must go
$fileName = $upload->getname();
$fileInfo = new SplFileInfo($fileName);
$fileExt = $fileInfo->getExtension();
$fileExt = strtolower($fileExt);
$newFileName = substr(md5(uniqid(rand(), true)), 0, 10) . date('ymdhis') . '.' . $fileExt;
//$fileExt = $upload->getExtension();
$fileImageExt = array('jpeg', 'jpg', 'png');
//error_log("File Extension :".$fileExt, 0);
$fileType = '';
$filePath = '';
$path = '';
//$path = ''.$newFileName;
if (in_array($fileExt, $fileImageExt)) {
$path = 'img/member/' . $newFileName;
// img/business_member ?
$filePath = 'img/member/';
// img/business_member ?
//$fileType = 'Image';
}
#move the file and simultaneously check if everything was ok
$upload->moveTo($path) ? $isUploaded = true : ($isUploaded = false);
}
#if any file couldn't be moved, then throw an message
if ($isUploaded) {
$memberPhotos = new MemberPhotos();
$memberPhotos->created = date('Y-m-d H:i:s');
$memberPhotos->modified = date('Y-m-d H:i:s');
$memberPhotos->member_id = $userSession['id'];
$memberPhotos->file_path = $filePath;
$memberPhotos->filename = $newFileName;
$memberPhotos->caption = $this->request->getPost('caption');
if (count($photos) > 0) {
$memberPhotos->primary_pic = 'No';
} else {
$memberPhotos->primary_pic = 'Yes';
$userSession['primary_pic'] = $filePath . $newFileName;
$this->session->set('userSession', $userSession);
}
if ($memberPhotos->create()) {
return $this->response->redirect('biz/add_photo/' . $id);
} else {
// if member photos creation is failed.
$this->view->disable();
print_r($memberPhotos . getMessages());
}
}
}
}
开发者ID:hinjanobara,项目名称:mbimages,代码行数:67,代码来源:BizController.php
示例10: getMessages
$chatID_temp = $chatIDobj->fetch();
$chatID = $chatID_temp['chatID'];
?>
<table class="chatTable" id="Message_<?php
echo $chatID_temp['chatID'];
?>
" rows="31" cols="2" id='messageArea'>
<tr>
<td><?php
echo $firstname . " " . $lastname;
?>
</td>
<td>You</td>
</tr>
<?php
echo getMessages($chatID_temp);
?>
</table>
<input id="messageText" type="text" name="messageArea"></input>
<?php
echo "<button id='btn_send' onclick=sendMessage({$chatID}); > Send </button>";
} else {
echo "<p> No messages to display, say something! </p>";
}
} else {
echo "<p>derp</p>";
}
//gets all the messages between two people
function getMessages($chatID)
{
include 'db.php';
开发者ID:armandoluja,项目名称:dating_website_final_project,代码行数:31,代码来源:message.php
示例11: getMessages
<!-- sidebar -->
<?php
include 'templates/sidebar.php';
?>
<!-- End sidebar -->
<!-- mainContent -->
<div id="mainContent">
<div id="inboxList">
<ul>
<?php
getMessages();
?>
</ul>
</div><!-- End inboxList -->
</div>
<!-- End mainContent -->
<!-- sidebar2 -->
<?php
include 'templates/sidebar2.php';
?>
<!-- End sidebar2 -->
开发者ID:rashadrussell,项目名称:Code-Central,代码行数:29,代码来源:inbox.php
示例12: array
<?php
}
?>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<!-- Contents -->
<div style="height:4em"></div>
<div class="container">
<div class="row messages">
<?php
$message_types = array(MSG_TYPE_ERR => 'alert-danger', MSG_TYPE_WARN => 'alert-warning', MSG_TYPE_INFO => 'alert-info');
$fmt = '<div class="alert %s" role="alert">%s</div>';
foreach ($message_types as $message_type => $alert_class) {
$messages = getMessages($message_type);
foreach ($messages as $message) {
printf($fmt, $alert_class, $message);
}
}
?>
</div>
<div class="row theme-showcase" role="main">
<?php
print $contents;
?>
</div>
</div>
</body>
</html>
开发者ID:Hope-Consultants-International,项目名称:IC-Discuss,代码行数:30,代码来源:main.tpl.php
示例13: showMessage
function showMessage($mess)
{
if ($mess['last'] > (time() - 3600*24*28)) {
global $db;
global $maxDepth;
global $maxLen;
$id = $mess['ID'];
$poster = $mess['poster'];
$subject = $mess['subject'];
$time = gmdate('j F Y H:i:s T',$mess['time']);
$message = strip_tags($mess['message'],'<b><i><u><a><s><font>');
if (strlen($message) > $maxLen) {
$message = substr($message, 0, $maxLen - 20) . '[truncated]' . substr($message, -20);
}
$importance = $mess['importance'];
$reply_to = $mess['reply_to'];
$ip = $mess['ip'];
$replies = numberOfReplies($id);
global $depth;
$tempDepth = $depth;
$query = "SELECT * FROM `messages` WHERE `poster` = \"$poster\"";
$postCount = mysql_num_rows(mysql_query($query,$db));
?>
<div style="padding-left: <?= $depth*20 ?>px;">
<p>
<small>
<a href="<?= $_PHP_SELF ?>?post=<?= $id ?>&maxDepth=1">View <?= $replies ?> Direct Replies</a>
<a href="<?= $_PHP_SELF ?>?post=<?= $id ?>">Permanent link</a>
<a href="postreply.php?reply=<?= $id ?>">Reply</a>
</small>
<?php if($_COOKIE['admin']) {?>
<small><a href="deletepost.php?post=<?= $id ?>">Delete</a></small>
<small><a href="editpost.php?post=<?= $id ?>">Edit</a></small><br />
<? } ?>
<br />
<strong><?= str_repeat('*',$importance) ?> <?=$subject?> <?= str_repeat('*',$importance) ?></strong><br />
<em><!--(<?=$id?> <?=$depth?> <?=$postCount?>)-->Posted by <b><?=$poster?></b> at <b><?=$time?></b></em></p>
<p><?=$message?></p>
<hr/>
</div>
<?
if ($depth < $maxDepth || $maxDepth == 0) {
$messages = getMessages($id);
$rows = mysql_num_rows($messages);
$depth++;
for ($i = 0; $i < $rows; $i++) {
showMessage(mysql_fetch_assoc($messages));
}
$depth = $tempDepth;
}
}
}
开发者ID:jftsang,项目名称:anarchy-forum,代码行数:59,代码来源:index.php
示例14: _
if ($_SESSION[$guid]["i18n"]["dateFormatRegEx"] == "") {
print "/^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\\d\\d\$/i";
} else {
print $_SESSION[$guid]["i18n"]["dateFormatRegEx"];
}
?>
, failureMessage: "Use <?php
if ($_SESSION[$guid]["i18n"]["dateFormat"] == "") {
print "dd/mm/yyyy";
} else {
print $_SESSION[$guid]["i18n"]["dateFormat"];
}
?>
." } );
date.add(Validate.Presence);
</script>
<script type="text/javascript">
$(function() {
$( "#date" ).datepicker();
});
</script>
<input style='min-width: 30px; margin-top: 0px; float: right' type='submit' value='<?php
print _('Go');
?>
'>
<?php
print "</form>";
print "</div>";
print "</div>";
print getMessages($guid, $connection2, "print", dateConvert($guid, $date));
}
开发者ID:dpredster,项目名称:core,代码行数:31,代码来源:messageWall_view.php
示例15: list
<?php
/*
** Zabbix
** Copyright (C) 2001-2016 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
list($table, $info) = make_latest_issues($data['filter'], 'zabbix.php?action=dashboard.view');
$output = ['header' => _n('Last %1$d issue', 'Last %1$d issues', DEFAULT_LATEST_ISSUES_CNT), 'body' => (new CDiv([getMessages(), $table]))->toString(), 'footer' => (new CListItem($info))->toString() . (new CListItem(_s('Updated: %s', zbx_date2str(TIME_FORMAT_SECONDS))))->toString()];
if ($data['user']['debug_mode'] == GROUP_DEBUG_MODE_ENABLED) {
CProfiler::getInstance()->stop();
$output['debug'] = CProfiler::getInstance()->make()->toString();
}
echo (new CJson())->encode($output);
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:27,代码来源:monitoring.widget.issues.view.php
示例16: getNombreContact
$url = 'contact.php?admin=index';
//pour la pagination, on va compter le nombre de produits correspondant à notre requète
$nbMessage = getNombreContact();
//on souhaite 5 news par page, le nombre de page est égal au nombre de news total divisé par 5.
//dans la plupart des cas, on aura un réel. pas de possibilité d'avoir 2.6 pages, on rajoute une page au cas où ca ne tombe pas juste
$nbPages = (int) ($nbMessage / $contactParPage) + 1;
//on vérifie qu'au cas où le résultat tombe juste, on affiche pas une page en plus qui serait vide
if ($nbMessage % $contactParPage == 0) {
$nbPages = $nbPages - 1;
}
if (!isset($_GET['page'])) {
$_GET['page'] = '1';
}
// pas de pages --> page 1
//on transforme le numero de page en entier, si la variable page n'est pas un nombre, page sera égal à 0
if (isset($_GET['page'])) {
$page = (int) $_GET['page'];
}
//on vérifie maintenant que le numero de page existe bien
if (isset($page) and $page <= $nbPages and $page > 0) {
$contactArray = getMessages(($page - 1) * $contactParPage, $contactParPage);
include_once 'vue/contact/admin/index.php';
} else {
$js = false;
$redirect[0] = $url;
$redirect[1] = '3';
$page = 'admin';
$titreErreur = 'administration ~ contact - erreur';
$erreur = 'Aucun message ne se trouve sur cette page!';
include_once 'vue/erreur.php';
}
开发者ID:Rbeuque74,项目名称:boutiqueMvc,代码行数:31,代码来源:index.php
示例17: sendMessage
function sendMessage($chatId, $message, $sender, $reciever)
{
$message = htmlspecialchars($message);
setChatContacts($sender, $reciever);
$messages = getMessages();
$messages[$chatId][] = array('t' => date("H:i:s", time()), 'm' => $message);
shm_put_var(getMemoryId(), 0, json_encode($messages));
}
开发者ID:shylux,项目名称:TheLegendOfROOT,代码行数:8,代码来源:chathandler.php
示例18: calc
width: calc(100% - 270px);
font-family: Arial;
min-height: 40px;
display:inline-block;
color: yellow;
background: #6090e0;
text-align: right;
box-shadow: 2px 3px 10px #5080d0;
}
</style>
</head>
<body>
<div id="guest-desk">
<?php
if ($allMessages = getMessages($path)) {
?>
<?php
foreach ($allMessages as $data) {
?>
<div class="message">
<div>
<?php
echo $data['username'];
?>
<hr>
<small><?php
echo $data['date'];
?>
</small>
</div>
开发者ID:VyacheslavLynnyk,项目名称:php-academy.kiev.ua,代码行数:31,代码来源:index.php
示例19: session_start
session_start();
require_once 'global.php';
$database = new Database();
if (Tools::isLogged() && isset($_POST['mpcontenu'])) {
$conversationid = $_GET['mpid'];
$user = new User($_SESSION['login']);
// this is us
// create new mp
$database->newMP($user->getid(), $conversationid, $_POST['mpcontenu']);
// Set conversation as unread for all recipients
$recipients = $database->getConversationDest($user->getid(), $conversationid);
foreach ($recipients as $dest) {
$database->changeConversationReadStatus($conversationid, $dest[0], '1');
}
}
if (Tools::isLogged() && isset($_GET['mpid'])) {
$user = new User($_SESSION['login']);
$conversation = $database->getFullConversationByID($_GET['mpid']);
// if we are just looking at the conversation, get its posts
$database->changeConversationReadStatus($_GET['mpid'], $user->getid(), '0');
// make it read
}
Tools::callTwig('detailmp.twig', array('connected' => Tools::isLogged(), 'user' => $user, 'conversation' => getMessages($conversation, $user), 'conversationinfo' => getMessages($conversation, $user)[0]->getConversation()));
function getMessages($conversation, $user)
{
foreach ($conversation as $message) {
$messagesobj[] = new Message($message, $user);
}
return $messagesobj;
}
开发者ID:tcitworld,项目名称:FaceClone,代码行数:30,代码来源:detailmp.php
示例20: shareAlreadyUploadedFile
}
function shareAlreadyUploadedFile($id, $user)
{
$content = '{username|' . $user . '} {lang|' . "userUploadedFile" . '} {file|' . $id . '}.';
postMessage($content, 0);
}
//Escape all input
$_GET = escapeArray($_GET);
$_POST = escapeArray($_POST);
//Handle actions
if ($_GET['action'] == 'postMessage') {
postMessage($_POST['content'], $_SESSION['user']['id']);
} elseif ($_GET['action'] == 'getMessage') {
getMessage($_POST['id']);
} elseif ($_GET['action'] == 'getMessages') {
getMessages($_POST['lastReceivedId']);
} elseif ($_GET['action'] == 'getRecentMessages') {
getRecentMessages();
} elseif ($_GET['action'] == 'getNextMessages') {
getNextMessages($_POST['lastTimestamp']);
} elseif ($_GET['action'] == 'setStatus') {
setStatus($_SESSION['user']['id'], $_POST['status']);
} elseif ($_GET['action'] == 'logOn') {
logOn($_SESSION['user']['id']);
} elseif ($_GET['action'] == 'getAllUsers') {
getAllUsers();
} elseif ($_GET['action'] == 'editMessage') {
editMessage($_SESSION['user']['id'], $_POST['message'], $_POST['content']);
} elseif ($_GET['action'] == 'getAllEmoticons') {
getAllEmoticons();
} elseif ($_GET['action'] == 'getAllImages') {
开发者ID:perrr,项目名称:svada,代码行数:31,代码来源:data.php
注:本文中的getMessages函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论