*/ echo ipSlot('showComments'); ?> <div class="containerForm"> <?php echo '<div class="coFormTitle">' . __('Write a comment', 'Comments') . '</div>'; ?> <div class="commentSuccess input-group hidden"> <div id="cCloseBtn" class="commentCloseBtn"><?php echo __('Close', 'Comments'); ?> </div> <div><?php echo __('Your comment has been sent and it is awaiting moderation. Thank you.', 'Comments'); ?> </div> </div> <?php if (ipGetOption('Comments.requireLogin') == 'Yes') { if (ipUser()->loggedIn()) { echo $form->render(); } else { $curLink = ipContent()->getCurrentPage()->getLink(); $_SESSION['User_redirectAfterLogin'] = $curLink; echo '<a style="text-decoration:none" href="' . ipRouteUrl('User_login') . '" class="button warning">' . __('Please, Login for comment', 'Comments') . '</a>'; } } else { echo $form->render(); } ?> </div>
public static function sendMailNotification($page, $author, $date, $comm, $emailAuthor, $pageTitle = '', $vcode = '') { $sendEmail = ipGetOption('Comment.useSeparateEmail'); if (empty($sendEmail)) { $sendEmail = ipGetOptionLang('Config.websiteEmail'); } $noUser = '******' . __("You are not a registered user, or pehaps you were not logged in when have commented. So, you need to verify " . "your email address before your comment is moderated and published. Please, click on the following link for " . "such a thing: ", "Comments") . '<a href="' . ipHomeUrl() . ipContent()->getCurrentLanguage()->getUrlPath() . 'comments/' . $vcode . '-!' . $emailAuthor . '">' . __('Email verification', 'Comments') . '</a>' . __(" If it doesn't work, please copy and past the following in your web browser: ", "Comments") . "<strong>" . ipHomeUrl() . ipContent()->getCurrentLanguage()->getUrlPath() . "comments/" . $vcode . '-!' . $emailAuthor . '</strong></div><br />'; if (ipUser()->isLoggedIn()) { $noUser = ''; } //array can has: 'title', 'content', 'signature', 'footer'. $contentAdmin = sprintf('<div><strong>' . __('Page', 'Comments') . ':</strong> ' . __($pageTitle, 'Comments') . ' (%s)</div>' . '<div><strong>' . __('Author', 'Comments') . ':</strong> %s - ' . $emailAuthor . '</div>' . '<div><strong>' . __('Date', 'Comments') . ':</strong> %s</div>' . '<div><strong>' . __('Comment', 'Comments') . ':</strong></div>' . '<div><cite class="mail">%s</cite></div>', $page, $author, $date, $comm); $templateAdmin = array('title' => __('You just received a comment', 'Comments'), 'content' => $contentAdmin, 'signature' => '<h4>' . __('Internal Administration', 'Comments') . '</h4>', 'footer' => '<h4>' . ipGetOptionLang('Config.websiteTitle') . '</h4>'); $contentAuthor = sprintf(__('Your comment has been sent and it is awaiting moderation. Thank you.', 'Comments') . $noUser . '<div><strong>' . __('Page', 'Comments') . ':</strong> ' . __($pageTitle, 'Comments') . ' (%s)</div>' . '<div><strong>' . __('Author', 'Comments') . ':</strong> %s - ' . $emailAuthor . '</div>' . '<div><strong>' . __('Date', 'Comments') . ':</strong> %s</div>' . '<div><strong>' . __('Comment', 'Comments') . ':</strong></div>' . '<div><cite class="mail">%s</cite></div>', $page, $author, $date, $comm); $templateAuthor = array('title' => __('You just sent a comment', 'Comments'), 'content' => $contentAuthor, 'signature' => '<div>' . __('Kindest regards', 'Comments') . ',</div>', 'footer' => '<h4>' . ipGetOptionLang('Config.websiteTitle') . '</h4>'); /* ipSendEmail ( string $from , string $fromName , string $to , string $toName , string $subject , string $content , [ boolean $urgent ] , [ boolean $html ] , [ string|array|null $files ] ) */ if (ipGetOption('Comments.informAboutNewComments') == 'Yes') { //ipSendEmail() Administration ipSendEmail($sendEmail, __('Site Comment', 'Comments'), $sendEmail, __('Comment Moderation', 'Comments'), __('There is a new comment', 'Comments') . ': ' . __($pageTitle, 'Comments'), ipEmailTemplate($templateAdmin), true, true); } if (ipGetOption('Comments.requireEmailConfirmation') == 'Yes') { //ipSendMail Author ipSendEmail($sendEmail, ipGetOptionLang('Config.websiteTitle'), $emailAuthor, $author, __('You have just done a comment in our website', 'Comments') . ': ' . __($pageTitle, 'Comments'), ipEmailTemplate($templateAuthor), true, true); } }
public static function ipReplacePlaceholders($info) { $content = $info['content']; $userData = ipUser()->data(); $userEmail = !empty($userData['email']) ? $userData['email'] : ''; $userName = !empty($userData['name']) ? $userData['name'] : ''; $values = array('{websiteTitle}' => ipGetOptionLang('Config.websiteTitle'), '{websiteEmail}' => ipGetOptionLang('Config.websiteEmail'), '{websiteUrl}' => ipConfig()->baseUrl(), '{userId}' => ipUser()->userId(), '{userEmail}' => $userEmail, '{userName}' => $userName); foreach ($info['customValues'] as $key => $value) { $values['{' . $key . '}'] = $value; } $values = ipFilter('ipReplacePlaceholdersValues', $values, $info); $answer = strtr($content, $values); $answer = ipFilter('ipReplacePlaceholders', $answer, $info); return $answer; }