From: <vb...@us...> - 2002-09-10 04:28:14
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv13512/core Modified Files: note_api.php page_api.php Log Message: Fixed 0000033: no calls for the theme_notes_none function [not tested] Index: note_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/note_api.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- note_api.php 9 Sep 2002 22:56:56 -0000 1.8 +++ note_api.php 10 Sep 2002 04:28:11 -0000 1.9 @@ -216,9 +216,13 @@ if ( $t_page_id === '' ) { theme_not_indexed( $p_page, $p_url ); } else { - theme_notes_start( $p_file, $p_url ); - note_print_all( $p_file ); - theme_notes_end( $p_file, $p_url ); + if ( page_visible_notes_count ( $t_page_id ) > 0 ) { + theme_notes_start( $p_file, $p_url ); + note_print_all( $p_file ); + theme_notes_end( $p_file, $p_url ); + } else { + theme_notes_none( $p_file, $p_url ); + } } } ### -------------------- Index: page_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/page_api.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- page_api.php 9 Sep 2002 22:30:21 -0000 1.4 +++ page_api.php 10 Sep 2002 04:28:11 -0000 1.5 @@ -28,6 +28,18 @@ return false; } ### -------------------- + function page_visible_notes_count( $p_page_id ) { + global $g_phpWN_note_table; + + $c_page_id = db_prepare_int( $p_page_id ); + + $query = "SELECT COUNT(*) + FROM $g_phpWN_note_table + WHERE page_id=$c_page_id"; + $result = db_query( $query ); + return db_result( $result, 0, 0 ); + } + ### -------------------- function get_page_name( $p_id ) { global $g_phpWN_page_table; |