summary refs log tree commit diff stats
path: root/includes/comments.php
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2008-11-19 17:27:03 -0500
committerStarla Insigna <hatkirby@fourisland.com>2008-11-19 17:27:03 -0500
commit24503e3abe705acde2df159aeae61be0d009f92e (patch)
tree8debbd53dcd0db2f5934c5e2af4e697e3787781d /includes/comments.php
downloadfourisland-24503e3abe705acde2df159aeae61be0d009f92e.tar.gz
fourisland-24503e3abe705acde2df159aeae61be0d009f92e.tar.bz2
fourisland-24503e3abe705acde2df159aeae61be0d009f92e.zip
Imported sources
Diffstat (limited to 'includes/comments.php')
-rw-r--r--includes/comments.php97
1 files changed, 97 insertions, 0 deletions
diff --git a/includes/comments.php b/includes/comments.php new file mode 100644 index 0000000..9cb8b18 --- /dev/null +++ b/includes/comments.php
@@ -0,0 +1,97 @@
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 includes/comments.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
25include('includes/recaptchalib.php');
26$publickey = "6LfgvgEAAAAAAG_BJMkWk8sNcT1nBaGoXKJYb-JT";
27$privatekey = "6LfgvgEAAAAAAD0_UVLp57MU7tqcypsbZPS9qTnr";
28
29$curID = 0;
30
31$template = new FITemplate('comments');
32$template->add('PAGEID',$page_id);
33$template->add('CODEDDEF',urlencode('http://www.fourisland.com/images/error404.png'));
34$template->add('USERNAME',(isLoggedIn() ? sess_get('uname') : 'Anonymous'));
35
36if (!isLoggedIn())
37{
38 $template->add('RECAPTCHA',recaptcha_get_html($publickey));
39 $template->adds_block('NOLOG',array('exi'=>1));
40}
41
42$getcomments = "SELECT * FROM comments WHERE page_id = \"" . $page_id . "\" ORDER BY posttime";
43$getcomments2 = mysql_query($getcomments) or die($getcomments);
44$i=0;
45while ($getcomments3[$i] = mysql_fetch_array($getcomments2))
46{
47 $getuser = "SELECT * FROM users WHERE username = \"" . $getcomments3[$i]['username'] . "\"";
48 $getuser2 = mysql_query($getuser);
49 $getuser3 = mysql_fetch_array($getuser2);
50
51 if ($getuser3['username'] == $getcomments3[$i]['username'])
52 {
53 $username = $getuser3['username'];
54 $email = $getuser3['user_email'];
55 $website = $getuser3['website'];
56 } else {
57 $getanon = "SELECT * FROM anon_commenters WHERE username = \"" . $getcomments3[$i]['username'] . "\"";
58 $getanon2 = mysql_query($getanon);
59 $getanon3 = mysql_fetch_array($getanon2);
60
61 if ($getanon3['username'] == $getcomments3[$i]['username'])
62 {
63 $username = $getanon3['username'] . ' (Guest)';
64 $email = $getanon3['email'];
65 $website = $getanon3['website'];
66 }
67 }
68
69 if (isset($username))
70 {
71 if ($getcomments3[$i]['rating'] > -2)
72 {
73 $text = parseBBCode($getcomments3[$i]['comment']);
74 } else {
75 $text = 'This comment has been rated down below the threshold for public viewing (-1), suggesting that it may contain inappropriate or off topic content. (Or it may have been flame bait, or simply bad!)';
76 }
77
78 if ($getcomments3[$i]['title'] != '')
79 {
80 $title2 = $getcomments3[$i]['title'];
81 } else {
82 $title2 = 'Untitled';
83 }
84
85 $template->add_ref($curID, 'COMMENTS', array( 'CODEDEMAIL' => md5(strtolower($email)),
86 'USERNAME' => (($website != '') ? '<A HREF="http://' . $website . '">' . $username . '</A>' : $username),
87 'DATE' => date("F dS Y \a\\t g:i:s a",strtotime($getcomments3[$i]['posttime'])),
88 'RATING' => $getcomments3[$i]['rating'],
89 'ID' => $getcomments3[$i]['id'],
90 'TEXT' => $text,
91 'TITLE' => $title2));
92 }
93 $i++;
94}
95$template->display();
96
97?>