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
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv26048 Modified Files: admin.php index.html login.php login_page.php logout.php note_add.php note_add_msg_inc.php note_add_page.php Log Message: - Fixed a problem with the default value for $g_absolute_directory - Enhanced the themes template. - Cleanup of admin.php - Did cleaning of parameters before injecting them into SQL in api.php - Updated the roadmap. - Cleanup of logout.php - Cleanup of login_page.php - Cleanup of login.php - Cleanup of note_add.php - Cleanup of note_add_page.php (still more work). - Cleanup of xml.php - Cleanup of webservices.php - Cleanup of index.html Index: admin.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- admin.php 4 Sep 2002 15:03:49 -0000 1.11 +++ admin.php 5 Sep 2002 06:25:19 -0000 1.12 @@ -8,46 +8,41 @@ # -------------------------------------------------------- # $Id$ # -------------------------------------------------------- -?> -<? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> -<? login_cookie_check() ?> -<? + + include( "core" . DIRECTORY_SEPARATOR . "api.php" ); + + login_cookie_check(); + $queue_count = note_queue_count(); -?> -<? print_html_top() ?> -<? print_head_top() ?> -<? print_title( $g_window_title ) ?> -<? print_css( $g_css_inc_file ) ?> -<? print_head_bottom() ?> -<? print_body_top() ?> -<? print_header( $g_page_title ) ?> -<? print_top_page( $g_top_page_inc ) ?> -<? print_admin_menu() ?> + print_html_top(); + print_head_top(); + print_title( $g_window_title ); + print_css( $g_css_inc_file ); + print_head_bottom(); + print_body_top(); + print_header( $g_page_title ); + print_top_page( $g_top_page_inc ); -<br /> -<!-- DIV? --> -<table width="50%" bgcolor="<? echo $g_table_border_color ?>" cellspacing="1" border="0"> -<tr align="center" bgcolor="<? echo $g_header_color ?>"> - <td colspan=3> - <strong><? echo $s_admin_title ?></strong> - </td> -</tr> -<tr bgcolor=<? echo $g_primary_light_color ?> align="center" valign="middle" height="50"> - <td width="33%"> - <a href="<? echo $g_admin_index_files ?>"><? echo $s_index_files ?></a> - </td> - <td width="34%"> - <a href="<? echo $g_admin_view_queue ?>"><? echo $s_view_queue ?></a> [<? echo $queue_count ?>] - </td> - <td width="33%"> - <a href="<? echo $g_admin_change_password ?>"><? echo $s_change_password ?></a> - </td> -</tr> -</table> -</div> + print_admin_menu(); -<? print_footer( __FILE__ ) ?> -<? print_bottom_page( $g_bottom_page_inc ) ?> -<? print_body_bottom() ?> -<? print_html_bottom() ?> \ No newline at end of file + echo <<<EOT + <br /> + <table width="50%" bgcolor="$g_table_border_color" cellspacing="1" border="0"> + <tr align="center" bgcolor="$g_header_color"> + <td colspan="3"><strong>$s_admin_title</strong></td> + </tr> + <tr bgcolor="$g_primary_light_color" align="center" valign="middle" height="50"> + <td width="33%"><a href="$g_admin_index_files">$s_index_files</a></td> + <td width="34%"><a href="$g_admin_view_queue">$s_view_queue</a> [$queue_count]</td> + <td width="33%"><a href="$g_admin_change_password">$s_change_password</a></td> + </tr> + </table> + </div> +EOT; + + print_footer( __FILE__ ); + print_bottom_page( $g_bottom_page_inc ); + print_body_bottom(); + print_html_bottom(); +?> \ No newline at end of file Index: index.html =================================================================== RCS file: /cvsroot/webnotes/webnotes/index.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- index.html 2 Sep 2002 22:06:26 -0000 1.4 +++ index.html 5 Sep 2002 06:25:19 -0000 1.5 @@ -1,8 +1,8 @@ <html> -<head> -<meta http-equiv="Refresh" content="0;URL=admin.php" /> -</head> -<body> -<a href="admin.php">click here</a> -</body> -</html> \ No newline at end of file + <head> + <meta http-equiv="Refresh" content="0;URL=admin.php" /> + </head> + <body> + <a href="admin.php">click here</a> + </body> +</html> Index: login.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/login.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- login.php 3 Sep 2002 06:59:08 -0000 1.5 +++ login.php 5 Sep 2002 06:25:19 -0000 1.6 @@ -1,4 +1,4 @@ -<? +<?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 2002 Webnotes Team - web...@so... @@ -8,32 +8,34 @@ # -------------------------------------------------------- # $Id$ # -------------------------------------------------------- -?> -<? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> -<? - ### get user info + + require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); + + $c_username = db_prepare_string( $f_username ); + + ### get user info $query = "SELECT * FROM $g_phpWN_user_table - WHERE username='$f_username'"; + WHERE username='$c_username'"; $result = db_query( $query ); $row = db_fetch_array( $result ); if ( $row ) { - extract( $row, EXTR_PREFIX_ALL, "u" ); + extract( $row, EXTR_PREFIX_ALL, "v" ); } else { ### invalid login, retry header( "Location: $g_login_page?f_msg=error" ); exit; } - if( true /* password_match( $f_password, $u_password ) */ ) { + if( true /* password_match( $f_password, $v_password ) */ ) { ### set permanent cookie (1 year) - if (( isset( $f_perm_login ) )&&( $f_perm_login=="on")) { - setcookie( $g_string_cookie, $u_cookie_string, time()+$g_cookie_time_length ); + if ( ( isset( $f_perm_login ) ) && ( $f_perm_login == "on" ) ) { + setcookie( $g_string_cookie, $v_cookie_string, time() + $g_cookie_time_length ); } ### set temp cookie, cookie dies after browser closes else { - setcookie( $g_string_cookie, $u_cookie_string ); + setcookie( $g_string_cookie, $v_cookie_string ); } header( "Location: $g_admin_page" ); Index: login_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/login_page.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- login_page.php 3 Sep 2002 06:59:08 -0000 1.11 +++ login_page.php 5 Sep 2002 06:25:19 -0000 1.12 @@ -1,4 +1,4 @@ -<? +<?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 2002 Webnotes Team - web...@so... @@ -8,66 +8,54 @@ # -------------------------------------------------------- # $Id$ # -------------------------------------------------------- -?> -<? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> -<? + + require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); + ### Check to see if already logged in - if (( isset( $g_string_cookie_val ))&&( !empty( $g_string_cookie_val ) )) { + if ( ( isset( $g_string_cookie_val ) ) && ( !empty( $g_string_cookie_val ) ) ) { login_cookie_check( $g_admin_page ); } -?> -<? print_html_top() ?> -<? print_head_top() ?> -<? print_title( $g_window_title ) ?> -<? print_css( $g_css_inc_file ) ?> -<? print_head_bottom() ?> -<? print_body_top() ?> -<? print_header( $g_page_title ) ?> -<? print_top_page( $g_top_page_inc ) ?> -<br /> -<div align="center"> -<form method="post" action="<? echo $g_login ?>"> -<table width="40%" bgcolor="<? echo $g_table_border_color ?>" cellspacing="1" border="0"> -<tr bgcolor=<? echo $g_header_color ?>> - <td colspan="2" bgcolor="<? echo $g_table_title_color ?>"> - <strong><? echo $s_login_title ?></strong> - </td> -</tr> -<tr bgcolor="<? echo $g_white_color ?>"> - <td width="25%"> - <? echo $s_username ?>: - </td> - <td width="75%"> - <input type="text" name="f_username" size="32" maxlength="32" /> - </td> -</tr> -<tr bgcolor="<? echo $g_white_color ?>"> - <td> - <? echo $s_password ?>: - </td> - <td> - <input type="password" name="f_password" size="32" maxlength="32" /> - </td> -</tr> -<tr bgcolor="<? echo $g_white_color ?>"> - <td> - <? echo $s_save_login ?>: - </td> - <td> - <input type="checkbox" name="f_perm_login" /> - </td> -</tr> -<tr bgcolor="<? echo $g_white_color ?>"> - <td align="center" colspan="2"> - <input type="submit" value="<? echo $s_login_button ?>" /> - </td> -</tr> -</table> -</form> -</div> + print_html_top(); + print_head_top(); + print_title( $g_window_title ); + print_css( $g_css_inc_file ); + print_head_bottom(); + print_body_top(); + print_header( $g_page_title ); + print_top_page( $g_top_page_inc ); -<? print_bottom_page( $g_bottom_page_inc ) ?> -<? print_footer(__FILE__) ?> -<? print_body_bottom() ?> -<? print_html_bottom() ?> \ No newline at end of file + echo <<<EOT + <br /> + <div align="center"> + <form method="post" action="$g_login"> + <table width="40%" bgcolor="$g_table_border_color" cellspacing="1" border="0"> + <tr bgcolor="$g_header_color"> + <td colspan="2" bgcolor="$g_table_title_color"><strong>$s_login_title</strong></td> + </tr> + <tr bgcolor="$g_white_color"> + <td width="25%">$s_username:</td> + <td width="75%"><input type="text" name="f_username" size="32" maxlength="32" /></td> + </tr> + <tr bgcolor="$g_white_color"> + <td>$s_password:</td> + <td><input type="password" name="f_password" size="32" maxlength="32" /></td> + </tr> + <tr bgcolor="$g_white_color"> + <td>$s_save_login:</td> + <td><input type="checkbox" name="f_perm_login" /></td> + </tr> + <tr bgcolor="echo $g_white_color"> + <td align="center" colspan="2"><input type="submit" value="$s_login_button" /></td> + </tr> + </table> + </form> + </div> + +EOT; + + print_bottom_page( $g_bottom_page_inc ); + print_footer(__FILE__); + print_body_bottom(); + print_html_bottom(); +?> \ No newline at end of file Index: logout.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/logout.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- logout.php 3 Sep 2002 06:59:08 -0000 1.9 +++ logout.php 5 Sep 2002 06:25:19 -0000 1.10 @@ -1,4 +1,4 @@ -<? +<?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 2002 Webnotes Team - web...@so... @@ -8,37 +8,40 @@ # -------------------------------------------------------- # $Id$ # -------------------------------------------------------- -?> -<? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> -<? + + require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); + ### remove cookie setcookie( $g_string_cookie ); -?> -<? print_html_top() ?> -<? print_head_top() ?> -<? print_title( $g_window_title ) ?> -<? print_css( $g_css_inc_file ) ?> -<? print_meta_redirect( $g_logout_redirect_page, 2 ) ?> -<? print_head_bottom() ?> -<? print_body_top() ?> -<? print_header( $g_page_title ) ?> -<p> -<div align="center"> -<table width="40%" bgcolor="<? echo $g_table_border_color ?>" cellspacing="1" border="0"> -<tr bgcolor="<? echo $g_white_color ?>"> - <td bgcolor="<? echo $g_table_title_color ?>"> - <strong><? echo $s_logged_out_msg ?></strong> - </td> -</tr> -<tr bgcolor="<? echo $g_white_color ?>"> - <td align="right" bgcolor="<? echo $g_primary_color_dark ?>"> - <strong><? echo $s_logout_redirect_msg ?><a href="<? echo $g_logout_redirect_page ?>">Here</a></strong> - </td> -</tr> -</table> -</div> + print_html_top(); + print_head_top(); + print_title( $g_window_title ); + print_css( $g_css_inc_file ); + print_meta_redirect( $g_logout_redirect_page, 2 ); + print_head_bottom(); + print_body_top(); + print_header( $g_page_title ); -<? print_footer( __FILE__ ) ?> -<? print_body_bottom() ?> -<? print_html_bottom() ?> \ No newline at end of file + # @@@@ The word "Here" needs to be localised. + echo <<<EOT + <br /> + <div align="center"> + <table width="40%" bgcolor="$g_table_border_color" cellspacing="1" border="0"> + <tr bgcolor="$g_white_color"> + <td bgcolor="$g_table_title_color"><strong>$s_logged_out_msg</strong></td> + </tr> + <tr bgcolor="$g_white_color"> + <td align="right" bgcolor="$g_primary_color_dark"> + <strong>$s_logout_redirect_msg <a href="$g_logout_redirect_page">Here</a></strong> + </td> + </tr> + </table> + </div> + +EOT; + + print_footer( __FILE__ ); + print_body_bottom(); + print_html_bottom(); +?> \ No newline at end of file Index: note_add.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- note_add.php 3 Sep 2002 06:59:08 -0000 1.10 +++ note_add.php 5 Sep 2002 06:25:19 -0000 1.11 @@ -1,4 +1,4 @@ -<? +<?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 2002 Webnotes Team - web...@so... @@ -8,40 +8,41 @@ # -------------------------------------------------------- # $Id$ # -------------------------------------------------------- -?> -<? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> -<? + + require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); + ### insert note $result = note_add( $f_page_id, $f_email, $REMOTE_ADDR, $f_note ); -?> -<? print_html_top() ?> -<? print_head_top() ?> -<? print_title( $g_window_title ) ?> -<? print_css( $g_css_inc_file ) ?> -<? + + print_html_top(); + print_head_top(); + print_title( $g_window_title ); + print_css( $g_css_inc_file ); + if ( $result ) { print_meta_redirect( $f_url, $g_time_wait ); } -?> -<? print_head_bottom() ?> -<? print_body_top() ?> -<? print_header( $g_page_title ) ?> -<p> -<div align="center"> -<? + print_head_bottom(); + print_body_top(); + print_header( $g_page_title ); + + echo '<br />'; + echo '<div align="center">'; + if ( $result ) { - PRINT "$s_created_note_msg<br />"; + echo "$s_created_note_msg<br />"; } else { - PRINT "$s_sql_error_msg <a href=\"<? echo $g_administrator_email ?>\">$s_administrator</a><br />"; + echo "$s_sql_error_msg <a href=\"$g_administrator_email\">$s_administrator</a><br />"; echo $query; } -?> -<p> -<a href="<? echo $f_url ?>"><? echo $s_click_to_proceed_msg ?></a> -</div> -<? print_footer(__FILE__) ?> -<? print_body_bottom() ?> -<? print_html_bottom() ?> \ No newline at end of file + echo '<br />'; + echo "<a href=\"$f_url\">$s_click_to_proceed_msg</a>"; + echo '</div>'; + + print_footer( __FILE__ ); + print_body_bottom(); + print_html_bottom(); +?> \ No newline at end of file Index: note_add_msg_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add_msg_inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- note_add_msg_inc.php 2 Sep 2002 22:06:26 -0000 1.4 +++ note_add_msg_inc.php 5 Sep 2002 06:25:19 -0000 1.5 @@ -1,12 +1,12 @@ <div align="center"> -<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>Currently 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> + <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>Currently 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> Index: note_add_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add_page.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- note_add_page.php 3 Sep 2002 06:59:08 -0000 1.10 +++ note_add_page.php 5 Sep 2002 06:25:19 -0000 1.11 @@ -1,4 +1,4 @@ - <? + <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 2002 Webnotes Team - web...@so... @@ -8,23 +8,24 @@ # -------------------------------------------------------- # $Id$ # -------------------------------------------------------- -?> -<? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> -<? print_html_top() ?> -<? print_head_top() ?> -<? print_title( $g_window_title ) ?> -<? print_css( $g_css_inc_file ) ?> -<? print_head_bottom() ?> -<? print_body_top() ?> -<? print_header( $g_page_title ) ?> -<? print_top_page( $g_top_page_inc ) ?> -<? + require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' ); + + print_html_top(); + print_head_top(); + print_title( $g_window_title ); + print_css( $g_css_inc_file ); + print_head_bottom(); + print_body_top(); + print_header( $g_page_title ); + print_top_page( $g_top_page_inc ); + $t_page_name = get_page_name( $f_page_id ); if ( empty ( $t_page_name ) ) { - PRINT "<div align=\"center\">"; - PRINT "$s_not_indexed_part1 <a href=\"mailto:$g_administrator_email\">$s_administrator</a> $s_not_indexed_part2"; - PRINT "</div>"; + echo "<div align=\"center\">"; + # @@@@ replace with one parameterised localisation string + echo "$s_not_indexed_part1 <a href=\"mailto:$g_administrator_email\">$s_administrator</a> $s_not_indexed_part2"; + echo "</div>"; } else { ?> @@ -34,71 +35,56 @@ <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 if ( file_exists( $g_note_add_include ) ) { include( $g_note_add_include ); } -?> -<br /> -<div align="center"> -<table bgcolor="<? echo $g_table_border_color ?>" width="75%" cellspacing="1" border="0"> -<form method="post" action="<? echo $g_note_add ?>"> -<input type="hidden" name="f_came_from" value="<? echo $HTTP_REFERER ?>" /> -<input type="hidden" name="f_page_id" value="<? echo $f_page_id ?>" /> -<input type="hidden" name="f_url" value="<? echo $f_url ?>" /> -<tr bgcolor="<? echo $g_header_color ?>"> - <td colspan="2"> - <strong><? echo $s_add_note ?></strong> - </td> -</tr> -<tr bgcolor="<? echo $g_primary_light_color ?>"> - <td width="15%"> - <? echo $s_page ?> - </td> - <td width="85%"> - <? echo basename ( $t_page_name ) ?> - </td> -</tr> -<tr bgcolor="<? echo $g_primary_dark_color ?>"> - <td> - <? echo $s_date ?> - </td> - <td> - <? echo date( $g_date_format, time() ) ?> - </td> -</tr> -<tr bgcolor="<? echo $g_primary_light_color ?>"> - <td> - <? echo $s_email ?> - </td> - <td> - <input type="text" name="f_email" size="64" maxlength="128" /> - </td> -</tr> -<tr bgcolor=<? echo $g_primary_dark_color ?>> - <td> - <? echo $s_note ?> - </td> - <td> - <textarea type="text" name="f_note" rows="16" cols="72"></textarea> - </td> -</tr> -<tr bgcolor="<? echo $g_white_color ?>"> - <td colspan="2" align="center"> - <input type="submit" value="<? echo $s_add_note_link ?>" /> - </td> -</tr> -</form> -</table> -</div> + $t_base_page_name = basename( $t_page_name ); + $t_date = date( $g_date_format, time() ); + + echo <<<EOT + <br /> + <div align="center"> + <table bgcolor="$g_table_border_color" width="75%" cellspacing="1" border="0"> + <form method="post" action="$g_note_add"> + <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" /> + <tr bgcolor="$g_header_color"> + <td colspan="2"><strong><? echo $s_add_note ?></strong></td> + </tr> + <tr bgcolor="$g_primary_light_color"> + <td width="15%">$s_page</td> + <td width="85%">$t_base_page_name</td> + </tr> + <tr bgcolor="$g_primary_dark_color"> + <td>$s_date</td> + <td>$t_date</td> + </tr> + <tr bgcolor="$g_primary_light_color"> + <td>$s_email</td> + <td><input type="text" name="f_email" size="64" maxlength="128" /></td> + </tr> + <tr bgcolor="$g_primary_dark_color"> + <td>$s_note</td> + <td><textarea type="text" name="f_note" rows="16" cols="72"></textarea></td> + </tr> + <tr bgcolor="$g_white_color"> + <td colspan="2" align="center"><input type="submit" value="$s_add_note_link" /></td> + </tr> + </form> + </table> + </div> + +EOT; -<? } ### end else -?> -<? print_footer( __FILE__ ) ?> -<? print_bottom_page( $g_bottom_page_inc ) ?> -<? print_body_bottom() ?> -<? print_html_bottom() ?> \ No newline at end of file + print_footer( __FILE__ ); + print_bottom_page( $g_bottom_page_inc ); + print_body_bottom(); + print_html_bottom(); +?> \ No newline at end of file |
From: <vb...@us...> - 2002-09-05 06:25:24
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv26048/core Modified Files: api.php config_inc.php Log Message: - Fixed a problem with the default value for $g_absolute_directory - Enhanced the themes template. - Cleanup of admin.php - Did cleaning of parameters before injecting them into SQL in api.php - Updated the roadmap. - Cleanup of logout.php - Cleanup of login_page.php - Cleanup of login.php - Cleanup of note_add.php - Cleanup of note_add_page.php (still more work). - Cleanup of xml.php - Cleanup of webservices.php - Cleanup of index.html Index: api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/api.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- api.php 4 Sep 2002 22:59:46 -0000 1.13 +++ api.php 5 Sep 2002 06:25:19 -0000 1.14 @@ -120,9 +120,11 @@ function get_user_info_arr( $p_string_cookie_val ) { global $g_phpWN_user_table; + $c_string_cookie_val = db_prepare_string( $p_string_cookie_val ); + $query = "SELECT * FROM $g_phpWN_user_table - WHERE cookie_string='$p_string_cookie_val'"; + WHERE cookie_string='$c_string_cookie_val'"; $result = db_query( $query ); return db_fetch_array( $result ); } @@ -135,9 +137,11 @@ $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 $g_phpWN_note_table - WHERE page_id='$p_page_id' + WHERE page_id='$c_page_id' ORDER BY date_submitted"; $result = db_query( $query ); $num_notes = db_num_rows( $result ); @@ -182,12 +186,12 @@ <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" /> - <td width="50%" align="center"> <input type="submit" value="$s_delete_button" /> </form> </td> Index: config_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/config_inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- config_inc.php 4 Sep 2002 13:36:58 -0000 1.4 +++ config_inc.php 5 Sep 2002 06:25:19 -0000 1.5 @@ -33,7 +33,7 @@ $g_web_directory = DIRECTORY_SEPARATOR . 'webnotes' . DIRECTORY_SEPARATOR; ### absolute directory path - $g_absolute_directory = dirname( __FILE__ ) . DIRECTORY_SEPARATOR; + $g_absolute_directory = dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR; ### default ordering of the notes. ### ASC = newest on bottom |
From: <vb...@us...> - 2002-09-05 06:25:24
|
Update of /cvsroot/webnotes/webnotes/themes In directory usw-pr-cvs1:/tmp/cvs-serv26048/themes Modified Files: theme_api.php Log Message: - Fixed a problem with the default value for $g_absolute_directory - Enhanced the themes template. - Cleanup of admin.php - Did cleaning of parameters before injecting them into SQL in api.php - Updated the roadmap. - Cleanup of logout.php - Cleanup of login_page.php - Cleanup of login.php - Cleanup of note_add.php - Cleanup of note_add_page.php (still more work). - Cleanup of xml.php - Cleanup of webservices.php - Cleanup of index.html Index: theme_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/themes/theme_api.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- theme_api.php 3 Sep 2002 01:10:39 -0000 1.1 +++ theme_api.php 5 Sep 2002 06:25:20 -0000 1.2 @@ -9,6 +9,26 @@ # $Id$ # -------------------------------------------------------- + ######################################################################### + # This is an empty template to be used to create new themes. + # To create a new theme, please follow the following steps: + # - Create a directory under the themes directory with the theme name. + # - Make a copy of this file under the new theme directory + # - Assign $g_theme to the theme name (not the full path) in + # core/custom_config_inc.php + ######################################################################### + + # The path to the api.php is calculated assume this file resides in a sub-directory + # under themes. For example, themes/phpnet/. + require_once ( dirname( dirname( dirname( __FILE__ ) ) ) . 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 before printing any notes to the page. function theme_notes_start( $p_page ) { } |
From: <rm...@us...> - 2002-09-05 03:19:37
|
Update of /cvsroot/webnotes/webnotes/themes/phpnet In directory usw-pr-cvs1:/tmp/cvs-serv18706 Added Files: theme_api.php Log Message: Remon's theme file --- NEW FILE: theme_api.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 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_api.php,v 1.1 2002/09/05 03:19:35 rmetira Exp $ # -------------------------------------------------------- # This function is called before printing any notes to the page. function theme_notes_start( $p_page ) { ?> <table border="0" cellpadding="4" cellspacing="0" width="100%"> <tr bgcolor="#d0d0d0" valign="top"> <td><small>User Contributed Notes</small><br /><b><?php echo $p_page; ?></b></td> </tr> <? } # 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_note_info_array ) { echo '<hr />'; #echo '<table border="0" cellpadding="2" cellspacing="0" width="100%">'; echo '<tr align="top" bgcolor="#e0e0e0">'; echo '<td><b>'.$p_note_info_array['email'].'</b><br />'.$p_note_info_array['submit_date']; echo '</td></tr>'; echo '<tr bgcolor="#f0f0f0">'; echo '<td colspan="2">'.nl2br($p_note_info_array['note']); echo '</td></tr>'; } # This function is called after all notes are echo'ed. function theme_notes_end( $p_page ) { echo '</table>'; } # 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 ) { echo "Notes_none"; } ?> |
From: <vb...@us...> - 2002-09-04 22:59:49
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv18345/core Modified Files: api.php Log Message: Fix an html error Index: api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/api.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- api.php 4 Sep 2002 15:03:50 -0000 1.12 +++ api.php 4 Sep 2002 22:59:46 -0000 1.13 @@ -187,7 +187,7 @@ <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" /> - <td width="50%" align="center" + <td width="50%" align="center"> <input type="submit" value="$s_delete_button" /> </form> </td> |
From: <vb...@us...> - 2002-09-04 15:03:57
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv9944/core Modified Files: api.php database_api.php note_api.php Log Message: - Added db_clean/unclean APIs to database_api.php - Renamed note_api.php APIs to note_*. Index: api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/api.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- api.php 4 Sep 2002 13:36:57 -0000 1.11 +++ api.php 4 Sep 2002 15:03:50 -0000 1.12 @@ -85,7 +85,7 @@ PRINT "<td>"; PRINT "</td>"; PRINT "</tr>"; - print_notes( $p_file ); + note_print_all( $p_file ); PRINT "<tr bgcolor=\"$g_primary_dark_color\">"; PRINT "<td align=\"right\">"; PRINT "<a href=\"$g_note_add_page?f_page_id=$t_page_id&f_url=$c_url\">$s_add_note_link</a>"; Index: database_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/database_api.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- database_api.php 3 Sep 2002 22:30:07 -0000 1.1 +++ database_api.php 4 Sep 2002 15:03:50 -0000 1.2 @@ -85,6 +85,56 @@ $t_result = mysql_close(); } ### -------------------- + # -------------------- + # prepare a string before DB insertion + function db_prepare_string( $p_string ) { + return mysql_escape_string( $p_string ); + } + # -------------------- + # prepare an integer before DB insertion + function db_prepare_int( $p_int ) { + return (integer)$p_int; + } + # -------------------- + # prepare a boolean before DB insertion + function db_prepare_bool( $p_bool ) { + return (int)(bool)$p_bool; + } + # -------------------- + # generic unprepare if type is unknown + function db_unprepare( $p_string ) { + return stripslashes( $p_string ); + } + # -------------------- + # unprepare a string after taking it out of the DB + function db_unprepare_string( $p_string ) { + return db_unprepare( $p_string ); + } + # -------------------- + # unprepare an integer after taking it out of the DB + function db_unprepare_int( $p_int ) { + return (integer)db_unprepare( $p_int ); + } + # -------------------- + # unprepare a boolean after taking it out of the DB + function db_unprepare_bool( $p_bool ) { + return (bool)db_unprepare( $p_bool ); + } + # -------------------- + # calls db_unprepare() on every item in a row + function db_unprepare_row( $p_row ) { + if ( false == $p_row ) { + return false; + } + + $t_new_row = array(); + + while ( list( $t_key, $t_val ) = each( $p_row ) ) { + $t_new_row[$t_key] = db_unprepare( $t_val ); + } + + return $t_new_row; + } ########################################################################### ### CODE TO EXECUTE ### Index: note_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/note_api.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- note_api.php 4 Sep 2002 13:36:58 -0000 1.2 +++ note_api.php 4 Sep 2002 15:03:50 -0000 1.3 @@ -10,7 +10,7 @@ # -------------------------------------------------------- ### -------------------- - function queue_count() { + function note_queue_count() { global $g_phpWN_note_table; $query = "SELECT COUNT(*) @@ -20,13 +20,13 @@ return db_result( $result, 0, 0 ); } ### -------------------- - function note_add( $p_page_id, $p_email, $p_REMOTE_ADDR, $p_note ) { + function note_add( $p_page_id, $p_email, $p_remote_addr, $p_note ) { global $g_phpWN_note_table; - $c_page_id = (integer)$p_page_id; - $c_email = string_safe ( $p_email ); # addslashes( htmlspecialchars( $p_email ) ); - $c_note = string_safe ( $p_note ); # addslashes( nl2br( htmlspecialchars( $p_note ) ) ); - $c_remote_address = string_safe( $p_REMOTE_ADDR ); + $c_page_id = db_prepare_int( $p_page_id ); + $c_email = db_prepare_string( $p_email ); + $c_note = db_prepare_string( $p_note ); + $c_remote_address = db_prepare_string( $p_remote_addr ); $query = "INSERT INTO $g_phpWN_note_table ( id, page_id, email, ip, date_submitted, note ) @@ -35,20 +35,22 @@ return db_query( $query ); } ### -------------------- - function delete_note( $p_id ) { + function note_delete( $p_id ) { global $g_phpWN_note_table; + $c_id = db_prepare_int( $p_id ); + $query = "DELETE FROM $g_phpWN_note_table - WHERE id='$p_id'"; + WHERE id='$c_id'"; $result = db_query( $query ); } ### -------------------- - function update_note( $p_id, $p_email, $p_note ) { + function note_update( $p_id, $p_email, $p_note ) { global $g_phpWN_note_table; - $c_id = (integer)$p_id; - $c_email = string_safe ( $p_email ); - $c_note = string_safe ( $p_note ); + $c_id = db_prepare_int( $p_id ); + $c_email = db_prepare_string( $p_email ); + $c_note = db_prepare_string( $p_note ); $query = "UPDATE $g_phpWN_note_table SET email='$c_email', note='$c_note' @@ -56,33 +58,33 @@ $result = db_query( $query ); } ### -------------------- - function accept_note( $p_id ) { + function note_accept( $p_id ) { global $g_phpWN_note_table; - $c_id = (integer) $p_id; + $c_id = db_prepare_int( $p_id ); $query = "UPDATE $g_phpWN_note_table SET visible='1' WHERE id='$c_id'"; $result = db_query( $query ); } ### -------------------- - function decline_note( $p_id ) { + function note_decline( $p_id ) { global $g_phpWN_note_table; - $c_id = (integer) $p_id; + $c_id = db_prepare_int( $p_id ); $query = "DELETE FROM $g_phpWN_note_table WHERE id='$c_id'"; $result = db_query( $query ); } ### -------------------- - function print_notes( $p_page_name ) { + function note_print_all( $p_page_name ) { global $g_hostname, $g_db_username, $g_db_password, $g_database_name, $g_table_border_color, $g_primary_dark_color, $g_primary_light_color, $g_white_color, $g_phpWN_note_table, $g_phpWN_page_table, $g_note_order; - $c_page_name = string_safe ( $p_page_name ); + $c_page_name = db_prepare_string( $p_page_name ); $query = "SELECT * FROM $g_phpWN_page_table p, @@ -93,27 +95,26 @@ $result = db_query( $query ); $entry_count = db_num_rows( $result ); if ( $entry_count>0 ) { - for ($i=0;$i<$entry_count;$i++) { + for ( $i = 0; $i < $entry_count; $i++ ) { $row = db_fetch_array( $result ); extract( $row, EXTR_PREFIX_ALL, "v" ); - $v_email = stripslashes( $v_email ); - $v_note = nl2br( string_preserve_spaces ( string_unsafe( $v_note ) ) ); + + $v_email = db_unprepare_string( $v_email ); + $v_note = nl2br( string_preserve_spaces ( db_unprepare_string( $v_note ) ) ); $date = date( "M, d Y H:i", sql_to_unix_time( $v_date_submitted ) ); - PRINT "<tr bgcolor=\"$g_primary_dark_color\">"; - PRINT "<td>"; - PRINT " <i><a href=\"mailto:$v_email\">$v_email</a></i> - $v_date_submitted"; - PRINT "</td>"; - PRINT "</tr>"; - PRINT "<tr bgcolor=$g_primary_light_color>"; - PRINT "<td><pre>"; - echo $v_note; - PRINT "</pre></td>"; - PRINT "</tr>"; - PRINT "<tr bgcolor=\"$g_white_color\" height=\"2\">"; - PRINT "<td>"; - PRINT "</td>"; - PRINT "</tr>"; + echo <<<EOT + <tr bgcolor="$g_primary_dark_color"> + <td> <em><a href="mailto:$v_email">$v_email</a></em> - $v_date_submitted</td> + </tr> + <tr bgcolor="$g_primary_light_color"> + <td><pre>$v_note</pre></td> + </tr> + <tr bgcolor="$g_white_color" height="2"> + <td></td> + </tr> + +EOT; } } } |
From: <vb...@us...> - 2002-09-04 15:03:57
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv9944 Modified Files: admin.php admin_manage_notes.php admin_view_queue.php Log Message: - Added db_clean/unclean APIs to database_api.php - Renamed note_api.php APIs to note_*. Index: admin.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- admin.php 3 Sep 2002 06:59:08 -0000 1.10 +++ admin.php 4 Sep 2002 15:03:49 -0000 1.11 @@ -12,7 +12,7 @@ <? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> <? login_cookie_check() ?> <? - $queue_count = queue_count(); + $queue_count = note_queue_count(); ?> <? print_html_top() ?> <? print_head_top() ?> Index: admin_manage_notes.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_manage_notes.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- admin_manage_notes.php 3 Sep 2002 06:59:08 -0000 1.10 +++ admin_manage_notes.php 4 Sep 2002 15:03:49 -0000 1.11 @@ -12,11 +12,11 @@ <? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> <? if (( isset( $f_action ))&&( $f_action=="delete" )) { - delete_note( $f_id ); + note_delete( $f_id ); } if (( isset( $f_action ))&&( $f_action=="update" )) { - update_note( $f_id, $f_email, $f_note ); + note_update( $f_id, $f_email, $f_note ); } ?> <? print_html_top() ?> Index: admin_view_queue.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_view_queue.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- admin_view_queue.php 3 Sep 2002 06:59:08 -0000 1.10 +++ admin_view_queue.php 4 Sep 2002 15:03:49 -0000 1.11 @@ -17,11 +17,11 @@ } if ( $f_action=="accept" ) { - accept_note( $f_id ); + note_accept( $f_id ); } if ( $f_action=="decline" ) { - decline_note( $f_id ); + note_decline( $f_id ); } $row = select_queued_notes_arr(); @@ -30,7 +30,7 @@ $v_note = string_edit( $v_note ); } - $queue_count = queue_count(); + $queue_count = note_queue_count(); ?> <? print_html_top() ?> <? print_head_top() ?> |
From: <vb...@us...> - 2002-09-04 13:37:01
|
Update of /cvsroot/webnotes/webnotes/lang In directory usw-pr-cvs1:/tmp/cvs-serv6169/lang Modified Files: strings_english.php strings_french.php strings_italian.php Log Message: - Fixed a typo in a variable name in all localisation files. - Clean up of variables before saving to the database. - The directory separators were not handled correctly when passed on the url. - Changed some "&" to "& a m p ;" - Renamed a configuration variable ($p_notes_order) to ($g_notes_order). - Changed the contents of the note to be preformatted when displayed. - Added a directory with two sample files, to be used for demonstration / testing. Index: strings_english.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/lang/strings_english.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- strings_english.php 3 Sep 2002 06:59:09 -0000 1.2 +++ strings_english.php 4 Sep 2002 13:36:58 -0000 1.3 @@ -85,7 +85,7 @@ ### note_add_page.php $s_not_indexed_part1 = "This page is not indexed in the database. Please get the"; ### $s_administrator # defined elsewhere - $s_not_indexed__part2 = "to run the file indexer."; + $s_not_indexed_part2 = "to run the file indexer."; $s_back_link = "Back"; $s_add_note = "Add Note"; $s_delete = "Date"; Index: strings_french.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/lang/strings_french.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- strings_french.php 3 Sep 2002 06:59:09 -0000 1.1 +++ strings_french.php 4 Sep 2002 13:36:58 -0000 1.2 @@ -63,7 +63,7 @@ $s_sql_error_msg = "ERREUR DETECTE: Rapporter cette requête SQL à"; ### note_add_page.php $s_not_indexed_part1 = "Cette page n'est pas indexée dans la base. SVP"; ### $s_administrator # defined elsewhere - $s_not_indexed__part2 = "pour activer l'indexateur."; + $s_not_indexed_part2 = "pour activer l'indexateur."; $s_back_link = "Retour"; $s_add_note = "Ajouter Note"; $s_delete = "Date"; Index: strings_italian.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/lang/strings_italian.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- strings_italian.php 3 Sep 2002 06:59:09 -0000 1.1 +++ strings_italian.php 4 Sep 2002 13:36:58 -0000 1.2 @@ -65,7 +65,7 @@ $s_sql_error_msg = "ERRORE: query sql "; ### note_add_page.php $s_not_indexed_part1 = "questa pagina non e' stata indicizzata nel database. Prendi l'"; ### $s_administrator # defined elsewhere - $s_not_indexed__part2 = " per eseguire l'indicizzazione."; + $s_not_indexed_part2 = " per eseguire l'indicizzazione."; $s_back_link = "Indietro"; $s_add_note = "Inserisci Nota"; $s_delete = "Data"; |
From: <vb...@us...> - 2002-09-04 13:37:01
|
Update of /cvsroot/webnotes/webnotes/sample In directory usw-pr-cvs1:/tmp/cvs-serv6169/sample Added Files: webservices.php xml.php Log Message: - Fixed a typo in a variable name in all localisation files. - Clean up of variables before saving to the database. - The directory separators were not handled correctly when passed on the url. - Changed some "&" to "& a m p ;" - Renamed a configuration variable ($p_notes_order) to ($g_notes_order). - Changed the contents of the note to be preformatted when displayed. - Added a directory with two sample files, to be used for demonstration / testing. --- NEW FILE: webservices.php --- <html> <head> <title>Web services (from Webopedia)</title> </head> <body> <h1>Web services</h1> <p>The term Web services describes a standardized way of integrating Web-based applications using the XML, SOAP, WSDL and UDDI open standards over an Internet protocol backbone. XML is used to tag the data, SOAP is used to transfer the data, WSDL is used for describing the services available and UDDI is used for listing what services are available. Used primarily as a means for businesses to communicate with each other and with clients, Web services allow organizations to communicate data without intimate knowledge of each other's IT systems behind the firewall.</p> <p>Unlike traditional client/server models, such as a Web server/Web page system, Web services do not provide the user with a GUI. Web services instead share business logic, data and processes through a programmatic interface across a network. The applications interface, not the users. Developers can then add the Web service to a GUI (such as a Web page or an executable program) to offer specific functionality to users.</p> <p>Web services allow different applications from different sources to communicate with each other without time-consuming custom coding, and because all communication is in XML, Web services are not tied to any one operating system or programming language. For example, Java can talk with Perl, Windows applications can talk with UNIX applications.</p> <p>Web services do not require the use of browsers or HTML.</p> <p>Web services are sometimes called application services.</p> <p>The above definition was copied from <a href="http://www.webopedia.com">Webopedia</a>.</p> <?php include("../core/api.php"); # replace with actual path print_web_notes( __FILE__, $PHP_SELF ); ?> </body> </html> --- NEW FILE: xml.php --- <html> <head> <title>XML (from Webopedia)</title> </head> <body> <h1>XML</h1> <p>Short for Extensible Markup Language, a specification developed by the W3C. XML is a pared-down version of SGML, designed especially for Web documents. It allows designers to create their own customized tags, enabling the definition, transmission, validation, and interpretation of data between applications and between organizations.</p> <p>The above definition was copied from <a href="http://www.webopedia.com">Webopedia</a>.</p> <?php include("../core/api.php"); # replace with actual path print_web_notes( __FILE__, $PHP_SELF ); ?> </body> </html> |
From: <vb...@us...> - 2002-09-04 13:37:00
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv6169/core Modified Files: api.php config_inc.php html_api.php note_api.php page_api.php string_api.php Log Message: - Fixed a typo in a variable name in all localisation files. - Clean up of variables before saving to the database. - The directory separators were not handled correctly when passed on the url. - Changed some "&" to "& a m p ;" - Renamed a configuration variable ($p_notes_order) to ($g_notes_order). - Changed the contents of the note to be preformatted when displayed. - Added a directory with two sample files, to be used for demonstration / testing. Index: api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/api.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- api.php 4 Sep 2002 07:11:24 -0000 1.10 +++ api.php 4 Sep 2002 13:36:57 -0000 1.11 @@ -66,33 +66,37 @@ $s_user_notes, $s_add_note_link, $s_manage, $s_admin; - db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); + PRINT "<br />"; + PRINT "<div align=\"center\">"; $t_page_id = get_page_id( $p_file ); + if ( $t_page_id === '' ) { + PRINT "$s_not_indexed_part1 <a href=\"mailto:$g_administrator_email\">$s_administrator</a> $s_not_indexed_part2"; + } else { + $c_url = urlencode( $p_url ); - PRINT "<br />"; - PRINT "<div align=\"center\">"; - PRINT "<table bgcolor=\"$g_table_border_color\" width=\"640\" cellspacing=\"1\" border=\"0\" cellpadding=\"3\">"; - PRINT "<tr bgcolor=\"$g_header_color\">"; - PRINT "<td align=\"center\">"; - PRINT "<strong>$s_user_notes</strong>"; - PRINT "</td>"; - PRINT "</tr>"; - PRINT "<tr bgcolor=\"$g_white_color\" height=\"2\">"; - PRINT "<td>"; - PRINT "</td>"; - PRINT "</tr>"; - print_notes( $p_file ); - PRINT "<tr bgcolor=\"$g_primary_dark_color\">"; - PRINT "<td align=\"right\">"; - PRINT "<a href=\"$g_note_add_page?f_page_id=$t_page_id&f_url=$p_url\">$s_add_note_link</a>"; - if (is_moderator()) { - PRINT " | <a href=\"$g_admin_manage_notes?f_page_id=$t_page_id&f_url=$p_url\">$s_manage</a>"; - PRINT " | <a href=\"$g_admin_page\">$s_admin</a>"; - } - PRINT "</td>"; - PRINT "</tr>"; - PRINT "</table>"; + PRINT "<table bgcolor=\"$g_table_border_color\" width=\"640\" cellspacing=\"1\" border=\"0\" cellpadding=\"3\">"; + PRINT "<tr bgcolor=\"$g_header_color\">"; + PRINT "<td align=\"center\">"; + PRINT "<strong>$s_user_notes</strong>"; + PRINT "</td>"; + PRINT "</tr>"; + PRINT "<tr bgcolor=\"$g_white_color\" height=\"2\">"; + PRINT "<td>"; + PRINT "</td>"; + PRINT "</tr>"; + print_notes( $p_file ); + PRINT "<tr bgcolor=\"$g_primary_dark_color\">"; + PRINT "<td align=\"right\">"; + PRINT "<a href=\"$g_note_add_page?f_page_id=$t_page_id&f_url=$c_url\">$s_add_note_link</a>"; + if ( is_moderator() ) { + PRINT " | <a href=\"$g_admin_manage_notes?f_page_id=$t_page_id&f_url=$c_url\">$s_manage</a>"; + PRINT " | <a href=\"$g_admin_page\">$s_admin</a>"; + } + PRINT "</td>"; + PRINT "</tr>"; + PRINT "</table>"; + } PRINT "</div>"; } ### -------------------- Index: config_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/config_inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- config_inc.php 3 Sep 2002 22:30:07 -0000 1.3 +++ config_inc.php 4 Sep 2002 13:36:58 -0000 1.4 @@ -37,7 +37,7 @@ ### default ordering of the notes. ### ASC = newest on bottom - $p_note_order = 'ASC'; + $g_note_order = 'ASC'; ### Time to wait between redirects (except index.html) $g_time_wait = 2; Index: html_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/html_api.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- html_api.php 3 Sep 2002 22:30:07 -0000 1.1 +++ html_api.php 4 Sep 2002 13:36:58 -0000 1.2 @@ -62,7 +62,7 @@ echo '<hr size=1 />'; print_phpWebNotes_version(); echo '<address>Copyright (c) 2000-2002</address>'; - echo '<address><a href=\"mailto:$g_webmaster_email\">$g_webmaster_email</a></address>'; + echo "<address><a href=\"mailto:$g_webmaster_email\">$g_webmaster_email</a></address>"; } ### -------------------- function print_body_bottom() { Index: note_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/note_api.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- note_api.php 3 Sep 2002 22:30:07 -0000 1.1 +++ note_api.php 4 Sep 2002 13:36:58 -0000 1.2 @@ -23,15 +23,16 @@ function note_add( $p_page_id, $p_email, $p_REMOTE_ADDR, $p_note ) { global $g_phpWN_note_table; - $p_email = addslashes( htmlspecialchars( $p_email ) ); - $p_note = addslashes( nl2br( htmlspecialchars( $p_note ) ) ); + $c_page_id = (integer)$p_page_id; + $c_email = string_safe ( $p_email ); # addslashes( htmlspecialchars( $p_email ) ); + $c_note = string_safe ( $p_note ); # addslashes( nl2br( htmlspecialchars( $p_note ) ) ); + $c_remote_address = string_safe( $p_REMOTE_ADDR ); $query = "INSERT INTO $g_phpWN_note_table ( id, page_id, email, ip, date_submitted, note ) VALUES - ( null, '$p_page_id', '$p_email', '$p_REMOTE_ADDR', NOW(), '$p_note' )"; + ( null, '$c_page_id', '$c_email', '$c_remote_address', NOW(), '$c_note' )"; return db_query( $query ); - } ### -------------------- function delete_note( $p_id ) { @@ -45,28 +46,32 @@ function update_note( $p_id, $p_email, $p_note ) { global $g_phpWN_note_table; - $p_email = addslashes( htmlspecialchars( $p_email ) ); - $p_note = addslashes( nl2br( htmlspecialchars( $p_note ) ) ); + $c_id = (integer)$p_id; + $c_email = string_safe ( $p_email ); + $c_note = string_safe ( $p_note ); + $query = "UPDATE $g_phpWN_note_table - SET email='$p_email', note='$p_note' - WHERE id='$p_id'"; + SET email='$c_email', note='$c_note' + WHERE id='$c_id'"; $result = db_query( $query ); } ### -------------------- function accept_note( $p_id ) { global $g_phpWN_note_table; + $c_id = (integer) $p_id; $query = "UPDATE $g_phpWN_note_table SET visible='1' - WHERE id='$p_id'"; + WHERE id='$c_id'"; $result = db_query( $query ); } ### -------------------- function decline_note( $p_id ) { global $g_phpWN_note_table; + $c_id = (integer) $p_id; $query = "DELETE FROM $g_phpWN_note_table - WHERE id='$p_id'"; + WHERE id='$c_id'"; $result = db_query( $query ); } ### -------------------- @@ -75,13 +80,15 @@ $g_table_border_color, $g_primary_dark_color, $g_primary_light_color, $g_white_color, $g_phpWN_note_table, $g_phpWN_page_table, - $p_note_order; + $g_note_order; + + $c_page_name = string_safe ( $p_page_name ); $query = "SELECT * FROM $g_phpWN_page_table p, $g_phpWN_note_table n - WHERE p.page='$p_page_name' AND n.page_id=p.id AND n.visible='1' - ORDER BY n.date_submitted $p_note_order"; + WHERE p.page='$c_page_name' AND n.page_id=p.id AND n.visible='1' + ORDER BY n.date_submitted $g_note_order"; $result = db_query( $query ); $entry_count = db_num_rows( $result ); @@ -90,7 +97,7 @@ $row = db_fetch_array( $result ); extract( $row, EXTR_PREFIX_ALL, "v" ); $v_email = stripslashes( $v_email ); - $v_note = string_preserve_spaces( stripslashes( $v_note ) ); + $v_note = nl2br( string_preserve_spaces ( string_unsafe( $v_note ) ) ); $date = date( "M, d Y H:i", sql_to_unix_time( $v_date_submitted ) ); PRINT "<tr bgcolor=\"$g_primary_dark_color\">"; @@ -99,9 +106,9 @@ PRINT "</td>"; PRINT "</tr>"; PRINT "<tr bgcolor=$g_primary_light_color>"; - PRINT "<td>"; + PRINT "<td><pre>"; echo $v_note; - PRINT "</td>"; + PRINT "</pre></td>"; PRINT "</tr>"; PRINT "<tr bgcolor=\"$g_white_color\" height=\"2\">"; PRINT "<td>"; Index: page_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/page_api.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- page_api.php 3 Sep 2002 22:30:07 -0000 1.1 +++ page_api.php 4 Sep 2002 13:36:58 -0000 1.2 @@ -14,15 +14,17 @@ global $g_hostname, $g_db_username, $g_db_password, $g_database_name, $g_phpWN_page_table; + $c_file = string_safe ( $p_file ); + $query = "SELECT id FROM $g_phpWN_page_table - WHERE page='$p_file'"; + WHERE page='$c_file'"; $result = db_query( $query ); if ( db_num_rows( $result) > 0 ) { return db_result( $result, 0, 0 ); } else { - return ""; + return ''; } } ### -------------------- @@ -30,15 +32,17 @@ global $g_hostname, $g_db_username, $g_db_password, $g_database_name, $g_phpWN_page_table; + $c_id = (integer)$p_id; + $query = "SELECT page FROM $g_phpWN_page_table - WHERE id='$p_id'"; + WHERE id='$c_id'"; $result = db_query( $query ); if ( db_num_rows( $result) > 0 ) { return db_result( $result, 0, 0 ); } else { - return ""; + return ''; } } ### -------------------- @@ -48,23 +52,27 @@ $handle = opendir( $p_path ); while ( $file = readdir( $handle ) ) { - if ( is_dir( $p_path."/".$file )&&( $file!="." ) ) { - if ($file=="..") { - $t_path = dirname( $p_path ); - PRINT "<a href=\"$g_admin_index_files?f_dir=$t_path\">$file</a><br />"; + if ( is_dir( $p_path . $file ) && ( $file != '.' ) ) { + if ( $file == '..' ) { + $t_dir = dirname( $p_path ); } else { - PRINT "<a href=\"$g_admin_index_files?f_dir=$p_path/$file\">$file</a><br />"; + $t_dir = $p_path . $file; } + $t_dir = urlencode( $t_dir ); + echo "<a href=\"$g_admin_index_files?f_dir=$t_dir\">$file</a><br />"; } } + closedir( $handle ); } ### -------------------- function add_file( $p_page_name ) { global $g_phpWN_page_table; + $c_page_name = string_safe( $p_page_name ); + $query = "SELECT COUNT(*) FROM $g_phpWN_page_table - WHERE page='$p_page_name'"; + WHERE page='$c_page_name'"; $result = db_query( $query ); $count = db_result( $result, 0, 0 ); if ( $count == 1 ) { @@ -75,50 +83,40 @@ $g_phpWN_page_table ( id, date_indexed, page ) VALUES - (null, NOW(), '$p_page_name' )"; + (null, NOW(), '$c_page_name' )"; $result = db_query( $query ); return $result; } ### -------------------- - function index_files( $path="" ) { - $dir_count = 0; - $file_count = 0; - - $dir = array(); - $xfile = array(); + function index_files( $path='' ) { + $dirs = array(); + $files = array(); $handle = opendir( $path ); while ( $file = readdir( $handle ) ) { - if ($file==".") {continue;} - if ($file=="..") {continue;} - if ( is_dir( $path.$file ) ) { - $dir[$dir_count] = $file; - $dir_count++; - } else { - $xfile[$file_count] = $file; - $file_count++; + if ( ( $file == '.' ) || ( $file == '..' ) ) { + continue; + } + if ( is_dir( $path . $file ) ) { + $dirs[] = $file; + } else { + $files[] = $file; } } closedir( $handle ); - sort( $dir ); - sort( $xfile ); + sort( $dirs ); + sort( $files ); - for ($i=0;$i<$file_count;$i++) { - if ( !is_dir( $path.$xfile[$i] ) ) { - if ( add_file( $path.$xfile[$i] ) ) { - PRINT "$path$xfile[$i]<br>"; - } + foreach ( $files as $file ) { + if ( add_file( $path . $file ) ) { + echo "$path$file<br />"; } } - for ($i=0;$i<$dir_count;$i++) { - if ( $dir[$i]=="." ) continue; - if ( $dir[$i]==".." ) continue; - index_files( $path.$dir[$i]."/" ); + foreach ( $dirs as $dir ) { + index_files( $path . $dir . DIRECTORY_SEPARATOR ); } } ### -------------------- - - ?> Index: string_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/string_api.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- string_api.php 3 Sep 2002 22:30:07 -0000 1.1 +++ string_api.php 4 Sep 2002 13:36:58 -0000 1.2 @@ -11,7 +11,7 @@ ### -------------------- function string_safe( $p_string ) { - return addslashes( nl2br( $p_string ) ); + return addslashes( $p_string ); } ### -------------------- function string_unsafe( $p_string ) { |
From: <vb...@us...> - 2002-09-04 13:37:00
|
Update of /cvsroot/webnotes/webnotes/doc In directory usw-pr-cvs1:/tmp/cvs-serv6169/doc Modified Files: ROADMAP Log Message: - Fixed a typo in a variable name in all localisation files. - Clean up of variables before saving to the database. - The directory separators were not handled correctly when passed on the url. - Changed some "&" to "& a m p ;" - Renamed a configuration variable ($p_notes_order) to ($g_notes_order). - Changed the contents of the note to be preformatted when displayed. - Added a directory with two sample files, to be used for demonstration / testing. Index: ROADMAP =================================================================== RCS file: /cvsroot/webnotes/webnotes/doc/ROADMAP,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ROADMAP 3 Sep 2002 22:30:08 -0000 1.2 +++ ROADMAP 4 Sep 2002 13:36:58 -0000 1.3 @@ -18,6 +18,10 @@ * Database schema modifications * Revise the directory structure * Language Localisation + * Indexing + * Support indexing of one file + * Support indexing of a directory without recursing into sub-directories. + * Explorer look'n'feel. * Infrastructure: * A new website with demo for all available themes + admin demo * Install Mantis Bugtracker (http://mantisbt.sf.net) |
From: <vb...@us...> - 2002-09-04 13:37:00
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv6169 Modified Files: admin_index_files.php Log Message: - Fixed a typo in a variable name in all localisation files. - Clean up of variables before saving to the database. - The directory separators were not handled correctly when passed on the url. - Changed some "&" to "& a m p ;" - Renamed a configuration variable ($p_notes_order) to ($g_notes_order). - Changed the contents of the note to be preformatted when displayed. - Added a directory with two sample files, to be used for demonstration / testing. Index: admin_index_files.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_index_files.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- admin_index_files.php 3 Sep 2002 06:59:08 -0000 1.11 +++ admin_index_files.php 4 Sep 2002 13:36:57 -0000 1.12 @@ -12,8 +12,14 @@ <? include ( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> <? login_cookie_check() ?> <? - if (!isset($f_dir)) { + if ( !isset( $f_dir ) ) { $f_dir = dirname( __FILE__ ); + } else { + $f_dir = stripslashes( urldecode( $f_dir ) ); + } + + if ( ( substr( $f_dir, -1 ) != '\\' ) && ( substr ( $f_dir, -1 ) != '/' ) ) { + $f_dir = $f_dir . DIRECTORY_SEPARATOR; } ?> <? print_html_top() ?> @@ -36,17 +42,17 @@ <tr bgcolor="<? echo $g_white_color ?>"> <td> <? echo $s_current_directory ?>: - <? echo $f_dir."/"; ?> + <? echo $f_dir; ?> </td> </tr> <? - if (isset( $f_action ) && ( $f_action=="index" )) { + if ( isset( $f_action ) && ( $f_action == "index" ) ) { ?> <tr bgcolor="<? echo $g_white_color ?>"> <td> <? echo $s_indexed_following_files ?>: <br /> - <? index_files( $f_dir."/" ) ?> + <? index_files( $f_dir ) ?> </td> </tr> <? } ?> |
From: <vb...@us...> - 2002-09-04 13:28:48
|
Update of /cvsroot/webnotes/webnotes/sample In directory usw-pr-cvs1:/tmp/cvs-serv3486/sample Log Message: Directory /cvsroot/webnotes/webnotes/sample added to the repository |
From: <vb...@us...> - 2002-09-04 07:11:28
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv26505/core Modified Files: api.php Log Message: Used heredoc format rather than a lot of PRINT commands Index: api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/api.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- api.php 3 Sep 2002 22:30:06 -0000 1.9 +++ api.php 4 Sep 2002 07:11:24 -0000 1.10 @@ -21,8 +21,8 @@ } } - $t_path_main = dirname( dirname( __FILE__ ) ) . '/'; # DIRECTORY_SEPARATOR; - $t_path_core = $t_path_main . 'core' . '/'; # DIRECTORY_SEPARATOR; + $t_path_main = dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR; + $t_path_core = $t_path_main . 'core' . DIRECTORY_SEPARATOR; # The $g_ext can not be used before the custom config is included. require_once( $t_path_core . 'php_api.php' ); @@ -138,70 +138,62 @@ $result = db_query( $query ); $num_notes = db_num_rows( $result ); - for ($i=0;$i<$num_notes;$i++) { + for ( $i = 0; $i < $num_notes; $i++ ) { $row = db_fetch_array( $result ); extract( $row, EXTR_PREFIX_ALL, "v" ); $v_note = string_edit( $v_note ); - PRINT "<form method=\"post\" action=\"$g_admin_manage_notes\">"; - PRINT "<input type=\"hidden\" name=\"f_action\" value=\"update\" />"; - PRINT "<input type=\"hidden\" name=\"f_id\" value=\"$v_id\" />"; - PRINT "<input type=\"hidden\" name=\"f_page_id\" value=\"$p_page_id\" />"; - PRINT "<input type=\"hidden\" name=\"f_url\" value=\"$p_url\" />"; - PRINT "<tr bgcolor=\"$g_white_color\" height=\"4\">"; - PRINT "<td colspan=\"2\">"; - PRINT "</td>"; - PRINT "</tr>"; - PRINT "<tr bgcolor=\"$g_primary_light_color\">"; - PRINT "<td>"; - PRINT "$s_date"; - PRINT "</td>"; - PRINT "<td>"; - PRINT "$v_date_submitted"; - PRINT "</td>"; - PRINT "</tr>"; - PRINT "<tr bgcolor=\"$g_primary_dark_color\">"; - PRINT "<td>"; - PRINT "$s_email"; - PRINT "</td>"; - PRINT "<td>"; - PRINT "<input type=text name=f_email size=64 maxlength=64 value=\"$v_email\" />"; - PRINT "</td>"; - PRINT "</tr>"; - PRINT "<tr bgcolor=\"$g_primary_light_color\">"; - PRINT "<td>"; - PRINT "$s_ip"; - PRINT "</td>"; - PRINT "<td>"; - PRINT "$v_ip"; - PRINT "</td>"; - PRINT "</tr>"; - PRINT "<tr bgcolor=\"$g_primary_dark_color\">"; - PRINT "<td>"; - PRINT "$s_note"; - PRINT "</td>"; - PRINT "<td>"; - PRINT "<textarea name=\"f_note\" cols=\"72\" rows=\"16\">$v_note</textarea>"; - PRINT "</td>"; - PRINT "</tr>"; - PRINT "<tr bgcolor=\"$g_white_color\">"; - PRINT "<td colspan=\"2\">"; - PRINT "<table width=\"100%\"><tr><td>"; - PRINT "<td width=\"50%\" align=\"center\">"; - PRINT "<input type=\"submit\" value=\"$s_update_button\" />"; - PRINT "</td>"; - PRINT "</form>"; - PRINT "<form method=\"post\" action=\"$g_admin_manage_notes\">"; - PRINT "<input type=\"hidden\" name=\"f_action\" value=\"delete\" />"; - PRINT "<input type=\"hidden\" name=\"f_id\" value=\"$v_id\" />"; - PRINT "<input type=\"hidden\" name=\"f_page_id\" value=\"$p_page_id\" />"; - PRINT "<input type=\"hidden\" name=\"f_url\" value=\"$p_url\" />"; - PRINT "<td width=\"50%\" align=\"center\">"; - PRINT "<input type=\"submit\" value=\"$s_delete_button\" />"; - PRINT "</td></tr></table>"; - PRINT "</td>"; - PRINT "</tr>"; - PRINT "</form>"; + # @@@@ 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> + <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" /> + <td width="50%" align="center" + <input type="submit" value="$s_delete_button" /> + </form> + </td> + </tr> + </table> + </td> + </tr> + + +EOT; } } ### -------------------- |
From: <vb...@us...> - 2002-09-03 22:30:12
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv21009/core Modified Files: api.php config_inc.php php_api.php Added Files: access_api.php config_api.php constants_inc.php database_api.php html_api.php lang_api.php note_api.php page_api.php string_api.php Log Message: - Split api.php into multiple APIs. - Merged lang_api.php over from Mantis. - Merged config_api.php over from Mantis. - Minor changes with the docs. --- NEW FILE: access_api.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 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: access_api.php,v 1.1 2002/09/03 22:30:06 vboctor Exp $ # -------------------------------------------------------- ### -------------------- function password_match( $p_test_password, $p_password ) { $salt = substr( $p_password, 0, 2 ); if ( crypt( $p_test_password, $salt ) == $p_password ) { return true; } else { return false; } } ### -------------------- function create_random_password( $p_email ) { mt_srand( time() ); $t_val = mt_rand( 0, mt_getrandmax() ) + mt_rand( 0, mt_getrandmax() ); return substr( crypt( md5( $p_email.$t_val ) ), 0, 12 ); } ### -------------------- function is_moderator() { global $g_string_cookie_val, $g_phpWN_user_table, $g_hostname, $g_db_username, $g_db_password, $g_database_name; $query = "SELECT COUNT(*) FROM $g_phpWN_user_table WHERE cookie_string='$g_string_cookie_val'"; $result = db_query( $query ); $count = db_result( $result, 0, 0 ); return $count; } ### -------------------- ### 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 function login_cookie_check( $p_redirect_url="" ) { global $g_string_cookie_val, $g_login_page, $g_logout, $g_hostname, $g_db_username, $g_db_password, $g_database_name, $g_phpWN_user_table; ### @@@@@ DISABLE FOR NOW return; ### if logged in if ( isset( $g_string_cookie_val ) ) { if ( empty( $g_string_cookie_val ) ) { header( "Location: $g_login_page" ); exit; } ### go to redirect if ( !empty( $p_redirect_url ) ) { header( "Location: $p_redirect_url" ); exit; } ### continue with current page else { return; } } ### not logged in else { header( "Location: $g_login_page" ); exit; } } ### -------------------- ?> --- NEW FILE: config_api.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 2002 Mantis Team - man...@so... # 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: config_api.php,v 1.1 2002/09/03 22:30:06 vboctor Exp $ # -------------------------------------------------------- ########################################################################### # Configuration API ########################################################################### # ------------------ # Retrieves the value of a config option # This function will return one of (in order of preference): # 1. The user-defined value (if set) # 2. The default value (if known) # 3. The value passed as the second parameter of the function function config_get( $p_option, $p_default=null ) { # ------ global variable implementation ------ # this function implements getting configuration # from our current global variable scheme. This # interface should remain constant but we could # call out to other functions or replace this code # to use a DB or some other method if ( isset( $GLOBALS['g_'.$p_option] ) ) { return $GLOBALS['g_'.$p_option]; } else { # unless we were allowing for the option not to exist by passing # a default, trigger a NOTICE if ( null == $p_default ) { error_parameters($p_option); trigger_error( ERROR_CONFIG_OPT_NOT_FOUND, NOTICE ); } return $p_default; } } # ------------------ # Returns true if the specified config option exists (ie. a # value or default can be found), false otherwise function config_is_set( $p_option ) { if ( isset( $GLOBALS['g_'.$p_option] ) ) { return true; } else { return false; } } # ------------------ # Sets the value of the given config option to the given value # If the config option does not exist, an ERROR is triggered function config_set( $p_option, $p_value ) { if ( ! isset( $GLOBALS['g_'.$p_option] ) ) { trigger_error( ERROR_CONFIG_OPT_NOT_FOUND, ERROR ); } $GLOBALS['g_'.$p_option] = $p_value; return true; } # ------------------ # Checks if an obsolete configuration variable is still in use. If so, an error # will be generated and the script will exit. This is called from login_page.php and # admin_check.php. function config_obsolete($var, $replace) { if ( config_is_set( $var ) ) { echo '$g_' . $var . ' is now obsolete'; if ($replace != '') { echo ', please use $g_' . $replace; } exit; } } ?> --- NEW FILE: constants_inc.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 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: constants_inc.php,v 1.1 2002/09/03 22:30:07 vboctor Exp $ # -------------------------------------------------------- ########################################################################### ### CONSTANTS ### ########################################################################### define( 'ON', 1 ); define( 'OFF', 0 ); ?> --- NEW FILE: database_api.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 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: database_api.php,v 1.1 2002/09/03 22:30:07 vboctor Exp $ # -------------------------------------------------------- ########################################################################### # Database : MYSQL for now ########################################################################### ### -------------------- # connect to database function db_connect($p_hostname="localhost", $p_username="root", $p_password="", $p_database="webnotes", $p_port=3306 ) { $t_result = mysql_connect( $p_hostname.":".$p_port, $p_username, $p_password ); $t_result = mysql_select_db( $p_database ); ### Temproary error handling if ( !$t_result ) { echo "ERROR: FAILED CONNECTION TO DATABASE"; exit; } } ### -------------------- # persistent connect to database function db_pconnect($p_hostname="localhost", $p_username="root", $p_password="", $p_database="webnotes", $p_port=3306 ) { $t_result = mysql_pconnect( $p_hostname.":".$p_port, $p_username, $p_password ); $t_result = mysql_select_db( $p_database ); ### Temproary error handling if ( !$t_result ) { echo "ERROR: FAILED CONNECTION TO DATABASE"; exit; } } ### -------------------- # execute query, requires connection to be opened, # goes to error page if error occurs # Use this when you don't want to handler an error yourself function db_query( $p_query ) { $t_result = mysql_query( $p_query ); if ( !$t_result ) { echo "ERROR: FAILED QUERY: ".$p_query; exit; } else { return $t_result; } } ### -------------------- function db_select_db( $p_db_name ) { return mysql_select_db( $p_db_name ); } ### -------------------- function db_num_rows( $p_result ) { return mysql_num_rows( $p_result ); } ### -------------------- function db_fetch_array( $p_result ) { return mysql_fetch_array( $p_result ); } ### -------------------- function db_result( $p_result, $p_index1=0, $p_index2=0 ) { if ( $p_result && ( db_num_rows( $p_result ) > 0 ) ) { return mysql_result( $p_result, $p_index1, $p_index2 ); } else { return false; } } ### -------------------- function db_close() { $t_result = mysql_close(); } ### -------------------- ########################################################################### ### CODE TO EXECUTE ### ########################################################################### db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); ?> --- NEW FILE: html_api.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 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: html_api.php,v 1.1 2002/09/03 22:30:07 vboctor Exp $ # -------------------------------------------------------- ### -------------------- function print_html_top() { echo '<html>'; } ### -------------------- function print_head_top() { echo '<head>'; } ### -------------------- function print_title( $p_title ) { echo "<title>$p_title</title>"; } ### -------------------- function print_css( $p_css="" ) { if ( !empty( $p_css ) && file_exists( $p_css ) ) { include( $p_css ); } } ### -------------------- function print_meta_redirect( $p_url, $p_time ) { echo "<meta http-equiv=\"Refresh\" content=\"$p_time;URL=$p_url\">"; } ### -------------------- function print_head_bottom() { echo '</head>'; } ### -------------------- function print_body_top() { echo '<body>'; } ### -------------------- function print_header( $p_title="" ) { echo "<h3>$p_title</h3>"; } ### -------------------- function print_top_page( $p_page ) { if ( !empty( $p_page ) && file_exists( $p_page ) ) { include( $p_page ); } } ### -------------------- function print_bottom_page( $p_page ) { if ( !empty( $p_page ) && file_exists( $p_page ) ) { include( $p_page ); } } ### -------------------- function print_footer( $p_file ) { global $g_string_cookie_val, $g_webmaster_email; echo '<hr size=1 />'; print_phpWebNotes_version(); echo '<address>Copyright (c) 2000-2002</address>'; echo '<address><a href=\"mailto:$g_webmaster_email\">$g_webmaster_email</a></address>'; } ### -------------------- function print_body_bottom() { echo '</body>'; } ### -------------------- function print_html_bottom() { echo '</html>'; } ### -------------------- ########################################################################### # HTML Appearance Helper API ########################################################################### ### -------------------- ### checks to see whether we need to be displaying the version number function print_phpWebNotes_version() { global $g_phpWebNotes_version, $g_show_version; if ( ON == $g_show_version ) { echo "<em>phpWebNotes - $g_phpWebNotes_version</em>"; } } ### -------------------- function print_admin_menu() { global $g_admin_page, $g_logout, $s_admin_link, $s_logout_link; echo '<div align="center">'; echo "<a href=\"$g_admin_page\">$s_admin_link</a> | "; echo "<a href=\"$g_logout\">$s_logout_link</a>"; echo '<br />'; } ?> --- NEW FILE: lang_api.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 2002 Mantis Team - man...@so... # 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: lang_api.php,v 1.1 2002/09/03 22:30:07 vboctor Exp $ # -------------------------------------------------------- ### -------------------- # Retrieves an internationalized string # This function will return one of (in order of preference): # 1. The string in the current user's preferred language (if defined) # 2. The string in English function lang_get( $p_string ) { # note in the current implementation we always return the same value # because we don't have a concept of falling back on a language. The # language files actually *contain* English strings if none has been # defined in the correct language if ( isset( $GLOBALS['s_'.$p_string] ) ) { return $GLOBALS['s_'.$p_string]; } else { trigger_error( ERROR_LANG_STRING_NOT_FOUND, WARNING ); return ''; } } ?> --- NEW FILE: note_api.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 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: note_api.php,v 1.1 2002/09/03 22:30:07 vboctor Exp $ # -------------------------------------------------------- ### -------------------- function queue_count() { global $g_phpWN_note_table; $query = "SELECT COUNT(*) FROM $g_phpWN_note_table WHERE visible='0'"; $result = db_query( $query ); return db_result( $result, 0, 0 ); } ### -------------------- function note_add( $p_page_id, $p_email, $p_REMOTE_ADDR, $p_note ) { global $g_phpWN_note_table; $p_email = addslashes( htmlspecialchars( $p_email ) ); $p_note = addslashes( nl2br( htmlspecialchars( $p_note ) ) ); $query = "INSERT INTO $g_phpWN_note_table ( id, page_id, email, ip, date_submitted, note ) VALUES ( null, '$p_page_id', '$p_email', '$p_REMOTE_ADDR', NOW(), '$p_note' )"; return db_query( $query ); } ### -------------------- function delete_note( $p_id ) { global $g_phpWN_note_table; $query = "DELETE FROM $g_phpWN_note_table WHERE id='$p_id'"; $result = db_query( $query ); } ### -------------------- function update_note( $p_id, $p_email, $p_note ) { global $g_phpWN_note_table; $p_email = addslashes( htmlspecialchars( $p_email ) ); $p_note = addslashes( nl2br( htmlspecialchars( $p_note ) ) ); $query = "UPDATE $g_phpWN_note_table SET email='$p_email', note='$p_note' WHERE id='$p_id'"; $result = db_query( $query ); } ### -------------------- function accept_note( $p_id ) { global $g_phpWN_note_table; $query = "UPDATE $g_phpWN_note_table SET visible='1' WHERE id='$p_id'"; $result = db_query( $query ); } ### -------------------- function decline_note( $p_id ) { global $g_phpWN_note_table; $query = "DELETE FROM $g_phpWN_note_table WHERE id='$p_id'"; $result = db_query( $query ); } ### -------------------- function print_notes( $p_page_name ) { global $g_hostname, $g_db_username, $g_db_password, $g_database_name, $g_table_border_color, $g_primary_dark_color, $g_primary_light_color, $g_white_color, $g_phpWN_note_table, $g_phpWN_page_table, $p_note_order; $query = "SELECT * FROM $g_phpWN_page_table p, $g_phpWN_note_table n WHERE p.page='$p_page_name' AND n.page_id=p.id AND n.visible='1' ORDER BY n.date_submitted $p_note_order"; $result = db_query( $query ); $entry_count = db_num_rows( $result ); if ( $entry_count>0 ) { for ($i=0;$i<$entry_count;$i++) { $row = db_fetch_array( $result ); extract( $row, EXTR_PREFIX_ALL, "v" ); $v_email = stripslashes( $v_email ); $v_note = string_preserve_spaces( stripslashes( $v_note ) ); $date = date( "M, d Y H:i", sql_to_unix_time( $v_date_submitted ) ); PRINT "<tr bgcolor=\"$g_primary_dark_color\">"; PRINT "<td>"; PRINT " <i><a href=\"mailto:$v_email\">$v_email</a></i> - $v_date_submitted"; PRINT "</td>"; PRINT "</tr>"; PRINT "<tr bgcolor=$g_primary_light_color>"; PRINT "<td>"; echo $v_note; PRINT "</td>"; PRINT "</tr>"; PRINT "<tr bgcolor=\"$g_white_color\" height=\"2\">"; PRINT "<td>"; PRINT "</td>"; PRINT "</tr>"; } } } ### -------------------- ?> --- NEW FILE: page_api.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 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: page_api.php,v 1.1 2002/09/03 22:30:07 vboctor Exp $ # -------------------------------------------------------- ### -------------------- function get_page_id( $p_file ) { global $g_hostname, $g_db_username, $g_db_password, $g_database_name, $g_phpWN_page_table; $query = "SELECT id FROM $g_phpWN_page_table WHERE page='$p_file'"; $result = db_query( $query ); if ( db_num_rows( $result) > 0 ) { return db_result( $result, 0, 0 ); } else { return ""; } } ### -------------------- function get_page_name( $p_id ) { global $g_hostname, $g_db_username, $g_db_password, $g_database_name, $g_phpWN_page_table; $query = "SELECT page FROM $g_phpWN_page_table WHERE id='$p_id'"; $result = db_query( $query ); if ( db_num_rows( $result) > 0 ) { return db_result( $result, 0, 0 ); } else { return ""; } } ### -------------------- ### Allows for path navigation to choose base dir function print_dirs( $p_path ) { global $g_admin_index_files; $handle = opendir( $p_path ); while ( $file = readdir( $handle ) ) { if ( is_dir( $p_path."/".$file )&&( $file!="." ) ) { if ($file=="..") { $t_path = dirname( $p_path ); PRINT "<a href=\"$g_admin_index_files?f_dir=$t_path\">$file</a><br />"; } else { PRINT "<a href=\"$g_admin_index_files?f_dir=$p_path/$file\">$file</a><br />"; } } } } ### -------------------- function add_file( $p_page_name ) { global $g_phpWN_page_table; $query = "SELECT COUNT(*) FROM $g_phpWN_page_table WHERE page='$p_page_name'"; $result = db_query( $query ); $count = db_result( $result, 0, 0 ); if ( $count == 1 ) { return 0; } $query = "INSERT INTO $g_phpWN_page_table ( id, date_indexed, page ) VALUES (null, NOW(), '$p_page_name' )"; $result = db_query( $query ); return $result; } ### -------------------- function index_files( $path="" ) { $dir_count = 0; $file_count = 0; $dir = array(); $xfile = array(); $handle = opendir( $path ); while ( $file = readdir( $handle ) ) { if ($file==".") {continue;} if ($file=="..") {continue;} if ( is_dir( $path.$file ) ) { $dir[$dir_count] = $file; $dir_count++; } else { $xfile[$file_count] = $file; $file_count++; } } closedir( $handle ); sort( $dir ); sort( $xfile ); for ($i=0;$i<$file_count;$i++) { if ( !is_dir( $path.$xfile[$i] ) ) { if ( add_file( $path.$xfile[$i] ) ) { PRINT "$path$xfile[$i]<br>"; } } } for ($i=0;$i<$dir_count;$i++) { if ( $dir[$i]=="." ) continue; if ( $dir[$i]==".." ) continue; index_files( $path.$dir[$i]."/" ); } } ### -------------------- ?> --- NEW FILE: string_api.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 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: string_api.php,v 1.1 2002/09/03 22:30:07 vboctor Exp $ # -------------------------------------------------------- ### -------------------- function string_safe( $p_string ) { return addslashes( nl2br( $p_string ) ); } ### -------------------- function string_unsafe( $p_string ) { return stripslashes( $p_string ); } ### -------------------- function string_display( $p_string ) { return htmlspecialchars(stripslashes( $p_string )); } ### -------------------- function string_display_with_br( $p_string ) { return str_replace( "<br>", "<br>", htmlspecialchars(stripslashes( $p_string ))); } ### -------------------- function string_edit( $p_string ) { return str_replace( "<br>", "", stripslashes( $p_string ) ); } ### -------------------- # return just the URL portion of the file path function string_get_url( $p_page ) { global $DOCUMENT_ROOT; return substr( $p_page, strlen($DOCUMENT_ROOT), strlen($p_page)); } ### -------------------- function string_preserve_spaces( $p_string ) { $p_string = str_replace( "\t", " ", $p_string ); return str_replace( " ", " ", $p_string ); } ### -------------------- ?> Index: api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/api.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- api.php 3 Sep 2002 06:59:08 -0000 1.8 +++ api.php 3 Sep 2002 22:30:06 -0000 1.9 @@ -8,8 +8,7 @@ # -------------------------------------------------------- # $Id$ # -------------------------------------------------------- -?> -<? + ########################################################################### ### INCLUDES ### ########################################################################### @@ -27,6 +26,7 @@ # The $g_ext can not be used before the custom config is included. require_once( $t_path_core . 'php_api.php' ); + require_once( $t_path_core . 'constants_inc.php' ); require_once( $t_path_core . 'config_inc.php' ); $t_custom_config = $t_path_core . 'custom_config_inc.php'; @@ -35,177 +35,24 @@ } $t_path_lang = $t_path_main . 'lang' . DIRECTORY_SEPARATOR; - require_once( $t_path_lang . 'strings_' . $g_language . $g_ext ); - - ########################################################################### - ### FUNCTIONS ### - ########################################################################### - - ########################################################################### - # Database : MYSQL for now - ########################################################################### - ### -------------------- - # connect to database - function db_connect($p_hostname="localhost", $p_username="root", - $p_password="", $p_database="webnotes", - $p_port=3306 ) { - - $t_result = mysql_connect( $p_hostname.":".$p_port, - $p_username, $p_password ); - $t_result = mysql_select_db( $p_database ); - - ### Temproary error handling - if ( !$t_result ) { - echo "ERROR: FAILED CONNECTION TO DATABASE"; - exit; - } - } - ### -------------------- - # persistent connect to database - function db_pconnect($p_hostname="localhost", $p_username="root", - $p_password="", $p_database="webnotes", - $p_port=3306 ) { - - $t_result = mysql_pconnect( $p_hostname.":".$p_port, - $p_username, $p_password ); - $t_result = mysql_select_db( $p_database ); - - ### Temproary error handling - if ( !$t_result ) { - echo "ERROR: FAILED CONNECTION TO DATABASE"; - exit; - } + require_once( $t_path_lang . 'strings_english' . $g_ext ); + if( $g_language != 'english') { + require_once( $t_path_lang . 'strings_' . $g_language . $g_ext ); } - ### -------------------- - # execute query, requires connection to be opened, - # goes to error page if error occurs - # Use this when you don't want to handler an error yourself - function db_query( $p_query ) { - $t_result = mysql_query( $p_query ); - if ( !$t_result ) { - echo "ERROR: FAILED QUERY: ".$p_query; - exit; - } - else { - return $t_result; - } - } - ### -------------------- - function db_select_db( $p_db_name ) { - return mysql_select_db( $p_db_name ); - } - ### -------------------- - function db_num_rows( $p_result ) { - return mysql_num_rows( $p_result ); - } - ### -------------------- - function db_fetch_array( $p_result ) { - return mysql_fetch_array( $p_result ); - } - ### -------------------- - function db_result( $p_result, $p_index1=0, $p_index2=0 ) { - if ( $p_result && ( db_num_rows( $p_result ) > 0 ) ) { - return mysql_result( $p_result, $p_index1, $p_index2 ); - } - else { - return false; - } - } - ### -------------------- - function db_close() { - $t_result = mysql_close(); - } - ### -------------------- - ########################################################################### - # Core HTML API - ########################################################################### - ### -------------------- - function print_html_top() { - PRINT "<html>"; - } - ### -------------------- - function print_head_top() { - PRINT "<head>"; - } - ### -------------------- - function print_title( $p_title ) { - PRINT "<title>$p_title</title>"; - } - ### -------------------- - function print_css( $p_css="" ) { - if ( !empty( $p_css ) && file_exists( $p_css ) ) { - include( $p_css ); - } - } - ### -------------------- - function print_meta_redirect( $p_url, $p_time ) { - PRINT "<meta http-equiv=\"Refresh\" content=\"$p_time;URL=$p_url\">"; - } - ### -------------------- - function print_head_bottom() { - PRINT "</head>"; - } - ### -------------------- - function print_body_top() { - PRINT "<body>"; - } - ### -------------------- - function print_header( $p_title="" ) { - PRINT "<h3>$p_title</h3>"; - } - ### -------------------- - function print_top_page( $p_page ) { - if ( !empty( $p_page ) && file_exists( $p_page ) ) { - include( $p_page ); - } - } - ### -------------------- - function print_bottom_page( $p_page ) { - if ( !empty( $p_page ) && file_exists( $p_page ) ) { - include( $p_page ); - } - } - ### -------------------- - function print_footer( $p_file ) { - global $g_string_cookie_val, $g_webmaster_email; + require_once( $t_path_core . 'lang_api.php' ); + require_once( $t_path_core . 'config_api.php' ); + require_once( $t_path_core . 'database_api.php' ); + require_once( $t_path_core . 'note_api.php' ); + require_once( $t_path_core . 'string_api.php' ); + require_once( $t_path_core . 'access_api.php' ); + require_once( $t_path_core . 'page_api.php' ); + require_once( $t_path_core . 'html_api.php' ); - PRINT "<hr size=1 />"; - print_phpWebNotes_version(); - PRINT "<address>Copyright (c) 2000-2002</address>"; - PRINT "<address><a href=\"mailto:$g_webmaster_email\">$g_webmaster_email</a></address>"; - } - ### -------------------- - function print_body_bottom() { - PRINT "</body>"; - } - ### -------------------- - function print_html_bottom() { - PRINT "</html>"; - } - ### -------------------- ########################################################################### - # HTML Appearance Helper API + ### FUNCTIONS ### ########################################################################### - ### -------------------- - ### checks to see whether we need to be displaying the version number - function print_phpWebNotes_version() { - global $g_phpWebNotes_version, $g_show_version; - if ( $g_show_version==1 ) { - PRINT "<em>phpWebNotes - $g_phpWebNotes_version</em>"; - } - } - ### -------------------- - function print_admin_menu() { - global $g_admin_page, $g_logout, - $s_admin_link, $s_logout_link; - - PRINT "<div align=\"center\">"; - PRINT "<a href=\"$g_admin_page\">$s_admin_link</a> | "; - PRINT "<a href=\"$g_logout\">$s_logout_link</a>"; - PRINT "<br />"; - } ########################################################################### # Print API ########################################################################### @@ -249,79 +96,6 @@ PRINT "</div>"; } ### -------------------- - function print_notes( $p_page_name ) { - global $g_hostname, $g_db_username, $g_db_password, $g_database_name, - $g_table_border_color, $g_primary_dark_color, - $g_primary_light_color, $g_white_color, - $g_phpWN_note_table, $g_phpWN_page_table, - $p_note_order; - - $query = "SELECT * - FROM $g_phpWN_page_table p, - $g_phpWN_note_table n - WHERE p.page='$p_page_name' AND n.page_id=p.id AND n.visible='1' - ORDER BY n.date_submitted $p_note_order"; - - $result = db_query( $query ); - $entry_count = db_num_rows( $result ); - if ( $entry_count>0 ) { - for ($i=0;$i<$entry_count;$i++) { - $row = db_fetch_array( $result ); - extract( $row, EXTR_PREFIX_ALL, "v" ); - $v_email = stripslashes( $v_email ); - $v_note = string_preserve_spaces( stripslashes( $v_note ) ); - $date = date( "M, d Y H:i", sql_to_unix_time( $v_date_submitted ) ); - - PRINT "<tr bgcolor=\"$g_primary_dark_color\">"; - PRINT "<td>"; - PRINT " <i><a href=\"mailto:$v_email\">$v_email</a></i> - $v_date_submitted"; - PRINT "</td>"; - PRINT "</tr>"; - PRINT "<tr bgcolor=$g_primary_light_color>"; - PRINT "<td>"; - echo $v_note; - PRINT "</td>"; - PRINT "</tr>"; - PRINT "<tr bgcolor=\"$g_white_color\" height=\"2\">"; - PRINT "<td>"; - PRINT "</td>"; - PRINT "</tr>"; - } - } - } - ### -------------------- - function get_page_id( $p_file ) { - global $g_hostname, $g_db_username, $g_db_password, $g_database_name, - $g_phpWN_page_table; - - $query = "SELECT id - FROM $g_phpWN_page_table - WHERE page='$p_file'"; - $result = db_query( $query ); - if ( db_num_rows( $result) > 0 ) { - return db_result( $result, 0, 0 ); - } - else { - return ""; - } - } - ### -------------------- - function get_page_name( $p_id ) { - global $g_hostname, $g_db_username, $g_db_password, $g_database_name, - $g_phpWN_page_table; - - $query = "SELECT page - FROM $g_phpWN_page_table - WHERE id='$p_id'"; - $result = db_query( $query ); - if ( db_num_rows( $result) > 0 ) { - return db_result( $result, 0, 0 ); - } - else { - return ""; - } - } - ### -------------------- ########################################################################### # Date API ########################################################################### @@ -336,138 +110,9 @@ } ### -------------------- ########################################################################### - # String API - ########################################################################### - ### -------------------- - function string_safe( $p_string ) { - return addslashes( nl2br( $p_string ) ); - } - ### -------------------- - function string_unsafe( $p_string ) { - return stripslashes( $p_string ); - } - ### -------------------- - function string_display( $p_string ) { - return htmlspecialchars(stripslashes( $p_string )); - } - ### -------------------- - function string_display_with_br( $p_string ) { - return str_replace( "<br>", "<br>", htmlspecialchars(stripslashes( $p_string ))); - } - ### -------------------- - function string_edit( $p_string ) { - return str_replace( "<br>", "", stripslashes( $p_string ) ); - } - ### -------------------- - # return just the URL portion of the file path - function string_get_url( $p_page ) { - global $DOCUMENT_ROOT; - - return substr( $p_page, strlen($DOCUMENT_ROOT), strlen($p_page)); - } - ### -------------------- - function string_preserve_spaces( $p_string ) { - $p_string = str_replace( "\t", " ", $p_string ); - return str_replace( " ", " ", $p_string ); - } - ### -------------------- - ########################################################################### - ### Authentication API ### - ########################################################################### - ### -------------------- - function password_match( $p_test_password, $p_password ) { - $salt = substr( $p_password, 0, 2 ); - if ( crypt( $p_test_password, $salt ) == $p_password ) { - return true; - } - else { - return false; - } - } - ### -------------------- - function create_random_password( $p_email ) { - mt_srand( time() ); - $t_val = mt_rand( 0, mt_getrandmax() ) + mt_rand( 0, mt_getrandmax() ); - return substr( crypt( md5( $p_email.$t_val ) ), 0, 12 ); - } - ### -------------------- - function is_moderator() { - global $g_string_cookie_val, $g_phpWN_user_table, - $g_hostname, $g_db_username, $g_db_password, $g_database_name; - - $query = "SELECT COUNT(*) - FROM $g_phpWN_user_table - WHERE cookie_string='$g_string_cookie_val'"; - $result = db_query( $query ); - $count = db_result( $result, 0, 0 ); - - return $count; - } - ### -------------------- - ### 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 - function login_cookie_check( $p_redirect_url="" ) { - global $g_string_cookie_val, - $g_login_page, $g_logout, - $g_hostname, $g_db_username, $g_db_password, $g_database_name, - $g_phpWN_user_table; - - ### @@@@@ DISABLE FOR NOW - return; - - ### if logged in - if ( isset( $g_string_cookie_val ) ) { - if ( empty( $g_string_cookie_val ) ) { - header( "Location: $g_login_page" ); - exit; - } - - ### go to redirect - if ( !empty( $p_redirect_url ) ) { - header( "Location: $p_redirect_url" ); - exit; - } - ### continue with current page - else { - return; - } - } - ### not logged in - else { - header( "Location: $g_login_page" ); - exit; - } - } - ### -------------------- - ########################################################################### ### Function API ### ########################################################################### ### -------------------- - function note_add( $p_page_id, $p_email, $p_REMOTE_ADDR, $p_note ) { - global $g_phpWN_note_table; - - $p_email = addslashes( htmlspecialchars( $p_email ) ); - $p_note = addslashes( nl2br( htmlspecialchars( $p_note ) ) ); - $query = "INSERT - INTO $g_phpWN_note_table - ( id, page_id, email, ip, date_submitted, note ) - VALUES - ( null, '$p_page_id', '$p_email', '$p_REMOTE_ADDR', NOW(), '$p_note' )"; - return db_query( $query ); - - } - ### -------------------- - function queue_count() { - global $g_phpWN_note_table; - - $query = "SELECT COUNT(*) - FROM $g_phpWN_note_table - WHERE visible='0'"; - $result = db_query( $query ); - return db_result( $result, 0, 0 ); - } - ### -------------------- function get_user_info_arr( $p_string_cookie_val ) { global $g_phpWN_user_table; @@ -560,42 +205,6 @@ } } ### -------------------- - function delete_note( $p_id ) { - global $g_phpWN_note_table; - - $query = "DELETE FROM $g_phpWN_note_table - WHERE id='$p_id'"; - $result = db_query( $query ); - } - ### -------------------- - function update_note( $p_id, $p_email, $p_note ) { - global $g_phpWN_note_table; - - $p_email = addslashes( htmlspecialchars( $p_email ) ); - $p_note = addslashes( nl2br( htmlspecialchars( $p_note ) ) ); - $query = "UPDATE $g_phpWN_note_table - SET email='$p_email', note='$p_note' - WHERE id='$p_id'"; - $result = db_query( $query ); - } - ### -------------------- - function accept_note( $p_id ) { - global $g_phpWN_note_table; - - $query = "UPDATE $g_phpWN_note_table - SET visible='1' - WHERE id='$p_id'"; - $result = db_query( $query ); - } - ### -------------------- - function decline_note( $p_id ) { - global $g_phpWN_note_table; - - $query = "DELETE FROM $g_phpWN_note_table - WHERE id='$p_id'"; - $result = db_query( $query ); - } - ### -------------------- function select_queued_notes_arr() { global $g_phpWN_note_table, $g_phpWN_page_table; @@ -606,90 +215,6 @@ $result = db_query( $query ); return db_fetch_array( $result ); } - ### -------------------- - ### Allows for path navigation to choose base dir - function print_dirs( $p_path ) { - global $g_admin_index_files; - - $handle = opendir( $p_path ); - while ( $file = readdir( $handle ) ) { - if ( is_dir( $p_path."/".$file )&&( $file!="." ) ) { - if ($file=="..") { - $t_path = dirname( $p_path ); - PRINT "<a href=\"$g_admin_index_files?f_dir=$t_path\">$file</a><br />"; - } else { - PRINT "<a href=\"$g_admin_index_files?f_dir=$p_path/$file\">$file</a><br />"; - } - } - } - } - ### -------------------- - function add_file( $p_page_name ) { - global $g_phpWN_page_table; - - $query = "SELECT COUNT(*) - FROM $g_phpWN_page_table - WHERE page='$p_page_name'"; - $result = db_query( $query ); - $count = db_result( $result, 0, 0 ); - if ( $count == 1 ) { - return 0; - } - - $query = "INSERT INTO - $g_phpWN_page_table - ( id, date_indexed, page ) - VALUES - (null, NOW(), '$p_page_name' )"; - $result = db_query( $query ); - return $result; - } - ### -------------------- - function index_files( $path="" ) { - $dir_count = 0; - $file_count = 0; - - $dir = array(); - $xfile = array(); - - $handle = opendir( $path ); - while ( $file = readdir( $handle ) ) { - if ($file==".") {continue;} - if ($file=="..") {continue;} - if ( is_dir( $path.$file ) ) { - $dir[$dir_count] = $file; - $dir_count++; - } else { - $xfile[$file_count] = $file; - $file_count++; - - } - } - closedir( $handle ); - sort( $dir ); - sort( $xfile ); - - for ($i=0;$i<$file_count;$i++) { - if ( !is_dir( $path.$xfile[$i] ) ) { - if ( add_file( $path.$xfile[$i] ) ) { - PRINT "$path$xfile[$i]<br>"; - } - } - } - - for ($i=0;$i<$dir_count;$i++) { - if ( $dir[$i]=="." ) continue; - if ( $dir[$i]==".." ) continue; - index_files( $path.$dir[$i]."/" ); - } - } - ### -------------------- - - ########################################################################### - ### CODE TO EXECUTE ### - ########################################################################### - - db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); ########################################################################### ### END ### Index: config_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/config_inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- config_inc.php 3 Sep 2002 00:40:50 -0000 1.2 +++ config_inc.php 3 Sep 2002 22:30:07 -0000 1.3 @@ -8,8 +8,7 @@ # -------------------------------------------------------- # $Id$ # -------------------------------------------------------- -?> -<? + ########################### # CONFIGURATION SETTINGS ########################### @@ -47,7 +46,7 @@ $g_cookie_time_length = 30000000; # 1 year ### Display phpWebNotes version on pages - $g_show_version = 1; + $g_show_version = ON; $g_window_title = 'phpWebNotes'; $g_page_title = 'phpWebNotes'; Index: php_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/php_api.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- php_api.php 3 Sep 2002 00:40:50 -0000 1.2 +++ php_api.php 3 Sep 2002 22:30:07 -0000 1.3 @@ -1,6 +1,7 @@ <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... + # 2002 Mantis Team - man...@so... # 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 |
From: <vb...@us...> - 2002-09-03 22:30:12
|
Update of /cvsroot/webnotes/webnotes/doc In directory usw-pr-cvs1:/tmp/cvs-serv21009/doc Modified Files: CREDITS ROADMAP Log Message: - Split api.php into multiple APIs. - Merged lang_api.php over from Mantis. - Merged config_api.php over from Mantis. - Minor changes with the docs. Index: CREDITS =================================================================== RCS file: /cvsroot/webnotes/webnotes/doc/CREDITS,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CREDITS 3 Sep 2002 06:59:09 -0000 1.1 +++ CREDITS 3 Sep 2002 22:30:08 -0000 1.2 @@ -18,6 +18,7 @@ ---------- Remon Metira +Mantis Team (mantisbt.sf.net - some code was re-used from Mantis Bugtracker) Translations ------------ Index: ROADMAP =================================================================== RCS file: /cvsroot/webnotes/webnotes/doc/ROADMAP,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ROADMAP 3 Sep 2002 06:59:09 -0000 1.1 +++ ROADMAP 3 Sep 2002 22:30:08 -0000 1.2 @@ -12,6 +12,7 @@ * Support compression / output buffering * Support for themes with a php.net theme * Support MD5 password encryption + * LDAP Support * Support for cross-reference from one note to the other * Support direct links to specific notes * Database schema modifications @@ -41,7 +42,7 @@ * Support for user supplied CSS. (vb: value to be confirmed) * Consider re-using some APIs like config_api.php / lang_api.php / database_api.php / php_api.php / gpc_api.php from mantisbt. - * Revisit code to match Mantis standards. For example, change all <? to <?php. + * Revisit code to match Mantis standards. For example, change all ? to ?php. * Define ON / OFF for configs * Add note_api.php and rename methods to note_add(), note_update(), note_delete(), note_accept(), note_decline(), ... * Add access_api.php - note_accept() / decline() / update() / delete() should check the access level. |
From: <vb...@us...> - 2002-09-03 06:59:12
|
Update of /cvsroot/webnotes/webnotes/lang In directory usw-pr-cvs1:/tmp/cvs-serv16194/lang Modified Files: strings_english.php Added Files: strings_french.php strings_italian.php Log Message: - Did some updates to the documents and added some extra docs. - Move the db_connect to api.php rather than doing it in all files. - Added the Italian strings from the website - Added the French strings from the website --- NEW FILE: strings_french.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 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: strings_french.php,v 1.1 2002/09/03 06:59:09 vboctor Exp $ # -------------------------------------------------------- # Ce fichier facilite la localisation ### General Strings $s_sql_error_msg = "ERREUR DETECTE: Rapporter cette requête SQL à"; $s_administrator = "Administrateur"; $s_click_to_proceed_msg = "Cliquer ici pour continuer"; $s_admin_link = "Administration"; $s_logout_link = "Sortie"; ### core_API.php $s_user_notes = "Contribution des utilisateurs"; $s_update_button = "MAJ"; ### $s_add_note_link # defined elsewhere $s_manage = "Gestion"; $s_admin = "Admin"; ### admin.php $s_admin_title = "Administration"; $s_index_files = "Index des Fichiers"; $s_view_queue = "Voir la file d'attente"; $s_change_password = "Changer le mot de passe"; ### admin_change_password.php $s_change_password_title = "Changer le mot de passe"; ### $s_username # defined elsewhere ### $s_password # defined elsewhere $s_verify_password = "Verifier le mot de passe"; $s_change_password_link = "Changer le mot de passe"; ### admin_index_files.php $s_index_files_title = "Index des Fichiers"; $s_current_directory = "Répertoire courant"; $s_indexed_following_files = "Indexation des fichiers suivants"; $s_index_msg = "Indexation récursive à partir de ce répertoire. Les doublons seront ignorés."; $s_index_files_link = "Index des Fichiers"; ### admin_manage_notes.php $s_date = "Date"; $s_email = "Email"; $s_ip = "IP"; $s_note = "Note"; $s_delete_button = "Détruire"; $s_back_link = "Retour"; $s_manage_notes_title = "Titre des Notes"; $s_page = "Page"; ### admin_view_queue.php $s_view_queue_title = "Voir la file d'attente"; $s_items_in_queue = "article(s) dans la file"; ### $s_page # defined elsewhere ### $s_date # defined elsewhere ### $s_email # defined elsewhere ### $s_ip # defined elsewhere ### $s_note # defined elsewhere $s_accept_link = "Accepter"; $s_decline_link = "Décliner"; ### login.php ### login_page.php $s_login_title = "Login"; $s_username = "Utilisateur"; $s_password = "Mot de Passe"; $s_save_login = "Sauvegarder Login"; $s_login_button = "Login"; ### logout.php $s_logged_out_msg = "Sortie..."; $s_logout_redirect_msg = "Redirigé vers..."; ### note_add.php $s_created_note_msg = "Note créee..."; $s_sql_error_msg = "ERREUR DETECTE: Rapporter cette requête SQL à"; ### note_add_page.php $s_not_indexed_part1 = "Cette page n'est pas indexée dans la base. SVP"; ### $s_administrator # defined elsewhere $s_not_indexed__part2 = "pour activer l'indexateur."; $s_back_link = "Retour"; $s_add_note = "Ajouter Note"; $s_delete = "Date"; $s_email = "Email"; $s_note = "Note"; $s_add_note_link = "Ajouter Note"; ?> --- NEW FILE: strings_italian.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 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: strings_italian.php,v 1.1 2002/09/03 06:59:09 vboctor Exp $ # -------------------------------------------------------- # This file is to aid in localization # This file is to aid in localization ### General Strings $s_sql_error_msg = "ERRORE: sql query "; $s_administrator = "Amministratore"; $s_click_to_proceed_msg = "Clicca per procedere"; $s_admin_link = "Amministrazione"; $s_logout_link = "Uscita"; ### core_API.php $s_user_notes = "Nota inserita dall'utente"; $s_update_button = "Aggiorna"; ### $s_add_note_link # defined elsewhere $s_manage = "Gestione"; $s_admin = "Amministratore"; ### admin.php $s_admin_title = "Amministratore"; $s_index_files = "Indice File"; $s_view_queue = "Visualizza la coda"; $s_change_password = "Modifica Password"; ### admin_change_password.php $s_change_password_title = "Modifica Password"; ### $s_username # defined elsewhere ### $s_password # defined elsewhere $s_verify_password = "Verifica Password"; $s_change_password_link = "Modifica Password"; ### admin_index_files.php $s_index_files_title = "Indice File"; $s_current_directory = "Directory Attuale"; $s_indexed_following_files = "File attualmente indicizzati"; $s_index_msg = "Indicizzazione ricorsiva da questa directory. I Duplicati saranno ignorati."; $s_index_files_link = "File Indicizzati"; ### admin_manage_notes.php $s_date = "Data"; $s_email = "Email"; $s_ip = "IP"; $s_note = "Nota"; $s_delete_button = "Elimina"; $s_back_link = "Indiatro"; $s_manage_notes_title = "Gestione Note"; $s_page = "Pagina"; ### admin_view_queue.php $s_view_queue_title = "Visualizza Coda"; $s_items_in_queue = "Elementi in questa coda"; ### $s_page # defined elsewhere ### $s_date # defined elsewhere ### $s_email # defined elsewhere ### $s_ip # defined elsewhere ### $s_note # defined elsewhere $s_accept_link = "Conferma"; $s_decline_link = "Annulla"; ### login.php ### login_page.php $s_login_title = "Login"; $s_username = "Nome Utente"; $s_password = "Password"; $s_save_login = "salva la Login"; $s_login_button = "Login"; ### logout.php $s_logged_out_msg = "Sei uscito..."; $s_logout_redirect_msg = "Redirezione a..."; ### note_add.php $s_created_note_msg = "Nota Creata..."; $s_sql_error_msg = "ERRORE: query sql "; ### note_add_page.php $s_not_indexed_part1 = "questa pagina non e' stata indicizzata nel database. Prendi l'"; ### $s_administrator # defined elsewhere $s_not_indexed__part2 = " per eseguire l'indicizzazione."; $s_back_link = "Indietro"; $s_add_note = "Inserisci Nota"; $s_delete = "Data"; $s_email = "Email"; $s_note = "Nota"; $s_add_note_link = "Nuova Nota"; ?> Index: strings_english.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/lang/strings_english.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- strings_english.php 2 Sep 2002 14:10:37 -0000 1.1 +++ strings_english.php 3 Sep 2002 06:59:09 -0000 1.2 @@ -1,10 +1,14 @@ -<? +<?php # phpWebNotes - a php based note addition system - # Copyright (C) 2000, 2001 Kenzaburo Ito - ke...@30... + # Copyright (C) 2000 Kenzaburo Ito - ke...@30... + # 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$ + # -------------------------------------------------------- + # This file is to aid in localization ### General Strings |
From: <vb...@us...> - 2002-09-03 06:59:12
|
Update of /cvsroot/webnotes/webnotes/doc In directory usw-pr-cvs1:/tmp/cvs-serv16194/doc Modified Files: ChangeLog INSTALL README Added Files: CREDITS ROADMAP Log Message: - Did some updates to the documents and added some extra docs. - Move the db_connect to api.php rather than doing it in all files. - Added the Italian strings from the website - Added the French strings from the website --- NEW FILE: CREDITS --- # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 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 *** Please contact Webnotes administrators if you should be on this list! CREDITS Administrators -------------- Kenzaburo Ito Victor Boctor Developers ---------- Remon Metira Translations ------------ Dat-Son Nguyen (French) Luca Pecatore (Italian) --- NEW FILE: ROADMAP --- # phpWebNotes - a php based note addition system # Copyright (C) 2000 Kenzaburo Ito - ke...@30... # 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 phpWebNotes 2.0.0 * General cleanup of the code / rewrite. * XHTML compliance * Support compression / output buffering * Support for themes with a php.net theme * Support MD5 password encryption * Support for cross-reference from one note to the other * Support direct links to specific notes * Database schema modifications * Revise the directory structure * Language Localisation * Infrastructure: * A new website with demo for all available themes + admin demo * Install Mantis Bugtracker (http://mantisbt.sf.net) * Setup webnotes-devel news group * Setup webnotes-cvs news group 2.1.0 * New Manual 3.0.0 * Database abstraction * Logo ----------------------------------------- SCRATCH PAD ----------------------------------------- To-Do list: * Be able to require user logins (vb: currently login check is disabled) * Be able to reverse the display order * Support for user supplied CSS. (vb: value to be confirmed) * Consider re-using some APIs like config_api.php / lang_api.php / database_api.php / php_api.php / gpc_api.php from mantisbt. * Revisit code to match Mantis standards. For example, change all <? to <?php. * Define ON / OFF for configs * Add note_api.php and rename methods to note_add(), note_update(), note_delete(), note_accept(), note_decline(), ... * Add access_api.php - note_accept() / decline() / update() / delete() should check the access level. Index: ChangeLog =================================================================== RCS file: /cvsroot/webnotes/webnotes/doc/ChangeLog,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ChangeLog 3 Sep 2002 00:10:05 -0000 1.4 +++ ChangeLog 3 Sep 2002 06:59:09 -0000 1.5 @@ -1,22 +1,12 @@ -phpWebNotes - -To-Do list: +# phpWebNotes - a php based note addition system +# Copyright (C) 2000 Kenzaburo Ito - ke...@30... +# 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 - * Be able to require user logins (vb: currently login check is disabled) - * Be able to reverse the display order - * Support themes and provide a php.net theme (including icons). (vb: directory created) - * Support for user supplied CSS. (vb: value to be confirmed) - * Revise the directory structure (webnotes/, webnotes/core/, - webnotes/themes/, webnotes/admin/, webnotes/sql/) (vb: done, still considering admin/ and config/) - * Setup webnotes-cvs mailing list. ( Ken ) - * Setup webnotes-dev mailing list. ( Ken ) - * Consider re-using some APIs like config_api.php / lang_api.php / - database_api.php / php_api.php / gpc_api.php from mantisbt. - * Improve website - * Database abstraction - * Language localization +phpWebNotes -??.??.2002 - ? +??.10.2002 - 2.0.0 * Added directory core/ to include source files that are not accessed directly through the web. * Added directory sql/ to include SQL files to be used to create/upgrade the database. * Added directory themes/ to include different themes to be used to view the webnotes. @@ -24,6 +14,7 @@ * Added directory doc/ to contain documentation files. * Change the extension of the language files to .php rather than .txt. * Moved to XHTML (not tested yet) + * Integrated the Italian/French strings into webnotes. 03.12.2000 - 1.0.0 Index: INSTALL =================================================================== RCS file: /cvsroot/webnotes/webnotes/doc/INSTALL,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- INSTALL 2 Sep 2002 12:42:13 -0000 1.1 +++ INSTALL 3 Sep 2002 06:59:09 -0000 1.2 @@ -1,3 +1,9 @@ +# phpWebNotes - a php based note addition system +# Copyright (C) 2000 Kenzaburo Ito - ke...@30... +# 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 + ------------------------------------------------------------------------------- ### Installation steps ### ------------------------------------------------------------------------------- @@ -10,8 +16,8 @@ 2. Next, untar/gzip it to the directory that you want. -3. After that you will need to cd into the directory and locate the -db_generate.sql file. Run the following command: +3. After that you will need to cd into the lang/ folder under the webnotes +directory and locate the db_generate.sql file. Run the following command: mysql -u<username> -p<password> <databasename> < db_generate.sql @@ -19,35 +25,28 @@ package like phpMyAdmin. You will need to have created the database ahead of time. -4. Now edit config_inc.php and set the appropriate variables. In particular you -will want to set the database variables. hostname, username, password, and +4. Create core/custom_config_inc.php which overrides the default values in +config_inc.php. You can edit directly the config_inc.php but this will make it +harder to upgrade to future releases of phpWebNotes. In particular you +will want to set the database variables: hostname, username, password, and database name must be set to match the configuration of your webserver and mysql database. Also, don't forget to input the correct directory paths. -Open up core_API.php and edit the path on the two require() lines to match your -setup. - 5. If you require .php3 extensions (instead of .php) run the convertToPHP3 script. You may need to first run "chmod +x convertToPHP3" to make the script executable. You will also have to look through the index.html file and change -admin.php to admin.php3. You will also need to rename all occurance of -core_API.php to core_API.php3 - -The script will rename all the .php3 files to .php. You also need to edit the -config_inc.php file and change $g_php = ".php3" to be ".php" +admin.php to admin.php3. You will also need to rename all occurrences of +api.php to api.php3 -NOTE: If your server sends .php3 files in plain text you're going to need to do -some heavy editing. Basically you'll need to rename all the .php files to .php3 -and then do a search and replace in every single file to rename core_API.php to -core_API.php3, and rename config_inc.php to config_inc.php3 in the core_API -file... and the same for all the other affected files. +The script will rename all the .php files to .php3. You also need to edit the +config_inc.php file and change $g_php = ".php" to be ".php3" 6. For every page that you want notes to be available you will need to convert their extension to one that is interpreted by php. Then insert these lines into the bottom of the document: <? - include("/home/www/webnotes/core_API.php"); + include("/home/www/webnotes/api.php"); # replace with actual path print_web_notes( __FILE__, $PHP_SELF ); ?> @@ -59,7 +58,7 @@ 7. You will need to index the files in your website. Open up the phpWebNotes directory in your web browser and login. The default username and password is administrator / root. You should change this later on! Open up the "File -Index" page. Select the root directory and then choose the Index button. It +Index" page. Select the root directory and then choose the Index button. It indexes all files in the directory it is located in and all subdirectories. 8. Notes will be added to a queue. They need to be approved by the @@ -92,4 +91,4 @@ http://www.mysql.com/ - good documentation. http://www.phpwizard.net/ - an excellent web front end to mysql. http://www.php.net/ - excellent documentation. -http://www.apache.org/ - you should be able to find what you need, I hope. \ No newline at end of file +http://www.apache.org/ - you should be able to find what you need, I hope. Index: README =================================================================== RCS file: /cvsroot/webnotes/webnotes/doc/README,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- README 3 Sep 2002 03:20:37 -0000 1.2 +++ README 3 Sep 2002 06:59:09 -0000 1.3 @@ -1,8 +1,8 @@ -------------------------------------------------------------------------------- -phpWebNotes -Copyright (C) 2000 Kenzaburo Ito - ke...@30... -------------------------------------------------------------------------------- - +# phpWebNotes - a php based note addition system +# Copyright (C) 2000 Kenzaburo Ito - ke...@30... +# 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 LICENSE @@ -25,37 +25,32 @@ INSTALL - installation instructions LICENSE - GPL license Changelog - List of fixes, additions, and todo items -config_inc.php3 - global configuration options -core_API.php3 - core functions -db_generate.sql - SQL tables ------------------------------------------------------------------------------- -phpWebNotes is a php based solution to letting users add their own comments to +phpWebNotes is a PHP based solution to letting users add their own comments to a document. It is heavily modelled after the example set by php.net. This project was originally conceived to help people who maintain technical -help docs and how-tos. It's more direct than searching through a forum and -less involving for the users than signing up for a mailing list. Of course, +help docs and how-tos. It's more direct than searching through a forum and +less involving for the users than signing up for a mailing list. Of course, it adapts to other uses easily. Updating documents is tedious and documents often lack the real world -examples and experience to make them truly useful. The best help sites I've +examples and experience to make them truly useful. The best help sites I've ever found had not only detailed documentation but lots and lots of examples -and problems and quirks that appear in real life. Unfortunately this rules -out many man pages (unix help docs). Allowing user comments lets the doc -maintainer do less work. Whenever the maintainer needs to update the doc they -can just roll in the user feedback instead of recreating the info. +and problems and quirks that appear in real life. Unfortunately this rules +out many man pages (unix help docs). Allowing user comments lets the doc +maintainer do less work. Whenever the maintainer needs to update the doc they +can just roll in the user feedback instead of recreating the information. This sort of automation cuts down on email and mailing list traffic as well. -You will need to have php, mysql, and a webserver. You don't need to know too -much about any of them other than how to set them up and some basic +You will need to have PHP, MySql, phpMyAdmin, and a web server. You don't need +to know too much about any of them other than how to set them up and some basic administration commands. -I'd appreciate an email letting me know if you find this program useful. -I won't publish any information without permission, I'd just like an idea -of usage and knowing I'm helping people will only motivate me more. - -Credits: - -Kenzaburo Ito - ke...@30... +The team would appreciate an email letting us know if you find this program +useful. This information will not be published without permission, it will just +provide the team with the feedback that this have proven to be useful for some +people and hence will motivate the team to put more effort into it. Also this +feedback is what we need to keep improving phpWebNotes. |
From: <vb...@us...> - 2002-09-03 06:59:12
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv16194/core Modified Files: api.php Log Message: - Did some updates to the documents and added some extra docs. - Move the db_connect to api.php rather than doing it in all files. - Added the Italian strings from the website - Added the French strings from the website Index: api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/api.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- api.php 3 Sep 2002 03:44:36 -0000 1.7 +++ api.php 3 Sep 2002 06:59:08 -0000 1.8 @@ -256,8 +256,6 @@ $g_phpWN_note_table, $g_phpWN_page_table, $p_note_order; - db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); - $query = "SELECT * FROM $g_phpWN_page_table p, $g_phpWN_note_table n @@ -686,6 +684,13 @@ } } ### -------------------- + + ########################################################################### + ### CODE TO EXECUTE ### + ########################################################################### + + db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); + ########################################################################### ### END ### ########################################################################### |
From: <vb...@us...> - 2002-09-03 06:59:12
|
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv16194 Modified Files: admin.php admin_change_password.php admin_index_files.php admin_manage_notes.php admin_view_queue.php login.php login_page.php logout.php note_add.php note_add_page.php Log Message: - Did some updates to the documents and added some extra docs. - Move the db_connect to api.php rather than doing it in all files. - Added the Italian strings from the website - Added the French strings from the website Index: admin.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- admin.php 3 Sep 2002 03:44:36 -0000 1.9 +++ admin.php 3 Sep 2002 06:59:08 -0000 1.10 @@ -12,8 +12,6 @@ <? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> <? login_cookie_check() ?> <? - db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); - $queue_count = queue_count(); ?> <? print_html_top() ?> Index: admin_change_password.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_change_password.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- admin_change_password.php 3 Sep 2002 00:40:50 -0000 1.9 +++ admin_change_password.php 3 Sep 2002 06:59:08 -0000 1.10 @@ -11,8 +11,6 @@ ?> <? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> <? - db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); - if (isset($f_action)&&($f_action=="change")) { if ($f_password==$f_password2) { $f_password = crypt($f_password); Index: admin_index_files.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_index_files.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- admin_index_files.php 3 Sep 2002 03:44:36 -0000 1.10 +++ admin_index_files.php 3 Sep 2002 06:59:08 -0000 1.11 @@ -12,8 +12,6 @@ <? include ( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> <? login_cookie_check() ?> <? - db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); - if (!isset($f_dir)) { $f_dir = dirname( __FILE__ ); } Index: admin_manage_notes.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_manage_notes.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- admin_manage_notes.php 3 Sep 2002 03:44:36 -0000 1.9 +++ admin_manage_notes.php 3 Sep 2002 06:59:08 -0000 1.10 @@ -11,8 +11,6 @@ ?> <? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> <? - db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); - if (( isset( $f_action ))&&( $f_action=="delete" )) { delete_note( $f_id ); } Index: admin_view_queue.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_view_queue.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- admin_view_queue.php 3 Sep 2002 00:40:50 -0000 1.9 +++ admin_view_queue.php 3 Sep 2002 06:59:08 -0000 1.10 @@ -12,8 +12,6 @@ <? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> <? login_cookie_check() ?> <? - db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); - if ( !isset ( $f_action ) ) { $f_action = "none"; } Index: login.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/login.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- login.php 3 Sep 2002 00:40:50 -0000 1.4 +++ login.php 3 Sep 2002 06:59:08 -0000 1.5 @@ -11,8 +11,6 @@ ?> <? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> <? - db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); - ### get user info $query = "SELECT * FROM $g_phpWN_user_table Index: login_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/login_page.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- login_page.php 3 Sep 2002 03:44:36 -0000 1.10 +++ login_page.php 3 Sep 2002 06:59:08 -0000 1.11 @@ -11,8 +11,6 @@ ?> <? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> <? - db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); - ### Check to see if already logged in if (( isset( $g_string_cookie_val ))&&( !empty( $g_string_cookie_val ) )) { login_cookie_check( $g_admin_page ); Index: logout.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/logout.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- logout.php 3 Sep 2002 00:40:50 -0000 1.8 +++ logout.php 3 Sep 2002 06:59:08 -0000 1.9 @@ -11,9 +11,6 @@ ?> <? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> <? - db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); -?> -<? ### remove cookie setcookie( $g_string_cookie ); ?> Index: note_add.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- note_add.php 3 Sep 2002 03:44:36 -0000 1.9 +++ note_add.php 3 Sep 2002 06:59:08 -0000 1.10 @@ -11,8 +11,6 @@ ?> <? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> <? - db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); - ### insert note $result = note_add( $f_page_id, $f_email, $REMOTE_ADDR, $f_note ); ?> Index: note_add_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add_page.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- note_add_page.php 3 Sep 2002 03:44:36 -0000 1.9 +++ note_add_page.php 3 Sep 2002 06:59:08 -0000 1.10 @@ -10,9 +10,6 @@ # -------------------------------------------------------- ?> <? include( "core" . DIRECTORY_SEPARATOR . "api.php" ) ?> -<? - db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); -?> <? print_html_top() ?> <? print_head_top() ?> <? print_title( $g_window_title ) ?> |
From: <vb...@us...> - 2002-09-03 03:44:39
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv3691/core Modified Files: api.php Log Message: Replace <p /> with <br /> for better rendering by most browsers. Index: api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/api.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- api.php 3 Sep 2002 03:39:18 -0000 1.6 +++ api.php 3 Sep 2002 03:44:36 -0000 1.7 @@ -204,7 +204,7 @@ PRINT "<div align=\"center\">"; PRINT "<a href=\"$g_admin_page\">$s_admin_link</a> | "; PRINT "<a href=\"$g_logout\">$s_logout_link</a>"; - PRINT "<p />"; + PRINT "<br />"; } ########################################################################### # Print API @@ -223,7 +223,7 @@ $t_page_id = get_page_id( $p_file ); - PRINT "<p />"; + PRINT "<br />"; PRINT "<div align=\"center\">"; PRINT "<table bgcolor=\"$g_table_border_color\" width=\"640\" cellspacing=\"1\" border=\"0\" cellpadding=\"3\">"; PRINT "<tr bgcolor=\"$g_header_color\">"; |
Update of /cvsroot/webnotes/webnotes In directory usw-pr-cvs1:/tmp/cvs-serv3691 Modified Files: admin.php admin_index_files.php admin_manage_notes.php login_page.php note_add.php note_add_page.php Log Message: Replace <p /> with <br /> for better rendering by most browsers. Index: admin.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- admin.php 3 Sep 2002 00:40:50 -0000 1.8 +++ admin.php 3 Sep 2002 03:44:36 -0000 1.9 @@ -27,7 +27,7 @@ <? print_admin_menu() ?> -<p /> +<br /> <!-- DIV? --> <table width="50%" bgcolor="<? echo $g_table_border_color ?>" cellspacing="1" border="0"> <tr align="center" bgcolor="<? echo $g_header_color ?>"> Index: admin_index_files.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_index_files.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- admin_index_files.php 3 Sep 2002 00:40:50 -0000 1.9 +++ admin_index_files.php 3 Sep 2002 03:44:36 -0000 1.10 @@ -47,7 +47,7 @@ <tr bgcolor="<? echo $g_white_color ?>"> <td> <? echo $s_indexed_following_files ?>: - <p /> + <br /> <? index_files( $f_dir."/" ) ?> </td> </tr> @@ -65,7 +65,7 @@ <input type="hidden" name="f_dir" value="<? echo $f_dir?>" /> <td> <? echo $s_index_msg ?> - <p /> + <br /> <input type="submit" value="<? echo $s_index_files_link ?>" /> </td> </form> Index: admin_manage_notes.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/admin_manage_notes.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- admin_manage_notes.php 3 Sep 2002 00:40:50 -0000 1.8 +++ admin_manage_notes.php 3 Sep 2002 03:44:36 -0000 1.9 @@ -30,10 +30,10 @@ <? print_header( $g_page_title ) ?> <? print_top_page( $g_top_page_inc ) ?> -<p /> +<br /> <div align="center"> <a href="<? echo $f_url?>"><? echo $s_back_link ?></a> -<p /> +<br /> <table bgcolor="<? echo $g_table_border_color ?>" width="75%" cellspacing="1" border="0"> <tr bgcolor="<? echo $g_header_color ?>"> <td colspan="2"> Index: login_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/login_page.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- login_page.php 3 Sep 2002 00:40:50 -0000 1.9 +++ login_page.php 3 Sep 2002 03:44:36 -0000 1.10 @@ -27,7 +27,7 @@ <? print_header( $g_page_title ) ?> <? print_top_page( $g_top_page_inc ) ?> -<p /> +<br /> <div align="center"> <form method="post" action="<? echo $g_login ?>"> <table width="40%" bgcolor="<? echo $g_table_border_color ?>" cellspacing="1" border="0"> Index: note_add.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- note_add.php 3 Sep 2002 00:40:50 -0000 1.8 +++ note_add.php 3 Sep 2002 03:44:36 -0000 1.9 @@ -33,10 +33,10 @@ <div align="center"> <? if ( $result ) { - PRINT "$s_created_note_msg<p />"; + PRINT "$s_created_note_msg<br />"; } else { - PRINT "$s_sql_error_msg <a href=\"<? echo $g_administrator_email ?>\">$s_administrator</a><p />"; + PRINT "$s_sql_error_msg <a href=\"<? echo $g_administrator_email ?>\">$s_administrator</a><br />"; echo $query; } ?> Index: note_add_page.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/note_add_page.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- note_add_page.php 3 Sep 2002 00:40:50 -0000 1.8 +++ note_add_page.php 3 Sep 2002 03:44:36 -0000 1.9 @@ -44,7 +44,7 @@ } ?> -<p /> +<br /> <div align="center"> <table bgcolor="<? echo $g_table_border_color ?>" width="75%" cellspacing="1" border="0"> <form method="post" action="<? echo $g_note_add ?>"> |