From: <vb...@us...> - 2002-09-11 04:47:51
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv22614/core Modified Files: config_inc.php note_api.php page_api.php Log Message: - Implemented 0000035: Allow auto-indexing if page was not indexed - Fixed a typo in page_valid_id() where it was named page_valid_ip() - Fixed a problem in print_webnotes() where it was using $p_page rather than $p_file. [ This is a blind commit - not tested ] Index: config_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/config_inc.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- config_inc.php 10 Sep 2002 01:14:35 -0000 1.10 +++ config_inc.php 11 Sep 2002 04:47:49 -0000 1.11 @@ -138,6 +138,12 @@ # minutes to wait before document is stale (in minutes) $g_content_expire = 0; + ################### + # ADMIN SETTINGS + ################### + + $g_auto_index_pages = ON; + ######################## # MODERATION SETTINGS ######################## Index: note_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/note_api.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- note_api.php 10 Sep 2002 10:34:14 -0000 1.10 +++ note_api.php 11 Sep 2002 04:47:49 -0000 1.11 @@ -213,8 +213,17 @@ echo '<br />'; $t_page_id = page_get_id( $p_file ); - if ( $t_page_id === '' ) { - theme_not_indexed( $p_page, $p_url ); + if ( !page_valid_id( $t_page_id ) ) { + global $g_auto_index_pages; + + if ( ON === $g_auto_index_pages ) { + if ( page_add( $p_file ) ) { + print_web_notes( $p_file, $p_url ); + return; + } + } + + theme_not_indexed( $p_file, $p_url ); } else { if ( page_visible_notes_count ( $t_page_id ) > 0 ) { theme_notes_start( $p_file, $p_url ); Index: page_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/page_api.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- page_api.php 10 Sep 2002 13:58:34 -0000 1.7 +++ page_api.php 11 Sep 2002 04:47:49 -0000 1.8 @@ -28,12 +28,12 @@ return false; } ### -------------------- - function page_valid_ip( $p_page_id ) { + function page_valid_id( $p_page_id ) { return ( false !== $p_page_id ); } ### -------------------- function page_is_indexed( $p_file ) { - return ( page_valid_ip( page_get_id( $p_file ) ) ); + return ( page_valid_id( page_get_id( $p_file ) ) ); } ### -------------------- function page_visible_notes_count( $p_page_id ) { @@ -104,7 +104,7 @@ $t_filename = $p_path . $file; $t_id = page_get_id( $t_filename ); #echo "<a href=\"$g_admin_index_files?f_dir=$t_file\">$file</a><br />"; - $t_add = !page_valid_ip( $t_id ); + $t_add = !page_valid_id( $t_id ); if ( !$t_add ) { $t_count = '(' . page_visible_notes_count( $t_id ) . ')'; } else { |