Changeset 66 for trunk/export.php


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.
File:
1 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";
Note: See TracChangeset for help on using the changeset viewer.