You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(240) |
Oct
(66) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(9) |
Sep
(7) |
Oct
|
Nov
|
Dec
|
From: <vb...@us...> - 2002-09-22 02:47:19
|
Update of /cvsroot/webnotes/webnotes/sql In directory usw-pr-cvs1:/tmp/cvs-serv28006/sql Modified Files: db_upgrade.sql 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: db_upgrade.sql =================================================================== RCS file: /cvsroot/webnotes/webnotes/sql/db_upgrade.sql,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- db_upgrade.sql 19 Sep 2002 22:50:39 -0000 1.5 +++ db_upgrade.sql 22 Sep 2002 02:47:16 -0000 1.6 @@ -1,5 +1,6 @@ ALTER TABLE `phpWN_user_table` CHANGE `password` `password` VARCHAR( 32 ) NOT NULL; ALTER TABLE `phpWN_user_table` CHANGE `access_level` `access_level` INT( 2 ) DEFAULT '40' NOT NULL; ALTER TABLE `phpWN_page_table` ADD `url` VARCHAR( 255 ) NOT NULL ; -ALTER TABLE `phpWN_page_table` ADD `prev_id` INT( 10 ) UNSIGNEDZEROFILL NOT NULL ; -ALTER TABLE `phpWN_page_table` ADD `next_id` INT( 10 ) UNSIGNEDZEROFILL NOT NULL ; +ALTER TABLE `phpWN_page_table` ADD `prev_id` INT( 10 ) UNSIGNED ZEROFILL NOT NULL ; +ALTER TABLE `phpWN_page_table` ADD `next_id` INT( 10 ) UNSIGNED ZEROFILL NOT NULL ; +ALTER TABLE `phpWN_page_table` ADD `last_updated` DATETIME NOT NULL AFTER `date_indexed` ; \ No newline at end of file |
From: <vb...@us...> - 2002-09-22 02:47:19
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv28006 Modified Files: login_page.php note_add_msg_inc.php note_add_page.php note_preview_page.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: login_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/login_page.php,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- login_page.php 21 Sep 2002 02:44:32 -0000 1.20 +++ login_page.php 22 Sep 2002 02:47:16 -0000 1.21 @@ -54,7 +54,7 @@ } echo <<<EOT - <div align="center"> + <div class="center"> <form name="f_login_form" method="post" action="$g_login"> <table class="box" summary=""> <tr class="title"> @@ -62,15 +62,15 @@ <td width="75%" align="right">[ <a href="signup_page.php"><strong>Sign Up</strong></a> ]</td> </tr> <tr class="row-1"> - <td class="category">$s_username:</td> + <th>$s_username:</th> <td><input type="text" name="f_username" size="32" maxlength="32" /></td> </tr> <tr class="row-2"> - <td class="category">$s_password:</td> + <th>$s_password:</th> <td><input type="password" name="f_password" size="32" maxlength="32" /></td> </tr> <tr class="row-1"> - <td class="category">$s_save_login:</td> + <th>$s_save_login:</th> <td><input type="checkbox" name="f_perm_login" /></td> </tr> <tr class="buttons"> Index: note_add_msg_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add_msg_inc.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- note_add_msg_inc.php 21 Sep 2002 02:44:32 -0000 1.8 +++ note_add_msg_inc.php 22 Sep 2002 02:47:16 -0000 1.9 @@ -8,8 +8,8 @@ # $Id$ # -------------------------------------------------------- ?> -<div class="medium-width"> <div class="center"> +<div class="medium-width"> <div class="note"> <p class="title">NOTE</p> <p>You can contribute your insights to this document via your web browser!</p> Index: note_add_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add_page.php,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- note_add_page.php 21 Sep 2002 02:44:32 -0000 1.19 +++ note_add_page.php 22 Sep 2002 02:47:16 -0000 1.20 @@ -63,8 +63,9 @@ $t_date = date ($g_date_format); echo <<<EOT - <div class="small-width"> - <table summary=""> + <div class="center"> + <div class="medium-width"> + <table class="box" summary=""> <form method="post" action="$g_note_preview_page"> <input type="hidden" name="f_page_id" value="$f_page_id" /> <input type="hidden" name="f_note_id" value="$t_note_id" /> @@ -94,6 +95,7 @@ </tr> </form> </table> + </div> </div> EOT; } ### end else Index: note_preview_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_preview_page.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- note_preview_page.php 21 Sep 2002 02:44:32 -0000 1.8 +++ note_preview_page.php 22 Sep 2002 02:47:16 -0000 1.9 @@ -56,6 +56,7 @@ $f_note = string_to_form( $f_note ); echo <<<EOT + <div class="spacer"></div> <form method="post" action="$g_note_add"> <input type="hidden" name="f_note_id" value="$f_note_id" /> <input type="hidden" name="f_page_id" value="$f_page_id" /> |
From: <vb...@us...> - 2002-09-21 02:44:36
|
Update of /cvsroot/webnotes/webnotes/themes/phpnet In directory usw-pr-cvs1:/tmp/cvs-serv19759/themes/phpnet Modified Files: theme.css theme_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: theme.css =================================================================== RCS file: /cvsroot/webnotes/webnotes/themes/phpnet/theme.css,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- theme.css 20 Sep 2002 05:00:36 -0000 1.1 +++ theme.css 21 Sep 2002 02:44:33 -0000 1.2 @@ -9,29 +9,7 @@ # -------------------------------------------------------- */ -/* -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 } -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; } -*/ +div.phpnet { font-family:Verdana, Arial; font-size: 10pt; background: transparent; } +div.phpnet td { font-family:Verdana, Arial; font-size: 10pt; padding: 4px; } +div.phpnet th { font-family:Verdana, Arial; font-size: 10pt; padding: 4px; } +div.phpnet p { font-family:Verdana, Arial; font-size: 10pt; } Index: theme_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/themes/phpnet/theme_api.php,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- theme_api.php 20 Sep 2002 06:57:44 -0000 1.21 +++ theme_api.php 21 Sep 2002 02:44:33 -0000 1.22 @@ -40,9 +40,7 @@ $t_notes = $p_page_data['notes']; $t_page = $p_page_data['page']; - $t_url = $p_page_data['url']; - $c_url = urlencode( $t_url ); $t_page_id = $p_page_data['id']; $t_images_base = $g_web_directory . 'themes/' . $g_theme . '/images/'; @@ -52,7 +50,7 @@ $next_picture = $t_images_base . 'caret_right.gif'; if ( false === $p_page_data['preview'] ) { - $t_link_start = "<a href=\"$g_note_add_page?f_page_id=$t_page_id&f_url=$c_url\">"; + $t_link_start = "<a href=\"$g_note_add_page?f_page_id=$t_page_id\">"; $t_link_end = '</a>'; } else { $t_link_start = $t_link_end = ''; @@ -63,6 +61,7 @@ # echo <<<EOT + <div class="phpnet"> <table summary="" border="0" cellpadding="4" cellspacing="0" width="100%"> <tr bgcolor="#d0d0d0" valign="top"> <td><small>User Contributed Notes</small><br /><strong>$t_page</strong></td> @@ -103,6 +102,9 @@ $t_moderation .= link_note_action( $t_note_info['id'], 'archive', $t_url, access_check_action( ACTION_NOTES_MODERATE_ARCHIVE ) ) . ' '; + $t_moderation .= link_note_action( $t_note_info['id'], 'edit', $t_url, + access_check_action( ACTION_NOTES_EDIT ) ); + $t_moderation .= link_note_action( $t_note_info['id'], 'delete', $t_url, access_check_action( ACTION_NOTES_MODERATE_DELETE ) ); @@ -186,7 +188,7 @@ } if ( false === $p_page_data['preview'] ) { - $t_link_start = "<a href=\"$g_note_add_page?f_page_id=$t_page_id&f_url=$c_url\">"; + $t_link_start = "<a href=\"$g_note_add_page?f_page_id=$t_page_id\">"; $t_link_end = '</a>'; } else { $t_link_start = $t_link_end = ''; @@ -211,7 +213,13 @@ </table> </td></tr> </table> + </div> EOT; + if ( access_is_logged_in() ) { + echo '<div class="pwn">'; + print_admin_menu(); + echo '</div>'; + } } ### -------------------- ?> |
From: <vb...@us...> - 2002-09-21 02:44:36
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv19759 Modified Files: action.php admin_change_password.php admin_manage_notes.php admin_manage_users.php index.php login.php login_page.php logout.php note_add.php note_add_msg_inc.php note_add_page.php note_preview_page.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: action.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/action.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- action.php 19 Sep 2002 05:15:47 -0000 1.6 +++ action.php 21 Sep 2002 02:44:32 -0000 1.7 @@ -17,17 +17,30 @@ exit; } - if ( !isset( $f_url ) ) { - echo 'f_url not defined<br />'; - exit; - } else { - $c_url = urldecode( $f_url ); - } + #if ( !isset( $f_url ) ) { + # echo 'f_url not defined<br />'; + # exit; + #} else { + # $c_url = urldecode( $f_url ); + #} # @@@@ add handling for confirm? # The access level check is done in the APIs if ( isset( $f_note_id )) { + $t_note_info = note_get_info( note_where_id_equals( $f_note_id ) ); + if ( false === $t_note_info ) { + echo "note not found"; + exit; + } + + $t_page_info = page_get_info( page_where_id_equals( $t_note_info['page_id'] ) ); + if ( false === $t_page_info ) { + echo "page not found"; + exit; + } + $t_url = $t_page_info['url']; + if ( 'accept' === $f_action ) { note_accept( $f_note_id ); } else if ( 'decline' === $f_action ) { @@ -41,6 +54,8 @@ note_pack_deleted(); } else if ( 'pending' === $f_action ) { note_pending( $f_note_id ); + } else if ( 'edit' === $f_action ) { + header( "Location: $g_note_add_page?f_note_id=$f_note_id" ); } } @@ -67,13 +82,13 @@ print_admin_menu(); - echo "<br /><div align=\"center\">Operation Successful<br /><a href=\"$c_url\">[ Click here to proceed ]</a></div><br />"; + echo "<br /><div align=\"center\">Operation Successful<br /><a href=\"$t_url\">[ Click here to proceed ]</a></div><br />"; print_footer( __FILE__ ); print_bottom_page( $g_bottom_page_inc ); print_body_bottom(); print_html_bottom(); } else { - util_header_redirect( $c_url ); + util_header_redirect( $t_url ); } ?> Index: admin_change_password.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_change_password.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- admin_change_password.php 18 Sep 2002 12:33:31 -0000 1.16 +++ admin_change_password.php 21 Sep 2002 02:44:32 -0000 1.17 @@ -50,30 +50,30 @@ <form method="post" action="$g_admin_change_password"> <input type="hidden" name="f_action" value="change" /> <input type="hidden" name="f_id" value="$v_id" /> - <table class="width50"> - <tr class="form-title"> + <table class="box"> + <tr class="title"> <td colspan="2"> <strong>$s_change_password_title</strong> </td> </tr> <tr class="row-1"> - <td class="category" width="25%">$s_username:</td> + <th width="25%">$s_username:</th> <td width="75%">$v_username</td> </tr> <tr class="row-2"> - <td class="category">Current Password:</td> + <th>Current Password:</th> <td><input type="password" name="f_current_password" size="32" maxlength="32" /></td> </tr> <tr class="row-1"> - <td class="category">$s_password:</td> + <th>$s_password:</th> <td><input type="password" name="f_password" size="32" maxlength="32" /></td> </tr> <tr class="row-2"> - <td class="category">$s_verify_password:</td> + <th>$s_verify_password:</th> <td><input type="password" name="f_password2" size="32" maxlength="32" /></td> </tr> - <tr> - <td class="form-buttons" colspan="2"><input type="submit" value="$s_change_password_link" /></td> + <tr class="buttons"> + <td colspan="2"><input type="submit" value="$s_change_password_link" /></td> </tr> </table> </form> Index: admin_manage_notes.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_manage_notes.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- admin_manage_notes.php 19 Sep 2002 21:51:01 -0000 1.15 +++ admin_manage_notes.php 21 Sep 2002 02:44:32 -0000 1.16 @@ -29,7 +29,7 @@ foreach( $pages as $page ) { extract( $page, EXTR_PREFIX_ALL, 'v' ); - echo "<a href=\"$v_url\" target=\"_blank\">$v_page</a> - $v_url<br />\n"; + echo "<a href=\"$v_url\">$v_page</a> - $v_url<br />\n"; } print_footer( __FILE__ ); Index: admin_manage_users.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_manage_users.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- admin_manage_users.php 18 Sep 2002 13:34:58 -0000 1.3 +++ admin_manage_users.php 21 Sep 2002 02:44:32 -0000 1.4 @@ -27,19 +27,20 @@ $t_users_array = user_get_all(); - echo '<div class="box" align="center">'; + #echo '<div class="pwn-box" align="center">'; - echo '<table border="0" width="95%" cellspacing="0">'; - echo "<thead><tr><td>User Name</td><td>Email</td><td>Access Level</td><td>Enabled</td></tr></thead><tbody>"; + echo '<table class="pwn-width100" border="0" width="95%" cellspacing="0">'; + echo "<thead><tr class=\"pwn-category\"><td>User Name</td><td>Email</td><td>Access Level</td><td>Enabled</td></tr></thead><tbody>"; $i = 0; foreach ( $t_users_array as $user ) { extract( $user, EXTR_PREFIX_ALL, 'v' ); + $v_enabled = $v_enabled ? 'x' : ' '; $t_color = util_alternate_colors( $i++ ); $t_access_level = enum_get_element( 'access_levels', $v_access_level ); echo "<tr bgcolor=\"$t_color\"><td>$v_username</td><td>$v_email</td><td>$t_access_level</td><td>$v_enabled</td></tr>"; } echo '</tbody></table>'; - echo '</div>'; + #echo '</div>'; print_footer( __FILE__ ); print_bottom_page( $g_bottom_page_inc ); Index: index.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/index.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- index.php 20 Sep 2002 04:21:09 -0000 1.2 +++ index.php 21 Sep 2002 02:44:32 -0000 1.3 @@ -8,5 +8,5 @@ # $Id$ # -------------------------------------------------------- - header("Location: login_page.php"); + header("Location: user_home_page.php"); ?> Index: login.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/login.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- login.php 20 Sep 2002 06:57:43 -0000 1.12 +++ login.php 21 Sep 2002 02:44:32 -0000 1.13 @@ -26,7 +26,7 @@ if( password_match( $f_password, $v_password ) ) { ### set permanent cookie (1 year) if ( ( isset( $f_perm_login ) ) && ( $f_perm_login == "on" ) ) { - if ( !setcookie( $g_string_cookie, $v_cookie_string, time() + $g_cookie_time_length, '/' ) ) { + if ( !setcookie( $g_string_cookie, $v_cookie_string, time() + $g_cookie_time_length, $g_cookie_url ) ) { # @@@@ Proper error message echo "Unable to set cookie"; exit; @@ -34,7 +34,7 @@ } ### set temp cookie, cookie dies after browser closes else { - if ( !setcookie( $g_string_cookie, $v_cookie_string, 0, '/' ) ) { + if ( !setcookie( $g_string_cookie, $v_cookie_string, 0, $g_cookie_url ) ) { # @@@@ Proper error message echo "Unable to set cookie"; exit; Index: login_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/login_page.php,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- login_page.php 16 Sep 2002 13:27:19 -0000 1.19 +++ login_page.php 21 Sep 2002 02:44:32 -0000 1.20 @@ -29,10 +29,9 @@ if ( $f_msg === 'error' ) { echo <<<EOT - <div class="warning" align="center"> + <div class="error" align="center"> <strong>ERROR:</strong> Unauthorised access for supplied user name and password. </div> - <br /> EOT; } @@ -42,7 +41,6 @@ <div class="warning" align="center"> <strong>WARNING:</strong> Plain password authentication is used, this will expose your passwords to administrators. </div> - <br /> EOT; } @@ -52,17 +50,16 @@ <div class="warning" align="center"> <strong>WARNING:</strong> You should disable the "administrator" account or change its password. </div> - <br /> EOT; } echo <<<EOT <div align="center"> <form name="f_login_form" method="post" action="$g_login"> - <table class="width50" summary=""> - <tr> - <td class="form-title" width="25%"><strong>$s_login_title</strong></td> - <td class="form-title" width="75%" align="right">[ <a href="signup_page.php"><strong>Sign Up</strong></a> ]</td> + <table class="box" summary=""> + <tr class="title"> + <td width="25%"><strong>$s_login_title</strong></td> + <td width="75%" align="right">[ <a href="signup_page.php"><strong>Sign Up</strong></a> ]</td> </tr> <tr class="row-1"> <td class="category">$s_username:</td> @@ -76,8 +73,8 @@ <td class="category">$s_save_login:</td> <td><input type="checkbox" name="f_perm_login" /></td> </tr> - <tr> - <td class="form-buttons" colspan="2"><input type="submit" value="$s_login_button" /></td> + <tr class="buttons"> + <td colspan="2"><input type="submit" value="$s_login_button" /></td> </tr> </table> </form> Index: logout.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/logout.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- logout.php 14 Sep 2002 06:22:02 -0000 1.13 +++ logout.php 21 Sep 2002 02:44:32 -0000 1.14 @@ -11,7 +11,7 @@ require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); ### remove cookie - setcookie( $g_string_cookie ); + setcookie( $g_string_cookie, '', 0, $g_cookie_url ); util_header_redirect( $g_logout_redirect_page ); print_html_top(); Index: note_add.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add.php,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- note_add.php 20 Sep 2002 04:17:42 -0000 1.17 +++ note_add.php 21 Sep 2002 02:44:32 -0000 1.18 @@ -13,12 +13,24 @@ access_ensure_check_action( ACTION_NOTES_SUBMIT ); $f_page_id = gpc_get_int( 'f_page_id' ); + $f_note_id = gpc_get_int( 'f_note_id' ); $f_email = stripslashes( gpc_get_string( 'f_email' ) ); $f_note = stripslashes( gpc_get_string( 'f_note' ) ); - $f_url = gpc_get_string( 'f_url' ); ### insert note - $result = note_add( $f_page_id, $f_email, $REMOTE_ADDR, $f_note); + if ( 0 == $f_note_id ) { + $result = note_add( $f_page_id, $f_email, $REMOTE_ADDR, $f_note); + } else { + $result = note_update( $f_note_id, $f_email, $f_note ); + } + + $t_page_info = page_get_info( page_where_id_equals( $f_page_id ) ); + if ( false === $t_page_info ) { + echo "page not found"; + exit; + } + + $t_url = $t_page_info['url']; print_html_top(); print_head_top(); @@ -26,25 +38,26 @@ print_css( $g_css_inc_file ); if ( $result ) { - print_meta_redirect( $f_url, $g_time_wait ); + print_meta_redirect( $t_url, $g_time_wait ); } print_head_bottom(); print_body_top(); print_header( $g_page_title ); - echo '<br />'; echo '<div align="center">'; - if ( $result ) { - echo "$s_created_note_msg<br />"; + if ( 0 == $f_note_id ) { + echo "<p>$s_created_note_msg</p>"; + } else { + echo "<p>Note modified successfully</p>"; + } } else { echo "$s_sql_error_msg <a href=\"$g_administrator_email\">$s_administrator</a><br />"; } - echo '<br />'; - echo "<a href=\"$f_url\">$s_click_to_proceed_msg</a>"; + echo "<p><a href=\"$t_url\">$s_click_to_proceed_msg</a></p>"; echo '</div>'; print_footer( __FILE__ ); Index: note_add_msg_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add_msg_inc.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- note_add_msg_inc.php 15 Sep 2002 13:20:56 -0000 1.7 +++ note_add_msg_inc.php 21 Sep 2002 02:44:32 -0000 1.8 @@ -8,19 +8,14 @@ # $Id$ # -------------------------------------------------------- ?> -<br /> -<div align="center"> -<div class="note75" align="center"> - <strong>NOTE</strong><br /><br /> - <table width="75%"> - <tr> - <td> - <p>You can contribute your insights to this document via your web browser!</p> - <p>Just add your comment and (optional) email address in the form below. If you do specify your real email, anti-spam measures are encouraged (eg. la...@ma...).</p> - <p>No HTML tags are allowed. Line breaks are preserved.</p> - <p>After you add your note it will be queued for approval by a moderator. Your note may be edited for spelling, grammar, and content.</p> - </td> - </tr> - </table> +<div class="medium-width"> +<div class="center"> +<div class="note"> + <p class="title">NOTE</p> + <p>You can contribute your insights to this document via your web browser!</p> + <p>Just add your comment and (optional) email address in the form below. If you do specify your real email, anti-spam measures are encouraged (eg. la...@ma...).</p> + <p>No HTML tags are allowed. Line breaks are preserved.</p> + <p>After you add your note it will be queued for approval by a moderator. Your note may be edited for spelling, grammar, and content.</p> +</div> </div> </div> Index: note_add_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add_page.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- note_add_page.php 18 Sep 2002 12:33:31 -0000 1.18 +++ note_add_page.php 21 Sep 2002 02:44:32 -0000 1.19 @@ -21,6 +21,25 @@ print_header( $g_page_title ); print_top_page( $g_top_page_inc ); + $f_note_id = gpc_get_int( 'f_note_id', 0 ); + if ( 0 == $f_note_id ) { + $f_page_id = gpc_get_int( 'f_page_id' ); + $t_default_email = ''; + $t_default_body = ''; + $t_note_id = 0; + } else { + $t_note_info = note_get_info( note_where_id_equals( $f_note_id ) ); + if ( false === $t_note_info ) { + # @@@@ proper error + echo "no note with the specified id"; + exit; + } + $t_default_email = $t_note_info['email']; + $t_default_body = $t_note_info['note']; + $t_note_id = db_prepare_int( $f_note_id ); + $f_page_id = $t_note_info['page_id']; + } + $t_page_name = page_get_name( $f_page_id ); if ( empty ( $t_page_name ) ) { echo "<div align=\"center\">"; @@ -31,11 +50,6 @@ else { ?> -<p> -<div align="center"> -<a href="<? echo $HTTP_REFERER?>"><? echo $s_back_link ?></a> -</div> - <?php # @@@@ When themes are supported, this won't be needed (or at least done in another way. ### Display a nice message @@ -49,40 +63,37 @@ $t_date = date ($g_date_format); echo <<<EOT - <br /> - <div align="center"> - <table class="width75" summary=""> + <div class="small-width"> + <table summary=""> <form method="post" action="$g_note_preview_page"> - <input type="hidden" name="f_came_from" value="$HTTP_REFERER" /> <input type="hidden" name="f_page_id" value="$f_page_id" /> - <input type="hidden" name="f_url" value="$f_url" /> + <input type="hidden" name="f_note_id" value="$t_note_id" /> <tr class="form-title"> <td colspan="2"><strong>$s_add_note</strong></td> </tr> - + <tr class="row-1"> - <td class="category" width="15%">$s_page</td> + <th width="15%">$s_page</th> <td width="85%">$t_base_page_name</td> </tr> <tr class="row-2"> - <td class="category">$s_date</td> + <th>$s_date</th> <td>$t_date</td> </tr> <tr class="row-1"> - <td class="category">$s_email</td> - <td><input type="text" name="f_email" size="64" maxlength="128" /></td> + <th>$s_email</th> + <td><input type="text" name="f_email" size="64" maxlength="128" value="$t_default_email"/></td> </tr> <tr class="row-2"> - <td class="category">$s_note</td> - <td><textarea type="text" name="f_note" rows="16" cols="72"></textarea></td> + <th>$s_note</th> + <td><textarea type="text" name="f_note" rows="16" cols="72">$t_default_body</textarea></td> </tr> - <tr> - <td class="form-buttons" colspan="2" align="center" width="80%"><input type="submit" value="Preview" /> - </td> + <tr class="form-buttons"> + <td colspan="2" align="center" width="80%"><input type="submit" value="Preview" /></td> </tr> </form> - </table> + </table> </div> EOT; } ### end else Index: note_preview_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_preview_page.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- note_preview_page.php 20 Sep 2002 04:17:42 -0000 1.7 +++ note_preview_page.php 21 Sep 2002 02:44:32 -0000 1.8 @@ -21,21 +21,18 @@ print_head_bottom(); print_body_top(); print_header( $g_page_title ); + print_spacer(); + $f_note_id = gpc_get_int( 'f_note_id' ); $f_page_id = gpc_get_int( 'f_page_id' ); $f_email = string_disable_html( gpc_get_string( 'f_email' ) ); $f_note = string_disable_html( gpc_get_string( 'f_note' ) ); - $f_came_from = gpc_get_string( 'f_came_from' ); - $f_url = gpc_get_string( 'f_url' ); - $t_back = htmlspecialchars( $HTTP_REFERER ); - echo <<<EOT -<br /> -<div align="center"> - <a href="$t_back">$s_back_link</a> -</div> -<br /> -EOT; + $t_page_info = page_get_info( page_where_id_equals( $f_page_id ) ); + if ( false === $t_page_info ) { + echo "page not found"; + exit; + } $t_note['id'] = '0'; $t_note['email']= $f_email; @@ -45,7 +42,7 @@ $t_page_data = array(); $t_page_data['id'] = 0; $t_page_data['page'] = page_get_name( $f_page_id ); - $t_page_data['url'] = $f_url; + $t_page_data['url'] = $t_page_info['url']; $t_page_data['preview'] = true; $t_page_data['prev_page'] = ''; $t_page_data['prev_url'] = ''; @@ -59,11 +56,9 @@ $f_note = string_to_form( $f_note ); echo <<<EOT - <br /> <form method="post" action="$g_note_add"> - <input type="hidden" name="f_came_from" value="$f_came_from" /> + <input type="hidden" name="f_note_id" value="$f_note_id" /> <input type="hidden" name="f_page_id" value="$f_page_id" /> - <input type="hidden" name="f_url" value="$f_url" /> <input type="hidden" name="f_email" value="$f_email" /> <input type="hidden" name="f_note" value="$f_note" /> <input type="submit" name="f_submit" value="Submit" /> |
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(); } ### -------------------- |
From: <vb...@us...> - 2002-09-20 06:57:47
|
Update of /cvsroot/webnotes/webnotes/themes/phpnet In directory usw-pr-cvs1:/tmp/cvs-serv4968/themes/phpnet Modified Files: theme_api.php Log Message: - Fixed a problem when the width of the note is too big. The last updated part had 100% width while the rest had more than 100%. - Used <tt> .. </tt> while preserving spaces and calling nl2br() to avoid having the notes gets too big when long lines are entered (ie. to enable wrapping). This is to replace the <pre> ... </pre> - Fixed a problem where cookies were not set on the root path, and hence, there were not effective for paths that are not below the login.php. Index: theme_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/themes/phpnet/theme_api.php,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- theme_api.php 20 Sep 2002 05:00:36 -0000 1.20 +++ theme_api.php 20 Sep 2002 06:57:44 -0000 1.21 @@ -116,7 +116,7 @@ if ( NOTE_VISIBLE_ACCEPTED != $t_note_info['visible'] ) { $t_visibility = '(' . note_get_visibility_str( $t_note_info['visible'] ) . ') - '; } - $t_id_view = "<pre>$t_visibility$t_id<br />$t_moderation</pre>"; + $t_id_view = "<tt>$t_visibility$t_id<br />$t_moderation</tt>"; $t_id_bookmark = "<a name=\"$t_id\"></a>"; } else { $t_id_view = ' '; @@ -136,7 +136,7 @@ } if ( isset( $t_note_info['note'] ) ) { - $t_note = '<pre>' . $t_note_info['note'] . '</pre>'; + $t_note = nl2br(string_preserve_spaces('<tt>' . $t_note_info['note'] . '</tt>')); } else { $t_note = ' '; } @@ -200,14 +200,16 @@ <img src="$help_picture" border="0" width="13" height="13" alt="About Notes" /> </td> </tr> - </table> EOT; } echo <<<EOT + <tr bgcolor="#d0d0d0" valign="top"><td colspan="2"> <table border="0" width="100%" bgcolor="#e0e0e0" cellpadding="0" cellspacing="4"> $t_navigation_row <tr><td align="right" colspan="2"><small>Last updated: Tue, 17 Sep 2002</small></td></tr> + </table> +</td></tr> </table> EOT; } |
From: <vb...@us...> - 2002-09-20 06:57:47
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv4968 Modified Files: login.php Log Message: - Fixed a problem when the width of the note is too big. The last updated part had 100% width while the rest had more than 100%. - Used <tt> .. </tt> while preserving spaces and calling nl2br() to avoid having the notes gets too big when long lines are entered (ie. to enable wrapping). This is to replace the <pre> ... </pre> - Fixed a problem where cookies were not set on the root path, and hence, there were not effective for paths that are not below the login.php. Index: login.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/login.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- login.php 17 Sep 2002 06:25:03 -0000 1.11 +++ login.php 20 Sep 2002 06:57:43 -0000 1.12 @@ -26,17 +26,17 @@ if( password_match( $f_password, $v_password ) ) { ### set permanent cookie (1 year) if ( ( isset( $f_perm_login ) ) && ( $f_perm_login == "on" ) ) { - if ( !setcookie( $g_string_cookie, $v_cookie_string, time() + $g_cookie_time_length ) ) { + if ( !setcookie( $g_string_cookie, $v_cookie_string, time() + $g_cookie_time_length, '/' ) ) { # @@@@ Proper error message - echo "Unable to set cookie"; + echo "Unable to set cookie"; exit; } } ### set temp cookie, cookie dies after browser closes else { - if ( !setcookie( $g_string_cookie, $v_cookie_string ) ) { + if ( !setcookie( $g_string_cookie, $v_cookie_string, 0, '/' ) ) { # @@@@ Proper error message - echo "Unable to set cookie"; + echo "Unable to set cookie"; exit; } } |
From: <vb...@us...> - 2002-09-20 06:57:47
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv4968/core Modified Files: pwn_api.php Log Message: - Fixed a problem when the width of the note is too big. The last updated part had 100% width while the rest had more than 100%. - Used <tt> .. </tt> while preserving spaces and calling nl2br() to avoid having the notes gets too big when long lines are entered (ie. to enable wrapping). This is to replace the <pre> ... </pre> - Fixed a problem where cookies were not set on the root path, and hence, there were not effective for paths that are not below the login.php. Index: pwn_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/pwn_api.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pwn_api.php 20 Sep 2002 04:17:43 -0000 1.1 +++ pwn_api.php 20 Sep 2002 06:57:44 -0000 1.2 @@ -20,7 +20,7 @@ if ( !page_valid_id( $t_page_id ) ) { if ( ON === config_get( 'auto_index_pages' ) ) { if ( page_add( $p_page ) ) { - print_web_notes( $p_page, $p_url, $p_prev_page, $p_next_page ); + pwn_body( $p_page, $p_url, $p_prev_page, $p_next_page ); return; } } |
From: <vb...@us...> - 2002-09-20 05:00:40
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv14325/core Modified Files: html_api.php Log Message: - Added theme.css under the phpnet theme. - Added print_css_link() to html_api. - Linked the theme.css instead of the css_inc.php in the pages that uses phpWebNotes. Better caching, better customisation, and no need to include admin related styles in pages using phpWebNotes. Index: html_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/html_api.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- html_api.php 20 Sep 2002 04:17:43 -0000 1.9 +++ html_api.php 20 Sep 2002 05:00:35 -0000 1.10 @@ -27,6 +27,10 @@ } } ### -------------------- + function print_css_link( $p_css ) { + echo "<link href=\"$p_css\" rel=\"stylesheet\" type=\"text/css\" />"; + } + ### -------------------- function print_meta_inc( $p_meta_inc = '' ) { if ( !empty( $p_meta_inc ) && file_exists( $p_meta_inc ) ) { include_once( $p_meta_inc ); |
From: <vb...@us...> - 2002-09-20 05:00:40
|
Update of /cvsroot/webnotes/webnotes/themes/phpnet In directory usw-pr-cvs1:/tmp/cvs-serv14325/themes/phpnet Modified Files: theme_api.php Added Files: theme.css Log Message: - Added theme.css under the phpnet theme. - Added print_css_link() to html_api. - Linked the theme.css instead of the css_inc.php in the pages that uses phpWebNotes. Better caching, better customisation, and no need to include admin related styles in pages using phpWebNotes. --- NEW FILE: theme.css --- /* # phpWebNotes - a php based note addition system # Copyright (C) 2000-2002 Webnotes Team - web...@so... # This program is distributed under the terms and conditions of the GPL # See the files README and LICENSE for details # -------------------------------------------------------- # $Id: theme.css,v 1.1 2002/09/20 05:00:36 vboctor Exp $ # -------------------------------------------------------- */ /* 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 } 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; } */ Index: theme_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/themes/phpnet/theme_api.php,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- theme_api.php 20 Sep 2002 04:21:09 -0000 1.19 +++ theme_api.php 20 Sep 2002 05:00:36 -0000 1.20 @@ -24,8 +24,9 @@ ### -------------------- function theme_head() { - global $g_css_inc_file; - print_css( $g_css_inc_file ); + global $g_web_directory; + $t_style = $g_web_directory . 'themes/phpnet/theme.css'; + print_css_link( $t_style ); } ### -------------------- function theme_body( $p_page_data ) { |
From: <vb...@us...> - 2002-09-20 04:21:12
|
Update of /cvsroot/webnotes/webnotes/themes/phpnet In directory usw-pr-cvs1:/tmp/cvs-serv6612/themes/phpnet Modified Files: theme_api.php Log Message: - Fixed index.php to re-direct to login_page.php rather than login.php - Fixed a parsing error in inline moderation. Index: theme_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/themes/phpnet/theme_api.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- theme_api.php 20 Sep 2002 04:17:43 -0000 1.18 +++ theme_api.php 20 Sep 2002 04:21:09 -0000 1.19 @@ -90,7 +90,7 @@ if ( false === $p_page_data['preview'] ) { if ( access_check_action( ACTION_NOTES_MODERATE ) ) { - $t_url = $p_url; # . "#" . $p_note_info_array['id']; + $t_url = $p_page_data['url']; $t_moderation = '<small>'; $t_moderation .= link_note_action( $t_note_info['id'], 'accept', $t_url, |
From: <vb...@us...> - 2002-09-20 04:21:12
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv6612 Modified Files: index.php Log Message: - Fixed index.php to re-direct to login_page.php rather than login.php - Fixed a parsing error in inline moderation. Index: index.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/index.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- index.php 20 Sep 2002 03:16:30 -0000 1.1 +++ index.php 20 Sep 2002 04:21:09 -0000 1.2 @@ -8,5 +8,5 @@ # $Id$ # -------------------------------------------------------- - header("Location: login.php"); + header("Location: login_page.php"); ?> |
From: <vb...@us...> - 2002-09-20 04:17:46
|
Update of /cvsroot/webnotes/webnotes/sample In directory usw-pr-cvs1:/tmp/cvs-serv5624/sample Modified Files: webservices.php xhtml.php xml.php Log Message: - Fixed the preview to use the new theme interface. - Fixed a layout problem with the preview page (because of styles). - Added APIs for updating the last-modified of pages / notes (not supported by db yet). - Renamed theme_output() to theme_body() and changed it to handle the case where the page data is false (page not indexed and auto index off). - Added theme_head() to be called with the <head>...</head> tags. - Added pwn_api.php to act the the main interface to phpWebNotes (pwn_head() and pwn_body()). - Changed the samples to use the new pwn_* apis. - Added meta tags to disable caching for pages that has phpWebNotes linked to it. - Used include_once() in all html_apis to avoid styles and other includes from being included more than once. Index: webservices.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/sample/webservices.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- webservices.php 19 Sep 2002 22:50:38 -0000 1.6 +++ webservices.php 20 Sep 2002 04:17:43 -0000 1.7 @@ -11,6 +11,10 @@ <html> <head> <title>Web services (from Webopedia)</title> + <?php + require_once("../core/api.php"); # replace with actual path + pwn_head(); + ?> </head> <body> <h1>Web services</h1> @@ -26,10 +30,7 @@ <p>The above definition was copied from <a href="http://www.webopedia.com">Webopedia</a>.</p> - <?php - require_once("../core/api.php"); # replace with actual path - print_web_notes( 'Web Services', $PHP_SELF, 'XHTML', null ); - ?> + <?php pwn_body( 'Web Services', $PHP_SELF, 'XHTML', null ); ?> <br /> <a href="http://sourceforge.net/projects/webnotes/"><img src="http://sourceforge.net/sflogo.php?group_id=15381&type=5" width="140" height="42" border="0" alt="phpWebNotes @ SourceForge"></a> Index: xhtml.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/sample/xhtml.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- xhtml.php 20 Sep 2002 02:48:47 -0000 1.2 +++ xhtml.php 20 Sep 2002 04:17:43 -0000 1.3 @@ -1,6 +1,10 @@ <html> <head> <title>XHTML</title> + <?php + require_once("../core/api.php"); # replace with actual path + pwn_head(); + ?> </head> <body> <h1>XHTML</h1> @@ -11,10 +15,7 @@ <p>When applied to Net devices, XHTML must go through a modularization process. This enables XHTML pages to be read by many different platforms.</p> <p>A device designer, using standard building blocks, will specify which elements are supported. Content creators will then target these building blocks--or modules.</p> <p>Because these modules conform to certain standards, XHTML's extensibility ensures that layout and presentation stay true-to-form over any platform.</p> - <?php - require_once("../core/api.php"); # replace with actual path - print_web_notes( 'XHTML', $PHP_SELF, 'XML', 'Web Services' ); - ?> + <?php pwn_body( 'XHTML', $PHP_SELF, 'XML', 'Web Services' ); ?> <br /> <a href="http://sourceforge.net/projects/webnotes/"><img src="http://sourceforge.net/sflogo.php?group_id=15381&type=5" width="140" height="42" border="0" alt="phpWebNotes @ SourceForge"></a> </body> Index: xml.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/sample/xml.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- xml.php 19 Sep 2002 22:50:38 -0000 1.6 +++ xml.php 20 Sep 2002 04:17:43 -0000 1.7 @@ -11,6 +11,10 @@ <html> <head> <title>XML (from Webopedia)</title> + <?php + require_once("../core/api.php"); # replace with actual path + pwn_head(); + ?> </head> <body> <h1>XML</h1> @@ -19,10 +23,7 @@ <p>The above definition was copied from <a href="http://www.webopedia.com">Webopedia</a>.</p> - <?php - require_once("../core/api.php"); # replace with actual path - print_web_notes( 'XML', $PHP_SELF, null, 'XHTML' ); - ?> + <?php pwn_body( 'XML', $PHP_SELF, null, 'XHTML' ); ?> <br /> <a href="http://sourceforge.net/projects/webnotes/"><img src="http://sourceforge.net/sflogo.php?group_id=15381&type=5" width="140" height="42" border="0" alt="phpWebNotes @ SourceForge"></a> </body> |
From: <vb...@us...> - 2002-09-20 04:17:46
|
Update of /cvsroot/webnotes/webnotes/themes/phpnet In directory usw-pr-cvs1:/tmp/cvs-serv5624/themes/phpnet Modified Files: theme_api.php Log Message: - Fixed the preview to use the new theme interface. - Fixed a layout problem with the preview page (because of styles). - Added APIs for updating the last-modified of pages / notes (not supported by db yet). - Renamed theme_output() to theme_body() and changed it to handle the case where the page data is false (page not indexed and auto index off). - Added theme_head() to be called with the <head>...</head> tags. - Added pwn_api.php to act the the main interface to phpWebNotes (pwn_head() and pwn_body()). - Changed the samples to use the new pwn_* apis. - Added meta tags to disable caching for pages that has phpWebNotes linked to it. - Used include_once() in all html_apis to avoid styles and other includes from being included more than once. Index: theme_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/themes/phpnet/theme_api.php,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- theme_api.php 20 Sep 2002 02:48:47 -0000 1.17 +++ theme_api.php 20 Sep 2002 04:17:43 -0000 1.18 @@ -22,18 +22,18 @@ require_once ( dirname( dirname( dirname( __FILE__ ) ) ) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'api.php' ); - # Identifies the version of the theme. This will allow the phpWebNotes - # engine in the future to support themes that are designed for older - # versions of phpWebNotes. - function theme_version() { - return (1); - } - - # This function is called if the current page was not indexed - function theme_not_indexed( $p_page ) { + ### -------------------- + function theme_head() { + global $g_css_inc_file; + print_css( $g_css_inc_file ); } + ### -------------------- + function theme_body( $p_page_data ) { + if ( false === $p_page_data ) { + # @@@ Handle not indexed (and auto index off) + return; + } - function theme_output( $p_page_data ) { global $g_note_add_page, $s_add_note_link, $s_manage, $s_admin, $g_web_directory, $g_theme; @@ -184,7 +184,7 @@ $t_navigation_row = "<tr><td>$t_prev_text</td><td align=\"right\">$t_next_text</td></tr>"; } - if ( !$p_page_data['preview'] ) { + if ( false === $p_page_data['preview'] ) { $t_link_start = "<a href=\"$g_note_add_page?f_page_id=$t_page_id&f_url=$c_url\">"; $t_link_end = '</a>'; } else { @@ -206,9 +206,9 @@ echo <<<EOT <table border="0" width="100%" bgcolor="#e0e0e0" cellpadding="0" cellspacing="4"> $t_navigation_row - <tr bgcolor="#cccccc"><td colspan="2"></td></tr> <tr><td align="right" colspan="2"><small>Last updated: Tue, 17 Sep 2002</small></td></tr> </table> EOT; } + ### -------------------- ?> |
From: <vb...@us...> - 2002-09-20 04:17:45
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv5624/core Modified Files: api.php css_inc.php html_api.php note_api.php page_api.php Added Files: pwn_api.php Log Message: - Fixed the preview to use the new theme interface. - Fixed a layout problem with the preview page (because of styles). - Added APIs for updating the last-modified of pages / notes (not supported by db yet). - Renamed theme_output() to theme_body() and changed it to handle the case where the page data is false (page not indexed and auto index off). - Added theme_head() to be called with the <head>...</head> tags. - Added pwn_api.php to act the the main interface to phpWebNotes (pwn_head() and pwn_body()). - Changed the samples to use the new pwn_* apis. - Added meta tags to disable caching for pages that has phpWebNotes linked to it. - Used include_once() in all html_apis to avoid styles and other includes from being included more than once. --- NEW FILE: pwn_api.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000-2002 Webnotes Team - web...@so... # This program is distributed under the terms and conditions of the GPL # See the files README and LICENSE for details # -------------------------------------------------------- # $Id: pwn_api.php,v 1.1 2002/09/20 04:17:43 vboctor Exp $ # -------------------------------------------------------- ### -------------------- function pwn_head() { global $g_meta_inc_file; print_meta_inc( $g_meta_inc_file ); theme_head(); } ### -------------------- function pwn_body( $p_page, $p_url, $p_prev_page = null, $p_next_page = null ) { $t_page_id = page_get_id( $p_page ); if ( !page_valid_id( $t_page_id ) ) { if ( ON === config_get( 'auto_index_pages' ) ) { if ( page_add( $p_page ) ) { print_web_notes( $p_page, $p_url, $p_prev_page, $p_next_page ); return; } } theme_body ( false ); } else { page_update_url( $t_page_id, $p_url ); page_update_neighbours( $t_page_id, $p_prev_page, $p_next_page ); $page_data = page_prepare_theme_data( $t_page_id ); theme_body ( $page_data ); } } ### -------------------- ?> Index: api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/api.php,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- api.php 20 Sep 2002 03:16:30 -0000 1.26 +++ api.php 20 Sep 2002 04:17:43 -0000 1.27 @@ -69,6 +69,7 @@ require_once( $t_path_core . 'gpc_api.php' ); require_once( $t_path_core . 'email_api.php' ); require_once( $t_path_core . 'enum_api.php' ); + require_once( $t_path_core . 'pwn_api.php' ); require_once( $t_path_main . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $g_theme . DIRECTORY_SEPARATOR . 'theme_api.php' ); Index: css_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/css_inc.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- css_inc.php 15 Sep 2002 13:20:56 -0000 1.7 +++ css_inc.php 20 Sep 2002 04:17:43 -0000 1.8 @@ -12,7 +12,7 @@ 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; text-align: left; } +td { font-family:Verdana, Arial; font-size: 10pt; padding: 4px; } p { font-family:Verdana, Arial; font-size: 10pt } h3 { font-family:Verdana, Arial; font-size: 13pt; font-weight: bold; text-align: center } address { font-family:Verdana, Arial; font-size: 8pt } Index: html_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/html_api.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- html_api.php 19 Sep 2002 21:51:01 -0000 1.8 +++ html_api.php 20 Sep 2002 04:17:43 -0000 1.9 @@ -23,13 +23,13 @@ ### -------------------- function print_css( $p_css = '' ) { if ( !empty( $p_css ) && file_exists( $p_css ) ) { - include( $p_css ); + include_once( $p_css ); } } ### -------------------- function print_meta_inc( $p_meta_inc = '' ) { if ( !empty( $p_meta_inc ) && file_exists( $p_meta_inc ) ) { - include( $p_meta_inc ); + include_once( $p_meta_inc ); } } ### -------------------- @@ -74,13 +74,13 @@ ### -------------------- function print_top_page( $p_page ) { if ( !empty( $p_page ) && file_exists( $p_page ) ) { - include( $p_page ); + include_once( $p_page ); } } ### -------------------- function print_bottom_page( $p_page ) { if ( !empty( $p_page ) && file_exists( $p_page ) ) { - include( $p_page ); + include_once( $p_page ); } } ### -------------------- Index: note_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/note_api.php,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- note_api.php 20 Sep 2002 03:16:30 -0000 1.22 +++ note_api.php 20 Sep 2002 04:17:43 -0000 1.23 @@ -34,11 +34,17 @@ $c_note = db_prepare_string( $p_note ); $c_remote_address = db_prepare_string( $p_remote_addr ); + # @@@@ Also set last-updated field + $query = "INSERT INTO " . config_get( 'phpWN_note_table' ) . " ( id, page_id, email, ip, date_submitted, note, visible ) VALUES ( null, '$c_page_id', '$c_email', '$c_remote_address', NOW(), '$c_note', '$t_visible' )"; - return db_query( $query ); + $result = db_query( $query ); + + page_touch( $p_page_id ); + + return ( $result ); } ### -------------------- function note_get_visibility_str( $p_visible ) { @@ -66,6 +72,8 @@ SET visible='$c_visibility' WHERE id='$c_id' LIMIT 1"; $result = db_query( $query ); + + note_touch( $p_id ); } ### -------------------- # Put back as pending if approved by default. @@ -104,6 +112,11 @@ SET email='$c_email', note='$c_note' WHERE id='$c_id' LIMIT 1"; $result = db_query( $query ); + + note_touch( $p_id ); + } + ### -------------------- + function note_touch( $p_note_id, $p_page_id = null ) { } ### -------------------- function note_get_all_visible( $p_page_id ) { @@ -173,29 +186,6 @@ } return db_query( $query ); - } - ### -------------------- - function print_web_notes( $p_page, $p_url, $p_prev_page = null, $p_next_page = null ) { - echo '<br />'; - - $t_page_id = page_get_id( $p_page ); - if ( !page_valid_id( $t_page_id ) ) { - if ( ON === config_get( 'auto_index_pages' ) ) { - if ( page_add( $p_page ) ) { - print_web_notes( $p_page, $p_url, $p_prev_page, $p_next_page ); - return; - } - } - - theme_not_indexed( $p_page, $p_url ); - } else { - page_update_url( $t_page_id, $p_url ); - page_update_neighbours( $t_page_id, $p_prev_page, $p_next_page ); - $page_data = page_prepare_theme_data( $t_page_id ); - if ( false !== $page_data ) { - theme_output ( $page_data ); - } - } } ### -------------------- ?> Index: page_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/page_api.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- page_api.php 20 Sep 2002 03:16:30 -0000 1.14 +++ page_api.php 20 Sep 2002 04:17:43 -0000 1.15 @@ -126,6 +126,8 @@ return; } + # @@@@ If the information is the same, then don't update/touch. + $c_page_id = db_prepare_int( $p_page_id ); $c_url = db_prepare_string( $p_url ); @@ -133,6 +135,7 @@ SET url='$c_url' WHERE id='$c_page_id' LIMIT 1"; $result = db_query( $query ); + page_touch( $p_page_id ); } ### -------------------- function page_update_neighbours( $p_page_id, $p_prev, $p_next ) { @@ -163,12 +166,19 @@ } } + # @@@@ If the information is the same, then don't update/touch. + $c_page_id = db_prepare_int( $p_page_id ); $query = "UPDATE " . config_get( 'phpWN_page_table' ) . " SET prev_id='$t_prev_id', next_id='$t_next_id' WHERE id='$c_page_id' LIMIT 1"; $result = db_query( $query ); + page_touch( $p_page_id ); + } + ### -------------------- + # Update the last modified time stamp for the page. + function page_touch( $p_page_id ) { } ### -------------------- ### Allows for path navigation to choose base dir |
From: <vb...@us...> - 2002-09-20 04:17:45
|
Update of /cvsroot/webnotes/webnotes/doc In directory usw-pr-cvs1:/tmp/cvs-serv5624/doc Modified Files: ChangeLog Log Message: - Fixed the preview to use the new theme interface. - Fixed a layout problem with the preview page (because of styles). - Added APIs for updating the last-modified of pages / notes (not supported by db yet). - Renamed theme_output() to theme_body() and changed it to handle the case where the page data is false (page not indexed and auto index off). - Added theme_head() to be called with the <head>...</head> tags. - Added pwn_api.php to act the the main interface to phpWebNotes (pwn_head() and pwn_body()). - Changed the samples to use the new pwn_* apis. - Added meta tags to disable caching for pages that has phpWebNotes linked to it. - Used include_once() in all html_apis to avoid styles and other includes from being included more than once. Index: ChangeLog =================================================================== RCS file: /cvsroot/webnotes/webnotes/doc/ChangeLog,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- ChangeLog 20 Sep 2002 02:48:46 -0000 1.18 +++ ChangeLog 20 Sep 2002 04:17:43 -0000 1.19 @@ -34,6 +34,7 @@ * Implemented inline moderation where the moderators can moderate notes on the actual pages. * Viewing notes based on access level rather than displaying all accepted notes for everybody. * Added support for prev / next documents. + * Added pwn_api.php to act the the main interface to phpWebNotes. 03.12.2000 - 1.0.0 |
From: <vb...@us...> - 2002-09-20 04:17:45
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv5624 Modified Files: note_add.php note_preview_page.php Log Message: - Fixed the preview to use the new theme interface. - Fixed a layout problem with the preview page (because of styles). - Added APIs for updating the last-modified of pages / notes (not supported by db yet). - Renamed theme_output() to theme_body() and changed it to handle the case where the page data is false (page not indexed and auto index off). - Added theme_head() to be called with the <head>...</head> tags. - Added pwn_api.php to act the the main interface to phpWebNotes (pwn_head() and pwn_body()). - Changed the samples to use the new pwn_* apis. - Added meta tags to disable caching for pages that has phpWebNotes linked to it. - Used include_once() in all html_apis to avoid styles and other includes from being included more than once. Index: note_add.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- note_add.php 18 Sep 2002 12:33:31 -0000 1.16 +++ note_add.php 20 Sep 2002 04:17:42 -0000 1.17 @@ -41,7 +41,6 @@ } else { echo "$s_sql_error_msg <a href=\"$g_administrator_email\">$s_administrator</a><br />"; - echo $query; } echo '<br />'; Index: note_preview_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_preview_page.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- note_preview_page.php 18 Sep 2002 12:33:31 -0000 1.6 +++ note_preview_page.php 20 Sep 2002 04:17:42 -0000 1.7 @@ -16,6 +16,7 @@ print_head_top(); print_title( $g_window_title ); print_css( $g_css_inc_file ); + theme_head(); print_head_bottom(); print_body_top(); @@ -41,10 +42,18 @@ $t_note['date'] = date ($g_date_format); $t_note['note'] = $f_note; - $t_page = page_get_name( $f_page_id ); - theme_notes_start( $t_page, $f_url, true ); - theme_notes_echo( $t_page, $f_url, $t_note, true ); - theme_notes_end( $t_page, $f_url, true ); + $t_page_data = array(); + $t_page_data['id'] = 0; + $t_page_data['page'] = page_get_name( $f_page_id ); + $t_page_data['url'] = $f_url; + $t_page_data['preview'] = true; + $t_page_data['prev_page'] = ''; + $t_page_data['prev_url'] = ''; + $t_page_data['next_page'] = ''; + $t_page_data['next_url'] = ''; + $t_page_data['notes'] = array ( $t_note ); + + theme_body( $t_page_data ); $f_email = string_to_form( $f_email ); $f_note = string_to_form( $f_note ); |
From: <vb...@us...> - 2002-09-20 03:16:33
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv25518/core Modified Files: api.php note_api.php page_api.php Log Message: - Remove print_manage_notes() since it was not used. - Uncommented some code in page_update_neighbours() which was needed. - Removed admin_pending.php since it was not used. - Removed index.html - Added index.php Index: api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/api.php,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- api.php 18 Sep 2002 12:33:31 -0000 1.25 +++ api.php 20 Sep 2002 03:16:30 -0000 1.26 @@ -37,7 +37,6 @@ $g_admin_view_queue = $g_web_directory . 'admin_view_queue' . $g_ext; $g_admin_manage_notes = $g_web_directory . 'admin_manage_notes' . $g_ext; $g_admin_manage_users = $g_web_directory . 'admin_manage_users' . $g_ext; - $g_admin_pending = $g_web_directory . 'admin_pending' . $g_ext; $g_admin_change_password = $g_web_directory . 'admin_change_password' . $g_ext; $g_user_home_page = $g_web_directory . 'user_home_page' . $g_ext; Index: note_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/note_api.php,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- note_api.php 20 Sep 2002 02:48:46 -0000 1.21 +++ note_api.php 20 Sep 2002 03:16:30 -0000 1.22 @@ -175,81 +175,6 @@ return db_query( $query ); } ### -------------------- - function print_manage_notes( $p_page_id, $p_url ) { - global $g_primary_light_color, $g_primary_dark_color, - $g_white_color, $g_header_color, - $g_admin_manage_notes, - $s_date, $s_email, $s_ip, $s_note, - $s_delete_button, $s_update_button; - - $c_page_id = db_prepare_int( $p_page_id ); - - $query = "SELECT * - FROM " . config_get( 'phpWN_note_table' ) . " - WHERE page_id='$c_page_id' - ORDER BY date_submitted"; - $result = db_query( $query ); - $num_notes = db_num_rows( $result ); - - for ( $i = 0; $i < $num_notes; $i++ ) { - $row = db_fetch_array( $result ); - extract( $row, EXTR_PREFIX_ALL, "v" ); - $v_note = string_edit( $v_note ); - - # @@@@ The HTML below has some problems... revise later - echo <<<EOT - <form method="post" action="$g_admin_manage_notes"> - <input type="hidden" name="f_action" value="update" /> - <input type="hidden" name="f_id" value="$v_id" /> - <input type="hidden" name="f_page_id" value="$p_page_id" /> - <input type="hidden" name="f_url" value="$p_url" /> - <tr bgcolor="$g_white_color" height="4"> - <td colspan="2"></td> - </tr> - <tr bgcolor="$g_primary_light_color"> - <td>$s_date</td> - <td>$v_date_submitted</td> - </tr> - <tr bgcolor="$g_primary_dark_color"> - <td>$s_email</td> - <td><input type="text" name="f_email" size="64" maxlength="64" value="$v_email" /></td> - </tr> - <tr bgcolor="$g_primary_light_color"> - <td>$s_ip</td> - <td>$v_ip</td> - </tr> - <tr bgcolor="$g_primary_dark_color"> - <td>$s_note</td> - <td><textarea name="f_note" cols="72" rows="16">$v_note</textarea></td> - </tr> - <tr bgcolor="$g_white_color"> - <td colspan="2"> - <table width="100%"> - <tr> - <td> - <td width="50%" align="center"> - <input type="submit" value="$s_update_button" /> - </td> - </form> - <td width="50%" align="center"> - <form method="post" action="$g_admin_manage_notes"> - <input type="hidden" name="f_action" value="delete" /> - <input type="hidden" name="f_id" value="$v_id" /> - <input type="hidden" name="f_page_id" value="$p_page_id" /> - <input type="hidden" name="f_url" value="$p_url" /> - <input type="submit" value="$s_delete_button" /> - </form> - </td> - </tr> - </table> - </td> - </tr> - - -EOT; - } - } - ### -------------------- function print_web_notes( $p_page, $p_url, $p_prev_page = null, $p_next_page = null ) { echo '<br />'; Index: page_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/page_api.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- page_api.php 20 Sep 2002 02:48:46 -0000 1.13 +++ page_api.php 20 Sep 2002 03:16:30 -0000 1.14 @@ -149,9 +149,9 @@ $t_prev_id = 0; } else { $t_prev_id = page_get_id( $p_prev ); - #if ( false === page_valid_id( $t_prev_id ) ) { - # $t_prev_id = 0; - #} + if ( false === page_valid_id( $t_prev_id ) ) { + $t_prev_id = 0; + } } if ( null === $p_next ) { @@ -162,7 +162,7 @@ $t_next_id = 0; } } - + $c_page_id = db_prepare_int( $p_page_id ); $query = "UPDATE " . config_get( 'phpWN_page_table' ) . " |
From: <vb...@us...> - 2002-09-20 03:16:33
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv25518 Added Files: index.php Removed Files: admin_pending.php index.html Log Message: - Remove print_manage_notes() since it was not used. - Uncommented some code in page_update_neighbours() which was needed. - Removed admin_pending.php since it was not used. - Removed index.html - Added index.php --- NEW FILE: index.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000-2002 Webnotes Team - web...@so... # This program is distributed under the terms and conditions of the GPL # See the files README and LICENSE for details # -------------------------------------------------------- # $Id: index.php,v 1.1 2002/09/20 03:16:30 vboctor Exp $ # -------------------------------------------------------- header("Location: login.php"); ?> --- admin_pending.php DELETED --- --- index.html DELETED --- |
From: <vb...@us...> - 2002-09-20 02:48:50
|
Update of /cvsroot/webnotes/webnotes/themes/phpnet In directory usw-pr-cvs1:/tmp/cvs-serv20300/themes/phpnet Modified Files: theme_api.php Log Message: - Changed the way the schemes are structure to accept one array which has all information rather than header, note, footer. - Remove the handling of finding out the prev / next page names/urls from the theme to the core. - Added page_prepare_theme_data() which prepares all the information to be used by the scheme into one array. The theme should never need to access the database. - Removed the row which has the add / help icons from the footer when there is no notes in the page. - Added source forge logo to the XHTML sample. Index: theme_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/themes/phpnet/theme_api.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- theme_api.php 19 Sep 2002 22:50:39 -0000 1.16 +++ theme_api.php 20 Sep 2002 02:48:47 -0000 1.17 @@ -29,195 +29,186 @@ return (1); } - # This function is called before printing any notes to the page. - function theme_notes_start( $p_page, $p_url, $p_preview = false ) { - global $g_note_add_page, $s_add_note_link, $s_manage, $s_admin, $g_web_directory, $g_theme; + # This function is called if the current page was not indexed + function theme_not_indexed( $p_page ) { + } - $c_url = urlencode( $p_url ); - $t_page_id = page_get_id( $p_page ); + function theme_output( $p_page_data ) { + global $g_note_add_page, $s_add_note_link, $s_manage, $s_admin, $g_web_directory, +$g_theme; + + $t_notes = $p_page_data['notes']; + $t_page = $p_page_data['page']; + $t_url = $p_page_data['url']; + + $c_url = urlencode( $t_url ); + $t_page_id = $p_page_data['id']; $t_images_base = $g_web_directory . 'themes/' . $g_theme . '/images/'; $add_picture = $t_images_base . 'notes_add.gif'; $help_picture = $t_images_base . 'notes_about.gif'; - - if ( !$p_preview ) { + $prev_picture = $t_images_base . 'caret_left.gif'; + $next_picture = $t_images_base . 'caret_right.gif'; + + if ( false === $p_page_data['preview'] ) { $t_link_start = "<a href=\"$g_note_add_page?f_page_id=$t_page_id&f_url=$c_url\">"; $t_link_end = '</a>'; } else { $t_link_start = $t_link_end = ''; } + # + # HEADER + # + echo <<<EOT <table summary="" border="0" cellpadding="4" cellspacing="0" width="100%"> <tr bgcolor="#d0d0d0" valign="top"> - <td><small>User Contributed Notes</small><br /><strong>$p_page</strong></td> + <td><small>User Contributed Notes</small><br /><strong>$t_page</strong></td> <td align="right"> $t_link_start<img src="$add_picture" border="0" width="13" height="13" alt="Add Notes" />$t_link_end <img src="$help_picture" border="0" width="13" height="13" alt="About Notes" /> </td> </tr> EOT; - } - # This function is called for every note. The note information - # are all included in the associative array that is passed to the - # function. The theme should check that a field is defined in - # the array before using it. - function theme_notes_echo( $p_page, $p_url, $p_note_info_array, $p_preview = false ) { - $t_moderation = ''; - - if ( false === $p_preview ) { - if ( access_check_action( ACTION_NOTES_MODERATE ) ) { - $t_url = $p_url; # . "#" . $p_note_info_array['id']; - $t_moderation = '<small>'; + # + # NOTES + # - $t_moderation .= link_note_action( $p_note_info_array['id'], 'accept', $t_url, - access_check_action( ACTION_NOTES_MODERATE_ACCEPT ) ) . ' '; + if ( 0 === count( $t_notes ) ) { + echo <<<EOT + <tr valign="top"> + <td bgcolor="#e0e0e0" colspan="2">There are no user contributed notes for this page.</td> + </tr> + </table> +EOT; + } else { + for ( $i = 0; $i < count( $t_notes ); $i++ ) { + $t_moderation = ''; + $t_note_info = $t_notes[$i]; - $t_moderation .= link_note_action( $p_note_info_array['id'], 'decline', $t_url, - access_check_action( ACTION_NOTES_MODERATE_DECLINE ) ) . ' '; + if ( false === $p_page_data['preview'] ) { + if ( access_check_action( ACTION_NOTES_MODERATE ) ) { + $t_url = $p_url; # . "#" . $p_note_info_array['id']; + $t_moderation = '<small>'; - $t_moderation .= link_note_action( $p_note_info_array['id'], 'archive', $t_url, - access_check_action( ACTION_NOTES_MODERATE_ARCHIVE ) ) . ' '; + $t_moderation .= link_note_action( $t_note_info['id'], 'accept', $t_url, + access_check_action( ACTION_NOTES_MODERATE_ACCEPT ) ) . ' '; - $t_moderation .= link_note_action( $p_note_info_array['id'], 'delete', $t_url, - access_check_action( ACTION_NOTES_MODERATE_DELETE ) ); + $t_moderation .= link_note_action( $t_note_info['id'], 'decline', $t_url, + access_check_action( ACTION_NOTES_MODERATE_DECLINE ) ) . ' '; - $t_moderation .= '</small>'; - } - } + $t_moderation .= link_note_action( $t_note_info['id'], 'archive', $t_url, + access_check_action( ACTION_NOTES_MODERATE_ARCHIVE ) ) . ' '; - if ( isset( $p_note_info_array['id'] ) && ( $p_note_info_array['id'] != 0 ) ) { - $t_id = '#' . (integer)$p_note_info_array['id']; - $t_visibility = ''; - if ( NOTE_VISIBLE_ACCEPTED != $p_note_info_array['visible'] ) { - $t_visibility = '(' . note_get_visibility_str( $p_note_info_array['visible'] ) . ') - '; - } - $t_id_view = "<pre>$t_visibility$t_id<br />$t_moderation</pre>"; - $t_id_bookmark = "<a name=\"$t_id\"></a>"; - } else { - $t_id_view = ' '; - $t_id_bookmark = ''; - } + $t_moderation .= link_note_action( $t_note_info['id'], 'delete', $t_url, + access_check_action( ACTION_NOTES_MODERATE_DELETE ) ); - if ( isset( $p_note_info_array['email'] ) ) { - $t_email = $p_note_info_array['email']; - } else { - $t_email = ''; - } + $t_moderation .= '</small>'; + } + } - if ( isset( $p_note_info_array['date'] ) ) { - $t_date = $p_note_info_array['date']; - } else { - $t_date = ''; - } + if ( isset( $t_note_info['id'] ) && ( $t_note_info['id'] != 0 ) ) { + $t_id = '#' . (integer)$t_note_info['id']; + $t_visibility = ''; + if ( NOTE_VISIBLE_ACCEPTED != $t_note_info['visible'] ) { + $t_visibility = '(' . note_get_visibility_str( $t_note_info['visible'] ) . ') - '; + } + $t_id_view = "<pre>$t_visibility$t_id<br />$t_moderation</pre>"; + $t_id_bookmark = "<a name=\"$t_id\"></a>"; + } else { + $t_id_view = ' '; + $t_id_bookmark = ''; + } - if ( isset( $p_note_info_array['note'] ) ) { - $t_note = '<pre>' . $p_note_info_array['note'] . '</pre>'; - } else { - $t_note = ' '; - } + if ( isset( $t_note_info['email'] ) ) { + $t_email = $t_note_info['email']; + } else { + $t_email = ''; + } - echo <<<EOT - <tr valign="top"> - <td bgcolor="#e0e0e0" colspan="2"> - $t_id_bookmark + if ( isset( $t_note_info['date'] ) ) { + $t_date = $t_note_info['date']; + } else { + $t_date = ''; + } - <table summary="" border="0" cellpadding="2" cellspacing="0" width="100%"> - <tr valign="top" bgcolor="#e0e0e0"> - <td><strong>$t_email</strong><br />$t_date</td> - <td align="right">$t_id_view</td> - </tr> - <tr bgcolor="#f0f0f0"> - <td colspan="2">$t_note</td> - </tr> - </table> - </td> - </tr> -EOT; - } + if ( isset( $t_note_info['note'] ) ) { + $t_note = '<pre>' . $t_note_info['note'] . '</pre>'; + } else { + $t_note = ' '; + } - # This function is called after all notes are echo'ed. - function theme_notes_end( $p_page, $p_url, $p_preview = false ) { - global $g_note_add_page, $g_web_directory, $g_theme; + echo <<<EOT + <tr valign="top"> + <td bgcolor="#e0e0e0" colspan="2"> + $t_id_bookmark - $c_url = urlencode( $p_url ); - $t_page_id = page_get_id( $p_page ); + <table summary="" border="0" cellpadding="2" cellspacing="0" width="100%"> + <tr valign="top" bgcolor="#e0e0e0"> + <td><strong>$t_email</strong><br />$t_date</td> + <td align="right">$t_id_view</td> + </tr> + <tr bgcolor="#f0f0f0"> + <td colspan="2">$t_note</td> + </tr> + </table> + </td> + </tr> +EOT; + } + } - $t_images_base = $g_web_directory . 'themes/' . $g_theme . '/images/'; - $add_picture = $t_images_base . 'notes_add.gif'; - $help_picture = $t_images_base . 'notes_about.gif'; - $prev_picture = $t_images_base . 'caret_left.gif'; - $next_picture = $t_images_base . 'caret_right.gif'; - - # @@@@ Should move outside the theme - $t_page = page_get_info( page_where_id_equals( $t_page_id ) ); - $t_prev_page = page_get_info( page_where_id_equals( $t_page['prev_id'] ) ); - $t_next_page = page_get_info( page_where_id_equals( $t_page['next_id'] ) ); + # + # FOOTER + # - if ( false === $t_prev_page ) { - $t_prev_text = ''; + if ( empty( $p_page_data['prev_page'] ) ) { + $t_prev_text = ''; } else { - $t_prev_text = "<img src=\"$prev_picture\" border=\"0\" width=\"11\" height=\"7\" alt=\"" . $t_prev_page['page'] . "\" />" . - link_create( $t_prev_page['url'], $t_prev_page['page'], true, '', '' ); + $t_prev_text = "<img src=\"$prev_picture\" border=\"0\" width=\"11\" height=\"7\" alt=\"" . $p_page_data['prev_page'] . "\" />" . + link_create( $p_page_data['prev_url'], $p_page_data['prev_page'], true, '', '' ); } - if ( false === $t_next_page ) { - $t_next_text = ''; + if ( empty( $p_page_data['next_page' ] ) ) { + $t_next_text = ''; } else { - $t_next_text = link_create( $t_next_page['url'], $t_next_page['page'], true, '', '' ) . - "<img src=\"$next_picture\" border=\"0\" width=\"11\" height=\"7\" alt=\"" . $t_next_page['page'] . "\" />"; + $t_next_text = link_create( $p_page_data['next_url'], $p_page_data['next_page'], true, '', '' ) . + "<img src=\"$next_picture\" border=\"0\" width=\"11\" height=\"7\" alt=\"" . $p_page_data['next_page'] . "\" />"; } if ( empty( $t_prev_text ) && empty( $t_next_text ) ) { - $t_navigation_row = ''; + $t_navigation_row = ''; } else { $t_navigation_row = "<tr><td>$t_prev_text</td><td align=\"right\">$t_next_text</td></tr>"; } - if ( !$p_preview ) { + if ( !$p_page_data['preview'] ) { $t_link_start = "<a href=\"$g_note_add_page?f_page_id=$t_page_id&f_url=$c_url\">"; $t_link_end = '</a>'; } else { $t_link_start = $t_link_end = ''; } + if ( 0 !== count( $t_notes ) ) { + echo <<<EOT + <tr bgcolor="#d0d0d0" valign="top"> + <td colspan="2" align="right"> + $t_link_start<img src="$add_picture" border="0" width="13" height="13" alt="Add Notes" />$t_link_end + <img src="$help_picture" border="0" width="13" height="13" alt="About Notes" /> + </td> + </tr> + </table> +EOT; + } + echo <<<EOT - <tr bgcolor="#d0d0d0" valign="top"> - <td colspan="2" align="right"> - $t_link_start<img src="$add_picture" border="0" width="13" height="13" alt="Add Notes" />$t_link_end - <img src="$help_picture" border="0" width="13" height="13" alt="About Notes" /> - </td> - </tr> - </table> <table border="0" width="100%" bgcolor="#e0e0e0" cellpadding="0" cellspacing="4"> $t_navigation_row <tr bgcolor="#cccccc"><td colspan="2"></td></tr> <tr><td align="right" colspan="2"><small>Last updated: Tue, 17 Sep 2002</small></td></tr> </table> EOT; -# </td></tr></table></td></tr></table> -# <img src="/gifs/caret-r.gif" border="0" width="11" height="7" ALT="next" /> -# <img src="/gifs/spacer.gif" width="1" height="1" border="0" alt="" /> - } - - # This function is called if the current page has no notes associated - # with it. In this case theme_notes_start() and theme_notes_end() - # APIs are not called. - function theme_notes_none( $p_page, $p_url ) { - theme_notes_start( $p_page, $p_url ); - - echo <<<EOT - <tr valign="top"> - <td bgcolor="#e0e0e0" colspan="2">There are no user contributed notes for this page. - </td> - </tr> - </table> -EOT; - theme_notes_end( $p_page, $p_url ); - } - - # This function is called if the current page was not indexed - function theme_not_indexed( $p_page ) { } ?> |
From: <vb...@us...> - 2002-09-20 02:48:50
|
Update of /cvsroot/webnotes/webnotes/sample In directory usw-pr-cvs1:/tmp/cvs-serv20300/sample Modified Files: xhtml.php Log Message: - Changed the way the schemes are structure to accept one array which has all information rather than header, note, footer. - Remove the handling of finding out the prev / next page names/urls from the theme to the core. - Added page_prepare_theme_data() which prepares all the information to be used by the scheme into one array. The theme should never need to access the database. - Removed the row which has the add / help icons from the footer when there is no notes in the page. - Added source forge logo to the XHTML sample. Index: xhtml.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/sample/xhtml.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- xhtml.php 19 Sep 2002 22:50:38 -0000 1.1 +++ xhtml.php 20 Sep 2002 02:48:47 -0000 1.2 @@ -15,5 +15,7 @@ require_once("../core/api.php"); # replace with actual path print_web_notes( 'XHTML', $PHP_SELF, 'XML', 'Web Services' ); ?> + <br /> + <a href="http://sourceforge.net/projects/webnotes/"><img src="http://sourceforge.net/sflogo.php?group_id=15381&type=5" width="140" height="42" border="0" alt="phpWebNotes @ SourceForge"></a> </body> </html> |
From: <vb...@us...> - 2002-09-20 02:48:50
|
Update of /cvsroot/webnotes/webnotes/doc In directory usw-pr-cvs1:/tmp/cvs-serv20300/doc Modified Files: ChangeLog Log Message: - Changed the way the schemes are structure to accept one array which has all information rather than header, note, footer. - Remove the handling of finding out the prev / next page names/urls from the theme to the core. - Added page_prepare_theme_data() which prepares all the information to be used by the scheme into one array. The theme should never need to access the database. - Removed the row which has the add / help icons from the footer when there is no notes in the page. - Added source forge logo to the XHTML sample. Index: ChangeLog =================================================================== RCS file: /cvsroot/webnotes/webnotes/doc/ChangeLog,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- ChangeLog 19 Sep 2002 05:15:47 -0000 1.17 +++ ChangeLog 20 Sep 2002 02:48:46 -0000 1.18 @@ -17,7 +17,6 @@ * Moved to XHTML (not tested yet) * Integrated the Italian/French strings into cvs. * Added support for themes (#2). - * Added the classic theme (#4). * Added admin_pending.php to allow moderating notes in any order (#10). * Added $g_auto_accept_notes to allow auto-accepting of notes (useful for demos and Intranet installations) * Added $g_auto_index_pages to allow auto-indexing for pages which call phpWebNotes but are not indexed. Default is ON. @@ -34,6 +33,7 @@ * Built infrastructure for multiple access levels. * Implemented inline moderation where the moderators can moderate notes on the actual pages. * Viewing notes based on access level rather than displaying all accepted notes for everybody. + * Added support for prev / next documents. 03.12.2000 - 1.0.0 |
From: <vb...@us...> - 2002-09-20 02:48:49
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv20300/core Modified Files: note_api.php page_api.php Log Message: - Changed the way the schemes are structure to accept one array which has all information rather than header, note, footer. - Remove the handling of finding out the prev / next page names/urls from the theme to the core. - Added page_prepare_theme_data() which prepares all the information to be used by the scheme into one array. The theme should never need to access the database. - Removed the row which has the add / help icons from the footer when there is no notes in the page. - Added source forge logo to the XHTML sample. Index: note_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/note_api.php,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- note_api.php 19 Sep 2002 22:50:38 -0000 1.20 +++ note_api.php 20 Sep 2002 02:48:46 -0000 1.21 @@ -106,24 +106,23 @@ $result = db_query( $query ); } ### -------------------- - function note_print_all( $p_page_name, $p_url ) { - $c_id = page_get_id( $p_page_name ); - if ( false === page_valid_id( $c_id ) ) { - return; + function note_get_all_visible( $p_page_id ) { + $notes = array(); + + $t_page_info = page_get_info( page_where_id_equals( $p_page_id ) ); + if ( false === $t_page_info ) { + return false; } - $c_page_name = db_prepare_string( $p_page_name ); + $c_page_id = db_prepare_int( $p_page_id ); $query = "SELECT * - FROM " . config_get( 'phpWN_page_table' ) . " p, - " . config_get( 'phpWN_note_table' ) . " n - WHERE p.page='$c_page_name' AND n.page_id=p.id - ORDER BY n.date_submitted " . config_get( 'note_order' ); + FROM " . config_get( 'phpWN_note_table' ) . " + WHERE page_id='$c_page_id' + ORDER BY date_submitted " . config_get( 'note_order' ); $result = db_query( $query ); - $entry_count = db_num_rows( $result ); - for ( $i = 0; $i < $entry_count; $i++ ) { - $row = db_fetch_array( $result ); + while ( $row = db_fetch_array( $result ) ) { extract( $row, EXTR_PREFIX_ALL, 'v' ); if ( ( NOTE_VISIBLE_PENDING == $v_visible ) && ( access_check_action( ACTION_NOTES_VIEW_PENDING ) === false ) ) { @@ -149,14 +148,14 @@ $info['visible'] = $v_visible; $info['id'] = $v_id; $info['email'] = $v_email; - $info['note'] = string_add_note_links( $p_url, string_preserve_spaces( string_disable_html( $v_note ) ) ); + $info['note'] = string_add_note_links( $t_page_info['url'], string_preserve_spaces( string_disable_html( $v_note ) ) ); - #Removed by Remon tell we fix the problem in the sql_to_unix_time - #$info['date'] = date( 'M, d Y H:i', sql_to_unix_time( $v_date_submitted ) ); $info['date'] = $v_date_submitted; - theme_notes_echo( $p_page_name, $p_url, $info ); + $notes[] = $info; } + + return( $notes ); } ### -------------------- # @@@@ Should be obsolete soon! @@ -267,13 +266,9 @@ } else { page_update_url( $t_page_id, $p_url ); page_update_neighbours( $t_page_id, $p_prev_page, $p_next_page ); - - if ( page_visible_notes_count ( $t_page_id ) > 0 ) { - theme_notes_start( $p_page, $p_url ); - note_print_all( $p_page, $p_url ); - theme_notes_end( $p_page, $p_url ); - } else { - theme_notes_none( $p_page, $p_url ); + $page_data = page_prepare_theme_data( $t_page_id ); + if ( false !== $page_data ) { + theme_output ( $page_data ); } } } Index: page_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/page_api.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- page_api.php 19 Sep 2002 22:50:38 -0000 1.12 +++ page_api.php 20 Sep 2002 02:48:46 -0000 1.13 @@ -291,4 +291,42 @@ return true; } ### -------------------- + function page_prepare_theme_data( $p_page_id ) { + $t_page_data = array(); + + $t_page_info = page_get_info( page_where_id_equals( $p_page_id ) ); + if ( false === $t_page_info ) { + return (false); + } + + $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['preview'] = false; + + $t_prev_page = page_get_info( page_where_id_equals( $t_page_info['prev_id'] ) ); + $t_next_page = page_get_info( page_where_id_equals( $t_page_info['next_id'] ) ); + + if ( false === $t_prev_page ) { + $t_page_data['prev_page'] = ''; + $t_page_data['prev_url'] = ''; + } else { + $t_page_data['prev_page'] = $t_prev_page['page']; + $t_page_data['prev_url'] = $t_prev_page['url']; + } + + if ( false === $t_next_page ) { + $t_page_data['next_page'] = ''; + $t_page_data['next_url'] = ''; + } else { + $t_page_data['next_page'] = $t_next_page['page']; + $t_page_data['next_url'] = $t_next_page['url']; + } + + $t_page_data['notes'] = note_get_all_visible( $p_page_id ); + + return( $t_page_data ); + } + ### -------------------- ?> |
From: <vb...@us...> - 2002-09-20 01:16:29
|
Update of /cvsroot/webnotes/webnotes/doc In directory usw-pr-cvs1:/tmp/cvs-serv2486/doc Modified Files: ROADMAP Log Message: Removing classic theme Index: ROADMAP =================================================================== RCS file: /cvsroot/webnotes/webnotes/doc/ROADMAP,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ROADMAP 19 Sep 2002 04:15:48 -0000 1.12 +++ ROADMAP 20 Sep 2002 01:16:26 -0000 1.13 @@ -10,7 +10,6 @@ * XHTML compliance * Support for themes * Implement php.net theme - * Implement classic theme to provide the original look'n'feel of version 1.0.0. * Email notifications to moderators/administrators on the submission of new notes. * Support MD5 password encryption (as the default) * Database schema modifications |
From: <vb...@us...> - 2002-09-19 22:50:43
|
Update of /cvsroot/webnotes/webnotes/themes/phpnet In directory usw-pr-cvs1:/tmp/cvs-serv26969/themes/phpnet Modified Files: theme_api.php Log Message: - Added prev_id and next_id to the pages table. - Handled prev/next from theme - Auto setting prev/next if specific in the call to webnotes. - Added XHTML example, to demonstrate the prev / prev-next / next. There is still a problem with pages that have no notes. Index: theme_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/themes/phpnet/theme_api.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- theme_api.php 19 Sep 2002 21:51:02 -0000 1.15 +++ theme_api.php 19 Sep 2002 22:50:39 -0000 1.16 @@ -149,7 +149,32 @@ $help_picture = $t_images_base . 'notes_about.gif'; $prev_picture = $t_images_base . 'caret_left.gif'; $next_picture = $t_images_base . 'caret_right.gif'; - + + # @@@@ Should move outside the theme + $t_page = page_get_info( page_where_id_equals( $t_page_id ) ); + $t_prev_page = page_get_info( page_where_id_equals( $t_page['prev_id'] ) ); + $t_next_page = page_get_info( page_where_id_equals( $t_page['next_id'] ) ); + + if ( false === $t_prev_page ) { + $t_prev_text = ''; + } else { + $t_prev_text = "<img src=\"$prev_picture\" border=\"0\" width=\"11\" height=\"7\" alt=\"" . $t_prev_page['page'] . "\" />" . + link_create( $t_prev_page['url'], $t_prev_page['page'], true, '', '' ); + } + + if ( false === $t_next_page ) { + $t_next_text = ''; + } else { + $t_next_text = link_create( $t_next_page['url'], $t_next_page['page'], true, '', '' ) . + "<img src=\"$next_picture\" border=\"0\" width=\"11\" height=\"7\" alt=\"" . $t_next_page['page'] . "\" />"; + } + + if ( empty( $t_prev_text ) && empty( $t_next_text ) ) { + $t_navigation_row = ''; + } else { + $t_navigation_row = "<tr><td>$t_prev_text</td><td align=\"right\">$t_next_text</td></tr>"; + } + if ( !$p_preview ) { $t_link_start = "<a href=\"$g_note_add_page?f_page_id=$t_page_id&f_url=$c_url\">"; $t_link_end = '</a>'; @@ -166,8 +191,7 @@ </tr> </table> <table border="0" width="100%" bgcolor="#e0e0e0" cellpadding="0" cellspacing="4"> - <tr><td><img src="$prev_picture" border="0" width="11" height="7" alt="Previous" />Previous</td> - <td align="right">Next<img src="$next_picture" border="0" width="11" height="7" alt="Next" /></td></tr> + $t_navigation_row <tr bgcolor="#cccccc"><td colspan="2"></td></tr> <tr><td align="right" colspan="2"><small>Last updated: Tue, 17 Sep 2002</small></td></tr> </table> @@ -190,6 +214,7 @@ </tr> </table> EOT; + theme_notes_end( $p_page, $p_url ); } # This function is called if the current page was not indexed |