Changeset 499 for trunk


Ignore:
Timestamp:
Jan 30, 2013, 10:34:18 PM (12 years ago)
Author:
chronos
Message:
  • Opraveno: Použití NULL hodnoty při práci s tabulkou Log a slovníkem.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/dictionary.php

    r466 r499  
    115115          $DbRow = $DbResult->fetch_row();
    116116          $Entry = $DbRow[0] + 1;
    117           $System->Database->query('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , `User`, `Language` ) VALUES ("'.$_POST['Original'].'", "'.$Entry.'", "", 0, 0);');
     117          $System->Database->query('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , `User`, `Language` ) VALUES ("'.$_POST['Original'].'", "'.$Entry.'", "", NULL, 0);');
    118118        }
    119119     
     
    137137      $DbResult = $System->Database->query('SELECT * FROM `Dictionary` WHERE `User`='.$User->Id.' AND `Entry`='.$_GET['entry'].' AND `Language`='.$_SESSION['language']);
    138138      $DbRow = $DbResult->fetch_assoc();
    139       $DbResult = $System->Database->query('SELECT * FROM `Dictionary` WHERE `User`=0 AND `Entry`='.$_GET['entry'].' AND `Language`=0');
     139      $DbResult = $System->Database->query('SELECT * FROM `Dictionary` WHERE (`User` IS NULL) AND (`Entry`='.$_GET['entry'].') AND (`Language`=0)');
    140140      $DbRow2 = $DbResult->fetch_assoc();
    141141      echo('<form action="dictionary.php?action=save" method="post">'.
    142142      '<fieldset><legend>Upravení slova</legend>'.
     143      '<input type="hidden" name="entry"  value="'.$_GET['entry'].'"/>'.
    143144      '<table><tr><td>'.
    144145      'Původní anglické slovo:</td><td><input type="text" name="Original" value="'.$DbRow2['Text'].'" /></td></tr>'.
  • trunk/includes/global_function.php

    r486 r499  
    255255    else $IP = addslashes($_SERVER['REMOTE_ADDR']);
    256256
    257   if(isset($User->Id)) $UserId = $User->Id;
    258     else $UserId = 0;
     257  if(!is_null($User->Id)) $UserId = $User->Id;
     258    else $UserId = 'NULL';
    259259  $Query = 'INSERT INTO `Log` ( `User` , `Type` , `Text` , `Date` , `IP` )
    260260   VALUES ('.$UserId.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.$IP.'")';
  • trunk/includes/user.php

    r495 r499  
    8484  function SetAnonymous()
    8585  {
    86     $this->Id = 0;
     86    $this->Id = NULL;
    8787    $this->Name = 'anonymous';
    8888    $this->Role = LICENCE_ANONYMOUS;
    89     $this->Language = 1;
     89    $this->Language = NULL;
    9090    $this->Redirecting = 1;
    91     $this->Team = 0;
     91    $this->Team = '';
    9292    $this->Email = '';
    9393  }
Note: See TracChangeset for help on using the changeset viewer.