Project

General

Profile

« Previous | Next » 

Revision 1157

Added by Dietmar over 14 years ago

Ticket #770, #785, #792, #807, #809, fixes and recoded the news module

View differences:

comment_page.php
24 24
*/
25 25

  
26 26
// Make sure page cannot be accessed directly
27
if(!defined('WB_URL')) { 
27
if(!defined('WB_URL')) {
28 28
	header('Location: ../index.php');
29 29
	exit(0);
30 30
}
31 31

  
32
//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
// check if frontend.css file needs to be included into the <body></body> of page
32
/* check if frontend.css file needs to be included into the <body></body> of page  */
38 33
if ( (!function_exists('register_frontend_modfiles') || !defined('MOD_FRONTEND_CSS_REGISTERED')) && file_exists(WB_PATH .'/modules/news/frontend.css')) {
39 34
	echo '<style type="text/css">';
40 35
	include(WB_PATH .'/modules/news/frontend.css');
......
42 37
}
43 38

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

  
55 53
// Get comments page template details from db
56 54
$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) {
55
if($query_settings->numRows() == 0)
56
{
58 57
	header("Location: ".WB_URL.PAGES_DIRECTORY."");
59
	exit(0);
60
} else {
58
	exit( 0 );
59
}
60
else
61
{
61 62
	$settings = $query_settings->fetchRow();
62 63

  
63 64
	// Print comments page
......
93 94
	?>:
94 95
	<br />
95 96
	<?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>
97
		<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 98
	<?php } else { ?>
98 99
		<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 100
	<?php } ?>
......
110 111
	<tr>
111 112
		<td><?php echo $TEXT['VERIFICATION']; ?>:</td>
112 113
		<td><?php call_captcha(); ?></td>
113
	</tr></table>
114
	<br />
114
	</tr>
115
    </table>
115 116
	<?php
116 117
	if(isset($_SESSION['captcha_error'])) {
117 118
		unset($_SESSION['captcha_error']);
......
120 121
	<?php
121 122
	}
122 123
	?>
123
	<input type="submit" name="submit" value="<?php echo $MOD_NEWS['TEXT_ADD_COMMENT']; ?>" />
124
	</form>	
124
	<table class="news-table">
125
	<tr>
126
	    <td>
127
            <input type="submit" name="submit" value="<?php echo $MOD_NEWS['TEXT_ADD_COMMENT']; ?>" />
128
        </td>
129
        <td>
130
		    <input type="button" value="<?php echo $TEXT['CANCEL']; ?>" onclick="history.go(-1)"  />
131
        </td>
132
	</tr>
133
    </table>
134
	</form>
125 135
	<?php
126 136
}
127 137

  

Also available in: Unified diff