if (!isset($_ANONNEWS)) { die; } /* Protect from direct requests */ /* This module handles the thread listing. */ $post_id = is_numeric($var_id) ? $var_id : 0; if ($result = mysql_query_cached("SELECT * FROM forum_posts WHERE `Id`='{$var_id}' AND `ParentId`='0'", 5)) { $post = $result->data[0]; $query = "SELECT * FROM forum_categories WHERE `Id`='{$post['CategoryId']}'"; if ($category = mysql_query_cached($query)->data[0]) { $topic = utf8entities(stripslashes($post['Topic'])); $caturlname = utf8entities(stripslashes($category['UrlName'])); $catname = utf8entities(stripslashes($category['Name'])); echo "<h2><a href=\"/forum\">Forum</a> > <a href=\"/forum/category/{$caturlname}/\">{$catname}</a> > {$topic}</h2>"; echo template_post($post); $query = "SELECT * FROM forum_posts WHERE `ParentId`='{$post['Id']}'"; if ($children = mysql_query_cached($query, 5)) { foreach ($children->data as $child) { echo template_post($child); } } echo "<div class=\"forum-reply\">\n\t\t\t<h3>Post a reply</h3>\n\t\t\t<form class=\"forum\" method=\"post\" action=\"/forum/post/{$var_id}/reply\">\n\t\t\t\t<input type=\"text\" name=\"name\" value=\"Anonymous\">\n\t\t\t\t<textarea name=\"body\"></textarea>\n\t\t\t\t<div class=\"forum-reply-button\">\n\t\t\t\t\t<button type=\"submit\" name=\"submit\">Post reply >></button>\n\t\t\t\t\t" . template_captcha() . "\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t</div>"; } else { $var_code = ANONNEWS_ERROR_NOT_FOUND; require "module.error.php"; } } else { $var_code = ANONNEWS_ERROR_NOT_FOUND; require "module.error.php"; }
if (!isset($_ANONNEWS)) { die; } /* Protect from direct requests */ /* This module handles the thread listing. */ if ($var_mode == "thread") { // Post a new thread. $categoryname = mysql_real_escape_string($var_id); if ($result = mysql_query_cached("SELECT * FROM forum_categories WHERE `UrlName`='{$categoryname}'")) { $category = $result->data[0]; if (!isset($_POST['submit'])) { $catname = utf8entities($var_id); $catrealname = utf8entities(stripslashes($category['Name'])); echo ""; echo "\n\t\t\t<h2><a href=\"/forum\">Forum</a> > <a href=\"/forum/category/{$catname}/\">{$catrealname}</a> > New Thread</h2>\n\t\t\t<div class=\"forum-reply\">\n\t\t\t\t<form class=\"forum\" method=\"post\" action=\"/forum/category/{$catname}/new\">\n\t\t\t\t\t<h3>Name</h3>\n\t\t\t\t\t<input type=\"text\" name=\"name\" value=\"Anonymous\">\n\t\t\t\t\t\n\t\t\t\t\t<h3>Topic Title</h3>\n\t\t\t\t\t<input type=\"text\" name=\"topic\">\n\t\t\t\t\t\n\t\t\t\t\t<h3>Contents</h3>\n\t\t\t\t\t<textarea name=\"body\" style=\"height: 350px;\"></textarea>\n\t\t\t\t\t<div class=\"forum-reply-button\">\n\t\t\t\t\t\t<button type=\"submit\" name=\"submit\">Create thread >></button>\n\t\t\t\t\t\t<h3>Complete the captcha</h3>\n\t\t\t\t\t\t" . template_captcha() . "\n\t\t\t\t\t</div>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t\t"; } else { $recaptcha = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if ($recaptcha->is_valid) { $name = !empty($_POST['name']) ? mysql_real_escape_string($_POST['name']) : "Anonymous"; $body = mysql_real_escape_string($_POST['body']); $topic = mysql_real_escape_string($_POST['topic']); $catname = mysql_real_escape_string($var_id); $result = mysql_query_cached("SELECT Id FROM forum_categories WHERE `UrlName`='{$catname}'"); $catid = $result->data[0]['Id']; if (!empty($body)) { if (!empty($topic)) { $parent = $result->data[0]; $query = "INSERT INTO forum_posts (`CategoryId`, `ParentId`, `Name`, `Topic`, `Posted`, `Body`, `Replies`, `LastReplyUser`, `LastReplyTime`)\n\t\t\t\t\t\tVALUES ('{$catid}', '0', '{$name}', '{$topic}', CURRENT_TIMESTAMP, '{$body}', '0', '', CURRENT_TIMESTAMP)"; if (mysql_query($query)) { $insid = mysql_insert_id();
Enter comma-separated tags here, that indicate what the article is about. This will make it easier to find on the site. </div> <input type="text" name="tags" id="input_tags" value=""> <h4>Press Release Language</h4> <select name="language"> <?php foreach ($languages as $iso => $lang) { echo "<option value=\"{$iso}\">{$lang}</option>"; } ?> </select> <h4>Complete the CAPTCHA</h4> <?php echo template_captcha(); ?> <div class="submit"> <button type="submit" name="submit" onclick="$('#submit_loader').css({'display':'block'}); $(this).css({'display':'none'}); return true;">Submit press release >></button> </div> <div class="submit-loader" id="submit_loader"> <img src="http://tahoe-gateway.cryto.net:3719/download/VVJJOkNISzpuMzRqdGlhb3gycGxxbnZjZm5hM3k1NzdyYTpsbDRvNzc1Z2FsYjVmdzVqd3Q2ems0aGQ0bGd2ZXMzZHl1YXRkZHVwa2p0YXFnbmdtMmlxOjM6NjoxMDgxOQ==/loader-wide.gif"><br> <strong>Submitting press release... (this may take a while!)</strong> </div> </form> <?php } elseif ($var_id == "submit") { // Stage 2: Processing the upload and press release. $recaptcha = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if ($recaptcha->is_valid) {
if (mysql_num_rows($res) > 0) { $row = mysql_fetch_array($res); $total = $row['Upvotes'] + 1; mysql_query("UPDATE press SET `Upvotes`='{$total}' WHERE `Id`='{$var_id}'"); } } echo "<strong>Your comment is now visible.</strong>\n\t\t\t\t\t<p><a href=\"/{$var_section}/item/{$var_id}/comments/#c-{$comment_id}\" class=\"page-button\"><< back to thread</a></p>"; render_comments($var_table, $var_id); $validated = true; } else { echo "<strong>The captcha you entered was incorrect.</strong> Try again.<br><br>"; } } } else { $error = true; $var_code = ANONNEWS_ERROR_NOT_FOUND; require "module.error.php"; } } if ($error === false && ($posted === true || $validated === false)) { if ($result = mysql_query_cached("SELECT * FROM comments WHERE `Id`='{$comment_id}'")) { $linecount = count(explode("\n", $result->data[0]['Body'])); $charcount = strlen($result->data[0]['Body']); echo "\n\t\t\t<form method=\"post\" action=\"/{$var_section}/item/{$var_id}/comments/post/{$parent}/\">\n\t\t\t\t<input type=\"hidden\" name=\"commentid\" value=\"{$comment_id}\">\n\t\t\t\t<input type=\"hidden\" name=\"validate\" value=\"true\">\n\t\t\t\t" . template_captcha(); if ($var_section == "press" && $linecount >= 2 && $charcount >= 100) { echo "<br><input type=\"checkbox\" name=\"upvote\" value=\"true\"> Upvote this press release<br><br>"; } echo "<button type=\"submit\" name=\"submit\">Verify</button>\n\t\t\t</form>\n\t\t\t"; } } }