1 |
562
|
Ruebenwurz
|
<?php
|
2 |
|
|
|
3 |
|
|
// $Id$
|
4 |
|
|
|
5 |
|
|
/*
|
6 |
|
|
|
7 |
|
|
Website Baker Project <http://www.websitebaker.org/>
|
8 |
|
|
Copyright (C) 2004-2008, Ryan Djurovich
|
9 |
|
|
|
10 |
|
|
Website Baker is free software; you can redistribute it and/or modify
|
11 |
|
|
it under the terms of the GNU General Public License as published by
|
12 |
|
|
the Free Software Foundation; either version 2 of the License, or
|
13 |
|
|
(at your option) any later version.
|
14 |
|
|
|
15 |
|
|
Website Baker is distributed in the hope that it will be useful,
|
16 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18 |
|
|
GNU General Public License for more details.
|
19 |
|
|
|
20 |
|
|
You should have received a copy of the GNU General Public License
|
21 |
|
|
along with Website Baker; if not, write to the Free Software
|
22 |
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
23 |
|
|
|
24 |
|
|
*/
|
25 |
|
|
|
26 |
|
|
// Make sure page cannot be accessed directly
|
27 |
|
|
if(!defined('WB_URL')) {
|
28 |
|
|
header('Location: ../index.php');
|
29 |
|
|
exit(0);
|
30 |
|
|
}
|
31 |
596
|
thorn
|
|
32 |
892
|
Ruebenwurz
|
//overwrite php.ini on Apache servers for valid SESSION ID Separator
|
33 |
|
|
if(function_exists('ini_set')) {
|
34 |
|
|
ini_set('arg_separator.output', '&');
|
35 |
|
|
}
|
36 |
|
|
|
37 |
890
|
aldus
|
// check if frontend.css file needs to be included into the <body></body> of page
|
38 |
|
|
if ( (!function_exists('register_frontend_modfiles') || !defined('MOD_FRONTEND_CSS_REGISTERED')) && file_exists(WB_PATH .'/modules/news/frontend.css')) {
|
39 |
|
|
echo '<style type="text/css">';
|
40 |
|
|
include(WB_PATH .'/modules/news/frontend.css');
|
41 |
|
|
echo "\n</style>\n";
|
42 |
|
|
}
|
43 |
|
|
|
44 |
901
|
Ruebenwurz
|
// check if module language file exists for the language set by the user (e.g. DE, EN)
|
45 |
|
|
if(!file_exists(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php')) {
|
46 |
|
|
// no module language file exists for the language set by the user, include default module language file EN.php
|
47 |
|
|
require_once(WB_PATH .'/modules/news/languages/EN.php');
|
48 |
|
|
} else {
|
49 |
|
|
// a module language file exists for the language defined by the user, load it
|
50 |
|
|
require_once(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php');
|
51 |
|
|
}
|
52 |
|
|
|
53 |
596
|
thorn
|
require_once(WB_PATH.'/include/captcha/captcha.php');
|
54 |
|
|
|
55 |
562
|
Ruebenwurz
|
// Get comments page template details from db
|
56 |
596
|
thorn
|
$query_settings = $database->query("SELECT comments_page,use_captcha,commenting FROM ".TABLE_PREFIX."mod_news_settings WHERE section_id = '".SECTION_ID."'");
|
57 |
562
|
Ruebenwurz
|
if($query_settings->numRows() == 0) {
|
58 |
|
|
header("Location: ".WB_URL.PAGES_DIRECTORY."");
|
59 |
|
|
exit(0);
|
60 |
|
|
} else {
|
61 |
|
|
$settings = $query_settings->fetchRow();
|
62 |
596
|
thorn
|
|
63 |
562
|
Ruebenwurz
|
// Print comments page
|
64 |
901
|
Ruebenwurz
|
$vars = array('[POST_TITLE]','[TEXT_COMMENT]');
|
65 |
|
|
$values = array(POST_TITLE, $MOD_NEWS['TEXT_COMMENT']);
|
66 |
|
|
echo str_replace($vars, $values, ($settings['comments_page']));
|
67 |
562
|
Ruebenwurz
|
?>
|
68 |
892
|
Ruebenwurz
|
<form name="comment" action="<?php echo WB_URL.'/modules/news/submit_comment.php?page_id='.PAGE_ID.'&section_id='.SECTION_ID.'&post_id='.POST_ID; ?>" method="post">
|
69 |
596
|
thorn
|
<?php if(ENABLED_ASP) { // add some honeypot-fields
|
70 |
|
|
?>
|
71 |
|
|
<input type="hidden" name="submitted_when" value="<?php $t=time(); echo $t; $_SESSION['submitted_when']=$t; ?>" />
|
72 |
739
|
thorn
|
<p class="nixhier">
|
73 |
596
|
thorn
|
email address:
|
74 |
762
|
thorn
|
<label for="email">Leave this field email blank:</label>
|
75 |
596
|
thorn
|
<input id="email" name="email" size="60" value="" /><br />
|
76 |
|
|
Homepage:
|
77 |
762
|
thorn
|
<label for="homepage">Leave this field homepage blank:</label>
|
78 |
596
|
thorn
|
<input id="homepage" name="homepage" size="60" value="" /><br />
|
79 |
|
|
URL:
|
80 |
762
|
thorn
|
<label for="url">Leave this field url blank:</label>
|
81 |
596
|
thorn
|
<input id="url" name="url" size="60" value="" /><br />
|
82 |
605
|
thorn
|
Comment:
|
83 |
762
|
thorn
|
<label for="comment">Leave this field comment blank:</label>
|
84 |
605
|
thorn
|
<input id="comment" name="comment" size="60" value="" /><br />
|
85 |
596
|
thorn
|
</p>
|
86 |
|
|
<?php }
|
87 |
|
|
?>
|
88 |
562
|
Ruebenwurz
|
<?php echo $TEXT['TITLE']; ?>:
|
89 |
|
|
<br />
|
90 |
|
|
<input type="text" name="title" maxlength="255" style="width: 90%;"<?php if(isset($_SESSION['comment_title'])) { echo ' value="'.$_SESSION['comment_title'].'"'; unset($_SESSION['comment_title']); } ?> />
|
91 |
|
|
<br /><br />
|
92 |
605
|
thorn
|
<?php echo $TEXT['COMMENT'];
|
93 |
|
|
?>:
|
94 |
562
|
Ruebenwurz
|
<br />
|
95 |
649
|
thorn
|
<?php if(ENABLED_ASP) { ?>
|
96 |
|
|
<textarea name="c0mment_<?php echo date('W'); ?>" style="width: 90%; height: 150px;"><?php if(isset($_SESSION['comment_body'])) { echo $_SESSION['comment_body']; unset($_SESSION['comment_body']); } ?></textarea>
|
97 |
|
|
<?php } else { ?>
|
98 |
|
|
<textarea name="comment" style="width: 90%; height: 150px;"><?php if(isset($_SESSION['comment_body'])) { echo $_SESSION['comment_body']; unset($_SESSION['comment_body']); } ?></textarea>
|
99 |
|
|
<?php } ?>
|
100 |
562
|
Ruebenwurz
|
<br /><br />
|
101 |
|
|
<?php
|
102 |
|
|
if(isset($_SESSION['captcha_error'])) {
|
103 |
|
|
echo '<font color="#FF0000">'.$_SESSION['captcha_error'].'</font><br />';
|
104 |
605
|
thorn
|
$_SESSION['captcha_retry_news'] = true;
|
105 |
562
|
Ruebenwurz
|
}
|
106 |
|
|
// Captcha
|
107 |
|
|
if($settings['use_captcha']) {
|
108 |
|
|
?>
|
109 |
|
|
<table cellpadding="2" cellspacing="0" border="0">
|
110 |
|
|
<tr>
|
111 |
596
|
thorn
|
<td><?php echo $TEXT['VERIFICATION']; ?>:</td>
|
112 |
|
|
<td><?php call_captcha(); ?></td>
|
113 |
562
|
Ruebenwurz
|
</tr></table>
|
114 |
|
|
<br />
|
115 |
|
|
<?php
|
116 |
676
|
thorn
|
if(isset($_SESSION['captcha_error'])) {
|
117 |
|
|
unset($_SESSION['captcha_error']);
|
118 |
|
|
?><script>document.comment.captcha.focus();</script><?php
|
119 |
|
|
}?>
|
120 |
|
|
<?php
|
121 |
562
|
Ruebenwurz
|
}
|
122 |
|
|
?>
|
123 |
901
|
Ruebenwurz
|
<input type="submit" name="submit" value="<?php echo $MOD_NEWS['TEXT_ADD_COMMENT']; ?>" />
|
124 |
562
|
Ruebenwurz
|
</form>
|
125 |
|
|
<?php
|
126 |
|
|
}
|
127 |
|
|
|
128 |
901
|
Ruebenwurz
|
?>
|