Changeset 376 for trunk/action.php
- Timestamp:
- Mar 11, 2010, 8:40:32 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/action.php
r366 r376 27 27 } 28 28 29 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `User` WHERE ` User` LIKE "%'.$Search.'%"'));29 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `User` WHERE `Name` LIKE "%'.$Search.'%"')); 30 30 echo('<tr><td><a href="userlist.php?search='.$Search.'">Uživatelé</a></td><td>'.$Line[0].'</td></tr>'); 31 31 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `Team` WHERE `Name` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%"')); … … 42 42 function DatabaseKit() 43 43 { 44 global $Database, $TranslationTree ;45 46 if( Licence(LICENCE_ADMIN))44 global $Database, $TranslationTree, $User; 45 46 if($User->Licence(LICENCE_ADMIN)) 47 47 { 48 48 echo('<form action="?action=dbkit" method="post">'); … … 172 172 function Delete() 173 173 { 174 global $Database ;175 176 if( Licence(LICENCE_MODERATOR))174 global $Database, $User; 175 176 if($User->Licence(LICENCE_MODERATOR)) 177 177 { 178 178 $TextID = $_GET['ID']; … … 185 185 function ShoutBox() 186 186 { 187 global $Database ;187 global $Database, $User; 188 188 189 189 if(array_key_exists('shoutbox', $_GET)) $shoutbox = $_GET['shoutbox']; … … 193 193 echo('<form action="action.php?action=shoutbox&shoutbox=1" method="post"><fieldset><legend>Nová zpráva kecátka</legend> 194 194 Uživatel: '); 195 if( Licence(LICENCE_USER)) echo('<b>'.$_SESSION['User'].'</b><br />');195 if($User->Licence(LICENCE_USER)) echo('<b>'.$User->Name.'</b><br />'); 196 196 else echo('<input type="text" name="user" /><br />'); 197 197 echo('Text zprávy: <br> … … 201 201 } else 202 202 { 203 if( Licence(LICENCE_USER)) $user = $_SESSION['User'];204 else die('Pro vkládaní musíte byt registrováni!');205 $text = $_POST['text'];206 $Database->SQLCommand('INSERT INTO `ShoutBox` ( `User` , `Text` , `Date` , `IP` )207 VALUES ("'.$user.'", "'.$text.'", NOW(), "'.$_SERVER['REMOTE_ADDR'].'")');208 echo('Zpráva vložena!<br>Budete přesměrováni...');209 echo('203 if($User->Licence(LICENCE_USER)) 204 { 205 $Text = $_POST['text']; 206 $Database->SQLCommand('INSERT INTO `ShoutBox` ( `User` , `Text` , `Date` , `IP` ) '. 207 ' VALUES ("'.$User->Name.'", "'.$Text.'", NOW(), "'.$_SERVER['REMOTE_ADDR'].'")'); 208 echo('Zpráva vložena!<br>Budete přesměrováni...'); 209 echo(' 210 210 <script type="text/javascript" language="JavaScript" charset="utf-8"> 211 211 setTimeout("parent.location.href=\'index.php\'",1000) 212 212 </script>'); 213 } else echo('Pro vkládaní musíte byt registrováni!'); 213 214 } 214 215 } … … 216 217 function ShoutBoxView() 217 218 { 218 global $Database ;219 global $Database, $User; 219 220 220 221 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `ShoutBox`'); … … 224 225 echo('<h3>Kecátko</h3>'); 225 226 echo($PageList['Output']); 226 if( Licence(LICENCE_USER)) echo(' <a href="action.php?action=shoutbox">Vložit</a>');227 if($User->Licence(LICENCE_USER)) echo(' <a href="action.php?action=shoutbox">Vložit</a>'); 227 228 echo('<div class="shoutbox">'); 228 229 $ID = $Database->SQLCommand('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC '.$PageList['SQLLimit']); … … 235 236 function ShowNewsHistory() 236 237 { 237 global $Database ;238 global $Database, $User; 238 239 239 240 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `News`'); … … 243 244 echo('<h3>Novinky</h3>'); 244 245 echo($PageList['Output']); 245 if( Licence(LICENCE_USER)) echo(' <a href="admin.php?action=addnew">Vložit</a>');246 if($User->Licence(LICENCE_USER)) echo(' <a href="admin.php?action=addnew">Vložit</a>'); 246 247 echo('<div class="shoutbox">'); 247 248 $ID = $Database->SQLCommand('SELECT `News`.`Time`, `News`.`Text`, `User`.`Name` AS `User` FROM `News` JOIN `User` ON `User`.`ID`=`News`.`User` ORDER BY `News`.`Time` DESC '.$PageList['SQLLimit']);
Note:
See TracChangeset
for help on using the changeset viewer.