Changeset 7
- Timestamp:
- May 9, 2008, 7:24:45 AM (17 years ago)
- Location:
- branches/2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2/frontend.php
r6 r7 32 32 } 33 33 34 function Login() 35 { 36 37 return($this->System->Modules['User']->Login($_POST['Username'], $_POST['Password'])); 38 } 39 40 function Logout() 41 { 42 43 return($this->System->Modules['User']->Logout()); 44 } 45 34 46 function TranslationGroupEdit($TranslationGroupId) 35 47 { 36 $Output = '<strong>Překlad textů:</strong><br /><table id="TranslationItem">';48 $Output = '<strong>Překlad textů:</strong><br /><table class="TranslationTable">'; 37 49 foreach($this->System->Modules['Translation']->GetTextList($TranslationGroupId) as $GroupItem) 38 50 { … … 69 81 function Menu() 70 82 { 71 $Output = '<strong>Menu:</strong><br /><a href="?Action=MangosImport">Import z MaNGOSu</a><br /><br />'; 83 $Output = '<strong>Menu:</strong><br />'. 84 '<a href="?">Uvodní stránka</a><br />'. 85 '<a href="?Action=TranslationGroupList">Seznam skupin</a><br />'. 86 '<a href="?Action=MangosImport">Import z MaNGOSu</a><br />'. 87 '<br />'; 72 88 return($Output); 73 89 } 90 91 function User() 92 { 93 $Output = 'Uživatel: '.$this->System->Modules['User']->User['Name'].' '; 94 if($this->System->Modules['User']->User['Id'] == 0) $Output .= '<a href="?Action=LoginDialog">Přihlásit</a>'; 95 else $Output .= '<a href="?Action=Logout">Odhlásit</a>'; 96 97 return($Output.'<br />'); 98 } 99 74 100 75 101 function Output() … … 79 105 switch($_GET['Action']) 80 106 { 107 case 'LoginDialog': 108 $Output = $this->LoginDialog(); 109 break; 110 case 'Login': 111 $Output = $this->Login(); 112 break; 113 case 'Logout': 114 $Output = $this->Logout(); 115 break; 81 116 case 'TranslationGroupEdit': 82 117 $Output = $this->TranslationGroupEdit($_GET['GroupId']); … … 85 120 $Output = $this->TextGroupList($_GET['GroupId']); 86 121 break; 122 case 'TranslationGroupList': 123 $Output = $this->TranslationGroupList(); 124 break; 87 125 case 'MangosImport': 88 126 $Output = $this->System->Modules['MangosImport']->FullImport(); 89 127 break; 90 128 } 91 else $Output = $this->Menu().$this->LoginDialog().'<br />'.$this->TranslationGroupList().'</div>';92 return($this->Header(). $Output.''.$this->Footer());129 else $Output = ''; 130 return($this->Header().'<table class="MainLayout"><tr><td id="LeftPanel">'.$this->User().$this->Menu().'</td><td>'.$Output.'</td></tr></table>'.$this->Footer()); 93 131 } 94 132 } -
branches/2/style.css
r6 r7 1 table 1 .TranslationTable 2 2 { 3 3 border-width: 1px; … … 5 5 border-color: black; 6 6 border-spacing: 0px; 7 text-align: center; 7 8 } 8 9 9 table td10 .TranslationTable td 10 11 { 11 12 border-width: 1px; 12 13 border-style: solid; 13 14 border-color: black; 15 width: 40%; 14 16 } 15 17 16 table th18 .TranslationTable th 17 19 { 18 20 border-width: 1px; 19 21 border-style: solid; 20 22 border-color: black; 21 } 22 23 #TranslationItem 24 { 25 _width: 600px; 26 text-align: center; 27 28 } 29 30 #TranslationItem td 31 { 32 _height: 100px; 33 width: 40%; 34 } 35 36 #TranslationItem th 37 { 38 width: 20%; 23 width: 15%; 39 24 } 40 25 … … 45 30 top: 0; 46 31 } 32 33 .MainLayout 34 { 35 border: 0; 36 width: 100%; 37 } 38 39 .MainLayout td 40 { 41 vertical-align: top; 42 } 43 44 .MainLayout #LeftPanel 45 { 46 width: 200px; 47 } -
branches/2/user.php
r5 r7 27 27 { 28 28 // Refresh time of last access 29 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('Time' => time()));30 } else $this->Database->insert('UserOnline', array('SessionId' => $SID, 'User' => 0, 'Time' => time(), 'IpAddress' => (gethostbyaddr(GetRemoteAddress()).' '.GetRemoteAddress())));29 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('Time' => 'NOW()')); 30 } else $this->Database->insert('UserOnline', array('SessionId' => $SID, 'User' => 0, 'Time' => 'NOW()', 'IpAddress' => (gethostbyaddr(GetRemoteAddress()).' '.GetRemoteAddress()))); 31 31 32 32 // Odeber neaktivní uživatele 33 $this->Database->delete('UserOnline', 'Time < '.(time() - USER_TIMEOUT));33 $this->Database->delete('UserOnline', 'Time < DATE_SUB(NOW(), INTERVAL '.USER_TIMEOUT.' SECOND)'); 34 34 35 35 // Zkontroluj přihlášení … … 39 39 { 40 40 $Query = $this->Database->select('User', '*', "Id='".$Row['User']."'"); 41 $ User = $Query->fetch_array();41 $this->User = $Query->fetch_array(); 42 42 $Result = USER_LOGGED; 43 43 } else { 44 $ User = array('FullName' => 'Návštěvník', 'Id' => 0, 'Name' => 'Anonym');44 $this->User = array('FullName' => 'Návštěvník', 'Id' => 0, 'Name' => 'Anonym'); 45 45 $Result = USER_NOT_LOGGED; 46 46 } … … 71 71 // Je uživatel registrován? 72 72 $Query = $this->Database->select('User', '*', 'Name="'.$Nick.'"'); 73 if($Query->num_rows ()> 0)73 if($Query->num_rows > 0) 74 74 { 75 75 $Row = $Query->fetch_array(); … … 89 89 { 90 90 $SID = session_id(); 91 $this->Database->update('User sOnline', 'SessionId="'.$SID.'"', array('User' => 0));91 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('User' => 0)); 92 92 return(USER_LOGGED_OUT); 93 93 }
Note:
See TracChangeset
for help on using the changeset viewer.