Changeset 259 for branches/release-1_3


Ignore:
Timestamp:
Jan 3, 2004, 10:39:52 PM (21 years ago)
Author:
z0rglub
Message:

if any update has been done, synchronize_all_users

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/release-1_3/admin/update.php

    r160 r259  
    2424  global $conf, $page, $user, $lang;
    2525               
    26   $site_id = 1;
     26  $uppercats = '';
    2727               
    2828  // 0. retrieving informations on the category to display
     
    3333    $cat_directory.= '/'.get_local_dir( $cat_id );
    3434    $result = get_cat_info( $cat_id );
     35    $uppercats = $result['uppercats'];
    3536    // 1. display the category name to update
    3637    $src = '../template/'.$user['template'].'/admin/images/puce.gif';
    3738    $output = '<img src="'.$src.'" alt="&gt;" />';
    38     $output.= '<span style="font-weight:bold;">'.$result['name'][0].'</span>';
     39    $output.= '<span style="font-weight:bold;">';
     40    $output.= $result['name'][count($result['name'])-1];
     41    $output.= '</span>';
    3942    $output.= ' [ '.$result['dir'].' ]';
    4043    $output.= '<div class="retrait">';
     
    5154  $query = 'SELECT id';
    5255  $query.= ' FROM '.PREFIX_TABLE.'categories';
    53   $query.= ' WHERE site_id = '.$site_id;
    54   if ( !is_numeric( $cat_id ) )
    55   {
    56     $query.= ' AND id_uppercat IS NULL';
    57   }
    58   else
    59   {
    60     $query.= ' AND id_uppercat = '.$cat_id;
    61   }
     56  $query.= ' WHERE site_id = 1';
     57  if ( !is_numeric( $cat_id ) ) $query.= ' AND id_uppercat IS NULL';
     58  else                          $query.= ' AND id_uppercat = '.$cat_id;
    6259  $query.= ';';
    6360  $result = mysql_query( $query );
     
    7875      if ( $file != '.'
    7976           and $file != '..'
    80            and is_dir ( $cat_directory.'/'.$file )
     77           and is_dir( $cat_directory.'/'.$file )
    8178           and $file != 'thumbnail' )
    8279      {
     
    9188          $query = 'SELECT id';
    9289          $query.= ' FROM '.PREFIX_TABLE.'categories';
    93           $query.= ' WHERE site_id = '.$site_id;
     90          $query.= ' WHERE site_id = 1';
    9491          $query.= " AND dir = '".$file."'";
    9592          $query.= ' AND id_uppercat';
     
    112109    $query = 'SELECT id';
    113110    $query.= ' FROM '.PREFIX_TABLE.'categories';
    114     $query.= ' WHERE site_id = '.$site_id;
     111    $query.= ' WHERE site_id = 1';
    115112    $query.= " AND dir = '".$subdir."'";
    116113    $query.= ' AND id_uppercat';
     
    125122      $query = 'INSERT INTO '.PREFIX_TABLE.'categories';
    126123      $query.= ' (dir,name,site_id,id_uppercat) VALUES';
    127       $query.= " ('".$subdir."','".$name."','".$site_id."'";
     124      $query.= " ('".$subdir."','".$name."',1";
    128125      if ( !is_numeric( $cat_id ) ) $query.= ',NULL';
    129126      else                          $query.= ",'".$cat_id."'";
     
    131128      mysql_query( $query );
    132129      $category_id = mysql_insert_id();
    133       // regeneration of the plain_structure to integrate the new category
    134       $page['plain_structure'] = get_plain_structure();
    135130    }
    136131    else
     
    150145  return $output;
    151146}
    152        
     147
    153148function insert_local_image( $rep, $category_id )
    154149{
     
    570565templatize_array( $tpl, 'lang', $sub );
    571566$vtp->setGlobalVar( $sub, 'user_template', $user['template'] );
    572 //-------------------------------------------------------- categories structure
    573 $page['plain_structure'] = get_plain_structure();
    574567//-------------------------------------------- introduction : choices of update
    575568// Display choice if "update" var is not specified
     
    622615}
    623616//---------------------------------------- update informations about categories
    624 update_category( 'all' );
     617if ( isset( $_GET['update'] )
     618     or isset( $page['cat'] )
     619     or @is_file( './listing.xml' ) )
     620{
     621  update_category( 'all' );
     622  synchronize_all_users();
     623}
    625624//----------------------------------------------------------- sending html code
    626625$vtp->Parse( $handle , 'sub', $sub );
Note: See TracChangeset for help on using the changeset viewer.