From: <vb...@us...> - 2002-09-09 22:30:25
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv31397/core Modified Files: config_inc.php note_api.php page_api.php Log Message: - Fixed 0000026: Submitting notes does not go back to the document - Partially Fixed 0000019: Support auto-accepting of notes - Fixed a problem in add_file() in page_api where it was rejecting new pages rather than duplicate pages. Index: config_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/config_inc.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- config_inc.php 6 Sep 2002 17:03:37 -0000 1.8 +++ config_inc.php 9 Sep 2002 22:30:21 -0000 1.9 @@ -107,4 +107,6 @@ $g_note_add = $g_web_directory . 'note_add' . $g_ext; $g_use_iis = OFF; + + $g_auto_accept_notes = OFF; ?> Index: note_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/note_api.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- note_api.php 9 Sep 2002 11:24:30 -0000 1.6 +++ note_api.php 9 Sep 2002 22:30:21 -0000 1.7 @@ -21,17 +21,24 @@ } ### -------------------- function note_add( $p_page_id, $p_email, $p_remote_addr, $p_note ) { - global $g_phpWN_note_table; + global $g_phpWN_note_table, $g_auto_accept_notes; + + if ( ON == $g_auto_accept_notes ) { + $t_visible = 1; + } else { + $t_visible = 0; + } $c_page_id = db_prepare_int( $p_page_id ); $c_email = db_prepare_string( $p_email ); $c_note = db_prepare_string( $p_note ); $c_remote_address = db_prepare_string( $p_remote_addr ); - $query = "INSERT + + $query = "INSERT INTO $g_phpWN_note_table - ( id, page_id, email, ip, date_submitted, note ) + ( id, page_id, email, ip, date_submitted, note, visible ) VALUES - ( null, '$c_page_id', '$c_email', '$c_remote_address', NOW(), '$c_note' )"; + ( null, '$c_page_id', '$c_email', '$c_remote_address', NOW(), '$c_note', $t_visible )"; return db_query( $query ); } ### -------------------- @@ -103,7 +110,7 @@ $info['note'] = nl2br( string_preserve_spaces ( db_unprepare_string( $v_note ) ) ); $info['date'] = date( 'M, d Y H:i', sql_to_unix_time( $v_date_submitted ) ); - theme_notes_echo( $p_page_name, $info ); + theme_notes_echo( $p_page_name, $p_url, $info ); } } ### -------------------- @@ -204,11 +211,11 @@ $t_page_id = get_page_id( $p_file ); if ( $t_page_id === '' ) { - theme_not_indexed( $p_page ); + theme_not_indexed( $p_page, $p_url ); } else { - theme_notes_start( $p_file ); + theme_notes_start( $p_file, $p_url ); note_print_all( $p_file ); - theme_notes_end( $p_file ); + theme_notes_end( $p_file, $p_url ); } } ### -------------------- Index: page_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/page_api.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- page_api.php 5 Sep 2002 14:13:00 -0000 1.3 +++ page_api.php 9 Sep 2002 22:30:21 -0000 1.4 @@ -66,7 +66,8 @@ } ### -------------------- function add_file( $p_page_name ) { - if ( get_page_id( $p_page_name ) === false ) { + # if page already exists, return to avoid duplicates + if ( get_page_id( $p_page_name ) !== false ) { return 0; } @@ -121,4 +122,4 @@ } } ### -------------------- -?> \ No newline at end of file +?> |