Changeset 465


Ignore:
Timestamp:
Apr 15, 2010, 6:45:17 AM (14 years ago)
Author:
george
Message:
  • Upraveno: V shoutboxu převádět textové html odkazy na aktivní.
Location:
trunk
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/action.php

    r460 r465  
    236236  $DbResult = $System->Database->query('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC '.$PageList['SQLLimit']);
    237237  while($Line = $DbResult->fetch_assoc())
    238     echo('<div><strong>'.$Line['User'].'</strong>: '.htmlspecialchars($Line['Text']).'</div>');
     238    echo('<div><strong>'.$Line['User'].'</strong>: '.MakeActiveLinks(htmlspecialchars($Line['Text'])).'</div>');
    239239  echo('</div>');
    240240  echo($PageList['Output']);
  • trunk/banners.php

    r462 r465  
    55ShowPage();
    66
    7 $Banner = '<a href="'.$System->Link('/').'"><img src="'.$System->Link('/banners/wowpreklad_big.jpg').'" '.
     7$Banner = '<a href="http://'.$System->Config['Web']['Host'].$System->Link('/').'"><img src="http://'.$System->Config['Web']['Host'].$System->Link('/banners/wowpreklad_big.jpg').'" '.
    88  'alt="wowpreklad" title="Otevřený projekt překládání celé hry World of Warcraft" '.
    99  'class="banner" height="60" width="468" /></a>';
    1010 
    11 $BannerSmall = '<a href="'.$System->Link('/').'"><img src="'.$System->Link('/banners/wowpreklad_small.jpg').'" '.
     11$BannerSmall = '<a href="http://'.$System->Config['Web']['Host'].$System->Link('/').'"><img src="http://'.$System->Config['Web']['Host'].$System->Link('/banners/wowpreklad_small.jpg').'" '.
    1212  'alt="wowpreklad" title="Otevřený projekt překládání celé hry World of Warcraft" '.
    1313  'class="banner" height="31" width="88" /></a>';
     
    1818echo($BannerSmall.' &nbsp;&nbsp;<textarea rows="2" cols="30">'.htmlspecialchars($BannerSmall).'</textarea><br />');
    1919 
    20 $DbResult = $System->Database->query('SELECT * FROM `Referrer` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH)');
     20$DbResult = $System->Database->query('SELECT * FROM `Referrer` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH) ORDER BY `DateLast` DESC');
    2121 
    2222echo('<br/><strong>Servery odkazující na nás:</strong> <br />
    23 <div style="font-size: 10px;">Seznam je automaticky aktualizován a zobrazeny jsou servery, ze kterých přišli uživatelé během posledních třech měsíců.</div><br />');
     23<div style="font-size: 10px;">Seznam je automaticky aktualizován a zobrazeny jsou servery, ze kterých přišli uživatelé během posledních třech měsíců řazený sestupně dle nejnovějších.</div><br />');
    2424while($Line = $DbResult->fetch_assoc())
    2525{
  • trunk/includes/global.php

    r462 r465  
    4848  $DbResult = $System->Database->query('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 30');
    4949  while($Line = $DbResult->fetch_assoc())
    50     echo('<tr><td><strong>'.$Line['User'].'</strong>: '.htmlspecialchars($Line['Text']).'</td></tr>');
     50    echo('<tr><td><strong>'.$Line['User'].'</strong>: '.MakeActiveLinks(htmlspecialchars($Line['Text'])).'</td></tr>');
    5151  echo('</table></div>');
    5252}
  • trunk/includes/global_function.php

    r462 r465  
    557557}
    558558
     559function MakeActiveLinks($Content)
     560{
     561  $Result = ''; 
     562  $I = 0;
     563  while(strpos($Content, 'http://') !== false)
     564  {
     565    $I = strpos($Content, 'http://');
     566    $Result .= substr($Content, 0, $I);
     567    $Content = substr($Content, $I);
     568    if(strpos($Content, ' ') !== false)
     569      $URL = substr($Content, 0, strpos($Content, ' '));
     570      else $URL = substr($Content, 0);
     571    $Result .= '<a href="'.$URL.'">'.$URL.'</a>';
     572    $Content = substr($Content, strlen($URL));
     573  }
     574  $Result .= $Content;
     575  return($Result);
     576}
     577
    559578?>
Note: See TracChangeset for help on using the changeset viewer.