Changeset 466 for trunk/includes
- Timestamp:
- Apr 15, 2010, 8:20:31 AM (15 years ago)
- Location:
- trunk/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/global.php
r465 r466 14 14 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($_GET[$Index]); 15 15 16 include_once(dirname(__FILE__).'/config.php'); 16 include_once(dirname(__FILE__).'/global_function.php'); 17 if(file_exists(dirname(__FILE__).'/config.php')) include_once(dirname(__FILE__).'/config.php'); 18 else die('Nenalezen konfigurační soubor config.php ve složce includes. Vytvořte jej zkopírováním vzoru config.sample.php.'); 17 19 include_once(dirname(__FILE__).'/Database.php'); 18 include_once(dirname(__FILE__).'/global_function.php');19 20 include_once(dirname(__FILE__).'/rss.php'); 20 21 include_once(dirname(__FILE__).'/system.php'); … … 48 49 $DbResult = $System->Database->query('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 30'); 49 50 while($Line = $DbResult->fetch_assoc()) 50 echo('<tr><td><strong>'.$Line['User'].'</strong>: '.MakeActiveLinks( htmlspecialchars($Line['Text'])).'</td></tr>');51 echo('<tr><td><strong>'.$Line['User'].'</strong>: '.MakeActiveLinks($Line['Text']).'</td></tr>'); 51 52 echo('</table></div>'); 52 53 } -
trunk/includes/global_function.php
r465 r466 342 342 if(isset($LanguageList[$LanguageId]) == false) 343 343 { 344 echo('Jazyk dle zadaného Id neexistuje.');344 ShowMessage('Jazyk dle zadaného Id neexistuje.', MESSAGE_CRITICAL); 345 345 ShowFooter(); 346 346 die(); … … 559 559 function MakeActiveLinks($Content) 560 560 { 561 $Content = htmlspecialchars($Content); 562 $Content = str_replace("\n", ' <br/>', $Content); 563 $Content = str_replace("\r", '', $Content); 564 561 565 $Result = ''; 562 566 $I = 0; … … 566 570 $Result .= substr($Content, 0, $I); 567 571 $Content = substr($Content, $I); 568 if(strpos($Content, ' ') !== false)569 572 $SpacePos = strpos($Content, ' '); 573 if($SpacePos !== false) $URL = substr($Content, 0, strpos($Content, ' ')); 570 574 else $URL = substr($Content, 0); 575 571 576 $Result .= '<a href="'.$URL.'">'.$URL.'</a>'; 572 577 $Content = substr($Content, strlen($URL)); … … 576 581 } 577 582 583 define('MESSAGE_WARNING', 0); 584 define('MESSAGE_CRITICAL', 1); 585 define('MESSAGE_INFORMATION', 2); 586 587 function ShowMessage($Text, $Type = MESSAGE_INFORMATION) 588 { 589 global $System; 590 591 $IconName = array(MESSAGE_INFORMATION => 'information', MESSAGE_WARNING => 'warning', MESSAGE_CRITICAL => 'critical'); 592 $BackgroundColor = array(MESSAGE_INFORMATION => '#e0e0ff', MESSAGE_WARNING => '#ffffe0', MESSAGE_CRITICAL => '#ffe0e0'); 593 594 echo('<div class="message" style="background-color: '.$BackgroundColor[$Type].';"><table><tr><td class="icon"><img src="'.$System->Link('/images/message/'.$IconName[$Type].'.png').'" alt="'.$IconName[$Type].'"><td>'.$Text.'</td></tr></table></div>'); 595 } 596 578 597 ?>
Note:
See TracChangeset
for help on using the changeset viewer.