Changeset 394 for trunk/include
- Timestamp:
- Mar 26, 2004, 6:08:09 PM (21 years ago)
- Location:
- trunk/include
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/common.inc.php
r393 r394 121 121 } 122 122 123 define( 'PREFIX_INCLUDE', '' );// en attendant la migration complète124 123 include(PHPWG_ROOT_PATH . 'include/constants.php'); 125 124 include(PHPWG_ROOT_PATH . 'include/config.inc.php'); … … 141 140 if ( getenv( 'HTTP_X_FORWARDED_FOR' ) != '' ) 142 141 { 143 $client_ip = ( !empty($_SERVER['REMOTE_ADDR']) ) ? $_SERVER['REMOTE_ADDR'] : ( ( !empty($_ENV['REMOTE_ADDR']) ) ? $_ENV['REMOTE_ADDR'] : $REMOTE_ADDR ); 142 $client_ip = ( !empty($_SERVER['REMOTE_ADDR']) ) ? 143 $_SERVER['REMOTE_ADDR'] : ( ( !empty($_ENV['REMOTE_ADDR']) ) ? $_ENV['REMOTE_ADDR'] : $REMOTE_ADDR ); 144 144 145 145 if ( preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", … … 159 159 else 160 160 { 161 $client_ip = ( !empty($_SERVER['REMOTE_ADDR']) ) ? $_SERVER['REMOTE_ADDR'] : ( ( !empty($_ENV['REMOTE_ADDR']) ) ? $_ENV['REMOTE_ADDR'] : $REMOTE_ADDR ); 161 $client_ip = ( !empty($_SERVER['REMOTE_ADDR']) ) ? 162 $_SERVER['REMOTE_ADDR'] : ( ( !empty($_ENV['REMOTE_ADDR']) ) ? $_ENV['REMOTE_ADDR'] : $REMOTE_ADDR ); 162 163 } 163 164 $user_ip = encode_ip($client_ip); 164 165 165 166 // 166 // Setup forumwide options, if this fails then we output a CRITICAL_ERROR167 // since basic foruminformation is not available167 // Setup gallery wide options, if this fails then we output a CRITICAL_ERROR 168 // since basic gallery information is not available 168 169 // 169 170 $query = 'SELECT param,value'; -
trunk/include/functions.inc.php
r375 r394 25 25 // | USA. | 26 26 // +-----------------------------------------------------------------------+ 27 include( PHPWG_ROOT_PATH .'include/functions_user.inc.php' ); 28 include( PHPWG_ROOT_PATH .'include/functions_session.inc.php' ); 29 include( PHPWG_ROOT_PATH .'include/functions_category.inc.php' ); 30 include( PHPWG_ROOT_PATH .'include/functions_xml.inc.php' ); 31 include( PHPWG_ROOT_PATH .'include/functions_group.inc.php' ); 27 include_once( PHPWG_ROOT_PATH .'include/functions_user.inc.php' ); 28 include_once( PHPWG_ROOT_PATH .'include/functions_session.inc.php' ); 29 include_once( PHPWG_ROOT_PATH .'include/functions_category.inc.php' ); 30 include_once( PHPWG_ROOT_PATH .'include/functions_xml.inc.php' ); 31 include_once( PHPWG_ROOT_PATH .'include/functions_group.inc.php' ); 32 include_once( PHPWG_ROOT_PATH .'include/htmlfunctions.inc.php' ); 32 33 33 34 //----------------------------------------------------------- generic functions … … 397 398 { 398 399 $to = $row['mail_address']; 399 include( P REFIX_INCLUDE.'./language/'.$row['language'].'.php' );400 include( PHPWG_ROOT_PATH.'language/'.$row['language'].'.php' ); 400 401 $content = $lang['mail_hello']."\n\n"; 401 402 switch ( $type ) -
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 -
trunk/include/functions_user.inc.php
r393 r394 261 261 $template_path = 'template/' ; 262 262 $template_name = $style ; 263 include_once( PHPWG_ROOT_PATH . $template_path . $template_name.'/htmlfunctions.inc.php' );264 263 $template = new Template(PHPWG_ROOT_PATH . $template_path . $template_name); 265 264 return $template;
Note: See TracChangeset
for help on using the changeset viewer.