@@ -83,9 +83,9 @@ discard block |
||
| 83 | 83 | $this->onlyUser(); |
| 84 | 84 | |
| 85 | 85 | //get the session userId |
| 86 | - $userId = (int)$this->session->get("userId"); |
|
| 86 | + $userId = (int) $this->session->get("userId"); |
|
| 87 | 87 | $comment = $this->request->getData("newComment"); |
| 88 | - $postId = (int)$this->request->getData("postId"); |
|
| 88 | + $postId = (int) $this->request->getData("postId"); |
|
| 89 | 89 | |
| 90 | 90 | //check if we are admin, Admins do not need moderation |
| 91 | 91 | $admin = $this->session->get('user_role_level') >= Constant::ADMIN_LEVEL; |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | $siteConfig = $this->siteConfig->getSiteConfig(); |
| 102 | 102 | $post = $this->postModel->getSinglePost($postId); |
| 103 | 103 | |
| 104 | - $emailMessage = "<h1>New comment on post " . $post->title . "</a></h1>"; |
|
| 105 | - $emailMessage .= "<p>Check it out <a href='" . $baseUrl . "admin/comments/moderate-comment/" . $commentId . "'>here</a> </p>"; |
|
| 104 | + $emailMessage = "<h1>New comment on post ".$post->title."</a></h1>"; |
|
| 105 | + $emailMessage .= "<p>Check it out <a href='".$baseUrl."admin/comments/moderate-comment/".$commentId."'>here</a> </p>"; |
|
| 106 | 106 | |
| 107 | 107 | $this->sendMail->send($siteConfig["admin_email_address"], "New comment added", $emailMessage); |
| 108 | 108 | |
@@ -96,9 +96,11 @@ |
||
| 96 | 96 | $baseUrl = $this->request->getBaseUrl(); |
| 97 | 97 | $redirectUrl = $this->removeFromBeginning($refererUrl, $baseUrl); |
| 98 | 98 | |
| 99 | - if (!$admin) //if we are not an admin, send an email to alert and add an alertBox |
|
| 99 | + if (!$admin) { |
|
| 100 | + //if we are not an admin, send an email to alert and add an alertBox |
|
| 100 | 101 | { |
| 101 | 102 | $siteConfig = $this->siteConfig->getSiteConfig(); |
| 103 | + } |
|
| 102 | 104 | $post = $this->postModel->getSinglePost($postId); |
| 103 | 105 | |
| 104 | 106 | $emailMessage = "<h1>New comment on post " . $post->title . "</a></h1>"; |