Changeset 626 for trunk/Modules/ShoutBox
- Timestamp:
- Dec 4, 2013, 9:50:16 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/ShoutBox/ShoutBox.php
r622 r626 20 20 'Title' => 'Kecátko', 'Channel' => 'shoutbox', 'Callback' => array('PageShoutBox', 'ShowRSS'), 21 21 'Permission' => LICENCE_ANONYMOUS)); 22 if(array_key_exists('Search', $this->System->ModuleManager->Modules)) 23 $this->System->ModuleManager->Modules['Search']->RegisterSearch('shoutbox', 24 T('Shoutbox'), array('UserName', 'Text'), '`ShoutBox`', $this->System->Link('/shoutbox/?search=')); 22 25 } 23 26 24 27 function ShowBox() 25 28 { 26 $Output = '<strong><a href="'.$this->System->Link('/shoutbox/').'">'.T(' Chatbox').':</a></strong>';29 $Output = '<strong><a href="'.$this->System->Link('/shoutbox/').'">'.T('Shoutbox').':</a></strong>'; 27 30 28 31 if($this->System->User->Licence(LICENCE_USER)) … … 52 55 function ShowList() 53 56 { 54 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `ShoutBox`'); 57 $Output = ''; 58 if(array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search']; 59 else if(!array_key_exists('search', $_SESSION)) $_SESSION['search'] = ''; 60 if(array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = ''; 61 if($_SESSION['search'] != '') 62 { 63 $SearchQuery = ' AND (`Text` LIKE "%'.$_SESSION['search'].'%")'; 64 $Output .= '<div><a href="?search=">'.sprintf(T('Disable filter "%s"'), $_SESSION['search']).'</a></div>'; 65 } else $SearchQuery = ''; 66 67 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `ShoutBox` WHERE 1'.$SearchQuery); 55 68 $DbRow = $DbResult->fetch_row(); 56 $PageList = GetPageList($DbRow[0]); 57 58 $Output = '<h3>Kecátko</h3>'.$PageList['Output'];69 $PageList = GetPageList($DbRow[0]); 70 71 $Output .= '<h3>'.T('Shoutbox').'</h3>'.$PageList['Output']; 59 72 if($this->System->User->Licence(LICENCE_USER)) 60 73 $Output .= ' <a href="'.$this->System->Link('/shoutbox/?a=add').'">'.T('Add').'</a>'; 61 74 $Output .= '<div class="shoutbox">'; 62 $DbResult = $this->System->Database->query('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC '.$PageList['SQLLimit']);75 $DbResult = $this->System->Database->query('SELECT * FROM `ShoutBox` WHERE 1'.$SearchQuery.' ORDER BY `ID` DESC '.$PageList['SQLLimit']); 63 76 while($Line = $DbResult->fetch_assoc()) 64 77 $Output .= '<div><strong>'.$Line['UserName'].'</strong>: '.MakeActiveLinks($Line['Text']).'</div>';
Note:
See TracChangeset
for help on using the changeset viewer.