From: <vb...@us...> - 2002-09-30 01:32:17
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv26903/core Modified Files: config_defaults_inc.php string_api.php Log Message: - Changed the default theme to phpnet, since classic no longer exists. - 0000061: http://xxxx should be converted to hyperlinks - 0000070: mailto:xxxx should be hyperlinked Index: config_defaults_inc.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/config_defaults_inc.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- config_defaults_inc.php 29 Sep 2002 13:51:37 -0000 1.8 +++ config_defaults_inc.php 30 Sep 2002 01:32:14 -0000 1.9 @@ -89,7 +89,7 @@ $g_language = 'english'; ### Theme to be used - $g_theme = 'classic'; + $g_theme = 'phpnet'; ### Customize this file for the add message page $g_note_add_include = 'note_add_msg_inc.php'; Index: string_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/string_api.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- string_api.php 26 Sep 2002 13:17:37 -0000 1.10 +++ string_api.php 30 Sep 2002 01:32:14 -0000 1.11 @@ -97,12 +97,22 @@ return ( $p_note ); } ### -------------------- + function string_hyperlink( $p_note_string ) { + $p_note_string = preg_replace("/(http:\/\/[0-9a-zA-Z\-\._]+)/", "<a href=\"\\1\">\\1</a>", $p_note_string); + $p_note_string = preg_replace("/(mailto:[0-9a-zA-Z\-\._@]+)/", "<a href=\"\\1\">\\1</a>", $p_note_string); + return ($p_note_string); + } + ### -------------------- function string_prepare_note_for_viewing( $p_note_string, $p_url = null ) { + $p_note_string = htmlspecialchars( $p_note_string ); + $p_note_string = string_preserve_spaces_at_bol( $p_note_string ); + $p_note_string = string_hyperlink( $p_note_string ); if ( null !== $p_url ) { - return( string_emotions( string_add_note_links( $p_url, string_preserve_spaces_at_bol( htmlspecialchars( $p_note_string ) ) ) ) ); - } else { - return( string_emotions( string_preserve_spaces_at_bol( htmlspecialchars( $p_note_string ) ) ) ); + $p_note_string = string_add_note_links( $p_url, $p_note_string ); } + + $p_note_string = string_emotions( $p_note_string ); + return ($p_note_string); } ### -------------------- ?> |