当前位置: 首页>>代码示例>>PHP>>正文


PHP Comments::edit方法代码示例

本文整理汇总了PHP中Comments::edit方法的典型用法代码示例。如果您正苦于以下问题:PHP Comments::edit方法的具体用法?PHP Comments::edit怎么用?PHP Comments::edit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Comments的用法示例。


在下文中一共展示了Comments::edit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: authorize

<?php

authorize();
if (!isset($_POST['postid']) || !is_number($_POST['postid']) || !isset($_POST['body']) || trim($_POST['body']) === '') {
    error(0);
}
if ($LoggedUser['DisablePosting']) {
    error('Your posting privileges have been removed.');
}
$SendPM = isset($_POST['pm']) && $_POST['pm'];
Comments::edit((int) $_POST['postid'], $_POST['body'], $SendPM);
// This gets sent to the browser, which echoes it in place of the old body
echo Text::full_format($_POST['body']);
开发者ID:Kufirc,项目名称:Gazelle,代码行数:13,代码来源:take_edit.php

示例2: function

/*
 * Comment component
 */
Route::get('comments/paginate/{foreignType}/{foreignId}', function ($foreignType, $foreignId) {
    return Comments::paginate($foreignType, $foreignId)->setPath(Request::url());
});
Route::post('comments/store', ['as' => 'comments.store', 'middleware' => 'csrf', 'uses' => function () {
    $foreignType = Input::get('foreigntype');
    $foreignId = Input::get('foreignid');
    return Comments::store($foreignType, $foreignId);
}]);
Route::get('comments/{id}', function ($id) {
    return Comments::get($id);
});
Route::get('comments/{id}/edit', ['as' => 'comments.edit', 'uses' => function ($id) {
    return Comments::edit($id);
}]);
Route::put('comments/{id}/update', ['as' => 'comments.update', 'middleware' => 'csrf', 'uses' => function ($id) {
    return Comments::update($id);
}]);
Route::delete('comments/{id}/delete', ['as' => 'comments.delete', 'middleware' => 'csrf', 'uses' => function ($id) {
    return Comments::delete($id);
}]);
/*
 * Ratings
 */
Route::post('ratings/store', ['as' => 'ratings.store', 'middleware' => 'csrf', 'uses' => function () {
    $foreignType = Input::get('foreigntype');
    $foreignId = Input::get('foreignid');
    return Ratings::store($foreignType, $foreignId);
}]);
开发者ID:chirilo,项目名称:Contentify,代码行数:31,代码来源:routes.php

示例3: error

$PrivateMessage = $_POST['privatemessage'];
$Body = $_POST['body'];
$Length = $_POST['length'];
$PostID = (int) $_POST['postid'];
$DB->query("\n\tSELECT AuthorID\n\tFROM comments\n\tWHERE ID = {$PostID}");
if (!$DB->has_results()) {
    error(404);
}
list($AuthorID) = $DB->next_record();
$UserInfo = Users::user_info($AuthorID);
if ($UserInfo['Class'] > $LoggedUser['Class']) {
    error(403);
}
$URL = site_url() . Comments::get_url_query($PostID);
if ($Length !== 'verbal') {
    $Time = (int) $Length * (7 * 24 * 60 * 60);
    Tools::warn_user($AuthorID, $Time, "{$URL} - {$Reason}");
    $Subject = 'You have received a warning';
    $PrivateMessage = "You have received a {$Length} week warning for [url={$URL}]this comment[/url].\n\n[quote]{$PrivateMessage}[/quote]";
    $WarnTime = time_plus($Time);
    $AdminComment = date('Y-m-d') . " - Warned until {$WarnTime} by " . $LoggedUser['Username'] . "\nReason: {$URL} - {$Reason}\n\n";
} else {
    $Subject = 'You have received a verbal warning';
    $PrivateMessage = "You have received a verbal warning for [url={$URL}]this comment[/url].\n\n[quote]{$PrivateMessage}[/quote]";
    $AdminComment = date('Y-m-d') . ' - Verbally warned by ' . $LoggedUser['Username'] . " for {$URL}\nReason: {$Reason}\n\n";
    Tools::update_user_notes($AuthorID, $AdminComment);
}
$DB->query("\n\tINSERT INTO users_warnings_forums\n\t\t(UserID, Comment)\n\tVALUES\n\t\t('{$AuthorID}', '" . db_string($AdminComment) . "')\n\tON DUPLICATE KEY UPDATE\n\t\tComment = CONCAT('" . db_string($AdminComment) . "', Comment)");
Misc::send_pm($AuthorID, $LoggedUser['ID'], $Subject, $PrivateMessage);
Comments::edit($PostID, $Body);
header("Location: {$URL}");
开发者ID:Kufirc,项目名称:Gazelle,代码行数:31,代码来源:take_warn.php


注:本文中的Comments::edit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。