Permalink
Newer
Older
100644 85 lines (80 sloc) 2.15 KB
1
<?
2
# Mantis - a php based bugtracking system
3
# Copyright (C) 2000 Kenzaburo Ito - kenito@300baud.org
4
# This program is distributed under the terms and conditions of the GPL
5
# See the README and LICENSE files for details
6
?>
7
<? include( "core_API.php" ) ?>
8
<? login_cookie_check() ?>
9
<?
10
db_mysql_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );
11
12
if ( !access_level_check_greater( "developer" ) ) {
13
### need to replace with access error page
14
header( "Location: $g_logout_page" );
15
exit;
16
}
17
Dec 5, 2000
18
### " character poses problem when editting so let's just convert them
19
$f_headline = string_safe( str_replace( "\"", "'", $f_headline ) );
20
$f_body = string_safe( $f_body );
Dec 5, 2000
21
### Add item
22
$query = "INSERT
23
INTO $g_mantis_news_table
24
( id, poster_id, date_posted, last_modified, headline, body )
25
VALUES
26
( null, '$f_poster_id', NOW(), NOW(), '$f_headline', '$f_body' )";
27
$result = mysql_query( $query );
28
?>
29
<? print_html_top() ?>
30
<? print_head_top() ?>
31
<? print_title( $g_window_title ) ?>
32
<? print_css( $g_css_include_file ) ?>
33
<?
34
if ( $result ) {
35
print_meta_redirect( $g_news_menu_page, $g_wait_time );
36
}
37
?>
38
<? include( $g_meta_include_file ) ?>
39
<? print_head_bottom() ?>
40
<? print_body_top() ?>
41
<? print_header( $g_page_title ) ?>
42
43
<p>
44
<? print_menu( $g_menu_include_file ) ?>
45
46
<p>
47
<div align=center>
48
<?
50
if ( $result ) {
51
$t_headline = string_unsafe( $f_headline );
52
$t_body = string_unsafe( $f_body );
53
?>
54
<p>
55
<div align=center>
56
<table width=75% bgcolor=<? echo $g_primary_border_color ?>>
57
<tr>
58
<td bgcolor=<? echo $g_primary_color_dark ?>>
59
<b><? echo string_unsafe( $t_headline ) ?></b>
60
</td>
61
</tr>
62
<tr>
63
<td bgcolor=<? echo $g_primary_color_light ?>>
64
<br>
65
<blockquote>
66
<? echo $t_body ?>
67
</blockquote>
68
</td>
69
</tr>
70
</table>
71
</div>
72
<?
73
}
75
else {
76
PRINT "ERROR DETECTED: Report this sql statement to <a href=\"<? echo $g_administrator_email ?>\">administrator</a><p>";
77
}
78
?>
79
<p>
80
<a href="<? echo $g_news_menu_page ?>">Click here to proceed</a>
81
</div>
82
83
<? print_footer() ?>
84
<? print_body_bottom() ?>
85
<? print_html_bottom() ?>