summary refs log tree commit diff stats
path: root/pages/post.php
diff options
context:
space:
mode:
Diffstat (limited to 'pages/post.php')
-rw-r--r--pages/post.php107
1 files changed, 107 insertions, 0 deletions
diff --git a/pages/post.php b/pages/post.php new file mode 100644 index 0000000..f7990bd --- /dev/null +++ b/pages/post.php
@@ -0,0 +1,107 @@
1<?php
2/*
3 444444444
4 4::::::::4
5 4:::::::::4
6 4::::44::::4
7 4::::4 4::::4 Four Island
8 4::::4 4::::4
9 4::::4 4::::4 Written and maintained by Starla Insigna
104::::444444::::444
114::::::::::::::::4 pages/post.php
124444444444:::::444
13 4::::4 Please do not use, reproduce or steal the
14 4::::4 contents of this file without explicit
15 4::::4 permission from Hatkirby.
16 44::::::44
17 4::::::::4
18 4444444444
19*/
20
21if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);}
22
23require('headerproc.php');
24
25$pageCategory = 'home';
26$pageAID = 'archive';
27
28include('includes/recaptchalib.php');
29$privatekey = "6LfgvgEAAAAAAD0_UVLp57MU7tqcypsbZPS9qTnr";
30
31$template = new FITemplate('msg');
32$template->add('BACK','the previous page');
33
34if (!isset($_GET['id']))
35{
36 $template->add('MSG','I\'m sorry, but there\'s no page-id set here, so sadly you can\'t comment yet. Why not contact the administratior (link on the HatBar) and tell him that you saw this error?');
37} else {
38 if ($_POST['comment'] == "")
39 {
40 $template->add('MSG','I\'m sorry, but you didn\'t enter a comment!');
41 } else {
42 if (!isLoggedIn())
43 {
44 $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
45 if (!$resp->is_valid)
46 {
47 $template->add('MSG',"The reCAPTCHA wasn't entered correctly. Go back and try it again. (reCAPTCHA said: " . $resp->error . ")");
48 } else {
49 if (preg_match('/^[A-Za-z0-9!#$&\'*+-\/=?^_`{|}~]+@[-A-Za-z0-9]+(\.[-A-Za-z0-9]+)+[A-Za-z]$/', $_POST['email']))
50 {
51 $getanon = "SELECT * FROM anon_commenters WHERE username = \"" . $_POST['username'] . "\"";
52 $getanon2 = mysql_query($getanon);
53 $getanon3 = mysql_fetch_array($getanon2);
54
55 if ($getanon3['username'] == $_POST['username'])
56 {
57 if ($getanon3['email'] == $_POST['email'])
58 {
59 $setcomment = "INSERT INTO comments SET page_id = \"" . $_GET['id'] . "\", username = \"" . $_POST['username'] . "\", comment = \"" . $_POST['comment'] . "\"";
60 $setcomment2 = mysql_query($setcomment);
61
62 $page_id = $_GET['id'];
63 $comType = substr($page_id,0,strpos($page_id,'-'));
64 $comID = substr($page_id,strpos($page_id,'-')+1);
65 if ($comType == 'updates')
66 {
67 recalcPop($comID);
68 }
69
70 $template->add('MSG',"Thank you, " . $getanon3['username'] . ", for posting your valuable comment!");
71 } else {
72 $template->add('MSG',"I'm sorry, but this anonymous username is already in use. If this is in fact you, please verify that you have entered the same email address that you entered the first time you commented here.");
73 }
74 } else {
75 $setcomment = "INSERT INTO moderation SET page_id = \"" . $_GET['id'] . "\", author = \"" . $_POST['username'] . "\", email = \"" . $_POST['email'] . "\", comment = \"" . $_POST['comment'] . "\", website = \"" . $_POST['website'] . "\"";
76 $setcomment2 = mysql_query($setcomment);
77
78 mail('hatkirby@fourisland.com', 'New comment to moderate on Four Island', 'Some one has anonymously left a comment on Four Island and it will require moderation.');
79
80 $template->add('MSG',"Thank you for posting your valuable comment!<P>However, as you aren't logged in, your comment will have to be verified by a moderator before it appears. Sorry!");
81 }
82 } else {
83 $template->add('MSG',"I'm sorry, but you've entered an invalid email address.");
84 }
85 }
86 } else {
87 $setcomment = "INSERT INTO comments SET page_id = \"" . $_GET['id'] . "\", username = \"" . sess_get('uname') . "\", comment = \"" . $_POST['comment'] . "\"";
88 $setcomment2 = mysql_query($setcomment);
89
90 mail('hatkirby@fourisland.com', 'New comment on Four Island!', sess_get('uname') . ' has posted a comment on Four Island under the "page id" ' . $_GET['id']);
91
92 $page_id = $_GET['id'];
93 $comType = substr($page_id,0,strpos($page_id,'-'));
94 $comID = substr($page_id,strpos($page_id,'-')+1);
95 if ($comType == 'updates')
96 {
97 recalcPop($comID);
98 }
99
100 $template->add('MSG',"Thank you, " . sess_get('uname') . ", for posting your valuable comment!");
101 }
102 }
103}
104
105$template->display();
106
107?>