Changeset 797


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.
Location:
trunk
Files:
3 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}
  • trunk/includes/Version.php

    r796 r797  
    66// and system will need database update.
    77
    8 $Revision = 796; // Subversion revision
     8$Revision = 797; // Subversion revision
    99$DatabaseRevision = 787; // Database structure revision
    1010$ReleaseTime = '2014-02-12';
  • trunk/includes/global.php

    r787 r797  
    66include_once(dirname(__FILE__).'/Update.php');
    77include_once(dirname(__FILE__).'/Page.php');
    8 if(file_exists(dirname(__FILE__).'/config.php')) 
     8if(file_exists(dirname(__FILE__).'/config.php'))
    99  include_once(dirname(__FILE__).'/config.php');
    1010include_once(dirname(__FILE__).'/Version.php');
     
    8383
    8484$UnitNames = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB');
    85  
     85
    8686function HumanSize($Value)
    8787{
     
    120120    $Parts[] = $Index.'='.$Item;
    121121  }
    122   return(implode('&', $Parts));
     122  return(implode('&amp;', $Parts));
    123123}
    124124
     
    135135}
    136136
    137 function getmonthyears($Days) 
     137function getmonthyears($Days)
    138138{
    139139  $month = floor($Days / 30);
    140140  $year = floor($month / 12);
    141141  $Days = floor($Days - $month * 30);
    142   $month = $month - $year * 12; 
     142  $month = $month - $year * 12;
    143143  return($year.'r '.$month.'m '.$Days.'d');
    144144}
     
    149149//  $text = 'Balthule\'s letter is dire. This Cult of the Dark Strand is a thorn in my side that must be removed. I have been dealing with some of the Dark Strand scum northeast of here at Ordil\'Aran. One of their number possesses a soul gem that I believe holds the secret to the cult\'s power.$b$bBring it to me, and I will be able to decipher the secrets held within.';
    150150 // $text = htmlspecialchars($text);
    151  
     151
    152152  $text = str_replace('$B','$B ',$text);
    153153  $text = urlencode($text);
     
    163163  error_reporting(E_ALL ^ E_WARNING);
    164164  if (($handle = @fopen($url, "r")) === FALSE) return false;
    165    
     165
    166166  $data = stream_get_contents($handle);
    167167  $data = substr($data, strpos($data,'result_box'));
     
    178178    $data = $partbefore.' '.$partafter;
    179179  }
    180  
     180
    181181  $data = utf8_encode($data);
    182182
     
    184184  $data = str_replace('$b $b','$b$b',$data);
    185185  $data = str_replace('| ','|',$data);
    186  
    187   return $data; 
     186
     187  return $data;
    188188}
    189189
     
    191191{
    192192  global $System;
    193    
     193
    194194  $QueryItems = GetQueryStringArray($_SERVER['QUERY_STRING']);
    195  
     195
    196196  $ItemPerPage = $System->Config['Web']['ItemsPerPage'];
    197197  $Around = round($System->Config['Web']['VisiblePagingItems'] / 2);
    198198  $Result = '';
    199199  $PageCount = floor($TotalCount / $ItemPerPage) + 1;
    200  
     200
    201201  if(!array_key_exists('Page', $_SESSION)) $_SESSION['Page'] = 0;
    202202  if(array_key_exists('page', $_GET)) $_SESSION['Page'] = $_GET['page'] * 1;
     
    204204  if($_SESSION['Page'] >= $PageCount) $_SESSION['Page'] = $PageCount - 1;
    205205  $CurrentPage = $_SESSION['Page'];
    206  
    207        
     206
     207
    208208  $Result .= 'Počet položek: <strong>'.$TotalCount.'</strong> &nbsp; Stránky: ';
    209209
     
    211211  if($PageCount > 1)
    212212  {
    213     if($CurrentPage > 0) 
     213    if($CurrentPage > 0)
    214214    {
    215       $QueryItems['page'] = 0;     
     215      $QueryItems['page'] = 0;
    216216      $Result.= '<a href="?'.SetQueryStringArray($QueryItems).'">&lt;&lt;</a> ';
    217217      $QueryItems['page'] = ($CurrentPage - 1);
     
    233233       $Result .= '<a href="?'.SetQueryStringArray($QueryItems).'">'.($i + 1).'</a> ';
    234234      }
    235     } 
     235    }
    236236    if($PagesMax < ($PageCount - 1)) $Result .= ' ... ';
    237     if($CurrentPage < ($PageCount - 1)) 
     237    if($CurrentPage < ($PageCount - 1))
    238238    {
    239239      $QueryItems['page'] = ($CurrentPage + 1);
     
    244244  }
    245245  $Result = '<div style="text-align: center">'.$Result.'</div>';
    246   return(array('SQLLimit' => ' LIMIT '.$CurrentPage * $ItemPerPage.', '.$ItemPerPage, 
     246  return(array('SQLLimit' => ' LIMIT '.$CurrentPage * $ItemPerPage.', '.$ItemPerPage,
    247247    'Page' => $CurrentPage,
    248248    'Output' => $Result,
     
    256256{
    257257  global $OrderDirSQL, $OrderArrowImage, $Config, $System;
    258  
     258
    259259  if(array_key_exists('OrderCol', $_GET)) $_SESSION['OrderCol'] = $_GET['OrderCol'];
    260   if(array_key_exists('OrderDir', $_GET) and (array_key_exists($_GET['OrderDir'], $OrderArrowImage))) 
     260  if(array_key_exists('OrderDir', $_GET) and (array_key_exists($_GET['OrderDir'], $OrderArrowImage)))
    261261        $_SESSION['OrderDir'] = $_GET['OrderDir'];
    262262  if(!array_key_exists('OrderCol', $_SESSION)) $_SESSION['OrderCol'] = $DefaultColumn;
    263   if(!array_key_exists('OrderDir', $_SESSION)) $_SESSION['OrderDir'] = $DefaultOrder; 
    264  
     263  if(!array_key_exists('OrderDir', $_SESSION)) $_SESSION['OrderDir'] = $DefaultOrder;
     264
    265265  // Check OrderCol
    266266  $Found = false;
     
    269269    if($Column['Name'] == $_SESSION['OrderCol'])
    270270    {
    271       $Found = true;   
     271      $Found = true;
    272272      break;
    273273    }
     
    280280  // Check OrderDir
    281281  if(($_SESSION['OrderDir'] != 0) and ($_SESSION['OrderDir'] != 1)) $_SESSION['OrderDir'] = 0;
    282  
     282
    283283  $Result = '';
    284284  $QueryItems = GetQueryStringArray($_SERVER['QUERY_STRING']);
     
    304304{
    305305  global $System;
    306  
     306
    307307  $Output = '<select name="ClientVersion">';
    308308  $DbResult = $System->Database->select('ClientVersion', '`Id`, `Version`', '`Imported` = 1');
    309   $Output .= '<option value=""'; 
    310   if($Selected == '') 
     309  $Output .= '<option value=""';
     310  if($Selected == '')
    311311    $Output .= ' selected="selected"';
    312312  $Output .= '>Žádná</option>';
    313313  while($ClientVersion = $DbResult->fetch_assoc())
    314314  {
    315     $Output .= '<option value="'.$ClientVersion['Id'].'"'; 
    316     if($Selected == $ClientVersion['Id']) 
     315    $Output .= '<option value="'.$ClientVersion['Id'].'"';
     316    if($Selected == $ClientVersion['Id'])
    317317      $Output .= ' selected="selected"';
    318318    $Output .= '>'.$ClientVersion['Version'].'</option>';
    319   }   
     319  }
    320320  $Output .= '</select>';
    321   return($Output);   
     321  return($Output);
    322322}
    323323
    324324function GetLanguageList()
    325 { 
     325{
    326326  global $System;
    327  
     327
    328328  $Result = array();
    329329  $DbResult = $System->Database->query('SELECT * FROM `Language` WHERE `Enabled` = 1');
     
    334334
    335335function GetTranslationTree()
    336 { 
     336{
    337337  global $System;
    338  
     338
    339339  $Result = array();
    340340  $DbResult = $System->Database->query('SELECT *, UNIX_TIMESTAMP(`LastImport`) AS `LastImportTime` FROM `Group` ORDER BY `Name`');
     
    381381}
    382382
    383 function FollowingTran($TextID, $Table, $GroupId, $Prev = false) 
    384 { 
     383function FollowingTran($TextID, $Table, $GroupId, $Prev = false)
     384{
    385385  global $System, $Config;
    386  
     386
    387387  if($Prev)
    388388    $sql = 'SELECT `ID` FROM `'.$Table.'` AS `item` WHERE '.
     
    394394      'FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Language` <> '.$Config['OriginalLanguage'].') '.
    395395      'AND (`sub`.`entry` = `item`.`entry`)) AND `ID` > '.$TextID.' ORDER BY `ID` LIMIT 1';
    396  
     396
    397397  $DbResult = $System->Database->query($sql);
    398398  $Next = $DbResult->fetch_assoc();
    399   if($Next) 
     399  if($Next)
    400400  {
    401401    if($Prev) $Output = '<a href="form.php?group='.$GroupId.'&amp;ID='.$Next['ID'].'">Předcházející '.$Next['ID'].'</a> ';
     
    408408{
    409409  global $System, $BuildNumbers;
    410  
    411   if(isset($BuildNumbers[$Version]) == false) 
     410
     411  if(isset($BuildNumbers[$Version]) == false)
    412412  {
    413413    $sql = 'SELECT `BuildNumber` FROM `ClientVersion` WHERE `Version` = "'.$Version.'"';
     
    419419}
    420420
    421 // TODO: Client version build number should not be used in internal references 
     421// TODO: Client version build number should not be used in internal references
    422422function GetVersionWOW($BuildNumber)
    423423{
    424424  global $System, $VersionsWOW;
    425  
    426   if(isset($VersionsWOW[$BuildNumber]) == false) 
     425
     426  if(isset($VersionsWOW[$BuildNumber]) == false)
    427427  {
    428428    $sql = 'SELECT `Version` FROM `ClientVersion` WHERE `BuildNumber` = "'.$BuildNumber.'"';
     
    434434}
    435435
    436 // TODO: Client version build number should not be used in internal references 
     436// TODO: Client version build number should not be used in internal references
    437437function GetVersionWOWId($BuildNumber)
    438438{
    439439  global $System, $VersionsWOWId;
    440  
    441   if(isset($VersionsWOWId[$BuildNumber]) == false) 
     440
     441  if(isset($VersionsWOWId[$BuildNumber]) == false)
    442442  {
    443443    $sql = 'SELECT `Id` FROM `ClientVersion` WHERE `BuildNumber` = "'.$BuildNumber.'"';
     
    452452{
    453453  global $TranslationTree;
    454  
    455   if(array_key_exists('group', $_GET)) $GroupId = $_GET['group'] * 1; 
     454
     455  if(array_key_exists('group', $_GET)) $GroupId = $_GET['group'] * 1;
    456456    else $GroupId = 1;
    457  
     457
    458458  if(isset($TranslationTree[$GroupId]) == false) ErrorMessage('Překladová skupina dle zadaného Id neexistuje.');
    459459  return($GroupId);
     
    473473        $_GET[$Index] = $Parameter;
    474474      }
    475     } 
     475    }
    476476  }
    477477}
     
    480480{
    481481  $QueryItems = GetQueryStringArray($_SERVER['QUERY_STRING']);
    482  
     482
    483483  if(array_key_exists('Tab', $_GET)) $_SESSION['Tab'] = $_GET['Tab'];
    484484  if(!array_key_exists('Tab', $_SESSION)) $_SESSION['Tab'] = 0;
     
    489489  {
    490490    $QueryItems['Tab'] = $Index;
    491     if($Index == $_SESSION['Tab']) $Selected = ' id="selected"'; 
     491    if($Index == $_SESSION['Tab']) $Selected = ' id="selected"';
    492492      else $Selected = '';
    493493    $Output .= '<li'.$Selected.'><a href="?'.SetQueryStringArray($QueryItems).'">'.$Tab.'</a></li>';
     
    520520}
    521521
    522 function DeleteDirectory($dirname) 
     522function DeleteDirectory($dirname)
    523523{
    524524  if(is_dir($dirname))
     
    526526    $dir_handle = opendir($dirname);
    527527    if(!$dir_handle) return(false);
    528     while($file = readdir($dir_handle)) 
     528    while($file = readdir($dir_handle))
    529529    {
    530530      if(($file != '.') and ($file != '..'))
    531531      {
    532532        if(!is_dir($dirname.'/'.$file)) unlink($dirname.'/'.$file);
    533           else DeleteDirectory($dirname.'/'.$file);   
     533          else DeleteDirectory($dirname.'/'.$file);
    534534      }
    535535    }
     
    546546}
    547547
    548 function GetIDbyName($Table) 
     548function GetIDbyName($Table)
    549549{
    550550  global $TranslationTree;
    551  
    552   foreach($TranslationTree as $TableID => $Value) 
     551
     552  foreach($TranslationTree as $TableID => $Value)
    553553  {
    554554    if($Value['TablePrefix'] == $Table) return $TableID;
    555555  }
    556556}
    557 function GetTranslatNamesArray() { 
     557function GetTranslatNamesArray() {
    558558
    559559$TablesColumn = array
     
    576576  return($TablesColumn);
    577577}
    578 function GetTranslatNames($Text,$mode,$TablesColumn, $FirstBig = True) 
     578function GetTranslatNames($Text,$mode,$TablesColumn, $FirstBig = True)
    579579{
    580580  global $System, $Config;
    581  
     581
    582582 /* $TablesID = array('gameobject' => 5,
    583583  'creature' => 6,
     
    609609    $Text = str_replace('>',' ',$Text);
    610610    $ArrStr = explode(' ', $Text);
    611     $sqlall = ''; 
    612   foreach($TablesColumn as $Table => $Column) 
    613   { 
     611    $sqlall = '';
     612  foreach($TablesColumn as $Table => $Column)
     613  {
    614614    $orderinby = ' ORDER BY ID DESC ';
    615615    $sql = 'SELECT `ID`, (SELECT CONCAT(  \''.GetIDbyName($Table).'\' )) AS  `GoupId`,`'.$Column.'` AS Orig, (SELECT `'.$Column.'` FROM `'.$Table.'` AS `T` WHERE '.
     
    620620    if ($mode == 1) $where .= ' AND EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> '.$Config['OriginalLanguage'].') AND (`Sub`.`Entry` = `O`.`Entry`))';
    621621    if ($mode == 2) $where .= ' AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> '.$Config['OriginalLanguage'].') AND (`Sub`.`Entry` = `O`.`Entry`))';
    622     $where .= ' AND ('; 
     622    $where .= ' AND (';
    623623    if (array_search('the' , $ArrStr)) $where .= '(`O`.`'.$Column.'` LIKE "The %") OR ';
    624    
     624
    625625    $SqlOK = false;
    626626    if (count($ArrStr) > 0) {
     
    639639      $where .= ')';
    640640    }
    641       if ($SqlOK) {                                                       
     641      if ($SqlOK) {
    642642        //$sql.$where.$groupby.$orderby
    643643//          $buff[] = array($Line['ID'], GetIDbyName($Table), $Line['Orig'], $Line['Tran']);
     
    646646      }
    647647
    648   }   
     648  }
    649649    if ($SqlOK) {
    650650        $orderby = ' ORDER BY LENGTH(Orig) DESC ';
     
    652652        $DbResult = $System->Database->query($sqlall.$orderby);
    653653    //  echo ($sql.'|'.$where.'|'.$groupby);
    654         while($Line = $DbResult->fetch_assoc()) 
     654        while($Line = $DbResult->fetch_assoc())
    655655        {
    656656          $buff[] = array($Line['ID'], $Line['GoupId'], $Line['Orig'], $Line['Tran']);
     
    665665  if($Pixels > $Width) $Pixels = $Width;
    666666  if($Text == '') $Text = $Percent;
    667  
     667
    668668  return('<div class="progressbar" style="width: '.$Width.'px">'.
    669     '<div class="bar" style="width: '.$Pixels.'px;"></div>'. 
    670     '<div class="text" style="width: '.$Width.'px">'.$Text.'</div>'. 
     669    '<div class="bar" style="width: '.$Pixels.'px;"></div>'.
     670    '<div class="text" style="width: '.$Width.'px">'.$Text.'</div>'.
    671671    '</div>');
    672672}
     
    675675{
    676676  $IndexLevel = 100;
    677  
     677
    678678  if($XP > 0) $Level = floor(sqrt($XP / $IndexLevel));
    679679    else $Level = 0;
     
    701701  $Content = str_replace("\n", ' <br/>', $Content);
    702702  $Content = str_replace("\r", '', $Content);
    703  
    704   $Result = ''; 
     703
     704  $Result = '';
    705705  $I = 0;
    706706  while((strpos($Content, 'http://') !== false) or (strpos($Content, 'https://') !== false))
     
    713713    if($SpacePos !== false) $URL = substr($Content, 0, strpos($Content, ' '));
    714714      else $URL = substr($Content, 0);
    715    
     715
    716716    $Result .= '<a href="'.$URL.'">'.$URL.'</a>';
    717717    $Content = substr($Content, strlen($URL));
     
    728728{
    729729  global $System;
    730  
     730
    731731  $IconName = array(
    732           MESSAGE_INFORMATION => 'information', 
    733     MESSAGE_WARNING => 'warning', 
     732          MESSAGE_INFORMATION => 'information',
     733    MESSAGE_WARNING => 'warning',
    734734    MESSAGE_CRITICAL => 'critical'
    735735  );
    736736  $BackgroundColor = array(
    737         MESSAGE_INFORMATION => '#e0e0ff', 
    738     MESSAGE_WARNING => '#ffffe0', 
     737        MESSAGE_INFORMATION => '#e0e0ff',
     738    MESSAGE_WARNING => '#ffffe0',
    739739        MESSAGE_CRITICAL => '#ffe0e0'
    740740  );
    741  
     741
    742742  return('<div class="message" style="background-color: '.$BackgroundColor[$Type].
    743743        ';"><table><tr><td class="icon"><img src="'.
Note: See TracChangeset for help on using the changeset viewer.