Exemplo n.º 1
0
     if ($count == 0) {
         $MW_COMMENT->prefix = $database['prefix'];
         $MW_COMMENT->date = date($SETTINGS->dateformat, strtotime("" . $SETTINGS->timeOffset . " hours"));
         // Add comments..
         $MW_COMMENT->add_comment_sql($_POST, $name, $comments, $email);
         // Send notification to webmaster if enabled..
         if ($BLOG->notify) {
             $MW_MAIL->addTag('{BLOGTITLE}', $BLOG->title);
             $MW_MAIL->addTag('{BLOGURL}', $SETTINGS->modR ? $SETTINGS->w_path . '/blog/' . $id . '/' . addTitleToUrl(cleanData($BLOG->title)) . '.html' : $SETTINGS->w_path . '/index.php?cmd=blog&post=' . $id);
             $MW_MAIL->addTag('{COMMENTS}', $comments);
             $MW_MAIL->addTag('{VISITOR}', $name);
             $MW_MAIL->addTag('{EMAIL}', $email);
             $MW_MAIL->addTag('{IP}', $_SERVER['REMOTE_ADDR']);
             $MW_MAIL->addTag('{DATE}', date($SETTINGS->dateformat, strtotime("" . $SETTINGS->timeOffset . " hours")));
             $MW_MAIL->addTag('{SITEPATH}', $SETTINGS->w_path);
             $MW_MAIL->sendMail($SETTINGS->name, $SETTINGS->email, $name, $email, '[' . $SETTINGS->website . '] ' . $msg_viewblog5, $MW_MAIL->template('themes/email/notification.txt'));
         }
         // Reload to blog page..
         $url = $SETTINGS->modR ? $SETTINGS->w_path . '/blog/' . $id . '/' . addTitleToUrl(cleanData($BLOG->title)) . '.html' : $SETTINGS->w_path . '/index.php?cmd=blog&post=' . $id;
         header("Location: {$url}");
         exit;
     }
 }
 // Get comments for this blog..
 $q_comments = mysql_query("SELECT * FROM " . $database['prefix'] . "comments\n                              WHERE postid = '{$b_post}'\n                              ORDER BY id " . ($SETTINGS->commentsOrder == 'asc' ? 'ASC' : 'DESC') . "\n                              ") or die(mysql_error());
 // Load tpl file and parse data..
 $find = array('{post_title}', '{post_content}', '{post_friend_url}', '{print_url}', '{print}', '{tell_a_friend}', '{comments_count}', '{post_date}', '{path}', '{bookmarks}');
 $replace = array(cleanData($BLOG->title), autoParseLinks(cleanData($BLOG->comments)), $SETTINGS->modR ? $SETTINGS->w_path . '/friend_' . $BLOG->id . '.html' : $SETTINGS->w_path . '/index.php?cmd=tell-a-friend&blog=' . $BLOG->id, $SETTINGS->modR ? $SETTINGS->w_path . '/print_' . $BLOG->id . '.html' : $SETTINGS->w_path . '/index.php?cmd=print&blog=' . $BLOG->id, $msg_script12, $msg_index, str_replace("{count}", number_format(mysql_num_rows($q_comments)), $msg_index3), $BLOG->rawpostdate, $SETTINGS->w_path . '/themes/' . THEME, $SETTINGS->bookmarks ? loadBookmarks($SETTINGS->modR ? $SETTINGS->w_path . '/friend_' . $BLOG->id . '.html' : $SETTINGS->w_path . '/index.php?cmd=tell-a-friend&blog=' . $BLOG->id, $BLOG->title) : '');
 $vBlog = str_replace($find, $replace, file_get_contents(FOLDER_PATH . 'themes/' . THEME . '/tpl_files/single_blog_post.tpl'));
 // Load comment data..
 if (mysql_num_rows($q_comments) > 0) {