From: <vb...@us...> - 2002-09-22 02:47:19
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv28006/core Modified Files: css_inc.php html_api.php note_api.php page_api.php pwn_api.php Log Message: - Fixed the border in the submit form - Removed the menu from the preview page. - Added a spacer in the preview page. - Fixed the alignment in the login / submit forms. - Removed the last updated from the preview. - Fixed the formatting of the note submit timestamp - Added the last updated timestamp for the page to the database. - Implemented the code to update/view the page last updated timestamp. Index: css_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/css_inc.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- css_inc.php 21 Sep 2002 02:44:33 -0000 1.9 +++ css_inc.php 22 Sep 2002 02:47:16 -0000 1.10 @@ -45,10 +45,10 @@ div.pwn p { font-family:Verdana, Arial; font-size: 10pt; } div.pwn div.spacer { width: auto; border: none; margin: 20px; } -div.pwn .large-width { width: 75%; } -div.pwn .medium-width { width: 75%; } -div.pwn .small-width { width: 50%; } -div.pwn .center { align: center; } +div.pwn .large-width { width: 100%; text-align: center; } +div.pwn .medium-width { width: 75%; text-align: center; } +div.pwn .small-width { width: 50%; text-align: center; } +div.pwn .center { text-align: center; } div.pwn div.title { background-color: #98b8e8; padding: 3px; border-bottom: 5px solid #000000; font-size: 10pt; font-weight: bold; letter-spacing: 1.0em; text-align: right; color: #204888; padding-top: 10px; padding-bottom: 10px; margin-bottom: 0px; } div.pwn div.menu { background-color: #f4f4f4; border-bottom: 1px solid #000000; padding: 3px; text-align: left; margin-bottom: 20px; padding-left: 10px; } div.pwn div.menu a { text-decoration: none; color: #666; } @@ -63,7 +63,7 @@ div.pwn th, div.pwn .category { background-color: #c8c8e8; color: #000000; font-weight: bold; } div.pwn form { margin: 0px; display: inline; } div.pwn address { font-family:Verdana, Arial; font-size: 8pt; } -div.pwn table.box { border: solid 1px #000000; margin-top: 10px; margin-bottom: 10px; } +div.pwn table.box { border: solid 1px #000000; margin-top: 10px; margin-bottom: 10px; text-align: left; width: 100%; } div.pwn tr.row-1 { background-color: #d8d8d8; color: #000000; } div.pwn tr.row-2 { background-color: #d8d8d8; color: #000000; } div.pwn tr.title { color: #000000; font-weight: bold; } Index: html_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/html_api.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- html_api.php 21 Sep 2002 02:44:33 -0000 1.11 +++ html_api.php 22 Sep 2002 02:47:16 -0000 1.12 @@ -10,7 +10,8 @@ ### -------------------- function print_html_top() { - echo '<html>'; + echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' . + "\n<html>"; } ### -------------------- function print_head_top() { Index: note_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/note_api.php,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- note_api.php 21 Sep 2002 02:44:33 -0000 1.24 +++ note_api.php 22 Sep 2002 02:47:16 -0000 1.25 @@ -16,7 +16,7 @@ ### -------------------- # $p_where is constructed by note_where* and hence does not need to be cleaned. function note_get_info ( $p_where, $p_field = null ) { - $query = "SELECT * + $query = "SELECT *, UNIX_TIMESTAMP(date_submitted) as date_submitted FROM " . config_get( 'phpWN_note_table' ) . " WHERE $p_where LIMIT 1"; @@ -145,7 +145,21 @@ return ( $result ); } ### -------------------- + function note_get_page_id( $p_note_id ) { + $t_note_info = note_get_info( note_where_id_equals ( $p_note_id ) ); + if ( false === $t_note_info ) { + return false; + } + + return $t_note_info['page_id']; + } + ### -------------------- function note_touch( $p_note_id, $p_page_id = null ) { + if ( null === $p_page_id ) { + $p_page_id = note_get_page_id( $p_note_id ); + } + + page_touch( $p_page_id ); } ### -------------------- function note_get_all_visible( $p_page_id ) { @@ -158,7 +172,7 @@ $c_page_id = db_prepare_int( $p_page_id ); - $query = "SELECT * + $query = "SELECT *, UNIX_TIMESTAMP(date_submitted) as date_submitted FROM " . config_get( 'phpWN_note_table' ) . " WHERE page_id='$c_page_id' ORDER BY date_submitted " . config_get( 'note_order' ); Index: page_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/page_api.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- page_api.php 20 Sep 2002 04:17:43 -0000 1.15 +++ page_api.php 22 Sep 2002 02:47:16 -0000 1.16 @@ -29,7 +29,7 @@ ### -------------------- # $p_where is constructed by page_where* and hence does not need to be cleaned. function page_get_info ( $p_where, $p_field = null ) { - $query = "SELECT * + $query = "SELECT *, UNIX_TIMESTAMP(last_updated) as last_updated FROM " . config_get( 'phpWN_page_table' ) . " WHERE $p_where LIMIT 1"; @@ -166,7 +166,10 @@ } } - # @@@@ If the information is the same, then don't update/touch. + # If the information is the same, then don't update/touch. + if ( ( $t_prev_id == $t_page_info['prev_id'] ) || ( $t_next_id == $t_page_info['next_id'] ) ) { + return; + } $c_page_id = db_prepare_int( $p_page_id ); @@ -179,6 +182,14 @@ ### -------------------- # Update the last modified time stamp for the page. function page_touch( $p_page_id ) { + $c_page_id = db_prepare_int( $p_page_id ); + + $query ='UPDATE ' . config_get( 'phpWN_page_table') . ' ' . + "SET last_updated=NOW() " . + "WHERE id='$c_page_id' " . + "LIMIT 1"; + + return ( false !== db_query( $query ) ); } ### -------------------- ### Allows for path navigation to choose base dir @@ -231,9 +242,9 @@ $c_page_name = db_prepare_string( $p_page_name ); $query = "INSERT INTO " . config_get( 'phpWN_page_table' ) . " - ( id, date_indexed, page ) + ( id, date_indexed, last_updated, page ) VALUES - ( null, NOW(), '$c_page_name' )"; + ( null, NOW(), NOW(), '$c_page_name' )"; $result = db_query( $query ); return $result; @@ -312,7 +323,7 @@ $t_page_data['id'] = $t_page_info['id']; $t_page_data['page'] = $t_page_info['page']; $t_page_data['url'] = $t_page_info['url']; - $t_page_data['last_modified'] = 0; + $t_page_data['last_updated'] = $t_page_info['last_updated']; $t_page_data['preview'] = false; $t_prev_page = page_get_info( page_where_id_equals( $t_page_info['prev_id'] ) ); Index: pwn_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/pwn_api.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- pwn_api.php 21 Sep 2002 02:44:33 -0000 1.3 +++ pwn_api.php 22 Sep 2002 02:47:16 -0000 1.4 @@ -12,7 +12,7 @@ function pwn_head() { global $g_meta_inc_file, $g_css_inc_file; print_meta_inc( $g_meta_inc_file ); - print_css_link( $g_css_inc_file ); + print_css( $g_css_inc_file ); theme_head(); } ### -------------------- |