Changeset 322


Ignore:
Timestamp:
Jan 27, 2004, 12:29:52 AM (20 years ago)
Author:
z0rglub
Message:

moving the synchronization between data and calculated after the real update
of the category status (still if changed)

File:
1 edited

Legend:

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

    r319 r322  
    4141  $query.= ';';
    4242  $row = mysql_fetch_array( mysql_query( $query ) );
     43 
     44  $query = 'UPDATE '.PREFIX_TABLE.'categories';
     45
     46  $query.= ' SET name = ';
     47  if ( $_POST['name'] == '' )
     48    $query.= 'NULL';
     49  else
     50    $query.= "'".htmlentities( $_POST['name'], ENT_QUOTES)."'";
     51
     52  $query.= ', comment = ';
     53  if ( $_POST['comment'] == '' )
     54    $query.= 'NULL';
     55  else
     56    $query.= "'".htmlentities( $_POST['comment'], ENT_QUOTES )."'";
     57
     58  $query.= ", status = '".$_POST['status']."'";
     59  $query.= ", visible = '".$_POST['visible']."'";
     60
     61  if ( isset( $_POST['uploadable'] ) )
     62    $query.= ", uploadable = '".$_POST['uploadable']."'";
     63
     64  if ( isset( $_POST['associate'] ) )
     65  {
     66    $query.= ', id_uppercat = ';
     67    if ( $_POST['associate'] == -1 ) $query.= 'NULL';
     68    else                             $query.= $_POST['associate'];
     69  }
     70  $query.= ' WHERE id = '.$_GET['cat'];
     71  $query.= ';';
     72  mysql_query( $query );
    4373
    4474  if ( $_POST['status'] != $row['status'] )
     
    5787    synchronize_all_users();
    5888  }
    59  
    60   $query = 'UPDATE '.PREFIX_TABLE.'categories';
    61 
    62   $query.= ' SET name = ';
    63   if ( $_POST['name'] == '' )
    64     $query.= 'NULL';
    65   else
    66     $query.= "'".htmlentities( $_POST['name'], ENT_QUOTES)."'";
    67 
    68   $query.= ', comment = ';
    69   if ( $_POST['comment'] == '' )
    70     $query.= 'NULL';
    71   else
    72     $query.= "'".htmlentities( $_POST['comment'], ENT_QUOTES )."'";
    73 
    74   $query.= ", status = '".$_POST['status']."'";
    75   $query.= ", visible = '".$_POST['visible']."'";
    76 
    77   if ( isset( $_POST['uploadable'] ) )
    78     $query.= ", uploadable = '".$_POST['uploadable']."'";
    79 
    80   if ( isset( $_POST['associate'] ) )
    81   {
    82     $query.= ', id_uppercat = ';
    83     if ( $_POST['associate'] == -1 ) $query.= 'NULL';
    84     else                             $query.= $_POST['associate'];
    85   }
    86   $query.= ' WHERE id = '.$_GET['cat'];
    87   $query.= ';';
    88   mysql_query( $query );
    8989
    9090  // checking users favorites
Note: See TracChangeset for help on using the changeset viewer.