Ignore:
Timestamp:
Feb 12, 2014, 9:11:46 PM (10 years ago)
Author:
chronos
Message:
  • Fixed: HTML syntax in user profile.
  • Fixed: Use correct HTML entity symbol "&" in query handling function.
File:
1 edited

Legend:

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

    r794 r797  
    1515                                        'Předmět: <strong>'.$Subject.'</strong><br />'.
    1616                                        'Text: <strong>'.$Text.'</strong><br />';
    17        
     17
    1818                        if(@mail($Email, $Subject, $Text, 'From: '.$this->System->Config['Web']['AdminEmail'].'\nReply-To: '.$this->System->Config['Web']['AdminEmail'].'\nX-Mailer: PHP/'))
    1919                        {
     
    2424                return($Output);
    2525        }
    26        
     26
    2727        function ExportList()
    2828        {
     
    3232                $DbRow = $DbResult->fetch_row();
    3333                $PageList = GetPageList($DbRow[0]);
    34        
     34
    3535                $Output .= '<h3>Exporty</h3>'.
    3636                                $PageList['Output'];
    37        
     37
    3838                $TableColumns = array(
    3939                                array('Name' => 'TimeCreate', 'Title' => 'Čas vytvoření'),
     
    4949                $Output .= '<table class="BaseTable">'.
    5050                                $Order['Output'];
    51        
     51
    5252                $DbResult = $this->System->Database->query('SELECT `User`.`Name` AS `UserName`, `Export`.`Id`, `Export`.`TimeCreate`, `Export`.`Title`, `Export`.`User`, `Export`.`UsedCount`, `Export`.`ClientVersion` AS `ClientVersionId`, '.
    5353      '(SELECT Version FROM `ClientVersion` WHERE `ClientVersion`.`Id`=`Export`.`ClientVersion`) AS `ClientVersion`, '.
     
    7171                $Output .= '</table>'.
    7272                                $PageList['Output'];
    73        
     73
    7474                $Output .= '<div style="text-align: center;"><a href="'.$this->System->Link('/export/').'">Stránka exportů</a></div>';
    7575                return($Output);
    7676        }
    77        
     77
    7878        function ShowLastTranslated()
    7979  {
    8080        $Count = 20;
    8181        $Output = '<strong>Poslední překlady:</strong>';
    82  
     82
    8383        $GroupListQuery = 'SELECT `Group`.* FROM `Group`';
    8484        $Query = '';
     
    107107                while($DbRow = $DbResult->fetch_assoc())
    108108                {
    109                         $Output .= '<tr><td>'.HumanDate($DbRow['ModifyTime']).'</td>'.                                         
     109                        $Output .= '<tr><td>'.HumanDate($DbRow['ModifyTime']).'</td>'.
    110110                                        '<td><a href="form.php?group='.$DbRow['Group'].'&amp;ID='.$DbRow['ID'].'">'.$DbRow['ID'].'</a></td>'.
    111111                                        '<td><a href="form.php?group='.$DbRow['Group'].'&amp;ID='.$DbRow['Take'].'">'.$DbRow['Take'].'</a></td>'.
     
    116116        return($Output);
    117117  }
    118  
     118
    119119        function ShowLastForum()
    120120  {
     
    122122        $Count = 20;
    123123        $Output = '<strong>Poslední příspěvky ve fóru:</strong>';
    124  
     124
    125125                $Output .= '<div class="shoutbox">';
    126126                $DbResult = $this->System->Database->query('SELECT `ForumText`.`Text`, `ForumText`.`Date`, `ForumText`.`UserName`,`ForumThread`.`Text` as `ThreadName`,`ForumText`.`Thread` FROM `ForumText` JOIN `ForumThread` ON `ForumThread`.`ID` = `ForumText`.`Thread` WHERE `ForumText`.`User` = '.($_GET['user'] * 1).' ORDER BY `ForumText`.`Date` DESC LIMIT '.$Count);
     
    130130                return($Output);
    131131  }
    132                
     132
    133133        function ShowProfile()
    134134        {
     
    148148                {
    149149                $UserLine = $DbResult->fetch_array();
    150                  
     150
    151151                $Output .=
    152152                '<h3>Překladatel '.$UserLine['Name'].'</h3>'.
     
    154154                'Výchozí verze klienta: <a href="'.$this->System->Link('/client-version/?action=item&amp;id='.$UserLine['PreferredVersion']).'"><strong>'.$UserLine['Version'].'</strong></a><br />'.
    155155                'Poslední připojení: <strong>'.HumanDateTime($UserLine['LastLogin']).'</strong><br />'.
    156                 '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 />';
     156                'Počet přeložených: <a href="TranslationList.php?user='.$UserLine['ID'].'&amp;state=2&amp;group=0" title="Zobrazit Všechny jeho přeložené texty"><strong>'.$UserLine['TranslatedCount'].'</strong></a><br />';
    157157                if($UserLine['TeamName'] != '')
    158158                        $Output .= 'Člen týmu: <a href="team/?action=team&amp;id='.$UserLine['Team'].'"><strong>'.$UserLine['TeamName'].'</strong></a><br />';
     
    164164    if ($DbResult->num_rows != 0) {
    165165      $Output .= 'Překladatel se řídí těmito pravidly:<br />';
     166      $Output .= '<ul>';
    166167      while ($UserTag = $DbResult->fetch_array()) {
    167168        $Output .= ' <li>'.$UserTag['Text'].'</li>';
    168169      }
     170      $Output .= '</ul>';
    169171    }
    170      
    171    
     172
     173
    172174    $Output .= '<br /><fieldset><legend>Text profilu:</legend>'.str_replace("\n", '<br/>', $UserLine['Info']).'</fieldset><br/>';
    173        
     175
    174176        $Output .= '<table class="Home"><tr>'.
    175177                        '<td>'.$this->ShowLastTranslated().'</td>'.
     
    179181                if($this->System->User->Licence(LICENCE_MODERATOR))
    180182         {
    181                         $Output .= '<fieldset><legend>Moderování</legend>';   
    182    
     183                        $Output .= '<fieldset><legend>Moderování</legend>';
     184
    183185      $Output .= '<form action="?user='.($_GET['user'] * 1).'" method="post">Přidání tagu uživateli:<br />';
    184186                  $Query = 'SELECT * FROM UserTagType';
    185187                  $DbResult = $this->Database->query($Query);
    186       while ($UserTag = $DbResult->fetch_array()) { 
     188      while ($UserTag = $DbResult->fetch_array()) {
    187189        //save:
    188190       if (array_key_exists('save', $_POST)) {
     
    202204        }
    203205       }
    204      
     206
    205207                    $Query = 'SELECT * FROM `UserTag` '.
    206208        'WHERE `UserTagType` = '.$UserTag['ID'].' AND `User` = '.($_GET['user'] * 1);
    207209                    $DbResult2 = $this->Database->query($Query);
    208210        if ($DbResult2->num_rows != 0) $checked = true;
    209         else  $checked = false; 
    210      
    211         $Output .= CheckBox('Tag'.$UserTag['ID'], $checked, 'CheckBox');   
     211        else  $checked = false;
     212
     213        $Output .= CheckBox('Tag'.$UserTag['ID'], $checked, 'CheckBox');
    212214        $Output .= ''.$UserTag['Text'].'<br />';
    213215      }
    214216      $Output .= '<input name="save" type="submit" value="Uložit" /></form>';
    215                  
     217
    216218                        $Output .= ' PosledníIP: <strong>'.$UserLine['LastIP'].'</strong><br />'.
    217219                                        'Prohlížeč: <strong>'.$UserLine['UserAgent'].'</strong><br />'.
     
    235237                return($Output);
    236238        }
    237          
     239
    238240        function Show()
    239241        {
     
    245247                } else $Output .= ShowMessage('Nevybrán uživatel', MESSAGE_CRITICAL);
    246248                return($Output);
    247         }       
     249        }
    248250}
Note: See TracChangeset for help on using the changeset viewer.