source: includes/global.php@ 16

Last change on this file since 16 was 16, checked in by maron, 16 years ago

Přidáno zkontrolování adminem

File size: 11.8 KB
Line 
1<?php
2
3session_start();
4include('config.php');
5include('databaseconection.php');
6
7//pøipojení do databáze
8$Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']);
9$Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']);
10$Database->SelectDatabase($Config['Database']['Database']);
11
12//globální funkce
13include('global_function.php');
14
15
16echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
17<HTML>
18<HEAD>
19 <META http-equiv="Content-Language" content="cs">
20 <META http-equiv="Content-Type" content="text/html; charset='.$Config['Web']['Charset'].'">
21 <META HTTP-EQUIV="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT">
22 <link rel="SHORTCUT ICON" href="/images/favicon.ico">
23 <TITLE>WoW server Heroes of Fantasy - Projekt pøekládání Questù do CZ</TITLE>
24 <meta http-equiv="Cache-Control" content="no-cache" />
25</HEAD>
26 <body>
27 <script type="text/javascript" language="JavaScript">
28 <!--
29 function show(what){
30 what.style.display=\'\';
31 }
32 function hide(what){
33 what.style.display=\'none\'
34 }
35 -->
36 </script>
37
38 ';
39
40
41//pøihlá¹ení
42 if (array_key_exists('LoginUser',$_POST)) {
43 $_SESSION['User'] = $_POST['LoginUser'];
44 $_SESSION['Pass'] = $_POST['LoginPass'];
45
46 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM user WHERE LOWER(user) = LOWER('".$_SESSION['User']."') AND pass = '".$_SESSION['Pass']."'"));
47 if (!$Line ) {
48 echo '<script> alert("Jméno nebo heslo bylo zadáno ¹patnì!"); </script>';
49 $_SESSION['UserID'] = '';
50 $_SESSION['User'] = '';
51 $_SESSION['Pass'] = '';
52 } else {
53 $_SESSION['UserID'] = $Line['ID'];
54 $_SESSION['User'] = $Line['user'];
55 WriteLog('Login: '.$_SESSION['User'], 3);
56 }
57 }
58//odhlá¹ení
59 if (array_key_exists('Logout',$_GET)) {
60 WriteLog('Odhlá¹ení', 3);
61 $_SESSION['User'] = '';
62 $_SESSION['Pass'] = '';
63 $_SESSION['UserID'] = '';
64 }
65//záznam o aktivitì
66 if (Licence(0))
67 $Database->SQLCommand("UPDATE user SET LastIP = '".$_SERVER['REMOTE_ADDR']."', LastLogin = now() WHERE ID = ".$_SESSION['UserID']);
68
69
70echo'<table border="0" width="100%">
71 <tr>
72 <td width="150" valign="top">
73 <a Title="Hlavní stránka" href="index.php">Domù</a><br />
74 <a Title="Diskuze na téma pøekládání" href="http://wow.zdechov.net/forum/viewforum.php?f=22">Fórum projektu</a><br />
75 <a Title="Weby odkazující na tento projekt bennerem" href="banners.php">Odkazuje na nás</a><br />
76 <a Title="Slovník wow výrazù" onclick="javascript:window.open(\'dictionary.php\',\'Slovník\',\'width=400,height=412\'); return false;" href="dictionary.php">Slovníèek</a><br />
77 <a Title="Statistika pøekládání" href="statistic.php">Statistika</a><br />
78 <a href="download.php" Title="Zde si mù¾ete stáhnout pøelo¾ené texty">Stahování</a><br />';
79
80 if (Licence(0))
81 echo '<a Title="Nastavení u¾ivatele" href="Options.php">Nastavení</a><br />';
82 else
83 echo '<a Title="Registrace u¾ivatele pro pøekládání" href="registrace.php" style="color: red">Registrace</a><br />';
84
85 //questy rolovací menu "
86 echo '<br /><div id="quests_menu1" style="background-color: #ffff66;" onMouseMove="show(quests_menu)" onmouseout="hide(quests_menu)">
87 <a href="ListQuests.php?filter">Questy</a></div>
88
89 <div id="quests_menu" style="display: none; background-color: #ffffcc;" onMouseMove="show(quests_menu)" onmouseout="hide(quests_menu)">
90 &nbsp;<a Title="Zde mù¾ete zaèít pøekládat" href="ListQuests.php?selection">Nepøelo¾ené questy</a><br>
91 &nbsp;<a Title="Pøelo¾ené questy, mù¾ete zde hlasovat, nebo opravovat Quest" href="ListQuests.php?Translate">Pøelo¾ené questy</a><br>
92 ';
93 if (Licence(0)) {
94 echo '&nbsp;<a Title="Nedokonèené questy" href="ListQuests.php?mydevelop">Rozepsané questy</a><br>
95 &nbsp;<a Title="V¹echny Questy, které jsem pøelo¾il" href="ListQuests.php?my">Moje questy</a><br>
96 &nbsp;<a Title="Questy, které bych mìl oznámkovat" href="ListQuests.php?notvote">Neznámkované questy</a><br>';
97 }
98 if (Licence(2)) {
99 echo '&nbsp;<a Title="Nezkontrolované Questy" href="ListQuests.php?nocheck">Nezkontrolované q.</a><br>';
100 echo '&nbsp;<a Title="Zkontrolované Questy" href="ListQuests.php?check">Zkontrolované q.</a><br>';
101 }
102 echo '&nbsp;<a Title="Sestavit speciální fitr" href="ListQuests.php?filter">Filtr questù ...</a><br>';
103 echo '</div>';
104
105 //npc rolovací menu
106 echo '<div id="npc_menu1" style="background-color: #ffff66; margin: 5px 0px 0px 0px;" onMouseMove="show(npc_menu)" onmouseout="hide(npc_menu)">
107 <a href="npc_list.php?filter">NPC_texty</a></div>
108
109 <div id="npc_menu" onMouseMove="show(npc_menu)" onmouseout="hide(npc_menu)" style="display: none; background-color: #ffffcc;">
110 &nbsp;<a Title="Zde mù¾ete zaèít pøekládat NPC_texty" href="npc_list.php?notran">Nepøelo¾ené npc_text</a><br>
111 &nbsp;<a Title="Ve¹keré pøelo¾ené NPC_texty" href="npc_list.php?Translate">Pøelo¾ené npc_text</a><br>
112 ';
113 if (Licence(0)) {
114 echo '&nbsp;<a Title="Nedokonèené NPC_texty" href="npc_list.php?mydevelop">Rozepsané npc_text</a><br>
115 &nbsp;<a Title="V¹echny NPC_texty, které bych mìl je¹tì oznámkovat" href="npc_list.php?my">Moje npc_text</a><br>
116 &nbsp;<a Title="NPC_texty, které jsem je¹tì neoznámkoval" href="npc_list.php?notvote">Neznámkované npc</a><br>';
117 }
118 if (Licence(2)) {
119 echo '&nbsp;<a Title="Nezkontrolované NPC_texty" href="npc_list.php?nocheck">Nezkontrolované npc</a><br>';
120 echo '&nbsp;<a Title="Zkontrolované NPC_texty" href="npc_list.php?check">Zkontrolované npc</a><br>';
121 }
122 echo '&nbsp;<a Title="Sestavit speciální fitr" href="npc_list.php?filter">Filtr npc_text ...</a><br>';
123 echo '</div>';
124
125 //page rolovací menu
126 echo '<div id="page_menu1" style="background-color: #ffff66; margin: 5px 0px 0px 0px;" onMouseMove="show(page_menu)" onmouseout="hide(page_menu)">
127 <a href="page_list.php?filter">page_texty</a></div>
128
129 <div id="page_menu" onMouseMove="show(page_menu)" onmouseout="hide(page_menu)" style="display: none; background-color: #ffffcc;">
130 &nbsp;<a Title="Zde mù¾ete zaèít pøekládat page_texty" href="page_list.php?notran">Nepøelo¾ené page_text</a><br>
131 &nbsp;<a Title="Ve¹keré pøelo¾ené page_texty" href="page_list.php?Translate">Pøelo¾ené page_text</a><br>
132 ';
133 if (Licence(0)) {
134 echo '&nbsp;<a Title="Nedokonèené page_texty" href="page_list.php?mydevelop">Rozepsané page_text</a><br>
135 &nbsp;<a Title="V¹echny page_texty, které bych mìl je¹tì oznámkovat" href="page_list.php?my">Moje page_text</a><br>
136 &nbsp;<a Title="page_texty, které jsem je¹tì neoznámkoval" href="page_list.php?notvote">Neznámkované page</a><br>';
137 }
138 if (Licence(2)) {
139 echo '&nbsp;<a Title="Nezkontrolované page_texty" href="page_list.php?nocheck">Nezkontrolované page</a><br>';
140 echo '&nbsp;<a Title="Zkontrolované page_texty" href="page_list.php?check">Zkontrolované page</a><br>';
141 }
142 echo '&nbsp;<a Title="Sestavit speciální fitr" href="page_list.php?filter">Filtr page_text ...</a><br>';
143 echo '</div>';
144
145 //client rolovací menu
146 /* echo '<div id="client_menu1" style="background-color: #ffff66; margin: 5px 0px 0px 0px;" onMouseMove="show(client_menu)" onmouseout="hide(client_menu)">
147 <a href="client_list.php?filter">client_texty</a></div>
148
149 <div id="client_menu" onMouseMove="show(client_menu)" onmouseout="hide(client_menu)" style="display: none; background-color: #ffffcc;">
150 &nbsp;<a Title="Zde mù¾ete zaèít pøekládat client_texty" href="client_list.php?notran">Nepøelo¾ené client_text</a><br>
151 &nbsp;<a Title="Ve¹keré pøelo¾ené client_texty" href="client_list.php?Translate">Pøelo¾ené client_text</a><br>
152 ';
153 if (Licence(0)) {
154 echo '&nbsp;<a Title="Nedokonèené client_texty" href="client_list.php?mydevelop">Rozepsané client_text</a><br>
155 &nbsp;<a Title="V¹echny client_texty, které bych mìl je¹tì oznámkovat" href="client_list.php?my">Moje client_text</a><br>
156 &nbsp;<a Title="client_texty, které jsem je¹tì neoznámkoval" href="client_list.php?notvote">Neznámkované client</a><br>';
157 }
158 echo '&nbsp;<a Title="Sestavit speciální fitr" href="client_list.php?filter">Filtr client_text ...</a><br>';
159 echo '</div>';
160
161 */
162
163 echo '<br />';
164
165 /* echo '<a Title="Pøelo¾ené quest, mù¾ete zde hlasovat, nebo opravovat Quest" href="ListQuests.php?Translate">Pøelo¾ené questy</a><br />';
166
167 if (Licence(0)) {
168 echo '<a Title="Nedokonèené questy" href="ListQuests.php?mydevelop">Rozepsané questy</a><br />
169 <a Title="Pøelo¾ené questy pøilá¹eného u¾ivatele" href="ListQuests.php?my">Moje questy</a><br />
170 <br />';
171 }
172 */
173 if (Licence(1)) {
174 echo '<a href="log.php" Title="Log dìní (Moderator only)">Log</a><br>';
175 }
176 if (Licence(2)) {
177 // echo 'Administrace:';
178 echo '<a href="priorite.php" Title="Naètení priority questù (Admin only)">Priorita</a><br />';
179 echo '<a href="fill_database.php" Title="Naètení questù do database (Admin only)">Plnìní databáse</a><br />';
180 // echo '<a href="client_files/generate_SQL.php" Title="Generování clientských souborù (Admin only)">Generování C.S.</a><br>';
181 echo '<a href="https://wow.zdechov.net/mysql/" Title="PHP my admin (Admin only)">Database</a><br>';
182 echo '<br>';
183 }
184
185
186if (Licence(0)) {
187 // echo 'Jste pøihlá¹en jako: <b>'.$_SESSION['User'].'</b> <a href="index.php?Logout">Odhlásit</a>';
188} else {
189 echo ' <br />
190 <b>Login:</b><br>
191 <form action="index.php" method="post">
192 <table>
193 <tr>
194 <td><input type="text" name="LoginUser" size="13"></td>
195 </tr>
196 <tr>
197 <td><input type="password" name="LoginPass" size="13"></td>
198 </tr>
199 <tr>
200 <th><input type="submit" value="Pøihlásit"></th>
201 </tr>
202 </table>
203 </form>
204 ';
205}
206 echo 'Online u¾ivatelé:<br />';
207 $ID = $Database->SQLCommand("SELECT user,GM,ID FROM `user` WHERE LastLogin >= Now()-300");
208 while ($Line = mysql_fetch_array($ID)) {
209 if (Licence(1))
210 $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line['user'].'</a>';
211 else
212 $Name = $Line['user'];
213
214 if ($Line['GM'] <> 0)
215 $TextGM = ' ('.$Moderators[$Line['GM']].')';
216 else
217 $TextGM = '';
218 echo '<b>'.$Name.'</b>'.$TextGM.'<br />';
219 }
220
221
222 echo '<p style=" overflow: auto; width: 100%; height: 200px;">
223 <b>Shoutbox: </b><a href="action.php?shoutbox">Vlo¾it</a>
224 <table border="1" cellpadding="1" cellspacing="0">';
225 $ID = $Database->SQLCommand("SELECT * FROM shoutbox ORDER BY ID DESC LIMIT 10");
226 while ($Line = mysql_fetch_array($ID))
227 echo '<tr><td><span style="font-size: 10"><b>'.$Line['user'].'</b>: '.$Line['text'].'</span></td></tr>';
228 echo '</table>
229
230 ';
231
232
233 echo '</td>
234 <td width="10"></td>
235 <td valign="top">
236 ';
237
238
239
240
241 function ShowFooter()
242 { // BEGIN function ShowFooter
243 global $Database;
244
245 echo '
246 </td>
247 </tr>
248 <tr>
249 <td></td>
250 <td></td>
251 <td> <span style="color: grey">Program naprogramoval maron (maron2@centrum.cz)</span>';
252if (Licence(0))
253 echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Jste pøihlá¹en jako: <b>'.$_SESSION['User'].'</b> <a href="index.php?Logout">Odhlásit</a>';
254 echo ' </td></tr>
255 </table>
256 </body>
257</html>
258';
259
260 $Database->Disconnect();
261 } // END function ShowFooter
262
263?>
Note: See TracBrowser for help on using the repository browser.