Changeset 67
- Timestamp:
- Feb 5, 2009, 11:12:54 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Options.php
r63 r67 1 1 <?php 2 2 include('includes/global.php'); 3 4 ShowPage(); 3 5 4 6 if(Licence(LICENCE_USER)) -
trunk/TranslationList.php
r64 r67 2 2 3 3 include('includes/global.php'); 4 5 ShowPage(); 4 6 5 7 $TranslationItemPerPage = 200; -
trunk/action.php
r63 r67 2 2 3 3 include('includes/global.php'); 4 5 ShowPage(); 4 6 5 7 if(array_key_exists('group', $_GET)) $GroupId = $_GET['group']; else $GroupId = 1; … … 50 52 $Database->SQLCommand('UPDATE '.$Table.' SET Complete = 0 WHERE ID = '.$TextID); 51 53 echo('Překlad byl vrácen k opravě!'); 52 WriteLog('Překlad byl vrácen k opravě ˝<a href="form.php?group='.$GroupID.'&ID='.$TextID.'">'.$TextID.'</a>', 4);54 WriteLog('Překlad byl vrácen k opravě <a href="form.php?group='.$GroupID.'&ID='.$TextID.'">'.$TextID.'</a>', 4); 53 55 } 54 56 -
trunk/banners.php
r60 r67 2 2 3 3 include('includes/global.php'); 4 5 ShowPage(); 4 6 5 7 $ID = $Database->SQLCommand("SELECT * FROM `banner` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH)"); -
trunk/banners/banner.php
r55 r67 1 1 <?php 2 2 3 include('../includes/config.php'); 4 include('../includes/databaseconection.php'); 5 6 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']); 7 $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']); 8 $Database->SelectDatabase($Config['Database']['Database']); 3 include('../includes/global.php'); 9 4 10 5 header('Content-Type: image/png'); -
trunk/dictionary.php
r65 r67 1 1 <?php 2 2 3 session_start(); 4 5 // SQL injection hack protection 6 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($_POST[$Index]); 7 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($_GET[$Index]); 8 9 include('includes/config.php'); 10 include('includes/databaseconection.php'); 11 12 //připojení do databáze 13 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']); 14 $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']); 15 $Database->SelectDatabase($Config['Database']['Database']); 16 17 function Licence($Licence) 18 { 19 global $Database; 20 21 if(isset($_SESSION['User']) and $_SESSION['User'] <> '') 22 { 23 $User = $_SESSION['User']; 24 $Line = mysql_fetch_assoc($Database->SQLCommand("SELECT sha1('".$_SESSION['Pass']."') as pass;")); 25 $Pass = $Line['pass']; 26 27 $Line = mysql_fetch_assoc($Database->SQLCommand("SELECT * FROM user WHERE LOWER(user) = LOWER('$User')")); 28 if(!$Line) 29 { 30 return false; 31 } else 32 { 33 if($Licence == 1) 34 { 35 if($Line['gm'] == 1) 36 { 37 return true; 38 } else return false; 39 } 40 if($Line['pass'] == $Pass) 41 { 42 43 // zapsání poslení použité IP 44 // $Addres = $_SERVER['REMOTE_ADDR']; 45 // $Database->SQLCommand("UPDATE user SET LastLogin = now(), LastIP = '$Addres' WHERE user = '$User'"); 46 47 return True; 48 } else { return False; 49 // die('Nemáte zde přístup, přihlate se: <a href="'.$Config['Web']['BaseURL'].'">zde</a>'); 50 } 51 } 52 } else { return False; 53 // die('Nemáte zde přístup, přihlate se: <a href="'.$Config['Web']['BaseURL'].'">zde</a>'); 54 } 55 } 3 include('includes/global.php'); 56 4 57 5 echo('<?xml version="1.0" encoding="'.$Config['Web']['Charset'].'"?> -
trunk/download.php
r63 r67 12 12 include('addon/make.php'); 13 13 14 ShowPage(); 15 14 16 function CheckBox($Name, $Checked = false) 15 17 { … … 41 43 $ExportSetting = unserialize($_SESSION['ExportSetting']); 42 44 } 45 if(!isset($ExportSetting)) $ExportSetting = array('Diacritics' => 1, 'language-cz' => 1, 46 'language-sk' => 0, 'language-other' => 0, 'users-selection' => array(), 'users-order' => ''); 43 47 if(!array_key_exists('users-selection', $ExportSetting)) $ExportSetting['users-selection'] = array(); 44 48 -
trunk/fill_database.php
r64 r67 3 3 include('includes/global.php'); 4 4 include('dbc/dbc.php'); 5 6 ShowPage(); 5 7 6 8 echo('Načítání textů z databáze MaNGOSu: '); -
trunk/form.php
r54 r67 2 2 3 3 include('includes/global.php'); 4 5 ShowPage(); 4 6 5 7 if(array_key_exists('group', $_GET)) $GroupId = $_GET['group']; else $GroupId = 1; -
trunk/img_statistic.php
r57 r67 1 1 <?php 2 2 3 session_start(); 4 include('includes/config.php'); 5 include('includes/databaseconection.php'); 6 include('includes/global_function.php'); 7 8 // SQL injection hack protection 9 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($_POST[$Index]); 10 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($_GET[$Index]); 11 12 // Open database connection 13 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']); 14 $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']); 15 $Database->SelectDatabase($Config['Database']['Database']); 3 include('includes/global.php'); 16 4 17 5 $FontFile = 'images/FRIZQT__.ttf'; -
trunk/includes/config.sample.php
r61 r67 19 19 'ShowSQLError' => false, 20 20 'ShowPHPError' => false, 21 'ItemsPerPage' => 50, 21 22 ), 22 23 ); -
trunk/includes/global.php
r65 r67 135 135 function ShowPage() 136 136 { 137 global $Config, $Database ;137 global $Config, $Database, $RSSChannels; 138 138 139 139 echo('<?xml version="1.0" encoding="'.$Config['Web']['Charset'].'"?> … … 144 144 <link rel="stylesheet" href="'.$Config['Web']['BaseURL'].'style/style.css" type="text/css" media="all" /> 145 145 <script type="text/javascript" src="'.$Config['Web']['BaseURL'].'style/global.js"></script> 146 <link rel="SHORTCUT ICON" href="'.$Config['Web']['BaseURL'].'images/favicon.ico" /> 147 <title>Projekt překládání textů WoW</title> 146 <link rel="SHORTCUT ICON" href="'.$Config['Web']['BaseURL'].'images/favicon.ico" />'); 147 if(isset($RSSChannels)) 148 foreach($RSSChannels as $Channel) 149 echo(' <link rel="alternate" title="'.$Channel['Title'].'" href="'.$Channel['URL'].'" type="application/rss+xml">'); 150 echo('<title>Projekt překládání textů WoW</title> 148 151 </head> 149 152 <body>'); … … 197 200 } 198 201 199 ShowPage();200 201 202 function ShowFooter() 202 203 { -
trunk/includes/global_function.php
r65 r67 16 16 //$return = StrToLower($return); // velká písmena nahradí malými. 17 17 return($return); 18 } 19 20 function ListPaging($Address, $Table, $Where, $ItemsPerPage, $CurrentPage) 21 { 22 global $Database; 23 24 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM '.$Table.' '.$Where)); 25 $ItemCount = floor($Line[0] / $ItemsPerPage); 26 27 echo('Počet položek: <strong>'.$Line[0].'</strong> Zobrazit stránku: '); 28 29 if($CurrentPage > $ItemCount) $CurrentPage = ($ItemCount / $ItemsPerPage) - 1; 30 for($Page = 1; $Page <= $ItemCount; $Page++) 31 { 32 if($CurrentPage == $Page) echo('<strong>'.$Page.'</strong> '); 33 else echo('<a href="'.$Address.$Page.'">'.$Page.'</a> '); 34 } 35 echo('<br />'); 18 36 } 19 37 … … 116 134 ( 117 135 // index, indexname , barva , popis 118 array('0', 'Download CZWoW', 'brown', 'Stáhnutí CZWoW souboru'), 119 array('1', 'Questy', 'green', 'Operace s questy'), 120 array('2', 'Download SQL', 'brown', 'Stáhnutí Sql souboru'), 136 array('1', 'Překlady', 'green', 'Operace s překladdy'), 137 array('2', 'Stažení', 'brown', 'Stáhnutí souboru'), 121 138 array('3', 'Uživatelé', 'blue', 'Přihlášení uživatelů, nastavení, registrace'), 122 139 array('4', 'Moderátor', 'red', 'Přihlášení uživatelů'), 123 array('5', 'Hlasování', 'yellowgreen', 'Přihlášení uživatelů'),124 array('6', 'Npc_text', 'tomato', 'Operace s NPC_texty'),125 array('7', 'Page_text', 'aqua', 'Operace s page_texty'),126 array('8', 'Client_text', 'black', 'Operace s clien_texty'),127 140 ); 128 141 -
trunk/index.php
r63 r67 3 3 include('includes/global.php'); 4 4 5 ShowPage(); 6 5 7 $Banner = '<a href="'.$Config['Web']['BaseURL'].'"> 6 8 <img src="banners/baner_468_60.jpg" -
trunk/info.php
r63 r67 2 2 3 3 include('includes/global.php'); 4 5 ShowPage(); 4 6 5 7 echo('<h2>Informace k překladu hry:</h2> -
trunk/log.php
r49 r67 2 2 3 3 include('includes/global.php'); 4 include('rss.php'); 5 6 if(array_key_exists('rss', $_GET)) 7 { 8 $Items = array(); 9 if(array_key_exists('type', $_GET)) $Where = ' WHERE type = "'.$_GET['type'].'"'; 10 else $Where = ''; 11 $sql = 'SELECT *,UNIX_TIMESTAMP(date), (SELECT user.user FROM user WHERE user.id = log.user) as user FROM log'.$Where.' ORDER BY date DESC LIMIT 100'; 12 $ID = $Database->SQLCommand($sql); 13 while($Line = mysql_fetch_assoc($ID)) 14 { 15 $Items[] = array 16 ( 17 'Title' => $LogTypes[$Line['type']][1], 18 'Link' => $Config['Web']['BaseURL'].'log.php', 19 'Description' => $Line['text'].' ('.$Line['user'].', '.$Line['IP'].')', 20 'Time' => $Line['UNIX_TIMESTAMP(date)'], 21 ); 22 } 23 24 echo(GenerateRSS(array 25 ( 26 'Title' => 'WoWpřeklad', 27 'Link' => $Config['Web']['BaseURL'], 28 'Description' => 'Překlad textů WoW', 29 'WebmasterEmail' => $Config['Web']['AdminEmail'], 30 'Items' => $Items, 31 ))); 32 } else 33 { 34 if(array_key_exists('type', $_GET)) $Type = '&type='.$_GET['type']; 35 else $Type = ''; 4 36 5 echo('<b>Filtr: </b>'); 6 echo('<a href="log.php" title="Bez filtrování"><span style="color:black">Všechny</span></a> '); 7 foreach($LogTypes as $Index => $LogItem) 8 { 9 echo('<a href="log.php?type='.$LogItem[0].'" title="'.$LogItem[3].'"><span style="color:'.$LogItem[2].'">'.$LogItem[1].'</span></a> '); 37 $RSSChannels = array(array('Title' => 'Záznamy změn', 'URL' => 'log.php?rss'.$Type)); 38 ShowPage(); 39 40 if(array_key_exists('Page', $_GET)) $_SESSION['Page'] = $_GET['Page']; 41 else if(!array_key_exists('Page', $_SESSION)) $_SESSION['Page'] = 1; 42 43 echo('<b>Filtr: </b>'); 44 echo('<a href="log.php" title="Bez filtrování"><span style="color:black">Všechny</span></a> '); 45 foreach($LogTypes as $Index => $LogItem) 46 { 47 echo('<a href="log.php?type='.$LogItem[0].'" title="'.$LogItem[3].'"><span style="color:'.$LogItem[2].'">'.$LogItem[1].'</span></a> '); 48 } 49 50 // echo ' Formát: datum: text zprávy (uživatel, IP)<br /><br />'; 51 echo('<br /><br />'); 52 53 if(array_key_exists('type', $_GET)) $Where = ' WHERE type = "'.$_GET['type'].'"'; 54 else $Where = ''; 55 $sql = 'SELECT *,(SELECT user.user FROM user WHERE user.id = log.user) as user FROM log '.$Where.'ORDER BY date DESC LIMIT '.($_SESSION['Page'] - 1) * $Config['Web']['ItemsPerPage'].','.$Config['Web']['ItemsPerPage']; 56 57 ListPaging('?Page=', 'log', $Where, $Config['Web']['ItemsPerPage'], $_SESSION['Page']); 58 $ID = $Database->SQLCommand($sql); 59 while($Line = mysql_fetch_assoc($ID)) 60 { 61 foreach($LogTypes as $Index => $LogItem) 62 { 63 if($Line['type'] == $LogItem[0]) $color = $LogItem[2]; 64 } 65 echo($Line['date'].': <span style="color:'.$color.'">'.$Line['text'].'</span> ('.$Line['user'].', '.$Line['IP'].')<br />'); 66 } 67 //ListPaging('?Page=', 'log', $Where, $Config['Web']['ItemsPerPage'], $_SESSION['Page']); 68 69 ShowFooter(); 10 70 } 11 71 12 // echo ' Formát: datum: text zprávy (uživatel, IP)<br /><br />';13 echo('<br /><br />');14 15 if(array_key_exists('type', $_GET))16 {17 $sql = "SELECT *,(SELECT user.user FROM user WHERE user.id = log.user) as user18 FROM log WHERE type = '".$_GET['type']."' ORDER BY date DESC LIMIT 100";19 // if ($_GET['type'] == $LogItem[0]) { }20 } else $sql = "SELECT *,(SELECT user.user FROM user WHERE user.id = log.user) as user FROM log ORDER BY date DESC LIMIT 100";21 22 $ID = $Database->SQLCommand($sql);23 while($Line = mysql_fetch_array($ID))24 {25 foreach($LogTypes as $Index => $LogItem)26 {27 if($Line['type'] == $LogItem[0]) $color = $LogItem[2];28 }29 echo($Line['date'].': <span style="color:'.$color.'">'.$Line['text'].'</span> ('.$Line['user'].', '.$Line['IP'].')<br />');30 }31 32 ShowFooter();33 34 72 ?> -
trunk/registrace.php
r65 r67 2 2 3 3 include('includes/global.php'); 4 5 ShowPage(); 4 6 5 7 if(array_key_exists('user', $_POST)) -
trunk/save.php
r66 r67 2 2 3 3 include('includes/global.php'); 4 5 ShowPage(); 4 6 5 7 // Ochrana proti neoprávněnému přístupu -
trunk/statistic.php
r57 r67 2 2 3 3 include('includes/global.php'); 4 5 ShowPage(); 4 6 5 7 echo('<strong>Statistika:</strong><br />'); -
trunk/user.php
r49 r67 2 2 3 3 include('includes/global.php'); 4 5 ShowPage(); 4 6 5 7 if(array_key_exists('text', $_POST) and Licence(LICENCE_ADMIN)) -
trunk/userlist.php
r57 r67 3 3 include('includes/global.php'); 4 4 5 $ItemsPerPage = 50; 6 7 function WritePages($Address, $Table, $Where, $ItemsPerPage, $CurrentPage) 8 { 9 global $Database; 10 11 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM '.$Table.' '.$Where)); 12 $ItemCount = floor($Line[0] / $ItemsPerPage); 13 14 echo('Počet položek: <strong>'.$Line[0].'</strong> Zobrazit stránku: '); 15 16 if($CurrentPage > $ItemCount) $CurrentPage = ($ItemCount / $ItemsPerPage) - 1; 17 for($Page = 1; $Page <= $ItemCount; $Page++) 18 { 19 if($CurrentPage == $Page) echo('<strong>'.$Page.'</strong> '); 20 else echo('<a href="'.$Address.$Page.'">'.$Page.'</a> '); 21 } 22 } 5 ShowPage(); 23 6 24 7 echo('<strong>Seznam uživatelů:</strong><br />'); … … 29 12 if(array_key_exists('Desc', $_GET)) $_SESSION['Desc'] = $_GET['Desc']; 30 13 else if(!array_key_exists('Desc', $_SESSION)) $_SESSION['Desc'] = ''; 31 WritePages('?Page=', 'user', '', $ItemsPerPage, $_SESSION['Page']);14 ListPaging('?Page=', 'user', '', $Config['Web']['ItemsPerPage'], $_SESSION['Page']); 32 15 33 16 echo('<table class="BaseTable">'); … … 63 46 if($Group['TablePrefix'] != '') 64 47 $Query .= '(SELECT count(Vote) AS Vote FROM `'.$Group['TablePrefix'].'` WHERE (User = user.ID) AND (Complete = 1) AND (Language <> 0)) + '; 65 $Query .= '0) AS Vote FROM `user` ORDER BY '.$order.' '.$desc.' LIMIT '.($_SESSION['Page'] - 1) * $ ItemsPerPage.','.$ItemsPerPage;48 $Query .= '0) AS Vote FROM `user` ORDER BY '.$order.' '.$desc.' LIMIT '.($_SESSION['Page'] - 1) * $Config['Web']['ItemsPerPage'].','.$Config['Web']['ItemsPerPage']; 66 49 $ID = $Database->SQLCommand($Query); 67 50 while($Line = mysql_fetch_array($ID)) … … 78 61 } 79 62 echo('</table>'); 80 WritePages('?Page=', 'user', '', $ItemsPerPage, $_SESSION['Page']);63 ListPaging('?Page=', 'user', '', $Config['Web']['ItemsPerPage'], $_SESSION['Page']); 81 64 82 65 ShowFooter();
Note:
See TracChangeset
for help on using the changeset viewer.