From: <vb...@us...> - 2002-09-26 12:29:32
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv14439/core Modified Files: string_api.php user_api.php Log Message: - 0000059: Added checking for the enabled flag (part 2). - 0000065: Emotion icons Index: string_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/string_api.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- string_api.php 26 Sep 2002 06:55:05 -0000 1.7 +++ string_api.php 26 Sep 2002 12:29:30 -0000 1.8 @@ -67,11 +67,27 @@ return ( preg_replace( '/#([0-9]+)/', "<a href=\"$p_page_url#\\1\">#\\1</a>", $p_note ) ); } ### -------------------- + function string_emotions( $p_note ) { + $images_dir = config_get( 'web_directory' ) . 'images/'; + + $smile = '<img src="' . $images_dir . 'smile.gif" alt=":)" />'; + $sad = '<img src="' . $images_dir . 'sad.gif" alt=":(" />'; + $wink = '<img src="' . $images_dir . 'wink.gif" alt=";)" />'; + $big_smile = '<img src="' . $images_dir . 'bigsmile.gif" alt=":D" />'; + + $p_note = str_replace( ':)', $smile, $p_note ); + $p_note = str_replace( ':(', $sad, $p_note ); + $p_note = str_replace( ';)', $wink, $p_note ); + $p_note = str_replace( ':D', $big_smile, $p_note ); + + return ( $p_note ); + } + ### -------------------- function string_prepare_note_for_viewing( $p_note_string, $p_url = null ) { if ( null !== $p_url ) { - return( string_add_note_links( $p_url, string_preserve_spaces_at_bol( htmlspecialchars( $p_note_string ) ) ) ); + return( string_emotions( string_add_note_links( $p_url, string_preserve_spaces_at_bol( htmlspecialchars( $p_note_string ) ) ) ) ); } else { - return( string_preserve_spaces_at_bol( htmlspecialchars( $p_note_string ) ) ); + return( string_emotions( string_preserve_spaces_at_bol( htmlspecialchars( $p_note_string ) ) ) ); } } ### -------------------- Index: user_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/user_api.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- user_api.php 26 Sep 2002 12:03:59 -0000 1.9 +++ user_api.php 26 Sep 2002 12:29:30 -0000 1.10 @@ -15,12 +15,12 @@ ### -------------------- function user_create( $p_username, $p_password, $p_email, $p_access_level = null, $p_enabled = true ) { if ( false !== user_get_info( user_where_username_equals( $p_username ) ) ) { - echo "Duplicate user.<br />"; + echo "<p>Duplicate user.</p>"; return false; } if ( false !== user_get_info( user_where_email_equals( $p_email ) ) ) { - echo "Duplicate email.<br />"; + echo "<p>Duplicate email.</p>"; return false; } @@ -36,8 +36,8 @@ $t_cookie_string = create_cookie_string( $t_seed ); $c_cookie_string = db_prepare_string( $t_cookie_string ); - $query = "INSERT INTO phpWN_user_table (username, password, email, cookie_string) - VALUES ('$c_username', '$c_encrypted_password', '$c_email', '$c_cookie_string')"; + $query = "INSERT INTO phpWN_user_table (username, password, email, cookie_string, enabled) + VALUES ('$c_username', '$c_encrypted_password', '$c_email', '$c_cookie_string', 1)"; $result = mysql_query($query); return( false !== $result ); |