Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv19759/core Modified Files: access_api.php config_defaults_inc.php css_inc.php html_api.php link_api.php note_api.php pwn_api.php Log Message: - Added $g_cookie_url. - Fixed a problem with logout that was introduced by the previous commit. - Some changes towards more styles and less inline formatting. - Modified note_add_page.php / note_preview_page.php / note_add.php to support editing and some cleanup. - Added [ Edit ] action to inline moderation. - Added the menu to the inline moderation mode. - Changed the font for verdana/arial in the phpnet theme. Index: access_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/access_api.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- access_api.php 18 Sep 2002 12:33:31 -0000 1.7 +++ access_api.php 21 Sep 2002 02:44:33 -0000 1.8 @@ -137,6 +137,18 @@ return $count; } ### -------------------- + function access_is_logged_in() { + global $g_string_cookie_val; + + ### if logged in + if ( isset( $g_string_cookie_val ) ) { + return ( !empty( $g_string_cookie_val ) ); + } + + ### not logged in + return false; + } + ### -------------------- ### checks to see that a user is logged in ### if the user is and the account is enabled then let them pass ### otherwise redirect them to the login page Index: config_defaults_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/config_defaults_inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- config_defaults_inc.php 19 Sep 2002 05:15:47 -0000 1.5 +++ config_defaults_inc.php 21 Sep 2002 02:44:33 -0000 1.6 @@ -55,6 +55,9 @@ ### Cookies $g_string_cookie = 'PHPWEBNOTES_COOKIE_STRING'; + ### The url underwhich the cookie is visible + $g_cookie_url = '/'; + ################## # TIME SETTINGS ################## Index: css_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/css_inc.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- css_inc.php 20 Sep 2002 04:17:43 -0000 1.8 +++ css_inc.php 21 Sep 2002 02:44:33 -0000 1.9 @@ -10,28 +10,75 @@ ?> <style type="text/css"> -form { margin: 0px; display: inline; } -body { background-color: #ffffff; font-family:Verdana, Arial; font-size: 10pt } -td { font-family:Verdana, Arial; font-size: 10pt; padding: 4px; } -p { font-family:Verdana, Arial; font-size: 10pt } +div.pwn input { + background: #dcdcdc; + color: #000000; + font-size: 11px; + border-style: solid; + border-color: #b1b1b1; + border-width: thin; +} + + +div.pwn textarea { + background: #dcdcdc; + color: #000; + font-size: 11px; + border-style: solid; + border-color: #000; + border-width: 1px; + overflow: auto; +} + +div.pwn select { + background: #ccc; + color: #000; + font-size: 11px; + border-style: none; + border-color: #fff; + border-width: 0; +} + +div.pwn { font-family:Verdana, Arial; font-size: 10pt; background: transparent; } +div.pwn td { font-family:Verdana, Arial; font-size: 10pt; padding: 4px; } +div.pwn th { font-family:Verdana, Arial; font-size: 10pt; padding: 4px; } +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 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; } +div.pwn div.menu a:hover { text-decoration: underline; color: #000000; } +div.pwn div.footer {background-color: #ffffff; border-top: 1px solid #222222; padding: 3px; font-size: 10pt; text-align: left; color: #000000; margin-top: 20px; } +div.pwn div.top-file { } +div.pwn div.bottom-file { } +div.pwn div.warning {background-color: #f8e0e0; border: 1px solid #aa4444; padding: 8px; margin-top: 10px; margin-bottom: 10px; } +div.pwn div.error {background-color: #f8e0e0; border: 1px solid #aa4444; padding: 8px; margin-top: 10px; margin-bottom: 10px; } +div.pwn span.copyright { font-style: italic; } +div.pwn span.version { font-style: italic; } +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 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; } +div.pwn tr.buttons { color: #000000; text-align: center; } +div.pwn div.note p.title { font-weight: bold; text-align: center; } +div.pwn div.note { background-color: #c8e0f8; border: 1px solid #4444aa; padding: 8px; margin-top: 10px; margin-bottom: 10px; } + +/* h3 { font-family:Verdana, Arial; font-size: 13pt; font-weight: bold; text-align: center } -address { font-family:Verdana, Arial; font-size: 8pt } div {width: auto; font-size: 10pt; clear: both;} div.code {background-color: #f0f0f0; border: 1px solid #444444; padding: 8px; font-family: courier new, courier, fixed; white-space: pre;} -div.note75 { width: 75%; background-color: #c8e0f8; border: 1px solid #4444aa; padding: 8px;} div.note {background-color: #c8e0f8; border: 1px solid #4444aa; padding: 8px;} div.warning {background-color: #f8e0e0; border: 1px solid #aa4444; padding: 8px;} div.parent {background-color: #e8e8e8; border-bottom: 1px solid #aaaaaa; padding-top: 4px;} div.example {background-color: #f4f4f4; font-family: courier new, courier, fixed; border-left: 1px solid #000000; border-right: 1px solid #000000; display: inline;} -div.title {background-color: #c8e0f8; border: 1px solid #4444aa; padding: 8px;} div.box { border: 1px solid #000000; padding: 8px;} -div.warning {background-color: #f8e0e0; border: 1px solid #aa4444; padding: 8px;} -div.menu {background-color: #f4f4f4; border: 1px solid #000000; padding: 8px; text-align: center; } -tr.row-1 { background-color: #d8d8d8; color: #000000; } -tr.row-2 { background-color: #e8e8e8; color: #000000; } -td.category { background-color: #c8c8e8; color: #000000; font-weight: bold; } -td.form-title { background-color: #ffffff; color: #000000; font-weight: bold; } -td.form-buttons { background-color: #ffffff; color: #000000; font-weight: bold; text-align: center; } -table.width50 { width: 50%; border: solid 1px #000000; } -table.width75 { width: 75%; border: solid 1px #000000; } +*/ </style> Index: html_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/html_api.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- html_api.php 20 Sep 2002 05:00:35 -0000 1.10 +++ html_api.php 21 Sep 2002 02:44:33 -0000 1.11 @@ -64,7 +64,7 @@ } ### -------------------- function print_body_top() { - echo '<body>'; + echo '<body><div class="pwn">'; } ### -------------------- function print_header( $p_title = '' ) { @@ -72,33 +72,37 @@ <div class="title"> $p_title </div> - <br /> EOT; } ### -------------------- function print_top_page( $p_page ) { if ( !empty( $p_page ) && file_exists( $p_page ) ) { + echo '<div class="top-file">'; include_once( $p_page ); + echo '</div>'; } } ### -------------------- function print_bottom_page( $p_page ) { if ( !empty( $p_page ) && file_exists( $p_page ) ) { + echo '<div class="bottom-file">'; include_once( $p_page ); + echo '</div>'; } } ### -------------------- function print_footer( $p_file ) { global $g_webmaster_email; - echo '<br /><hr size="1" />'; + echo '<div class="footer">'; print_phpWebNotes_version(); - echo '<address>Copyright (c) 2000-2002</address>'; + echo '<span class="copyright">Copyright (c) 2000-2002</span><br />'; echo "<address><a href=\"mailto:$g_webmaster_email\">$g_webmaster_email</a></address>"; + echo '</div>'; } ### -------------------- function print_body_bottom() { - echo '</body>'; + echo '</div></body>'; } ### -------------------- function print_html_bottom() { @@ -112,10 +116,14 @@ ### checks to see whether we need to be displaying the version number function print_phpWebNotes_version() { if ( ON == config_get( 'show_version' ) ) { - echo '<em>phpWebNotes - ' . config_get( 'phpWebNotes_version' ) . '</em>'; + echo '<span class="version">phpWebNotes - ' . config_get( 'phpWebNotes_version' ) . '</span><br />'; } } ### -------------------- + function print_spacer() { + echo '<div class="spacer"></div>'; + } + ### -------------------- function print_admin_menu() { global $g_logout, $g_admin_index_files, $g_admin_change_password, $g_admin_manage_notes, $g_admin_manage_users, @@ -125,24 +133,23 @@ $queue_count = note_queue_count(); echo '<div class="menu">.: '; - echo "<a href=\"$g_user_home_page\">Home</a> :: "; + echo "<a title=\"Go to your home page\" href=\"$g_user_home_page\">Home</a> :: "; if ( access_check_action( ACTION_PAGES_MANAGE ) ) { - echo "<a href=\"$g_admin_index_files\">$s_index_files</a> :: "; + echo "<a title=\"Add or remove documents\" href=\"$g_admin_index_files\">$s_index_files</a> :: "; } if ( access_check_action( ACTION_NOTES_MODERATE ) ) { - echo "<a href=\"$g_admin_manage_notes\">$s_manage_notes</a> [$queue_count] :: "; + echo "<a title=\"Moderate notes\" href=\"$g_admin_manage_notes\">$s_manage_notes</a> [$queue_count] :: "; } if ( access_check_action( ACTION_USERS_MANAGE ) ) { - echo "<a href=\"$g_admin_manage_users\">$s_manage_users</a> :: "; + echo "<a title=\"View/edit user information\" href=\"$g_admin_manage_users\">$s_manage_users</a> :: "; } if ( access_check_action( ACTION_USERS_EDIT_OWN ) ) { - echo "<a href=\"$g_admin_change_password\">$s_change_password</a> :: "; + echo "<a title=\"Change your own password\" href=\"$g_admin_change_password\">$s_change_password</a> :: "; } echo <<<EOT - <a href="$g_logout">$s_logout_link</a> :. + <a title="Logout from phpWebNotes" href="$g_logout">$s_logout_link</a> :. </div> - <br /> EOT; } # -------------------- Index: link_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/link_api.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- link_api.php 19 Sep 2002 22:50:38 -0000 1.5 +++ link_api.php 21 Sep 2002 02:44:33 -0000 1.6 @@ -33,9 +33,9 @@ $c_note_id = db_prepare_int( $p_note_id ); $c_action = urlencode( $p_action ); - $c_url = urlencode( $p_url ); + # $c_url = urlencode( $p_url ); $t_action = config_get( 'web_directory') . 'action.php'; - $t_link = "$t_action?f_action=$c_action&f_note_id=$c_note_id&f_url=$c_url"; + $t_link = "$t_action?f_action=$c_action&f_note_id=$c_note_id"; # &f_url=$c_url"; return( link_create( $t_link, $t_caption, $p_link_active, $t_before, $t_after ) ); } Index: note_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/note_api.php,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- note_api.php 20 Sep 2002 04:17:43 -0000 1.23 +++ note_api.php 21 Sep 2002 02:44:33 -0000 1.24 @@ -9,6 +9,33 @@ # -------------------------------------------------------- ### -------------------- + function note_where_id_equals( $p_note_id ) { + $c_note_id = db_prepare_int( $p_note_id ); + return ("(id='$c_note_id')"); + } + ### -------------------- + # $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 * + FROM " . config_get( 'phpWN_note_table' ) . " + WHERE $p_where + LIMIT 1"; + + $result = db_query( $query ); + if ( db_num_rows( $result) > 0 ) { + $t_info = db_fetch_array( $result ); + + if ( null === $p_field ) { + return $t_info; + } else { + #echo "$p_field\n"; var_dump($t_info); exit; + return $t_info["$p_field"]; + } + } + + return false; + } + ### -------------------- # allow an array of visibilities as a parameter function note_queue_count() { # the reason of including the page is to avoid counting orphan @@ -114,6 +141,8 @@ $result = db_query( $query ); note_touch( $p_id ); + + return ( $result ); } ### -------------------- function note_touch( $p_note_id, $p_page_id = null ) { Index: pwn_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/pwn_api.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pwn_api.php 20 Sep 2002 06:57:44 -0000 1.2 +++ pwn_api.php 21 Sep 2002 02:44:33 -0000 1.3 @@ -10,8 +10,9 @@ ### -------------------- function pwn_head() { - global $g_meta_inc_file; + global $g_meta_inc_file, $g_css_inc_file; print_meta_inc( $g_meta_inc_file ); + print_css_link( $g_css_inc_file ); theme_head(); } ### -------------------- |