Changeset 394 for trunk/include


Ignore:
Timestamp:
Mar 26, 2004, 6:08:09 PM (21 years ago)
Author:
gweltas
Message:
  • Template migration
  • Admin Control Panel migration
  • Category management
Location:
trunk/include
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/common.inc.php

    r393 r394  
    121121}
    122122
    123 define( 'PREFIX_INCLUDE', '' );// en attendant la migration complète
    124123include(PHPWG_ROOT_PATH . 'include/constants.php');
    125124include(PHPWG_ROOT_PATH . 'include/config.inc.php');
     
    141140if ( getenv( 'HTTP_X_FORWARDED_FOR' ) != '' )
    142141{
    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 );
    144144
    145145  if ( preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/",
     
    159159else
    160160{
    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 );
    162163}
    163164$user_ip = encode_ip($client_ip);
    164165
    165166//
    166 // Setup forum wide options, if this fails then we output a CRITICAL_ERROR
    167 // since basic forum information is not available
     167// Setup gallery wide options, if this fails then we output a CRITICAL_ERROR
     168// since basic gallery information is not available
    168169//
    169170$query = 'SELECT param,value';
  • trunk/include/functions.inc.php

    r375 r394  
    2525// | USA.                                                                  |
    2626// +-----------------------------------------------------------------------+
    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' );
     27include_once( PHPWG_ROOT_PATH .'include/functions_user.inc.php' );
     28include_once( PHPWG_ROOT_PATH .'include/functions_session.inc.php' );
     29include_once( PHPWG_ROOT_PATH .'include/functions_category.inc.php' );
     30include_once( PHPWG_ROOT_PATH .'include/functions_xml.inc.php' );
     31include_once( PHPWG_ROOT_PATH .'include/functions_group.inc.php' );
     32include_once( PHPWG_ROOT_PATH .'include/htmlfunctions.inc.php' );
    3233
    3334//----------------------------------------------------------- generic functions
     
    397398  {
    398399    $to = $row['mail_address'];
    399     include( PREFIX_INCLUDE.'./language/'.$row['language'].'.php' );
     400    include( PHPWG_ROOT_PATH.'language/'.$row['language'].'.php' );
    400401    $content = $lang['mail_hello']."\n\n";
    401402    switch ( $type )
  • trunk/include/functions_category.inc.php

    r387 r394  
    112112    $category = array();
    113113    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                }
    118125      }
    119126      else if ( isset( $row[$info] ) ) $category[$info] = $row[$info];
     
    240247function get_cat_info( $id )
    241248{
    242   global $page;
    243 
    244249  $infos = array( 'nb_images','id_uppercat','comment','site_id','galleries_url'
    245250                  ,'dir','date_last','uploadable','status','visible'
     
    271276  $cat['name'] = array();
    272277
    273   $query = 'SELECT name FROM '.CATEGORIES_TABLE;
     278  $query = 'SELECT name,id FROM '.CATEGORIES_TABLE;
    274279  $query.= ' WHERE id IN ('.$cat['uppercats'].')';
    275280  $query.= ' ORDER BY id ASC';
     
    278283  while( $row = mysql_fetch_array( $result ) )
    279284  {
    280     array_push( $cat['name'], $row['name'] );
     285    $cat['name'][$row['id']] = $row['name'];
    281286  }
    282287 
     
    349354  $row = mysql_fetch_array( mysql_query( $query ) );
    350355  return $row['galleries_url'];
    351 }
    352 
    353 // The function get_cat_display_name returns a string containing the list
    354 // of upper categories to the root category from the lowest category shown
    355 // example : "anniversaires - fete mere 2002 - animaux - erika"
    356 // You can give two parameters :
    357 //   - $separation : the string between each category name " - " for example
    358 //   - $style : the style of the span tag for the lowest category,
    359 //     "font-style:italic;" for example
    360 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     else
    369       $output.= '<span style="'.$style.'">'.$name.'</span>';
    370   }
    371   if ( $replace_space ) return replace_space( $output );
    372   else                  return $output;
    373356}
    374357
     
    634617}
    635618?>
     619
  • trunk/include/functions_user.inc.php

    r393 r394  
    261261  $template_path = 'template/' ;
    262262  $template_name = $style ;
    263   include_once( PHPWG_ROOT_PATH . $template_path . $template_name.'/htmlfunctions.inc.php' );
    264263  $template = new Template(PHPWG_ROOT_PATH . $template_path . $template_name);
    265264  return $template;
Note: See TracChangeset for help on using the changeset viewer.