Project

General

Profile

« Previous | Next » 

Revision 1289

Added by kweitzel over 14 years ago

Branch 2.8.1 merged back into Trunk

View differences:

comment_page.php
1 1
<?php
2
/**
3
 *
4
 * @category        modules
5
 * @package         news
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2010, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 4.3.4 and higher
13
 * @version         $Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
2 18

  
3
// $Id$
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2009, 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 19
// Make sure page cannot be accessed directly
27
if(!defined('WB_URL')) { 
20
if(!defined('WB_URL')) {
28 21
	header('Location: ../index.php');
29 22
	exit(0);
30 23
}
31 24

  
32
//overwrite php.ini on Apache servers for valid SESSION ID Separator
33
if(function_exists('ini_set')) {
34
	ini_set('arg_separator.output', '&amp;');
35
}
36

  
37
// check if frontend.css file needs to be included into the <body></body> of page
25
/* check if frontend.css file needs to be included into the <body></body> of page  */
38 26
if ( (!function_exists('register_frontend_modfiles') || !defined('MOD_FRONTEND_CSS_REGISTERED')) && file_exists(WB_PATH .'/modules/news/frontend.css')) {
39 27
	echo '<style type="text/css">';
40 28
	include(WB_PATH .'/modules/news/frontend.css');
......
42 30
}
43 31

  
44 32
// 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')) {
33
if(!file_exists(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php'))
34
{
46 35
	// no module language file exists for the language set by the user, include default module language file EN.php
47 36
	require_once(WB_PATH .'/modules/news/languages/EN.php');
48
} else {
37
}
38
else
39
{
49 40
	// a module language file exists for the language defined by the user, load it
50 41
	require_once(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php');
51 42
}
......
54 45

  
55 46
// Get comments page template details from db
56 47
$query_settings = $database->query("SELECT comments_page,use_captcha,commenting FROM ".TABLE_PREFIX."mod_news_settings WHERE section_id = '".SECTION_ID."'");
57
if($query_settings->numRows() == 0) {
48
if($query_settings->numRows() == 0)
49
{
58 50
	header("Location: ".WB_URL.PAGES_DIRECTORY."");
59
	exit(0);
60
} else {
51
	exit( 0 );
52
}
53
else
54
{
61 55
	$settings = $query_settings->fetchRow();
62 56

  
63 57
	// Print comments page
......
93 87
	?>:
94 88
	<br />
95 89
	<?php if(ENABLED_ASP) { ?>
96
		<textarea name="c0mment_<?php echo date('W'); ?>" rows="10" cols="1" style="width: 90%; height: 150px;"><?php if(isset($_SESSION['comment_body'])) { echo $_SESSION['comment_body']; unset($_SESSION['comment_body']); } ?></textarea>
90
		<textarea name="comment_<?php echo date('W'); ?>" rows="10" cols="1" style="width: 90%; height: 150px;"><?php if(isset($_SESSION['comment_body'])) { echo $_SESSION['comment_body']; unset($_SESSION['comment_body']); } ?></textarea>
97 91
	<?php } else { ?>
98 92
		<textarea name="comment" rows="10" cols="1" style="width: 90%; height: 150px;"><?php if(isset($_SESSION['comment_body'])) { echo $_SESSION['comment_body']; unset($_SESSION['comment_body']); } ?></textarea>
99 93
	<?php } ?>
......
110 104
	<tr>
111 105
		<td><?php echo $TEXT['VERIFICATION']; ?>:</td>
112 106
		<td><?php call_captcha(); ?></td>
113
	</tr></table>
114
	<br />
107
	</tr>
108
    </table>
115 109
	<?php
116 110
	if(isset($_SESSION['captcha_error'])) {
117 111
		unset($_SESSION['captcha_error']);
......
120 114
	<?php
121 115
	}
122 116
	?>
123
	<input type="submit" name="submit" value="<?php echo $MOD_NEWS['TEXT_ADD_COMMENT']; ?>" />
124
	</form>	
117
	<table class="news-table">
118
	<tr>
119
	    <td>
120
            <input type="submit" name="submit" value="<?php echo $MOD_NEWS['TEXT_ADD_COMMENT']; ?>" />
121
        </td>
122
        <td>
123
		    <input type="button" value="<?php echo $TEXT['CANCEL']; ?>" onclick="history.go(-1)"  />
124
        </td>
125
	</tr>
126
    </table>
127
	</form>
125 128
	<?php
126 129
}
127 130

  
128 131

  

Also available in: Unified diff