diff options
author | mistic100 <mistic@piwigo.org> | 2013-11-10 16:18:55 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2013-11-10 16:18:55 +0000 |
commit | e6722ac1b4bf45a9416f175cf2729982f42fc8f0 (patch) | |
tree | 206a0d5308cc247a8235afe7a0503d4bf026117a /include/functions.inc.php | |
parent | ca80b5ade87f2cdf7ac7d7672910ff08005a3680 (diff) |
delete replace_space function, modify get_cat_display_name_* functions
git-svn-id: http://piwigo.org/svn/trunk@25425 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions.inc.php')
-rw-r--r-- | include/functions.inc.php | 47 |
1 files changed, 0 insertions, 47 deletions
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 : -// <div class="foo">My friend</div> -// ( 01234567891111111111222222222233 ) -// ( 0123456789012345678901 ) -// becomes : -// <div class="foo">My friend</div> -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</div>' - $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 ) { |