Changeset 394 for trunk/include/functions_category.inc.php
- Timestamp:
- Mar 26, 2004, 6:08:09 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_category.inc.php
r387 r394 112 112 $category = array(); 113 113 foreach ( $infos as $info ) { 114 if ( $info == 'uc.date_last' ) 115 { 116 list($year,$month,$day) = explode( '-', $row['date_last'] ); 117 $category['date_last'] = mktime(0,0,0,$month,$day,$year); 114 if ( $info == 'uc.date_last') 115 { 116 if (empty($row['date_last'])) 117 { 118 $category['date_last']= 0; 119 } 120 else 121 { 122 list($year,$month,$day) = explode( '-', $row['date_last'] ); 123 $category['date_last'] = mktime(0,0,0,$month,$day,$year); 124 } 118 125 } 119 126 else if ( isset( $row[$info] ) ) $category[$info] = $row[$info]; … … 240 247 function get_cat_info( $id ) 241 248 { 242 global $page;243 244 249 $infos = array( 'nb_images','id_uppercat','comment','site_id','galleries_url' 245 250 ,'dir','date_last','uploadable','status','visible' … … 271 276 $cat['name'] = array(); 272 277 273 $query = 'SELECT name FROM '.CATEGORIES_TABLE;278 $query = 'SELECT name,id FROM '.CATEGORIES_TABLE; 274 279 $query.= ' WHERE id IN ('.$cat['uppercats'].')'; 275 280 $query.= ' ORDER BY id ASC'; … … 278 283 while( $row = mysql_fetch_array( $result ) ) 279 284 { 280 array_push( $cat['name'], $row['name'] );285 $cat['name'][$row['id']] = $row['name']; 281 286 } 282 287 … … 349 354 $row = mysql_fetch_array( mysql_query( $query ) ); 350 355 return $row['galleries_url']; 351 }352 353 // The function get_cat_display_name returns a string containing the list354 // of upper categories to the root category from the lowest category shown355 // example : "anniversaires - fete mere 2002 - animaux - erika"356 // You can give two parameters :357 // - $separation : the string between each category name " - " for example358 // - $style : the style of the span tag for the lowest category,359 // "font-style:italic;" for example360 function get_cat_display_name( $array_cat_names, $separation,361 $style, $replace_space = true )362 {363 $output = '';364 foreach ( $array_cat_names as $i => $name ) {365 if ( $i > 0 ) $output.= $separation;366 if ( $i < count( $array_cat_names ) - 1 or $style == '')367 $output.= $name;368 else369 $output.= '<span style="'.$style.'">'.$name.'</span>';370 }371 if ( $replace_space ) return replace_space( $output );372 else return $output;373 356 } 374 357 … … 634 617 } 635 618 ?> 619
Note: See TracChangeset
for help on using the changeset viewer.