/
note_add.php
70 lines (57 loc) · 1.9 KB
/
note_add.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
# phpWebNotes - a php based note addition system
# Copyright (C) 2000-2002 Webnotes Team - webnotes-devel@sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the files README and LICENSE for details
# --------------------------------------------------------
# $Id: note_add.php,v 1.20 2003/09/13 06:59:30 vboctor Exp $
# --------------------------------------------------------
require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' );
access_ensure_check_action( ACTION_NOTES_SUBMIT );
$f_page_id = gpc_get_int( 'f_page_id' );
$f_note_id = gpc_get_int( 'f_note_id' );
$f_email = stripslashes( gpc_get_string( 'f_email' ) );
$f_note = stripslashes( gpc_get_string( 'f_note' ) );
### insert note
if ( 0 == $f_note_id ) {
$result = note_add( $f_page_id, $f_email, $REMOTE_ADDR, $f_note);
if ( $result !== false ) {
email_note_added( $result );
}
} else {
$result = note_update( $f_note_id, $f_email, $f_note );
email_note_updated( $f_note_id );
}
$t_page_info = page_get_info( page_where_id_equals( $f_page_id ) );
if ( false === $t_page_info ) {
echo "page not found";
exit;
}
$t_url = $t_page_info['url'];
print_html_top();
print_head_top();
print_title( $g_window_title );
print_css( $g_css_inc_file );
if ( $result ) {
print_meta_redirect( $t_url, $g_time_wait );
}
print_head_bottom();
print_body_top();
print_header( $g_page_title );
echo '<div align="center">';
if ( $result ) {
if ( 0 == $f_note_id ) {
echo "<p>$s_created_note_msg</p>";
} else {
echo "<p>Note modified successfully</p>";
}
}
else {
echo "$s_sql_error_msg <a href=\"$g_administrator_email\">$s_administrator</a><br />";
}
echo "<p><a href=\"$t_url\">$s_click_to_proceed_msg</a></p>";
echo '</div>';
print_footer( __FILE__ );
print_body_bottom();
print_html_bottom();
?>