Changeset 66


Ignore:
Timestamp:
Feb 5, 2009, 11:22:27 AM (16 years ago)
Author:
george
Message:
  • Upraveno: Export do SQL rozšířen i na tabulky, které nejsou importovány z databáze MaNGOSu.
Location:
trunk
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/export.php

    r61 r66  
    2424  $SelectedUsers = substr($SelectedUsers, 1);
    2525
     26  $UserNames = '';
    2627  $DbResult = $Database->SQLCommand("SELECT user FROM `user` WHERE ID IN (".$SelectedUsers.')');
    2728  while($DbRow = mysql_fetch_assoc($DbResult))
     
    5051
    5152  foreach($TranslationTree as $Group)
    52   if(($Group['TablePrefix'] != '') and (in_array($Group['Id'], $Setting['groups'])))
     53  if(in_array($Group['Id'], $Setting['groups']))
    5354  {
     55        if($Group['MangosTable'] == '')
     56        {
     57          $Group['MangosTable'] = $Group['TablePrefix'];
     58          $Group['MangosTableIndex'] = 'entry';
     59        }
    5460    $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND '.$WhereLang.' AND '.$WhereUsers.' ORDER BY FIELD(User, '.$SelectedUsers.')) AS T GROUP BY T.entry';
    5561    //echo($Query);
     
    6066          $Values = '';
    6167          foreach($Group['Items'] as $GroupItem)
    62             if($GroupItem['MangosColumn'] != '')
    63               $Values .= ', `'.$GroupItem['MangosColumn'].'`="'.addslashes($Line[$GroupItem['Column']]).'"';
     68          {
     69            if($GroupItem['MangosColumn'] == '') $GroupItem['MangosColumn'] = $GroupItem['Column'];
     70            $Values .= ', `'.$GroupItem['MangosColumn'].'`="'.addslashes($Line[$GroupItem['Column']]).'"';
     71          }
    6472      $Values = substr($Values, 2);
    6573      $Buffer .= 'UPDATE `'.$Group['MangosTable'].'` SET '.$Values.' WHERE `'.$Group['MangosTableIndex'].'` = '.$Line['entry'].';'."\n";
  • trunk/save.php

    r65 r66  
    3535        foreach($TranslationTree[$GroupId]['Items'] as $GroupItem)
    3636        {
    37           $Columns .= ', `'.$GroupItem['Column'].'`';
    38           $Values .= ', "'.@$_POST[$GroupItem['Column']].'"';
     37      if(array_key_exists($GroupItem['Column'], $_POST))
     38          {
     39                $Columns .= ', `'.$GroupItem['Column'].'`';
     40            $Values .= ', "'.@$_POST[$GroupItem['Column']].'"';
     41          }
    3942        } 
    4043        //echo('INSERT INTO `'.$Table.'` ('.$Columns.') VALUES ('.$Values.')');
Note: See TracChangeset for help on using the changeset viewer.