本文整理汇总了PHP中get_messages函数的典型用法代码示例。如果您正苦于以下问题:PHP get_messages函数的具体用法?PHP get_messages怎么用?PHP get_messages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_messages函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_all
function get_all($mysqli, $friend_ids)
{
if (!isset($_SESSION)) {
session_start();
}
if (!isset($_SESSION["id"]) || !valid_friends($friend_ids)) {
die("[]");
}
$my_id = $_SESSION["id"];
$friend_ids[] = $my_id;
$ids = $friend_ids;
sort($ids);
$room_id = get_room_id($mysqli, $ids);
return get_messages($mysqli, $room_id);
}
示例2: draw_message_box
function draw_message_box() {
$messages = get_messages();
while ($message = $messages->fetch_array()){
?><div class="mssg_text"><b>
<?php
echo '<div class=';
if ($message['user_id']==$_SESSION['user_id'])
echo 'mssg-self';
else if ($message['user_id']==get_team_leader())
echo 'mssg-tl';
echo '>';
echo ucfirst($message['fname']).' ';
echo ucfirst($message['lname']);
echo '</div>';
?></b>
<?php
echo '<BR>'.$message['message'];
echo '<BR></div><P>';
}
}
示例3: mysql_query
mysql_query($sql);
break;
case "list":
$password = $_GET["password"];
if (empty($password)) {
break;
}
#Check password.
$password = mysql_real_escape_string($password);
$node = get_node($node_id);
if ($node == FALSE) {
break;
}
if ($node["password"] != $password) {
break;
}
#Get messages.
$messages = get_messages($node_id);
#Delete old messages.
$node_id = mysql_real_escape_string($node_id);
$sql = "DELETE FROM `messages` WHERE `node_id`='{$node_id}'";
mysql_query($sql);
#Return messages as JSON.
echo json_encode($messages);
break;
default:
break;
}
}
//All done.
mysql_close($con);
示例4: forgot
/**
* The forgot password page
*/
public function forgot()
{
//Redirect if logged in
$this->load->model('User_model');
if ($this->User_model->checkSession()) {
redirect('user/index');
}
//Check for post
if ($this->input->post()) {
$form = $this->input->post(NULL, TRUE);
//Check if email is unique
$this->load->helper('email');
//Check email
if (!valid_email($form['email'])) {
set_message("The email that you have entered is not Invalid", 'error');
} else {
$email = check_plain($form['email']);
//Based on email generate new login url token
$this->load->model('User_model');
$this->load->model('Mail_model');
$user = $this->User_model->loadFromMail($email);
if ($user && $user->uid) {
//Generate new token and add to system
$token = $this->User_model->addUrlToken($user);
//Send email
$this->Mail_model->forgotMail($user, array('token' => $token));
set_message("Check your mail to Reset your password");
} else {
set_message("We dont have records for the email that you have given", 'error');
}
}
}
$this->load->view('include/header', array('scripts' => array('assets/js/register.js')));
$data['messages'] = get_messages();
$this->load->view('templates/forgot', $data);
//Show Footer
$this->load->view('include/footer');
}
示例5: header
<?php
$max = 5;
if (!isset($_SESSION['pseudo'])) {
header('location: ../');
} else {
include_once 'model/messagerie/get_messages.php';
include_once 'model/messagerie/get_nb_messages.php';
if (array_key_exists('goto', $_GET)) {
if ($_GET['goto'] < 1) {
$pageact = 1;
} else {
$pageact = $_GET['goto'];
}
} else {
$pageact = 1;
}
$messages = get_messages($_SESSION['pseudo'], $pageact, $max);
$nb_total = get_nb_messages($_SESSION['pseudo']);
include 'view/messagerie/index.php';
}
示例6: in
$delete = in('delete');
$message_sent_to = null;
// Sending mail section.
if ($message && $messenger) {
if ($to_clan && $has_clan) {
$message_sent_to = message_to_clan($message);
} elseif (!!$target_id) {
send_message($user_id, $target_id, $message);
$message_sent_to = $to;
// (
}
}
if ($delete) {
delete_messages();
}
$messages = get_messages($user_id, $limit, $offset);
$message_count = message_count();
$pages = ceil($message_count / $limit);
// Total pages.
//$current_page = floor(($message_count/$limit) - $limit); //
$nav = render_message_nav($page, $pages, $limit);
read_messages($user_id);
// mark messages as read for next viewing.
// TODO: Handle "send" and "deletion";
$message_list = '';
if (!empty($messages)) {
foreach ($messages as $loop_message) {
$loop_message['message'] = out($loop_message['message']);
$message_list .= render_template('single_message.tpl', array('message' => $loop_message));
}
}
示例7: define
define("context", "weblog");
// You must be logged on to view this!
protect(1);
templates_page_setup();
cleanup_messages(time() - 86400 * 30);
$title = run("profile:display:name") . " :: " . __gettext("Recent activity");
// If we haven't specified a start time, start time = 1 day ago
$starttime = optional_param('starttime', time() - 86400, PARAM_INT);
$body = "<p>" . __gettext("Currently viewing recent activity since ") . gmstrftime("%B %d, %Y", $starttime) . ".</p>";
$body .= "<p>" . __gettext("You may view recent activity during the following time-frames:") . "</p>";
$body .= "<ul><li><a href=\"index.php?starttime=" . (time() - 86400) . "\">" . __gettext("The last 24 hours") . "</a></li>";
$body .= "<li><a href=\"index.php?starttime=" . (time() - 86400 * 2) . "\">" . __gettext("The last 48 hours") . "</a></li>";
$body .= "<li><a href=\"index.php?starttime=" . (time() - 86400 * 7) . "\">" . __gettext("The last week") . "</a></li>";
$body .= "<li><a href=\"index.php?starttime=" . (time() - 86400 * 30) . "\">" . __gettext("The last month") . "</a></li></ul>";
$body .= "<h2>" . __gettext("Your recent messages") . "</h2>";
$user_messages = get_messages($page_owner, null, time() - $starttime);
if (is_array($user_messages) && !empty($user_messages)) {
foreach ($user_messages as $user_message) {
$body .= "<div class=\"user_message\">" . display_message($user_message) . "</div>";
}
}
$body .= "<h2>" . __gettext("Activity on weblog posts you have marked as interesting") . "</h2>";
if ($activities = get_records_sql('SELECT wc.*, u.username, u.name as weblogname, wp.weblog, wp.ident AS weblogpost, wp.title AS weblogtitle, wp.weblog AS weblog
FROM ' . $CFG->prefix . 'weblog_comments wc
LEFT JOIN ' . $CFG->prefix . 'weblog_watchlist wl ON wl.weblog_post = wc.post_id
LEFT JOIN ' . $CFG->prefix . 'weblog_posts wp ON wp.ident = wc.post_id
LEFT JOIN ' . $CFG->prefix . 'users u ON u.ident = wp.weblog
WHERE wc.posted > ? AND wl.owner = ?
ORDER BY wc.posted DESC', array($starttime, $page_owner))) {
foreach ($activities as $activity) {
$commentbody = stripslashes($activity->body);
示例8: startup
<?php
//Подключение модулей
include 'startup.php';
include 'model.php';
//Подготовка
startup();
//Была отправка формы?
if (!empty($_POST)) {
send_message($_POST['category'], $_POST['link'], $_POST['description'], $_POST['comment']);
//header('Location: index.php'); /* Если убрать эту строчку то вы дублируете запрос методом пост при перезагрузке. т.е. при перезагрузке страницы постоянно будут идти последние сообщения пользователя */
//exit();
}
$messages = get_messages();
?>
<!-- //<?php
/* Файл с этого сайта = http://objectone.ru/ */
?>
-->
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Минимальный каркас странички</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row">
示例9: insert_message
<?php
include "../model/msgdb.php";
if ($_POST['method'] == "insert") {
insert_message();
}
if ($_POST['method'] == "getall") {
get_messages();
}
示例10: database_init
</head>
<body>
<h1>Pompiedom</h1>
<div style="width:600px">
<p style="float:left">What are you doing?</p><span style="color:#888;float:right;font-size:33pt" id="counter"></span>
<form action="/status/admin/post.php" method="post">
<textarea name='message' rows='2' cols='55' id='status'></textarea><br/>
<input type='submit' value='Update' />
</form>
<?
require_once '../../../inc/database.inc.php';
$link = database_init();
$messages = get_messages($link);
foreach ($messages as $message) {
?>
<p><?php
echo $message['message'];
?>
</p>
<p class="info">Posted by <? echo USERNAME ?> on <span class="created"><?php
echo $message['created'];
?>
</p>
<? } ?>
</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
示例11: round
if (isset($ltime)) {
$time_diff = round($ltime / 1000) - $_SERVER['REQUEST_TIME'];
$c['time_diff'] = $time_diff;
set_timediff($time_diff, $username);
} else {
$time_diff = $c['time_diff'];
}
if (isset($message)) {
$message = mysql_real_escape_string($message);
$recepient = mysql_real_escape_string($recepient);
send_message($recepient, $message, $username);
}
if (isset($solution)) {
send_solution($solution, $username);
}
$c['messages'] = get_messages($self);
$usersonline = userlist($username);
$c['usersonline'] = $usersonline;
$cond = give_conditions($username);
$c['cond'] = $cond;
/// Stop changing the session variable, compare it to the old state, generate a response and save in DB
$c['md5_hash'] = '';
$c_old['md5_hash'] = '';
$old_session_hash = md5(serialize($c_old));
$new_session_hash = md5(serialize($c));
//if (isset($_GET['last_seen_session_hash']) and $_GET['last_seen_session_hash'] != $old_session_hash) {
// $sql = "select ses_value from session_buffer where ses_hash = '".$_GET['last_seen_session_hash']."'";
// $q = mysql_query($sql);
// if (mysql_num_rows($q)>0) $c_old = mysql_result($q,0);
//}
$c_old['md5_hash'] = $old_session_hash;
示例12: url
?>
<div class="row margin-bottom-20">
<div class="col-md-12 text-right">
<a href="<?php
echo url();
?>
/logout" class="btn btn-primary btn-sm" id="js-link-logout">logout</a>
</div>
</div>
<?php
}
?>
<?php
if (has_messages()) {
foreach (get_messages() as $message) {
?>
<div class="row">
<div class="col-md-12">
<div class="alert alert-info alert-dismissible fade in" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<strong>Message:</strong> <?php
echo $message;
?>
</div>
</div>
</div>
<?php
}
示例13: define
define("USER_FILE", "user.txt");
// define icon set directory
//define("ICON_SET", "smiley_fuge_icons");
//define("ICON_SET", "smiley_onigiri_riceballs");
define("ICON_SET", "smiley_the_glassy");
$icons = array(":-)" => array("file" => "smiley.png", "tooltip" => "Lächeln"), ":)" => array("file" => "smiley.png", "tooltip" => "Lächeln"), ";-)" => array("file" => "smiley-wink.png", "tooltip" => "Zwinkern"), ";)" => array("file" => "smiley-wink.png", "tooltip" => "Zwinkern"), ":-D" => array("file" => "smiley-grin.png", "tooltip" => "Grinsen"), ":D" => array("file" => "smiley-grin.png", "tooltip" => "Grinsen"), ":-(" => array("file" => "smiley-sad.png", "tooltip" => "Traurig"), ":(" => array("file" => "smiley-sad.png", "tooltip" => "Traurig"), ";-(" => array("file" => "smiley-cry.png", "tooltip" => "Weinen"), ";(" => array("file" => "smiley-cry.png", "tooltip" => "Weinen"), ":-O" => array("file" => "smiley-yell.png", "tooltip" => "Schreien"), ":O" => array("file" => "smiley-yell.png", "tooltip" => "Schreien"), ">-(" => array("file" => "smiley-mad.png", "tooltip" => "Sauer"), ">(" => array("file" => "smiley-mad.png", "tooltip" => "Sauer"), ":-@" => array("file" => "smiley-evil.png", "tooltip" => "Wütend"), ":@" => array("file" => "smiley-evil.png", "tooltip" => "Wütend"), ">-@" => array("file" => "smiley-twist.png", "tooltip" => "Zornig"), ">@" => array("file" => "smiley-twist.png", "tooltip" => "Zornig"), ":-o" => array("file" => "smiley-frighten.png", "tooltip" => "Erschrocken"), ":o" => array("file" => "smiley-frighten.png", "tooltip" => "Erschrocken"), ":-P" => array("file" => "smiley-razz.png", "tooltip" => "Zunge raustrecken"), ":P" => array("file" => "smiley-razz.png", "tooltip" => "Zunge raustrecken"), ":-X" => array("file" => "smiley-kiss.png", "tooltip" => "Küssen"), ":X" => array("file" => "smiley-kiss.png", "tooltip" => "Küssen"), "8-|" => array("file" => "smiley-roll.png", "tooltip" => "Ironisch"), "8|" => array("file" => "smiley-roll.png", "tooltip" => "Ironisch"), "B-)" => array("file" => "smiley-cool.png", "tooltip" => "Cool"), "B)" => array("file" => "smiley-cool.png", "tooltip" => "Cool"), ":-#" => array("file" => "smiley-zipper.png", "tooltip" => "Schweigen"), ":#" => array("file" => "smiley-zipper.png", "tooltip" => "Schweigen"), ":-§" => array("file" => "smiley-red.png", "tooltip" => "Verlegen"), ":§" => array("file" => "smiley-red.png", "tooltip" => "Verlegen"), "O:)" => array("file" => "smiley-angel.png", "tooltip" => "Unschuldig"), "O)" => array("file" => "smiley-angel.png", "tooltip" => "Unschuldig"), ":-Z" => array("file" => "smiley-sleep.png", "tooltip" => "Schlafen"), ":Z" => array("file" => "smiley-sleep.png", "tooltip" => "Schlafen"), ":-/" => array("file" => "smiley-confuse.png", "tooltip" => "Verwirrt"), ":/" => array("file" => "smiley-confuse.png", "tooltip" => "Verwirrt"), "\$-)" => array("file" => "smiley-money.png", "tooltip" => "Geldgierig"), "\$)" => array("file" => "smiley-money.png", "tooltip" => "Geldgierig"), "ccd" => array("file" => "thumb-up.png", "tooltip" => "Daumen hoch"), "cd" => array("file" => "thumb-up.png", "tooltip" => "Daumen hoch"), "ccq" => array("file" => "thumb-down.png", "tooltip" => "Daumen runter"), "cq" => array("file" => "thumb-down.png", "tooltip" => "Daumen runter"));
// perform as requested by GET
if ($_GET['action'] && $_SESSION['auth'] == true) {
switch ($_GET['action']) {
case 'logout':
remove_user($_SESSION['name']);
session_destroy();
header("Location: " . $_SERVER['PHP_SELF']);
break;
case 'get_messages':
echo get_messages($_SESSION['last_action']);
die;
break;
/*case 'get_userlist':
echo get_userlist();
die;
break;*/
}
}
// message was sent, write to file
if ($_POST['msg'] && $_SESSION['auth'] == true) {
write_message(microtime_float(), $_SESSION['name'], htmlspecialchars($_POST['msg']));
die;
}
// check if login is valid
if ($_GET['name'] && $_GET['password'] && $_SESSION['auth'] != true) {
示例14: get_message_preview
function get_message_preview($binding, $id)
{
$messages = get_messages($binding, $id, false, true);
if ($messages) {
return $messages[0]->preview_url;
} else {
return null;
}
}
示例15: EST
Date
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="3">All times are in EST (UTC-05:00)</td>
</tr>
</tfoot>
<tbody>
<?php
$Alert_Id = '';
if (isset($_GET['Alert_Id'])) {
$Alert_Id = $_GET['Alert_Id'];
}
$posts = get_messages($params, $Alert_Id);
foreach ($posts as $post) {
$Extra_Classes = '';
$Alerts_Id = get_post_meta($post->ID, 'Edd_Alert_Id', true);
if (isset($_GET['Alert_Id']) && $_GET['Alert_Id'] == $Alerts_Id) {
$Extra_Classes = 'active_alert';
$Alert_Post_Id = get_alert_id_by_meta_value($Alerts_Id);
if (get_post_meta($Alert_Post_Id, 'Is_Alert_Read', true) == '') {
echo "<script>\$(function(){ Edd.collaboration.Alerts.Read('" . $Alert_Post_Id . "'); });</script>";
update_post_meta($Alert_Post_Id, 'Is_Alert_Read', 'YES', false);
}
}
?>
<tr class="odd <?php
echo $Extra_Classes;
?>