Changeset 286 for trunk/includes/global_function.php
- Timestamp:
- Dec 22, 2009, 10:22:38 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/global_function.php
r285 r286 36 36 $Around = round($Config['Web']['VisiblePagingItems'] / 2); 37 37 $Result = ''; 38 $PageCount = ceil($TotalCount / $ItemPerPage);38 $PageCount = floor($TotalCount / $ItemPerPage) + 1; 39 39 40 40 if(!array_key_exists('Page', $_SESSION)) $_SESSION['Page'] = 0; … … 43 43 if($_SESSION['Page'] >= $PageCount) $_SESSION['Page'] = $PageCount - 1; 44 44 $CurrentPage = $_SESSION['Page']; 45 45 46 46 47 $Result .= 'Počet položek: <strong>'.$TotalCount.'</strong> Stránky: '; … … 184 185 185 186 $Result = array(); 186 $DbResult = $Database->SQLCommand('SELECT * FROM `language` ');187 $DbResult = $Database->SQLCommand('SELECT * FROM `language` WHERE `Enabled` = 1'); 187 188 while($DbRow = mysql_fetch_assoc($DbResult)) 188 189 $Result[$DbRow['Id']] = $DbRow; … … 278 279 if($Prev) echo('<a href="form.php?group='.$GroupId.'&ID='.$Next['ID'].'">Předcházející '.$Next['ID'].'</a> '); 279 280 else echo('<a href="form.php?group='.$GroupId.'&ID='.$Next['ID'].'">Následující '.$Next['ID'].'</a> '); 280 return 'form.php?group='.$GroupId.'&ID='.$Next['ID']; 281 } 282 } 283 281 return 'form.php?group='.$GroupId.'&ID='.$Next['ID']; 282 } 283 } 284 284 285 285 function HaveSameText($Group, $DbRow2, $Value) … … 334 334 function GetBuildNumber($Version) 335 335 { 336 global $Database, $BuildNumbers;337 338 if 339 { 340 $sql = 'SELECT BuildNumber FROM `wow_client_version` WHERE Version= "'.$Version.'"';336 global $Database, $BuildNumbers; 337 338 if(isset($BuildNumbers[$Version]) == false) 339 { 340 $sql = 'SELECT `BuildNumber` FROM `wow_client_version` WHERE `Version` = "'.$Version.'"'; 341 341 $DbRow = mysql_fetch_assoc($Database->SQLCommand($sql)); 342 342 $BuildNumbers[$Version] = $DbRow['BuildNumber']; … … 347 347 function GetVersionWOW($BuildNumber) 348 348 { 349 global $Database,$VersionsWOW; 350 if (isset($VersionsWOW[$BuildNumber]) == false) 351 { 352 $sql = 'SELECT Version FROM `wow_client_version` WHERE BuildNumber = "'.$BuildNumber.'"'; 349 global $Database, $VersionsWOW; 350 351 if(isset($VersionsWOW[$BuildNumber]) == false) 352 { 353 $sql = 'SELECT `Version` FROM `wow_client_version` WHERE `BuildNumber` = "'.$BuildNumber.'"'; 353 354 $Version = mysql_fetch_assoc($Database->SQLCommand($sql)); 354 355 $VersionsWOW[$BuildNumber] = $Version['Version']; 355 356 } 356 return($VersionsWOW[$BuildNumber]); 357 } 358 359 function GetDBCColumns($Version,$DBCFileName) 360 { 361 global $Database,$DBCColumns; 362 if (isset($DBCColumns[$Version][$DBCFileName]) == false) 363 { 364 $sql = 'SELECT DBCColumns_'.$DBCFileName.' as DBCColumns FROM `wow_client_version` WHERE Version = "'.$Version.'"'; 357 return($VersionsWOW[$BuildNumber]); 358 } 359 360 function GetDBCColumns($Version, $DBCFileName) 361 { 362 global $Database, $DBCColumns; 363 364 if(isset($DBCColumns[$Version][$DBCFileName]) == false) 365 { 366 $sql = 'SELECT `DBCColumns_'.$DBCFileName.'` AS `DBCColumns` FROM `wow_client_version` WHERE `Version` = "'.$Version.'"'; 365 367 $DbRow = mysql_fetch_assoc($Database->SQLCommand($sql)); 366 368 $DBCColumns[$Version][$DBCFileName] = $DbRow['DBCColumns']; 367 369 } 368 return($DBCColumns[$Version][$DBCFileName]); 369 } 370 371 function GetDBCColumnIndex($Version,$DBCFileName,$Column) 372 { 373 global $Database,$DBCColumnIndex; 374 if (isset($DBCColumnIndex[$Version][$DBCFileName][$Column]) == false) 375 { 376 $sql = 'SELECT '.$DBCFileName.'_'.$Column.' as DBCColumns FROM `wow_client_version` WHERE Version = "'.$Version.'"'; 370 return($DBCColumns[$Version][$DBCFileName]); 371 } 372 373 function GetDBCColumnIndex($Version, $DBCFileName, $Column) 374 { 375 global $Database, $DBCColumnIndex; 376 377 if(isset($DBCColumnIndex[$Version][$DBCFileName][$Column]) == false) 378 { 379 $sql = 'SELECT `'.$DBCFileName.'_'.$Column.'` AS `DBCColumns` FROM `wow_client_version` WHERE `Version` = "'.$Version.'"'; 377 380 $DbRow = mysql_fetch_assoc($Database->SQLCommand($sql)); 378 381 $DBCColumnIndex[$Version][$DBCFileName][$Column] = $DbRow['DBCColumns']; 379 382 } 380 return($DBCColumnIndex[$Version][$DBCFileName][$Column]); 383 return($DBCColumnIndex[$Version][$DBCFileName][$Column]); 384 } 385 386 function LoadGroupIdParameter() 387 { 388 global $TranslationTree; 389 390 if(array_key_exists('group', $_GET)) $GroupId = $_GET['group'] * 1; 391 else $GroupId = 1; 392 393 if(isset($TranslationTree[$GroupId]) == false) 394 { 395 echo('Překladová skupina dle zadaného Id neexistuje.'); 396 ShowFooter(); 397 die(); 398 } 399 return($GroupId); 400 } 401 402 function LoadLanguageIdParameter() 403 { 404 global $LanguageList; 405 406 if(array_key_exists('language', $_GET)) $LanguageId = $_GET['language'] * 1; 407 else $LanguageId = 1; 408 409 if(isset($LanguageList[$LanguageId]) == false) 410 { 411 echo('Jazyk dle zadaného Id neexistuje.'); 412 ShowFooter(); 413 die(); 414 } 415 return($LanguageId); 381 416 } 382 417
Note:
See TracChangeset
for help on using the changeset viewer.