Changeset 25425
- Timestamp:
- Nov 10, 2013, 5:18:55 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/cat_list.php
r25018 r25425 204 204 $navigation.= get_cat_display_name_from_id( 205 205 $_GET['parent_id'], 206 $base_url.'&parent_id=', 207 false 206 $base_url.'&parent_id=' 208 207 ); 209 208 } -
trunk/admin/picture_modify.php
r25019 r25425 393 393 get_cat_display_name_cache( 394 394 $row['uppercats'], 395 get_root_url().'admin.php?page=album-', 396 false 395 get_root_url().'admin.php?page=album-' 397 396 ); 398 397 -
trunk/admin/user_perm.php
r25018 r25425 129 129 $template->append( 130 130 'categories_because_of_groups', 131 get_cat_display_name_cache($category['uppercats'], null , false)131 get_cat_display_name_cache($category['uppercats'], null) 132 132 ); 133 133 } -
trunk/include/category_cats.inc.php
r25018 r25425 297 297 if ($page['section']=='recent_cats') 298 298 { 299 $name = get_cat_display_name_cache($category['uppercats'], null , false);299 $name = get_cat_display_name_cache($category['uppercats'], null); 300 300 } 301 301 else -
trunk/include/functions.inc.php
r25360 r25425 63 63 { 64 64 return number_format( $end - $start, 3, '.', ' ').' s'; 65 }66 67 // - The replace_space function replaces space and '-' characters68 // by their HTML equivalent &nbsb; and −69 // - The function does not replace characters in HTML tags70 // - This function was created because IE5 does not respect the71 // CSS "white-space: nowrap;" property unless space and minus72 // characters are replaced like this function does.73 // - Example :74 // <div class="foo">My friend</div>75 // ( 01234567891111111111222222222233 )76 // ( 0123456789012345678901 )77 // becomes :78 // <div class="foo">My friend</div>79 function replace_space( $string )80 {81 //return $string;82 $return_string = '';83 // $remaining is the rest of the string where to replace spaces characters84 $remaining = $string;85 // $start represents the position of the next '<' character86 // $end represents the position of the next '>' character87 ; // -> 088 $end = strpos ( $remaining, '>' ); // -> 1689 // as long as a '<' and his friend '>' are found, we loop90 while ( ($start=strpos( $remaining, '<' )) !==false91 and ($end=strpos( $remaining, '>' )) !== false )92 {93 // $treatment is the part of the string to treat94 // In the first loop of our example, this variable is empty, but in the95 // second loop, it equals 'My friend'96 $treatment = substr ( $remaining, 0, $start );97 // Replacement of ' ' by his equivalent ' '98 $treatment = str_replace( ' ', ' ', $treatment );99 $treatment = str_replace( '-', '−', $treatment );100 // composing the string to return by adding the treated string and the101 // following HTML tag -> 'My friend</div>'102 $return_string.= $treatment.substr( $remaining, $start, $end-$start+1 );103 // the remaining string is deplaced to the part after the '>' of this104 // loop105 $remaining = substr ( $remaining, $end + 1, strlen( $remaining ) );106 }107 $treatment = str_replace( ' ', ' ', $remaining );108 $treatment = str_replace( '-', '−', $treatment );109 $return_string.= $treatment;110 111 return $return_string;112 65 } 113 66 -
trunk/include/functions_category.inc.php
r23813 r25425 251 251 get_cat_display_name_cache( 252 252 $category['uppercats'], 253 null, 254 false 253 null 255 254 ) 256 255 ); -
trunk/include/functions_html.inc.php
r25202 r25425 32 32 * @param array cat_informations 33 33 * @param string url 34 * @param boolean replace_space35 34 * @return string 36 35 */ 37 function get_cat_display_name($cat_informations, 38 $url = '', 39 $replace_space = false) 36 function get_cat_display_name($cat_informations, $url = '') 40 37 { 41 38 global $conf; … … 87 84 } 88 85 } 89 if ($replace_space) 90 { 91 return replace_space($output); 92 } 93 else 94 { 95 return $output; 96 } 86 return $output; 97 87 } 98 88 … … 107 97 * @param string uppercats 108 98 * @param string url 109 * @param boolean replace_space110 99 * @return string 111 100 */ 112 101 function get_cat_display_name_cache($uppercats, 113 102 $url = '', 114 $replace_space = false,115 103 $single_link = false, 116 104 $link_class = null) … … 185 173 } 186 174 187 if ($replace_space) 188 { 189 return replace_space($output); 190 } 191 else 192 { 193 return $output; 194 } 175 return $output; 195 176 } 196 177 … … 231 212 } 232 213 233 function get_cat_display_name_from_id($cat_id, 234 $url = '', 235 $replace_space = false) 214 function get_cat_display_name_from_id($cat_id, $url = '') 236 215 { 237 216 $cat_info = get_cat_info($cat_id); 238 return get_cat_display_name($cat_info['upper_names'], $url , $replace_space);217 return get_cat_display_name($cat_info['upper_names'], $url); 239 218 } 240 219 -
trunk/include/ws_functions/pwg.categories.php
r25281 r25425 260 260 if ($params['fullname']) 261 261 { 262 $row['name'] = strip_tags(get_cat_display_name_cache($row['uppercats'], null , false));262 $row['name'] = strip_tags(get_cat_display_name_cache($row['uppercats'], null)); 263 263 } 264 264 else -
trunk/index.php
r23533 r25425 231 231 foreach ( $cats as $cat ) 232 232 { 233 $hints[] = get_cat_display_name( array($cat), '' , false);233 $hints[] = get_cat_display_name( array($cat), '' ); 234 234 } 235 235 $template->assign( 'category_search_results', $hints); -
trunk/search_rules.php
r25018 r25425 150 150 get_cat_display_name_cache( 151 151 $category['uppercats'], 152 null, // no url on category names 153 false // no blank replacement 152 null // no url on category names 154 153 ) 155 154 );
Note: See TracChangeset
for help on using the changeset viewer.