Changeset 460


Ignore:
Timestamp:
Apr 13, 2010, 5:22:25 PM (14 years ago)
Author:
george
Message:
  • Opraveno: Na konce řádků při generování exportů se vkládaly nulové znaky.
  • Upraveno: Místo zaznamenávání odkazujících webů na bannery se budou zaznamenávat veškeré cizí přístup včetně přístup přes bannery.
Location:
trunk
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/action.php

    r457 r460  
    273273else if($Action == 'dbkit') DatabaseKit();
    274274else if($Action == 'ShoutBoxView') ShoutBoxView();
    275 else echo('Nebyla zadána žándá akce');
     275else echo('Nebyla zadána žádná akce');
    276276
    277277ShowFooter();     
  • trunk/banners.php

    r455 r460  
    55ShowPage();
    66
    7 $Banner = '<a href="'.$System->Link('/').'"><img src="'.$System->Link('/banners/baner_468_60.jpg').'" '.
    8   'alt="banner_468" title="Otevřený projekt překládání celé hry World of Warcraft" '.
     7$Banner = '<a href="'.$System->Link('/').'"><img src="'.$System->Link('/banners/wowpreklad_big.jpg').'" '.
     8  'alt="wowpreklad" title="Otevřený projekt překládání celé hry World of Warcraft" '.
    99  'class="banner" height="60" width="468" /></a>';
    1010 
    11 $BannerSmall = '<a href="'.$System->Link('/').'"><img src="'.$System->Link('/banners/baner_88_31.jpg').'" '.
    12   'alt="banner_88" title="Otevřený projekt překládání celé hry World of Warcraft" '.
     11$BannerSmall = '<a href="'.$System->Link('/').'"><img src="'.$System->Link('/banners/wowpreklad_small.jpg').'" '.
     12  'alt="wowpreklad" title="Otevřený projekt překládání celé hry World of Warcraft" '.
    1313  'class="banner" height="31" width="88" /></a>';
    1414
     
    1818echo($BannerSmall.' &nbsp;&nbsp;<textarea rows="2" cols="30">'.htmlspecialchars($BannerSmall).'</textarea><br />');
    1919 
    20 $DbResult = $System->Database->query('SELECT * FROM `Banner` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH)');
     20$DbResult = $System->Database->query('SELECT * FROM `Referal` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH)');
    2121 
    2222echo('<br/><strong>Servery odkazující na nás:</strong> <br />
    23 <div style="font-size: 10px;">Seznam je automaticky aktualizován a zobrazeny jsou servery s aktivní bannerem mladším než tři měsíce.</div><br />');
     23<div style="font-size: 10px;">Seznam je automaticky aktualizován a zobrazeny jsou servery, ze kterých přišli uživatelé během posledních třech měsíců.</div><br />');
    2424while($Line = $DbResult->fetch_assoc())
    2525{
  • trunk/export/export.php

    r456 r460  
    332332      while(!$File->EOF())
    333333      {
    334         $Line = $File->ReadString();
     334        $Line = $File->ReadLine();
    335335        if(strpos($Line, '=') !== false)
    336336        {
     
    357357          if($Value['Comment'] != '') $NewLine .= ' -- '.$Value['Comment'];
    358358          $NewLine .= "\n";
    359           $File2->WriteString($NewLine);
    360         } else $File2->WriteString($Line."");
     359          $File2->WriteLine($NewLine);
     360        } else $File2->WriteLine($Line);
    361361      }
    362362      echo('Hotovo <br/>');
  • trunk/import/import.php

    r456 r460  
    105105          while(!$File->EOF())
    106106          {
    107             $Line = $File->ReadString();
     107            $Line = $File->ReadLine();
    108108            if(strpos($Line, '=') !== false)
    109109            {
     
    269269    while((!$File->EOF()))
    270270    {
    271       $Line = $File->ReadString();
     271      $Line = $File->ReadLine();
    272272      // Struktura
    273273      if(strpos($Line, 'CREATE TABLE `'.$this->Group['MangosTable'].'`') !== false)
  • trunk/includes/FileStream.php

    r447 r460  
    7474  }
    7575
    76   public function ReadString()
     76  public function ReadLine()
     77  {
     78    return(fgets($this->Handle));
     79  }   
     80
     81  public function ReadTextLine()
    7782  {
    7883    return(fgets($this->Handle));
     
    111116  public function WriteString($Value)
    112117  {
    113     fwrite($this->Handle, $Value."\0");
     118    fwrite($this->Handle, $Value);
     119  }
     120
     121  public function WriteLine($Value)
     122  {
     123    fputs($this->Handle, $Value);
    114124  }
    115125
  • trunk/includes/MemoryStream.php

    r447 r460  
    5858  }
    5959
    60   public function ReadString()
     60  public function ReadLine($EndSymbol = "\r")
    6161  {
    6262    $Length = 0;
     
    6565    {
    6666      $Char = $this->ReadChar();
    67       if($Char == "\0") break;
     67      if($Char == $EndSymbol) break;
    6868    }
    6969    $Result = substr($this->Data, $StartPosition, $this->Position - $StartPosition);
     
    104104  }   
    105105 
    106   public function WriteString($Value)
     106  public function WriteLine($Value)
    107107  {
    108     $this->WriteBlock($Value."\0", strlen($Value) + 1);
     108    $this->WriteBlock($Value."\r\n", strlen($Value) + 2);
    109109  }
    110110
  • trunk/includes/global.php

    r455 r460  
    2929$TranslationTree = GetTranslationTree();
    3030$LanguageList = GetLanguageList();
     31
     32LogReferal();
    3133
    3234function GetMicrotime()
  • trunk/includes/global_function.php

    r455 r460  
    536536}
    537537
     538function LogReferal()
     539{
     540  global $System;
     541
     542  if(array_key_exists('HTTP_REFERER', $_SERVER)) $Referer = addslashes($_SERVER['HTTP_REFERER']);
     543    else $Referer = '';
     544  $Referer = substr($Referer, strpos($Referer, '/') + 2);
     545  $HostName = substr($Referer, 0, strpos($Referer, '/'));
     546  if(substr($HostName, -1) == '.') $HostName = substr($HostName, 0, -1);
     547  //if($HostName != gethostbyname($HostName))
     548  {
     549    $Referer = 'http://'.$HostName.'/';
     550    $System->Database->query('REPLACE INTO `Referal` (`Web`, `DateFirst`, `DateLast`, `LastURL`) VALUES ("'.$Referer.'", NOW(), NOW( ), "'.addslashes($_SERVER['HTTP_REFERER']).'")');
     551  }
     552}
     553
    538554?>
Note: See TracChangeset for help on using the changeset viewer.