Changeset 563 for trunk


Ignore:
Timestamp:
Aug 14, 2013, 12:08:56 AM (11 years ago)
Author:
chronos
Message:
  • Fixed: On user profile show last translated texts and exports for displayed user instead of logged user.
  • Modified: Show time of last user appearence on profile page.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/User/Profile.php

    r560 r563  
    3030        {
    3131                $Output = '';
    32                 $Filter = ' WHERE `Export`.`User` = '.$this->System->User->Id;
     32                $Filter = ' WHERE `Export`.`User` = '.($_GET['user'] * 1);
    3333                $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` '.$Filter);
    3434                $DbRow = $DbResult->fetch_row();
     
    8686                                'WHERE (`T`.`Complete` = 1) AND '.
    8787                                '(`T`.`Language` != '.$this->System->Config['OriginalLanguage'].') AND '.
    88                                 '(`T`.`User` = '.$this->System->User->Id.') ORDER BY `T`.`ModifyTime` DESC LIMIT '.
     88                                '(`T`.`User` = '.($_GET['user'] * 1).') ORDER BY `T`.`ModifyTime` DESC LIMIT '.
    8989                                $Count.') AS `T`';
    9090                }
     
    130130                'Výchozí jazyk: <strong>'.$UserLine['LanguageName'].'</strong><br />'.
    131131                'Výchozí verze klienta: <strong>'.$UserLine['Version'].'</strong><br />'.
    132                 'Poslední připojení: <strong>'.$UserLine['LastLogin'].'</strong><br />'.
     132                'Poslední připojení: <strong>'.HumanDateTime($UserLine['LastLogin']).'</strong><br />'.
    133133                'Počet přeložených: <a href="TranslationList.php?user='.$UserLine['ID'].'&amp;state=2&group=0" title="Zobrazit Všechny jeho přeložené texty"><strong>'.$UserLine['TranslatedCount'].'</strong></a><br />';
    134134                if($UserLine['TeamName'] != '')
  • trunk/Modules/User/User.php

    r549 r563  
    3434    ), 0);
    3535        }
     36       
     37        function ShowOnlineList()
     38        {
     39                $Output = 'Online překladatelé:<br />';
     40                $DbResult = $this->System->Database->query('SELECT `Name`, `GM`, `User`.`ID` AS `ID` FROM `User` '.
     41                                'LEFT JOIN `UserTrace` ON `UserTrace`.`User` = `User`.`Id` '.
     42                                'WHERE (`LastLogin` >= NOW() - 300) AND ((`LastLogout` < `LastLogin`) OR (ISNULL(`LastLogout`)))');
     43                while($DbUser = $DbResult->fetch_assoc())
     44                {
     45                        $Name = '<a href="'.$this->System->Link('/user.php?user='.$DbUser['ID']).'">'.$DbUser['Name'].'</a>';
     46                        $Output .= '<strong>'.$Name.'</strong><br />';
     47                }
     48                return($Output);
     49        }       
    3650}
    3751
  • trunk/action.php

    r562 r563  
    184184}
    185185
    186 
    187186if(array_key_exists('group', $_GET)) $GroupId = LoadGroupIdParameter();
    188187  else $GroupId = 1;
     
    191190if(array_key_exists('action', $_GET)) $Action = $_GET['action'];
    192191
    193 else if($Action == 'search') $Output = Search();
     192if($Action == 'search') $Output = Search();
    194193else if($Action == 'dbkit') $Output = DatabaseKit();
    195194else $Output = ShowMessage('Nebyla zadána žádná akce.', MESSAGE_CRITICAL);
  • trunk/includes/Page.php

    r561 r563  
    33function ShowTopBar()
    44{
    5   global $Config, $System, $User, $System;
     5  global $Config, $System, $User;
    66 
    77  $Output = '<div class="Menu">';
     
    125125}
    126126
    127 function ShowOnlineUserList()
    128 {
    129   global $System, $Moderators, $User;
    130  
    131   $Output = 'Online překladatelé:<br />';
    132   $DbResult = $System->Database->query('SELECT `Name`, `GM`, `User`.`ID` AS `ID` FROM `User` '.
    133     'LEFT JOIN `UserTrace` ON `UserTrace`.`User` = `User`.`Id` '.
    134     'WHERE (`LastLogin` >= NOW() - 300) AND ((`LastLogout` < `LastLogin`) OR (ISNULL(`LastLogout`)))');
    135   while($DbUser = $DbResult->fetch_assoc())
    136   {
    137     $Name = '<a href="'.$System->Link('/user.php?user='.$DbUser['ID']).'">'.$DbUser['Name'].'</a>';
    138     $Output .= '<strong>'.$Name.'</strong><br />';
    139   }
    140   return($Output);
    141 }
    142 
    143127function ShowHeader()
    144128{
    145   global $User, $RSSChannels, $System; 
     129  global $User, $System; 
    146130 
    147131  $Output = '<?xml version="1.0" encoding="'.$System->Config['Web']['Charset'].'"?>
     
    168152  $Output .= '<table class="page"><tr><td class="menu">';
    169153  $Output .= ShowMainMenu();
    170   $Output .= ShowOnlineUserList();
     154  $Output .= $System->ModuleManager->Modules['User']->ShowOnlineList();
    171155  $Output .= '<br />';
    172156  $Output .= ShowSearchBox();
  • trunk/includes/Version.php

    r562 r563  
    11<?php
    22
    3 $Revision = 562; // Subversion revision
     3$Revision = 563; // Subversion revision
    44$DatabaseRevision = 543; // Database structure revision
    55$ReleaseTime = '2013-08-13';
  • trunk/includes/global.php

    r562 r563  
    356356}
    357357
     358function HumanDateTime($SQLDateTime)
     359{
     360  $DateTimeParts = explode(' ', $SQLDateTime);
     361  if($DateTimeParts[0] != '0000-00-00')
     362  {
     363    $DateParts = explode('-', $DateTimeParts[0]);
     364    $Output = ($DateParts[2] * 1).'.'.($DateParts[1] * 1).'.'.($DateParts[0] * 1);
     365  } else $Output = '&nbsp;';
     366  if(count($DateTimeParts) > 1)
     367  if($DateTimeParts[1] != '00:00:00')
     368  {
     369    $TimeParts = explode(':', $DateTimeParts[1]);
     370    $Output .= ' '.($TimeParts[0] * 1).':'.($TimeParts[1] * 1).':'.($TimeParts[2] * 1);
     371  };
     372  return($Output);
     373}
     374
    358375function FollowingTran($TextID, $Table, $GroupId, $Prev = false)
    359376{
Note: See TracChangeset for help on using the changeset viewer.