summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/helpers/comment_event.php27
-rw-r--r--modules/comment/views/comments.html.php2
2 files changed, 15 insertions, 14 deletions
diff --git a/modules/comment/helpers/comment_event.php b/modules/comment/helpers/comment_event.php
index ddf72e3c..a72102b9 100644
--- a/modules/comment/helpers/comment_event.php
+++ b/modules/comment/helpers/comment_event.php
@@ -24,23 +24,24 @@ class comment_event_Core {
static function user_deleted($user) {
$guest = identity::guest();
- Database::instance()
- ->query("UPDATE {comments}
- SET author_id = {$guest->id},
- guest_email = NULL,
- guest_name = 'guest',
- guest_url = NULL
- WHERE author_id = {$user->id}");
+ Database::instance()->from("comments")
+ ->set(array("author_id" => $guest->id,
+ "guest_email" => null,
+ "guest_name" => "guest",
+ "guest_url" => null))
+ ->where(array("author_id" => $user->id))
+ ->update();
}
static function identity_provider_changed($old_provider, $new_provider) {
$guest = identity::guest();
- Database::instance()
- ->query("UPDATE {comments}
- SET author_id = {$guest->id},
- guest_email = NULL,
- guest_name = 'guest',
- guest_url = null");
+ Database::instance()->from("comments")
+ ->set(array("author_id" => $guest->id,
+ "guest_email" => null,
+ "guest_name" => "guest",
+ "guest_url" => null))
+ ->where("1 = 1")
+ ->update();
}
static function admin_menu($menu, $theme) {
diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php
index 636f1522..fc54e3d2 100644
--- a/modules/comment/views/comments.html.php
+++ b/modules/comment/views/comments.html.php
@@ -1,5 +1,5 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
- <a href="<?= url::site("form/add/comments/{$item->id})") ?>" id="g-admin-comment-button"
+ <a href="<?= url::site("form/add/comments/{$item->id}") ?>" id="g-admin-comment-button"
class="g-button ui-corner-all ui-icon-left ui-state-default right">
<span class="ui-icon ui-icon-comment"></span>
<?= t("Add a comment") ?>