Ignore:
Timestamp:
Apr 12, 2009, 12:01:02 PM (16 years ago)
Author:
maron
Message:

Indexování dat při exportu podle ID, vlastní logo, anglické texty v locales místo ruských

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/export/export.php

    r178 r179  
    9898  if($Setting['language-sk']) $WhereLang .= " OR (Language = 2)";
    9999  if($Setting['language-other']) $WhereLang .= " OR (Language = 3)";
    100   if($WhereLang == '') $WhereLang = 1;
    101     else $WhereLang = '('.substr($WhereLang, 4).')';
    102 
    103   $SelectedUsers = ''; 
    104   foreach($Setting['users-selection'] as $Item)
    105     $SelectedUsers .= ','.$Item;
    106   $SelectedUsers = substr($SelectedUsers, 1);
    107 
    108   if($SelectedUsers == '') $Where = 0;
    109     else $Where = 'ID IN ('.$SelectedUsers.')';
    110  
    111   $UserNames = '';
    112   $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE '.$Where);
    113   while($DbRow = mysql_fetch_assoc($DbResult))
    114     $UserNames .= ','.$DbRow['user'];
    115   $UserNames = substr($UserNames, 1);   
    116    
    117   if($SelectedUsers == '') $WhereUsers = 1;
    118     else $WhereUsers = '(User IN ('.$SelectedUsers.'))';
    119 
     100  if($WhereLang == '') $WhereLang = 1;
     101    else $WhereLang = '('.substr($WhereLang, 4).')';
     102
     103  $SelectedUsers = ''; 
     104  foreach($Setting['users-selection'] as $Item)
     105    $SelectedUsers .= ','.$Item;
     106  $SelectedUsers = substr($SelectedUsers, 1);
     107
     108  if($SelectedUsers == '') $Where = 0;
     109    else $Where = 'ID IN ('.$SelectedUsers.')';
     110 
     111  $UserNames = '';
     112  $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE '.$Where);
     113  while($DbRow = mysql_fetch_assoc($DbResult))
     114    $UserNames .= ','.$DbRow['user'];
     115  $UserNames = substr($UserNames, 1);   
     116   
     117  if($SelectedUsers == '') $WhereUsers = 1;
     118    else $WhereUsers = '(User IN ('.$SelectedUsers.'))';
    120119
    121120        //data to aowow
     
    123122        $Database->SelectDatabase($AoWoWconf['mangos']['db']);   
    124123        $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']);
    125     $AoWoWTables = array('aowow_resistances', 'aowow_spelldispeltype', 'aowow_skill');
    126         foreach($AoWoWTables as $AoWoWTable) {
    127         $Buffer .= $AoWoWTable.', ';
     124    $AoWoWTables = array('aowow_resistances' => 'Id', 'aowow_spelldispeltype' => 'Id', 'aowow_skill' => 'skillID');
     125        foreach($AoWoWTables as $AoWoWTable => $IndexColum) {
     126        $Buffer .= '--'.$AoWoWTable.', ';
    128127                $Buffer .= "\n\n"; 
    129             $Query = 'SELECT name FROM '.$AoWoWTable;
     128            $Query = 'SELECT name,'.$IndexColum.' FROM '.$AoWoWTable;
    130129        $ID = $Database->SQLCommand($Query);
    131130                while($Line = mysql_fetch_assoc($ID)) {
     
    138137                        //echo ($Line['name'].'='.$Tran['tran']);
    139138                        if ($Tran['tran'] <> '')
    140                                 $Buffer .= 'UPDATE `'.$AoWoWTable.'` SET name = "'.addslashes($Tran['tran']).'" WHERE name = "'.addslashes($Line['name']).'";'."\n";
     139                                $Buffer .= 'UPDATE `'.$AoWoWTable.'` SET name = "'.addslashes($Tran['tran']).'" WHERE '.$IndexColum.' = '.$Line[$IndexColum].' ;'."\n";
    141140                }
    142141                $Buffer .= "\n\n"; 
    143142        }
     143        if($Setting['Diacritics'] != 1) $Buffer = utf2ascii($Buffer);
    144144        return($Buffer);
    145145
Note: See TracChangeset for help on using the changeset viewer.