Changeset 893 for trunk/Modules/ShoutBox/ShoutBox.php
- Timestamp:
- Mar 6, 2023, 1:48:45 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/ShoutBox/ShoutBox.php
r891 r893 27 27 function ShowBox() 28 28 { 29 $User = ModuleUser::Cast($this->System->GetModule('User'))->User; 29 30 $Output = '<strong><a href="'.$this->System->Link('/shoutbox/').'">'.T('Shoutbox').':</a></strong>'; 30 31 31 if ($ this->System->User->Licence(LICENCE_USER))32 if ($User->Licence(LICENCE_USER)) 32 33 $Output .= ' <a href="'.$this->System->Link('/shoutbox/?a=add').'">'.T('Add').'</a>'; 33 34 $Output .= '<div class="box"><div class="shoutbox"><table>'; … … 56 57 function ShowList() 57 58 { 59 $User = ModuleUser::Cast($this->System->GetModule('User'))->User; 58 60 $Output = ''; 59 61 if (array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search']; … … 71 73 72 74 $Output .= '<h3>'.T('Shoutbox').'</h3>'; 73 if ($ this->System->User->Licence(LICENCE_USER))75 if ($User->Licence(LICENCE_USER)) 74 76 $Output .= ' <a href="'.$this->System->Link('/shoutbox/?a=add').'">'.T('Add').'</a>'; 75 77 $Output .= $PageList['Output']; … … 84 86 function ShowAddForm() 85 87 { 88 $User = ModuleUser::Cast($this->System->GetModule('User'))->User; 86 89 $Output = ''; 87 if ($ this->System->User->Licence(LICENCE_USER))90 if ($User->Licence(LICENCE_USER)) 88 91 { 89 92 $Output .= '<form action="?" method="post">'. 90 93 '<fieldset><legend>'.T('New message').'</legend>'. 91 94 'Uživatel: '; 92 if ($ this->System->User->Licence(LICENCE_USER)) $Output .= '<b>'.$this->System->User->Name.'</b><br />';95 if ($User->Licence(LICENCE_USER)) $Output .= '<b>'.$User->Name.'</b><br />'; 93 96 else $Output .= '<input type="text" name="user" /><br />'; 94 97 $Output .= 'Text zprávy: <br/>'. … … 104 107 function AddFinish() 105 108 { 109 $User = ModuleUser::Cast($this->System->GetModule('User'))->User; 106 110 $Output = ''; 107 if ($ this->System->User->Licence(LICENCE_USER))111 if ($User->Licence(LICENCE_USER)) 108 112 { 109 113 if (array_key_exists('text', $_POST)) … … 115 119 // Protection against mutiple post of same message 116 120 $DbResult = $this->System->Database->query('SELECT `Text` FROM `ShoutBox` WHERE (`User` = "'. 117 $ this->System->User->Id.'") ORDER BY `Date` DESC LIMIT 1');121 $User->Id.'") ORDER BY `Date` DESC LIMIT 1'); 118 122 if ($DbResult->num_rows > 0) 119 123 { … … 125 129 { 126 130 $this->System->Database->query('INSERT INTO `ShoutBox` ( `User`, `UserName` , `Text` , `Date` , `IP` ) '. 127 ' VALUES ('.$ this->System->User->Id.', "'.$this->System->User->Name.131 ' VALUES ('.$User->Id.', "'.$User->Name. 128 132 '", "'.$Text.'", NOW(), "'.GetRemoteAddress().'")'); 129 133 $Output .= ShowMessage('Zpráva vložena.'); … … 139 143 function ShowRSS() 140 144 { 145 $User = ModuleUser::Cast($this->System->GetModule('User'))->User; 141 146 $Items = array(); 142 147 $TitleLength = 50; … … 150 155 ( 151 156 'Title' => $DbRow['UserName'].': '.$Title, 152 'Link' => 'https://'. $this->System->Config['Web']['Host'].$this->System->Link('/shoutbox/'),157 'Link' => 'https://'.Core::Cast($this->System)->Config['Web']['Host'].$this->System->Link('/shoutbox/'), 153 158 'Description' => $DbRow['Text'], 154 159 'Time' => $DbRow['UnixDate'], … … 157 162 $Output = GenerateRSS(array 158 163 ( 159 'Title' => $this->System->Config['Web']['Title'].' - '.T('Shoutbox'),160 'Link' => 'https://'. $this->System->Config['Web']['Host'].$this->System->Link('/shoutbox/'),161 'Description' => $this->System->Config['Web']['Description'],162 'WebmasterEmail' => $this->System->Config['Web']['AdminEmail'],164 'Title' => Core::Cast($this->System)->Config['Web']['Title'].' - '.T('Shoutbox'), 165 'Link' => 'https://'.Core::Cast($this->System)->Config['Web']['Host'].$this->System->Link('/shoutbox/'), 166 'Description' => Core::Cast($this->System)->Config['Web']['Description'], 167 'WebmasterEmail' => Core::Cast($this->System)->Config['Web']['AdminEmail'], 163 168 'Items' => $Items, 164 169 ));
Note:
See TracChangeset
for help on using the changeset viewer.