Ignore:
Timestamp:
Feb 2, 2009, 7:14:45 PM (16 years ago)
Author:
george
Message:
  • Opraveno: Zobrazení počtu překladů v tabulce uživatelů ve statistice.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/client_files/export_fo_file.php

    r40 r52  
    11<?php
    22
    3   session_start();
    4   include('../includes/config.php');
    5   include('../includes/databaseconection.php');
    6   include('../includes/global_function.php');
     3session_start();
     4include('../includes/config.php');
     5include('../includes/databaseconection.php');
     6include('../includes/global_function.php');
    77
    88  //připojení do databáze
    9   $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']);
    10   $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']);
    11   $Database->SelectDatabase($Config['Database']['Database']);   
     9$Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']);
     10$Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']);
     11$Database->SelectDatabase($Config['Database']['Database']);   
    1212 
    13   if (Licence(2)) {  // echo 'Přístup povolen';
    14   } else { die('Přístup zamítnut!'); }
     13if(Licence(LICENCE_ADMIN))
     14
     15} else die('Přístup zamítnut!');
    1516 
    16   //const
    17      $save_filename = '_export/LocalizationStrings.lua';
     17$save_filename = '_export/LocalizationStrings.lua';
    1818
    19   //funkce
    20     function RepairText($text)
    21     { // BEGIN function RepairText
    22          $text = mysql_escape_string($text);
    23          return $text;
    24     } // END function RepairText
     19function RepairText($text)
     20{
     21  $text = mysql_escape_string($text);
     22  return $text;
     23}
    2524
     25$Buffer = "local f=function(name, en, ru) RuWoW_interface[name]=ru; RuWoW_interface_entoname[en]=name; end; RuWoW_interface={ };RuWoW_interface_entoname={ };\n";
     26$sql = "SELECT * FROM client_text WHERE Language = '0' AND File = 0";
     27$ID = $Database->SQLCommand($sql);
     28while($Line = mysql_fetch_array($ID))
     29{
     30  $id_text = RepairText($Line['id_text']);
     31  $text = RepairText($Line['text']);           
     32 
     33  $Buffer .= 'f("'.$id_text.'", "'.$text.'", "test");'."\n";
     34}
    2635
     36$file_handle = fopen($save_filename, 'w');
     37$write_result = fwrite($file_handle, $Buffer);
     38fclose($file_handle);
    2739
    28       $Buffer = "local f=function(name, en, ru) RuWoW_interface[name]=ru; RuWoW_interface_entoname[en]=name; end; RuWoW_interface={ };RuWoW_interface_entoname={ };
    29 ";
    30       $sql = "SELECT * FROM client_text WHERE Language = '0' AND File = 0";
    31         $ID = $Database->SQLCommand($sql);
    32           while ($Line = mysql_fetch_array($ID)) {
    33            
    34             $id_text = RepairText($Line['id_text']);
    35             $text = RepairText($Line['text']);           
    36          
    37             $Buffer .= 'f("'.$id_text.'", "'.$text.'", "test");
    38 ';
    39           }
    40 
    41         $file_handle = fopen($save_filename, 'w');
    42         $write_result = fwrite($file_handle, $Buffer);
    43         fclose($file_handle);
    44 
    45       echo 'Exportování LocalizationStrings.lua: <b>hotovo</b>';
    46 
     40echo('Exportování LocalizationStrings.lua: <b>hotovo</b>');
    4741
    4842?>
Note: See TracChangeset for help on using the changeset viewer.