Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv1513/core Modified Files: .cvsignore api.php config_inc.php note_api.php util_api.php Added Files: css_inc.php link_api.php Log Message: - Some items were moved from the ROADMAP to webnotes.sf.net/mantis - Added action.php page to allow executing actions through links. - Added link_api.php to easily construct the links to trigger such actions. - Implemented admin_pending.php to allow the moderator to view all notes (grouped by page), and be able to accept/reject in any order. - Change the admin.php to link to admin_pending.php, this is much better for accepting / rejecting, but this causes the loss of the edit functionality (for now). - Moved css_inc.php to core/ - Added some strings to English language - Modified .cvsignore files to ignore PHPEdit temporary files. --- NEW FILE: css_inc.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: css_inc.php,v 1.1 2002/09/06 17:03:37 vboctor Exp $ # -------------------------------------------------------- ?> <style type="text/css"> body { background-color: #ffffff; font-family:Verdana, Arial; font-size: 10pt } td { font-family:Verdana, Arial; font-size: 10pt } p { font-family:Verdana, Arial; font-size: 10pt } h3 { font-family:Verdana, Arial; font-size: 13pt; font-weight: bold; text-align: center } address { font-family:Verdana, Arial; font-size: 8pt } </style> --- NEW FILE: link_api.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2002 Victor Boctor - vb...@us... # 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: link_api.php,v 1.1 2002/09/06 17:03:37 vboctor Exp $ # -------------------------------------------------------- ########################################################################### # Link API ########################################################################### ### -------------------- function link_note_action( $p_note_id, $p_action, $p_url ) { $t_caption = lang_get( 'action_' . $p_action ); $c_note_id = db_prepare_int( $p_note_id ); $c_action = urlencode( $p_action ); $c_url = urlencode( $p_url ); $t_action = config_get( 'web_directory') . 'action.php'; return "[ <a href=\"$t_action?f_action=$c_action&f_note_id=$c_note_id&f_url=$c_url\">$t_caption</a> ]"; } ?> Index: .cvsignore =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- .cvsignore 2 Sep 2002 22:55:46 -0000 1.1 +++ .cvsignore 6 Sep 2002 17:03:36 -0000 1.2 @@ -1 +1,2 @@ -custom_config_inc.php \ No newline at end of file +custom_config_inc.php +*.PHPEdit* \ No newline at end of file Index: api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/api.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- api.php 5 Sep 2002 17:30:29 -0000 1.15 +++ api.php 6 Sep 2002 17:03:36 -0000 1.16 @@ -41,6 +41,7 @@ require_once( $t_path_core . 'page_api.php' ); require_once( $t_path_core . 'html_api.php' ); require_once( $t_path_core . 'user_api.php' ); + require_once( $t_path_core . 'link_api.php' ); require_once( $t_path_core . 'util_api.php' ); require_once( $t_path_main . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $g_theme . DIRECTORY_SEPARATOR . 'theme_api.php' ); Index: config_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/config_inc.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- config_inc.php 5 Sep 2002 17:30:29 -0000 1.7 +++ config_inc.php 6 Sep 2002 17:03:37 -0000 1.8 @@ -98,10 +98,13 @@ $g_admin_index_files = $g_web_directory . 'admin_index_files' . $g_ext; $g_admin_manage_notes = $g_web_directory . 'admin_manage_notes' . $g_ext; $g_admin_view_queue = $g_web_directory . 'admin_view_queue' . $g_ext; + $g_admin_pending = $g_web_directory . 'admin_pending' . $g_ext; $g_admin_change_password = $g_web_directory . 'admin_change_password' . $g_ext; - $g_css_inc_file = $g_absolute_directory . 'css_inc' . $g_ext; + $g_css_inc_file = $g_absolute_directory . 'core' . DIRECTORY_SEPARATOR . 'css_inc' . $g_ext; $g_note_add_page = $g_web_directory . 'note_add_page' . $g_ext; $g_note_add = $g_web_directory . 'note_add' . $g_ext; + + $g_use_iis = OFF; ?> Index: note_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/note_api.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- note_api.php 5 Sep 2002 17:30:29 -0000 1.4 +++ note_api.php 6 Sep 2002 17:03:37 -0000 1.5 @@ -77,6 +77,9 @@ $result = db_query( $query ); } ### -------------------- + function note_archive( $p_id ) { + } + ### -------------------- function note_print_all( $p_page_name ) { global $g_phpWN_note_table, $g_phpWN_page_table, $g_note_order; @@ -103,15 +106,20 @@ } } ### -------------------- - function select_queued_notes_arr() { + function note_queue( $p_only_one = true ) { global $g_phpWN_note_table, $g_phpWN_page_table; - $query = "SELECT n.*, p.page + $query = "SELECT n.id as note_id, n.*, p.page FROM $g_phpWN_note_table n, $g_phpWN_page_table p - WHERE n.visible='0' AND n.page_id=p.id - LIMIT 1"; - $result = db_query( $query ); - return db_fetch_array( $result ); + WHERE n.visible='0' AND n.page_id=p.id"; + + if ( $p_only_one ) { + $query .= ' LIMIT 1'; + } else { + $query .= ' ORDER BY p.page, n.date_submitted'; + } + + return db_query( $query ); } ### -------------------- function print_manage_notes( $p_page_id, $p_url ) { Index: util_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/util_api.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- util_api.php 5 Sep 2002 22:44:34 -0000 1.1 +++ util_api.php 6 Sep 2002 17:03:37 -0000 1.2 @@ -22,5 +22,39 @@ substr( $p_timeString, 6, 2 ), substr( $p_timeString, 0, 4 ) ); } + # -------------------- + # alternate color function + function util_alternate_colors( $p_num, $p_color1='', $p_color2='' ) { + if ( empty( $p_color1 ) ) { + $p_color1 = config_get( 'primary_dark_color' ); + } + if ( empty( $p_color2 ) ) { + $p_color2 = config_get( 'primary_light_color' ); + } + + if ( 1 == $p_num % 2 ) { + return $p_color1; + } else { + return $p_color2; + } + } + # -------------------- + function util_header_redirect( $p_url ) { + $t_use_iis = config_get( 'use_iis'); + if ( OFF == $t_use_iis ) { + header( 'Status: 302' ); + } + + header( 'Content-Type: text/html' ); + header( 'Pragma: no-cache' ); + header( 'Expires: Fri, 01 Jan 1999 00:00:00 GMT' ); + header( 'Cache-control: no-cache, no-cache="Set-Cookie", private' ); + if ( ON == $t_use_iis ) { + header( "Refresh: 0;url=$p_url" ); + } else { + header( "Location: $p_url" ); + } + die; # additional output can cause problems so let's just stop output here + } ### -------------------- ?> |