- Timestamp:
- Jan 27, 2014, 10:01:33 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Forum/Forum.php
r762 r765 130 130 $Output .= '</div>'.$PageList['Output']; 131 131 return($Output); 132 133 return($Output);134 132 } 135 133 … … 177 175 $Output .= $PageList['Output']; 178 176 $Output .= '<div class="shoutbox">'; 179 $DbResult = $this->System->Database->query('SELECT * FROM `ForumText` WHERE `Thread` = '.$_GET['Thread'].' '.$SearchQuery.' ORDER BY `ID` DESC '.$PageList['SQLLimit']); 177 $DbResult = $this->System->Database->query('SELECT * FROM `ForumText` WHERE `Thread` = '. 178 $_GET['Thread'].' '.$SearchQuery.' ORDER BY `ID` DESC '.$PageList['SQLLimit']); 180 179 while($Line = $DbResult->fetch_assoc()) { 181 180 if ($this->System->User->Id == $Line['User']) 182 181 $edit = '<a href="?Edit='.$Line['ID'].'">editovat</a>'; 183 182 else $edit = ''; 184 $Output .= '<div><span style="float:right;">'.$edit.' ('.HumanDate($Line['Date']).')</span><strong>'.$Line['UserName'].'</strong>: '.str_replace("\n", '<br />',$parser->qparse($Line['Text'])).' </div> '; 183 $Output .= '<div><span style="float:right;">'.$edit.' ('.HumanDate($Line['Date']). 184 ')</span><strong>'.$Line['UserName'].'</strong>: '.str_replace("\n", '<br />',$parser->qparse($Line['Text'])).' </div> '; 185 185 } 186 186 $Output .= '</div>'.$PageList['Output']; … … 269 269 function ShowRSS() 270 270 { 271 $parser = new HTML_BBCodeParser2(array('filters' => array('Basic','Extended','Images','Links','Lists','Email'))); 272 273 $Items = array(); 271 274 $TitleLength = 50; 272 275 mb_internal_encoding('utf-8'); 273 $DbResult = $this->Database->query('SELECT UNIX_TIMESTAMP(`Date`) AS `UnixDate`, `User`, `UserName`, `Text`, ( SELECT `Text` FROM `ForumThread` WHERE `ID` = `ForumText`.`Thread`) as `Thread` FROM `ForumText` ORDER BY `ID` DESC LIMIT 20'); 276 $DbResult = $this->Database->query('SELECT `ID`, UNIX_TIMESTAMP(`Date`) AS `UnixDate`, '. 277 '`User`, `UserName`, `Text`, ( SELECT `Text` FROM `ForumThread` '. 278 'WHERE `ID` = `ForumText`.`Thread`) AS `Thread` FROM `ForumText` ORDER BY `ID` DESC LIMIT 20'); 274 279 while($DbRow = $DbResult->fetch_assoc()) 275 280 { … … 278 283 $Items[] = array 279 284 ( 280 281 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/'),282 'Description' => $DbRow['Text'],283 285 'Title' => $DbRow['Thread'].' - '.$DbRow['UserName'].': ', 286 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/forum/?Thread='.$DbRow['ID']), 287 'Description' => $parser->qparse($DbRow['Text']), 288 'Time' => $DbRow['UnixDate'], 284 289 ); 285 290 } 286 291 $Output = GenerateRSS(array 287 288 'Title' => 'WoW překlad - Fórum',289 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/'),290 'Description' => 'Překlad textů WoW',291 292 293 294 292 ( 293 'Title' => $this->System->Config['Web']['Title'].' - '.T('Forum'), 294 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/forum/'), 295 'Description' => $this->System->Config['Web']['Description'], 296 'WebmasterEmail' => $this->System->Config['Web']['AdminEmail'], 297 'Items' => $Items, 298 )); 299 return($Output); 295 300 } 296 301 } -
trunk/Modules/Log/Log.php
r636 r765 22 22 $this->System->RegisterPage('log.php', 'PageLog'); 23 23 $this->System->ModuleManager->Modules['Error']->OnError[] = array($this, 'DoAddItem'); 24 $this->System->ModuleManager->Modules['News']->RegisterRSS(array('Title' => 'Záznamy',24 $this->System->ModuleManager->Modules['News']->RegisterRSS(array('Title' => T('Logs'), 25 25 'Channel' => 'log', 'Callback' => array('PageLog', 'ShowRSS'), 'Permission' => LICENCE_ADMIN)); 26 26 } … … 103 103 $Output .= GenerateRSS(array 104 104 ( 105 'Title' => $this->System->Config['Web']['Title'] ,105 'Title' => $this->System->Config['Web']['Title'].' - '.T('Logs'), 106 106 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/'), 107 'Description' => $this->System->Config['Web'][' Title'],107 'Description' => $this->System->Config['Web']['Description'], 108 108 'WebmasterEmail' => $this->System->Config['Web']['AdminEmail'], 109 109 'Items' => $Items, -
trunk/Modules/News/News.php
r637 r765 22 22 $this->System->RegisterPage('news', 'PageNews'); 23 23 $this->System->RegisterPage('rss', 'PageRSS'); 24 $this->RegisterRSS(array('Title' => T(' System changes'), 'Channel' => 'news',24 $this->RegisterRSS(array('Title' => T('News'), 'Channel' => 'news', 25 25 'Callback' => array('PageNews', 'ShowRSS'), 'Permission' => LICENCE_ANONYMOUS)); 26 26 } … … 127 127 function ShowRSS() 128 128 { 129 $DbResult = $this->Database->query('SELECT UNIX_TIMESTAMP(`News`.`Time`) AS `UnixTime`, '. 130 '`News`.`Title`, `News`.`Time`, `User`.`Name`, `News`.`Text` '. 131 'FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10'); 132 while($DbRow = $DbResult->fetch_assoc()) 133 { 134 $Items[] = array 129 $Items = array(); 130 $DbResult = $this->Database->query('SELECT UNIX_TIMESTAMP(`News`.`Time`) AS `UnixTime`, '. 131 '`News`.`Title`, `News`.`Time`, `User`.`Name`, `News`.`Text` '. 132 'FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10'); 133 while($DbRow = $DbResult->fetch_assoc()) 134 { 135 $Items[] = array 136 ( 137 'Title' => $DbRow['Title'], 138 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/news/'), 139 'Description' => $DbRow['Text'].' ('.$DbRow['Name'].')', 140 'Time' => $DbRow['UnixTime'], 141 ); 142 } 143 $Output = GenerateRSS(array 135 144 ( 136 'Title' => $DbRow['Title'], 137 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/'), 138 'Description' => $DbRow['Text'].' ('.$DbRow['Name'].')', 139 'Time' => $DbRow['UnixTime'], 140 ); 141 } 142 $Output = GenerateRSS(array 143 ( 144 'Title' => 'WoW překlad - '.T('System changes'), 145 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/'), 146 'Description' => 'Překlad textů WoW', 147 'WebmasterEmail' => $this->System->Config['Web']['AdminEmail'], 148 'Items' => $Items, 149 )); 150 return($Output); 145 'Title' => $this->System->Config['Web']['Title'].' - '.T('System changes'), 146 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/news/'), 147 'Description' => $this->System->Config['Web']['Description'], 148 'WebmasterEmail' => $this->System->Config['Web']['AdminEmail'], 149 'Items' => $Items, 150 )); 151 return($Output); 151 152 } 152 153 } -
trunk/Modules/ShoutBox/ShoutBox.php
r637 r765 18 18 $this->System->RegisterPage('shoutbox', 'PageShoutBox'); 19 19 $this->System->ModuleManager->Modules['News']->RegisterRSS(array( 20 'Title' => 'Kecátko', 'Channel' => 'shoutbox', 'Callback' => array('PageShoutBox', 'ShowRSS'),20 'Title' => T('Shoutbox'), 'Channel' => 'shoutbox', 'Callback' => array('PageShoutBox', 'ShowRSS'), 21 21 'Permission' => LICENCE_ANONYMOUS)); 22 22 if(array_key_exists('Search', $this->System->ModuleManager->Modules)) … … 138 138 function ShowRSS() 139 139 { 140 $Items = array(); 140 141 $TitleLength = 50; 141 142 mb_internal_encoding('utf-8'); … … 148 149 ( 149 150 'Title' => $DbRow['UserName'].': '.$Title, 150 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/ '),151 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/shoutbox/'), 151 152 'Description' => $DbRow['Text'], 152 153 'Time' => $DbRow['UnixDate'], … … 154 155 } 155 156 $Output = GenerateRSS(array 156 157 'Title' => 'WoW překlad - Shoutbox',158 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/'),159 'Description' => 'Překlad textů WoW',160 161 162 163 157 ( 158 'Title' => $this->System->Config['Web']['Title'].' - '.T('Shoutbox'), 159 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/shoutbox/'), 160 'Description' => $this->System->Config['Web']['Description'], 161 'WebmasterEmail' => $this->System->Config['Web']['AdminEmail'], 162 'Items' => $Items, 163 )); 164 return($Output); 164 165 } 165 166 } -
trunk/Modules/Translation/Translation.php
r725 r765 29 29 $this->System->RegisterPage('progress', 'PageProgress'); 30 30 $this->System->RegisterPage('TranslationList.php', 'PageTranslationList'); 31 $this->System->ModuleManager->Modules['News']->RegisterRSS(array('Title' => 'Poslední překlady',31 $this->System->ModuleManager->Modules['News']->RegisterRSS(array('Title' => T('Last translations'), 32 32 'Channel' => 'translation', 'Callback' => array($this, 'ShowRSS'), 'Permission' => LICENCE_ANONYMOUS)); 33 33 $this->System->RegisterMenuItem(array( … … 59 59 function ShowRSS() 60 60 { 61 $Items = array(); 61 62 $DbResult = $this->Database->query('SELECT UNIX_TIMESTAMP(`Date`) AS `Date`, `User`.`Name` AS `UserName`, `Text` FROM `Log` '. 62 63 'JOIN `User` ON `User`.`ID` = `Log`.`User` WHERE `Type` = 1 ORDER BY `Date` DESC LIMIT 100'); … … 65 66 $Items[] = array 66 67 ( 67 68 69 70 68 'Title' => strip_tags($DbRow['Text'].' ('.$DbRow['UserName'].')'), 69 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/'), 70 'Description' => $DbRow['Text'], 71 'Time' => $DbRow['Date'], 71 72 ); 72 73 } 73 74 $Output = GenerateRSS(array 74 75 'Title' => 'WoW překlad - Poslední překlady',76 77 'Description' => 'Překlad textů WoW',78 79 80 75 ( 76 'Title' => $this->System->Config['Web']['Title'].' - '.T('Last translations'), 77 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/'), 78 'Description' => $this->System->Config['Web']['Description'], 79 'WebmasterEmail' => $this->System->Config['Web']['AdminEmail'], 80 'Items' => $Items, 81 )); 81 82 return($Output); 82 83 } -
trunk/Modules/User/User.php
r725 r765 227 227 'User' => null, 'LoginTime' => 'NOW()', 'ActivityTime' => 'NOW()', 228 228 'IpAddress' => GetRemoteAddress(), 'HostName' => gethostbyaddr(GetRemoteAddress()), 229 'ScriptName' => $_SERVER[' PHP_SELF']));229 'ScriptName' => $_SERVER['REQUEST_URI'])); 230 230 231 231 // Logged permanently? -
trunk/admin/install.php
r620 r765 58 58 '<tr><td>Relativní URL cesta:</td><td> <input type="text" name="BaseURL" value="'.$Config['Web']['BaseURL'].'"/></td></tr>'. 59 59 '<tr><td>Titulek webu:</td><td> <input type="text" name="Title" value="'.$Config['Web']['Title'].'"/></td></tr>'. 60 '<tr><td>Popis webu:</td><td> <input type="text" name="Description" value="'.$Config['Web']['Description'].'"/></td></tr>'. 60 61 '<tr><td>Email správce:</td><td> <input type="text" name="AdminEmail" value="'.$Config['Web']['AdminEmail'].'"/></td></tr>'. 61 62 '<tr><td>Počet položek navigace stránkování:</td><td> <input type="text" name="VisiblePagingItems" value="'.$Config['Web']['VisiblePagingItems'].'"/></td></tr>'. … … 79 80 if(array_key_exists('Schema', $_POST)) $Config['Database']['Database'] = $_POST['Schema']; 80 81 if(array_key_exists('Title', $_POST)) $Config['Web']['Title'] = $_POST['Title']; 82 if(array_key_exists('Description', $_POST)) $Config['Web']['Description'] = $_POST['Description']; 81 83 if(array_key_exists('BaseURL', $_POST)) $Config['Web']['BaseURL'] = $_POST['BaseURL']; 82 84 if(array_key_exists('AdminEmail', $_POST)) $Config['Web']['AdminEmail'] = $_POST['AdminEmail']; … … 109 111 'Web' => array( 110 112 'Title' => '".$Config['Web']['Title']."', 113 'Description' => '".$Config['Web']['Description']."', 111 114 'Charset' => 'utf-8', 112 115 'Host' => 'localhost', -
trunk/includes/Database.php
r709 r765 2 2 3 3 // Extended database class 4 // Date: 2011-11-25 5 4 // Date: 2014-01-27 6 5 7 6 class DatabaseResult … … 170 169 { 171 170 return($this->PDO->quote($Text)); 171 } 172 173 function __sleep() 174 { 175 return array('LastQuery'); 176 } 177 178 function __wakeup() 179 { 172 180 } 173 181 } -
trunk/includes/Page.php
r639 r765 31 31 var $Table; 32 32 var $Definition; 33 var $ItemActions; 33 34 34 35 function __construct($System) … … 37 38 $this->Table = ''; 38 39 $this->Definition = array(); 40 $this->ItemActions = array( 41 array('Name' => T('View'), 'URL' => '?action=view&id=#Id'), 42 array('Name' => T('Delete'), 'URL' => '?action=remove&id=#Id'), 43 ); 39 44 } 40 45 … … 46 51 if($_GET['action'] == 'add') $Output .= $this->AddItem(); 47 52 else if($_GET['action'] == 'view') $Output .= $this->ViewItem(); 53 else if($_GET['action'] == 'edit') $Output .= $this->ModifyItem(); 48 54 else if($_GET['action'] == 'remove') $Output .= $this->RemoveItem(); 49 55 else if($_GET['action'] == 'delete') $Output .= $this->DeleteItem(); … … 55 61 function ViewItem() 56 62 { 57 $Output = ''; 58 return($Output); 63 $DbResult = $this->Database->query('SELECT * FROM ('.$this->TableSQL.') AS `T` WHERE `Id`='.$_GET['id']); 64 if($DbResult->num_rows > 0) 65 { 66 $DbRow = $DbResult->fetch_assoc(); 67 68 $Output = T('Item'). 69 '<table>'; 70 foreach($this->Definition as $DefIndex => $Def) 71 { 72 $Output .= '<tr><td>'.$Def['Title'].':</td><td>'.$this->ViewControl($Def['Type'], $DefIndex, $DbRow[$DefIndex]).'</tr>'; 73 } 74 $Output .= '<tr>'. 75 '</table>'; 76 } else $Output = ShowMessage(T('Item not found'), MESSAGE_CRITICAL); 77 $Output .= '<a href="?action=add">'.T('Add').'</a> '; 78 $Output .= '<a href="?action=edit&id='.$_GET['id'].'">'.T('Edit').'</a> '; 79 $Output .= '<a href="?action=delete&id='.$_GET['id'].'">'.T('Add').'</a> '; 80 $Output .= '<a href="?">'.T('List').'</a><br/>'; 81 return($Output); 59 82 } 60 83 … … 69 92 $TableColumns = array(); 70 93 foreach($this->Definition as $Index => $Def) 71 $TableColumns[] = array('Name' => $Index, 'Title' => $Def['Title']); 94 if($Def['InList']) 95 $TableColumns[] = array('Name' => $Index, 'Title' => $Def['Title']); 96 if(count($this->ItemActions) > 0) 97 $TableColumns[] = array('Name' => '', 'Title' => 'Akce'); 72 98 73 99 $Order = GetOrderTableHeader($TableColumns, 'Name', 0); … … 79 105 $Output .= '<tr>'; 80 106 foreach($this->Definition as $Index => $Def) 107 if($Def['InList']) 81 108 { 82 109 if($Def['Type'] == 'URL') $Output .= '<td><a href="'.$Item[$Index].'">'.$Item[$Index].'</a></td>'; 83 110 else $Output .= '<td>'.$Item[$Index].'</td>'; 84 111 } 112 if(count($this->ItemActions) > 0) 113 { 114 $Output .= '<td>'; 115 foreach($this->ItemActions as $Index => $Action) 116 { 117 $URL = $Action['URL']; 118 if(strpos($URL, '#Id')) $URL = str_replace('#Id', $Item['Id'], $URL); 119 $Output .= '<a href="'.$URL.'">'.$Action['Name'].'</a> '; 120 } 121 $Output .= '</td>'; 122 } 85 123 $Output .= '</tr>'; 86 124 } 87 $Output .= '</table>'; 125 $Output .= '</table>'; 126 $Output .= '<a href="?action=add">'.T('Add').'</a><br/>'; 88 127 return($Output); 89 128 } … … 105 144 } else 106 145 { 107 $Output .= '<form action="?action=add&finish=1" method="post">'.108 '<fieldset><legend>'.T('New item').'</legend>'.109 '<table>';110 foreach($this->Definition as $DefIndex => $Def)111 {112 $Output .= '<tr><td>'.$Def['Title'].'</td><td>'.$this->GetControl($Def['Type'], $DefIndex).'</tr>';113 }114 $Output .= '<tr><td colspan="2"><input type="submit" value="'.T('Add').'" /></td></tr>'.115 '</table>'.116 '</fieldset>'.117 '</form>';146 $Output .= '<form action="?action=add&finish=1" method="post">'. 147 '<fieldset><legend>'.T('New item').'</legend>'. 148 '<table>'; 149 foreach($this->Definition as $DefIndex => $Def) 150 { 151 $Output .= '<tr><td>'.$Def['Title'].':</td><td>'.$this->GetControl($Def['Type'], $DefIndex, '').'</tr>'; 152 } 153 $Output .= '<tr><td colspan="2"><input type="submit" value="'.T('Add').'" /></td></tr>'. 154 '</table>'. 155 '</fieldset>'. 156 '</form>'; 118 157 } 119 158 } else $Output .= ShowMessage(T('Access denied'), MESSAGE_CRITICAL); 120 159 return($Output); 121 } 122 160 } 123 161 124 162 function DeleteItem() … … 132 170 } 133 171 134 function GetControl($Type, $Name )172 function GetControl($Type, $Name, $Value) 135 173 { 136 if($Type == 'Text') $Output = '<input type="text" name="'.$Name.'" />';174 if($Type == 'Text') $Output = '<input type="text" name="'.$Name.'" value="'.$Value.'"/>'; 137 175 else if($Type == 'Boolean') $Output = '<input type="checkbox" name="'.$Name.'"/>'; 138 else $Output = '<input type="text" name="'.$Name.'"/>'; 176 else $Output = '<input type="text" name="'.$Name.'" value="'.$Value.'"/>'; 177 return($Output); 178 } 179 180 function ViewControl($Type, $Name, $Value) 181 { 182 if($Type == 'Text') $Output = $Value; 183 else if($Type == 'URL') $Output = '<a href="'.$Value.'">'.$Value.'</a>'; 184 else if($Type == 'Boolean') $Output = $Value; 185 else $Output = $Value; 186 return($Output); 139 187 } 140 188 } -
trunk/includes/Version.php
r764 r765 6 6 // and system will need database update. 7 7 8 $Revision = 76 4; // Subversion revision8 $Revision = 766; // Subversion revision 9 9 $DatabaseRevision = 748; // Database structure revision 10 $ReleaseTime = '2014-01-2 6';10 $ReleaseTime = '2014-01-27'; -
trunk/includes/system.php
r748 r765 389 389 '<meta http-equiv="content-type" content="application/xhtml+xml; charset='.$this->System->Config['Web']['Charset'].'" />'. 390 390 '<meta name="keywords" content="wow, quest, questy, questů, preklad, mangos, překlad, překládání, přeložený, přeložení, čeština, world of warcraft, open source, free, addon" />'. 391 '<meta name="description" content="'.$this->System->Config['Web'][' Title'].'" />'.391 '<meta name="description" content="'.$this->System->Config['Web']['Description'].'" />'. 392 392 '<meta name="robots" content="all" />'. 393 393 '<link rel="stylesheet" href="'.$this->System->Link('/style/style.css').'" type="text/css" media="all" />'.
Note:
See TracChangeset
for help on using the changeset viewer.