當前位置: 首頁>>代碼示例>>PHP>>正文


PHP comment::find方法代碼示例

本文整理匯總了PHP中comment::find方法的典型用法代碼示例。如果您正苦於以下問題:PHP comment::find方法的具體用法?PHP comment::find怎麽用?PHP comment::find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在comment的用法示例。


在下文中一共展示了comment::find方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: adminNotify

 public function adminNotify()
 {
     if ($this->cookie->check("id_user") and $this->cookie->id_user == 1) {
         //no notificamos a administrador de su propio comentario.
         return;
     }
     $id = $this->registry->lastCommentID;
     $Comment = new comment();
     $comment = $Comment->find($id);
     $comment['content'] = utils::nl2br($comment['content']);
     if (!defined('GESHI_VERSION')) {
         $comment['content'] = $this->comment_source_code_beautifier($comment['content'], 'addTagPRE');
     } else {
         $comment['content'] = $this->comment_source_code_beautifier($comment['content']);
     }
     $User = new user();
     $user = $User->find(1);
     $Post = new post();
     $post = $Post->find($comment['ID_post']);
     $commentsWaiting = $Comment->countCommentsByPost(null, 'waiting');
     $mailStr = "\n\t\t\t<table width=\"100%\">\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<small>\n\t\t\t\t\t\t<strong>From IP</strong>: {$comment['IP']}<br />\n\t\t\t\t\t\t<strong>URL</strong>: <a href=\"{$comment['url']}\">{$comment['url']}</a><br />\n\t\t\t\t\t\t<strong>Email</strong>: <a href=\"mailto:{$comment['email']}\">{$comment['email']}</a><br />\n\t\t\t\t\t\t<strong>DateTime</strong>: {$comment['created']}<br />\n\t\t\t\t\t</small>\n\t\t\t\t\t<hr>\n\t\t\t\t\t<strong>Author</strong>: {$comment['author']}<br />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t\n\t\t\t<tr><td><strong>Content</strong></td></tr>\n\t\t\t<tr><td bgcolor=\"#f7f7f7\">\n\t\t\t\t{$comment['content']}\n\t\t\t\t<hr />\n\t\t\t</td></tr>\n\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tModerate comment: <a href=\"{$this->registry->path}comments/edit/{$comment['ID']}\">{$this->registry->path}comments/edit/{$comment['ID']}</a><br />\n\t\t\t\t\t\tView entry: <a href=\"{$this->registry->path}{$post['urlfriendly']}\">{$this->registry->path}{$post['urlfriendly']}</a>\n\t\t\t\t\t</p>\n\t\t\n\t\t\t\t\t<p>\n\t\t\t\t\t\tThere are {$commentsWaiting} comments waiting for approbal. <br />\n\t\t\t\t\t\tPlease moderate comments: <a href=\"{$this->registry->path}comments/waiting\">{$this->registry->path}comments</a>\n\t\t\t\t\t</p>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t\n\t\t\t</table>\n\t\t";
     $conf = $this->registry->conf;
     $subject = "[{$conf['blog_name']}] Nuevo Comentario en: {$post['title']}";
     $this->enviaMail($user['email'], $subject, $mailStr, $user['email']);
 }
開發者ID:ravenlp,項目名稱:CodiceCMS,代碼行數:25,代碼來源:commentNotify.plugin.php

示例2: ban

 /**
  * Report a comment as spam and remove it from the database.
  *
  * @param   string     $hash  Unique hash value of the parent page.
  * @param   integer    $id    Id of the comment to retrieve.
  *
  * @return  Response
  */
 public function ban($hash, $id)
 {
     $page = $this->findPageByHash($hash);
     $comment = comment::find($id);
     $this->reportSpam($comment);
     return $this->delete($hash, $id);
 }
開發者ID:buditanrim,項目名稱:kirby-comments,代碼行數:15,代碼來源:comment.php

示例3: show

 public function show($id)
 {
     $comment = comment::find($id);
     return view('comment.show', compact('comment'));
 }
開發者ID:rowlin,項目名稱:gostin-mayak.ru,代碼行數:5,代碼來源:CommentController.php

示例4: approve

 public function approve($id)
 {
     $Comment = new comment();
     $Comment->find($id);
     if ($Comment['type'] == 'pingback' or $Comment['type'] == 'trackback') {
         $Comment->setPingback();
     }
     $Comment['status'] = 'publish';
     $Comment->save();
     $this->registry->lastCommentID = $id;
     $this->plugin->call("comment_approbed");
     if ($this->isAjax()) {
         echo $id;
     } else {
         $this->redirect("comments");
     }
 }
開發者ID:ravenlp,項目名稱:CodiceCMS,代碼行數:17,代碼來源:comments_controller.php

示例5: array

 * @var  array
 */
return array('auth' => function () {
    if (!user::current() || !user::current()->isAdmin()) {
        redirect::to('plugin/comments/wizard');
    }
}, 'installed' => function () {
    if ($this->isInstalled()) {
        redirect::home();
    }
}, 'userCanCreate' => function () {
    $route = plugin('comments')->route();
    $hash = a::first($route->arguments());
    $page = site()->index()->findBy('hash', $hash);
    return $page instanceof Page && $page->isVisible();
}, 'userCanRead' => function () {
    $route = plugin('comments')->route();
    $hash = a::first($route->arguments());
    $page = site()->index()->findBy('hash', $hash);
    return $page instanceof Page && $page->isVisible();
}, 'userCanUpdate' => function () {
    $route = plugin('comments')->route();
    $id = a::last($route->arguments());
    $comment = comment::find($id);
    return $comment instanceof Comment && $comment->currentUserCan('update');
}, 'userCanDelete' => function () {
    $route = plugin('comments')->route();
    $id = a::last($route->arguments());
    $comment = comment::find($id);
    return $comment instanceof Comment && $comment->currentUserCan('delete');
});
開發者ID:buditanrim,項目名稱:kirby-comments,代碼行數:31,代碼來源:filters.php

示例6: getComments

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getComments($id)
 {
     $query = comment::find()->where(['item_id' => $id]);
     $dataProvider = new ActiveDataProvider(['query' => $query->from('comment')]);
     return $dataProvider;
 }
開發者ID:koakumasd,項目名稱:shop,代碼行數:9,代碼來源:Comment.php

示例7: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $comment = comment::find($id);
     if ($comment->author_id == Auth::user()->id) {
         $comment->delete();
         return redirect()->action('Insertions\\PostsController@index');
     } else {
         return view('errors.503');
     }
 }
開發者ID:aArenar54rus,項目名稱:bookcross,代碼行數:16,代碼來源:CommentsController.php


注:本文中的comment::find方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。