$edit_cmt->passwd = $write_cmt->passwd; } if ($clean_code != $edit_cmt->body) { $edit_cmt->body = $write_cmt->body; } $edit_cmt->asXML($dir . '/' . sanitize($_POST['cmtfile']) . '.xml'); // Set "Password" and "Login" cookies setcookie('password', str_replace('"', '"', stripslashes($_POST['password'])), $expire, '/', str_replace('www.', '', $domain)); setcookie('hashover-' . strtolower(str_replace(' ', '-', $name)), hash('ripemd160', $write_cmt->name . $write_cmt->passwd), $expire, '/', str_replace('www.', '', $domain)); } } // Kick visitor back to comment exit(header('Location: ' . $kickback . '#c' . str_replace('-', 'r', $_POST['cmtfile']))); } // Read comments without output read_comments($dir, 'no'); // Rename file for reply if (isset($_POST['reply_to']) and !empty($_POST['reply_to'])) { if (!preg_match('/[a-zA-Z]/i', $_POST['reply_to']) and file_exists($dir . '/' . $_POST['reply_to'] . ".xml")) { // Set reply directory information & "cookie" for successful reply $reply_dir = $dir . '/' . $_POST['reply_to'] . '.xml'; $cmt_file = $dir . '/' . $_POST['reply_to'] . '-' . $subfile_count["{$reply_dir}"] . '.xml'; setcookie('replied', $_POST['reply_to'], $expire, '/', str_replace('www.', '', $domain)); } } else { $cmt_file = $dir . '/' . $cmt_count . '.xml'; } // Write comment to file if ($write_cmt->asXML(sanitize($cmt_file))) { chmod($cmt_file, 0600); // Send notification e-mails
} else { exit(jsAddSlashes('<a href="' . $_GET['count_link'] . '#comments">Post Comment</a>', 'single')); } } } // Clear message cookie if (isset($_COOKIE['message']) and !empty($_COOKIE['message'])) { setcookie('message', '', 1, '/', str_replace('www.', '', $domain)); } // Check if either a comment or reply failed to post if (isset($_COOKIE['success']) and $_COOKIE['success'] == 'no') { setcookie('success', '', 1, '/', str_replace('www.', '', $domain)); if (isset($_COOKIE['replied']) and !empty($_COOKIE['replied'])) { $text['comment_form'] = $text['reply_form']; $text['post_button'] = $text['post_reply']; setcookie('replied', '', 1, '/', str_replace('www.', '', $domain)); } } // Check if visitor is on mobile device if (preg_match('/android/i', $_SERVER['HTTP_USER_AGENT']) or preg_match('/blackberry/i', $_SERVER['HTTP_USER_AGENT']) or preg_match('/phone/i', $_SERVER['HTTP_USER_AGENT'])) { $is_mobile = 'yes'; } else { $is_mobile = 'no'; } read_comments($dir, 'yes'); // Run read_comments function krsort($top_likes); // Sort popular comments if (!(include './scripts/php-mode.php')) { exit(jsAddSlashes('<b>HashOver - Error:</b> file "php-mode.php" could not be included!', 'single')); }