本文整理汇总了PHP中Notifications::addComment方法的典型用法代码示例。如果您正苦于以下问题:PHP Notifications::addComment方法的具体用法?PHP Notifications::addComment怎么用?PHP Notifications::addComment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notifications
的用法示例。
在下文中一共展示了Notifications::addComment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Notifications
<?php
$pagetitle = "Request an Exam Token";
require_once "includes/header.php";
$n = new Notifications();
if (Input::exists()) {
try {
$rat = $user->data()->rating;
if ($rat > 0 && $rat < 5) {
$rating = $t->getRating(++$rat);
}
if (!$n->exists(1, $user->data()->id)) {
$id = $n->add(array('type' => 1, 'from' => $user->data()->id, 'to_type' => 1, 'to' => 3, 'submitted' => date("Y-m-d H:i:s"), 'status' => 0));
$comment = $n->addComment(array('notification_id' => $id, 'submitted' => date("Y-m-d H:i:s"), 'submitted_by' => 0, 'text' => '<p>ATSimTest Theory token requested.</p><p><strong>Next Rating: </strong>' . $rating->short . ' (' . $rating->long . ')</p><p><strong>Admin Link: </strong><a target="_blank" class="btn btn-xs btn-primary" href="https://www.atsimtest.com/index.php?cmd=admin&sub=memberdetail&memberid=' . $user->data()->id . '">ATSimTest</a></p>'));
Session::flash('success', 'A theory token has been requested. Please allow 24 hours.');
Redirect::to('./index.php');
}
} catch (Exception $e) {
echo $e->getMessage();
}
}
?>
<h3 class="text-center">My ATSimTest Token</h3><br>
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-primary">
<div class="panel-heading">ATSimTest Token</div>
<div class="panel-body text-center">
示例2: Notifications
<?php
$pagetitle = 'Add Notification';
require_once "../includes/header.php";
$n = new Notifications();
if ($n->getNotification(Input::get('id'), $user->data()->id)) {
if (isset($_POST['text'])) {
$add = $n->addComment(['notification_id' => Input::get('id'), 'submitted' => date("Y-m-d H:i:s"), 'submitted_by' => $user->data()->id, 'text' => Input::get('text')]);
Session::flash('success', 'Comment added.');
} else {
Session::flash('error', 'No text entered.');
}
} else {
Session::flash('error', 'Comment could not be added.');
}
Redirect::to('./view.php?id=' . Input::get('id'));