From e6722ac1b4bf45a9416f175cf2729982f42fc8f0 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Sun, 10 Nov 2013 16:18:55 +0000 Subject: delete replace_space function, modify get_cat_display_name_* functions git-svn-id: http://piwigo.org/svn/trunk@25425 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions.inc.php | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) (limited to 'include/functions.inc.php') diff --git a/include/functions.inc.php b/include/functions.inc.php index 41fbb7d44..8996df05b 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -64,53 +64,6 @@ function get_elapsed_time( $start, $end ) return number_format( $end - $start, 3, '.', ' ').' s'; } -// - The replace_space function replaces space and '-' characters -// by their HTML equivalent &nbsb; and − -// - The function does not replace characters in HTML tags -// - This function was created because IE5 does not respect the -// CSS "white-space: nowrap;" property unless space and minus -// characters are replaced like this function does. -// - Example : -//
My friend
-// ( 01234567891111111111222222222233 ) -// ( 0123456789012345678901 ) -// becomes : -//
My friend
-function replace_space( $string ) -{ - //return $string; - $return_string = ''; - // $remaining is the rest of the string where to replace spaces characters - $remaining = $string; - // $start represents the position of the next '<' character - // $end represents the position of the next '>' character - ; // -> 0 - $end = strpos ( $remaining, '>' ); // -> 16 - // as long as a '<' and his friend '>' are found, we loop - while ( ($start=strpos( $remaining, '<' )) !==false - and ($end=strpos( $remaining, '>' )) !== false ) - { - // $treatment is the part of the string to treat - // In the first loop of our example, this variable is empty, but in the - // second loop, it equals 'My friend' - $treatment = substr ( $remaining, 0, $start ); - // Replacement of ' ' by his equivalent ' ' - $treatment = str_replace( ' ', ' ', $treatment ); - $treatment = str_replace( '-', '−', $treatment ); - // composing the string to return by adding the treated string and the - // following HTML tag -> 'My friend' - $return_string.= $treatment.substr( $remaining, $start, $end-$start+1 ); - // the remaining string is deplaced to the part after the '>' of this - // loop - $remaining = substr ( $remaining, $end + 1, strlen( $remaining ) ); - } - $treatment = str_replace( ' ', ' ', $remaining ); - $treatment = str_replace( '-', '−', $treatment ); - $return_string.= $treatment; - - return $return_string; -} - // get_extension returns the part of the string after the last "." function get_extension( $filename ) { -- cgit v1.2.3