Changeset 365 for trunk/img_level.php


Ignore:
Timestamp:
Mar 9, 2010, 11:29:05 AM (15 years ago)
Author:
george
Message:
  • Upraveno: Jména tabulek v databází upraveny na stejná s prvními velkými písmeny.
  • Upraveno: Doplněny SQL uvozovky do mnoha SQL dotazů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/img_level.php

    r357 r365  
    7272          else $groupby .= ', '.$TextItem['Column'];
    7373      }
    74       $IDtran = $Database->SQLCommand('SELECT * FROM `'.$Group['TablePrefix'].'` WHERE User = '.$user_ID.' AND Complete = 1 '.$groupby);
     74      $IDtran = $Database->SQLCommand('SELECT * FROM `'.$Group['TablePrefix'].'` WHERE `User` = '.$user_ID.' AND `Complete` = 1 '.$groupby);
    7575      while($Line = mysql_fetch_array($IDtran))
    7676      {   //jednotlivé překlady
     
    106106
    107107  // Hlavní kod pro uživatele
    108   $ID = $Database->SQLCommand('SELECT `ID`, `user` FROM `user` WHERE `NeedUpdate` = 1');
     108  $ID = $Database->SQLCommand('SELECT `ID`, `Name` FROM `User` WHERE `NeedUpdate` = 1');
    109109  while($LineUser = mysql_fetch_array($ID))
    110110  {
     
    120120   
    121121    $xp = GetXPFromTranslation($LineUser['ID']);
    122     $Database->SQLCommand('UPDATE `user` SET `XP` = '.$xp.', `TranslatedCount` = '.$TranslatedCount.' WHERE `user`.`ID` = '.$LineUser['ID']);
    123     CreateImg('user', $LineUser['user'], $xp);
     122    $Database->SQLCommand('UPDATE `User` SET `XP` = '.$xp.', `TranslatedCount` = '.$TranslatedCount.' WHERE `User`.`ID` = '.$LineUser['ID']);
     123    CreateImg('user', $LineUser['Name'], $xp);
    124124  }
    125125
    126126  // Hlavní kod pro překladatelské týmy
    127   $ID = $Database->SQLCommand('SELECT `ID`, `name`, (SELECT AVG(`XP`) FROM `user` WHERE `team` = `Team`.`Id`) AS `average` FROM `Team` WHERE `ID` IN (SELECT `Team` FROM `user` WHERE `NeedUpdate` = 1)');
     127  $ID = $Database->SQLCommand('SELECT `ID`, `Name`, (SELECT AVG(`XP`) FROM `User` WHERE `Team` = `Team`.`Id`) AS `Average` FROM `Team` WHERE `ID` IN (SELECT `Team` FROM `User` WHERE `NeedUpdate` = 1)');
    128128  while($LineTeam = mysql_fetch_array($ID))
    129129  {
    130     CreateImg('team', $LineTeam['name'], substr($LineTeam['average'], 0, strpos($LineTeam['average'],'.')));  //vytváření obrázku
     130    CreateImg('team', $LineTeam['Name'], substr($LineTeam['Average'], 0, strpos($LineTeam['Average'],'.')));  //vytváření obrázku
    131131  }
    132   $Database->SQLCommand('UPDATE `user` SET `NeedUpdate` = 0');
     132  $Database->SQLCommand('UPDATE `User` SET `NeedUpdate` = 0');
    133133}
    134134
     
    138138 
    139139  // Do update for all users
    140   $Database->SQLCommand('UPDATE `user` SET `NeedUpdate` = 1');
     140  $Database->SQLCommand('UPDATE `User` SET `NeedUpdate` = 1');
    141141  ImgLevelUpdate();
    142142 
    143143  echo('<strong>Uživatelé</strong><br/>');
    144   $ID = $Database->SQLCommand('SELECT `ID`, `user` FROM `user`');
     144  $ID = $Database->SQLCommand('SELECT `ID`, `Name` FROM `User`');
    145145  while($LineUser = mysql_fetch_array($ID))
    146146  {
    147     echo('<img src="tmp/user/'.$LineUser['user'].'/level.png" /> '.$LineUser['user'].'<br />');
     147    echo('<img src="tmp/user/'.$LineUser['Name'].'/level.png" /> '.$LineUser['Name'].'<br />');
    148148  }
    149149
    150150  echo('<br/><strong>Týmy</strong><br/>');
    151   $ID = $Database->SQLCommand('SELECT ID, Name FROM Team');
     151  $ID = $Database->SQLCommand('SELECT `ID`, `Name` FROM `Team`');
    152152  while($LineTeam = mysql_fetch_array($ID))
    153153  {
Note: See TracChangeset for help on using the changeset viewer.