Changeset 410 for trunk/includes/global_function.php
- Timestamp:
- Mar 31, 2010, 9:11:05 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/global_function.php
r399 r410 502 502 { 503 503 if (strpos($ArrStr[$i],"'s") > 0) 504 504 $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-2); 505 505 if (strpos($ArrStr[$i],',') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1); 506 506 if (strpos($ArrStr[$i],'.') > 0) $ArrStr[$i] = substr($ArrStr[$i],0,strlen($ArrStr[$i])-1); … … 511 511 $where .= '(`O`.`'.$Column.'` LIKE "%'.addslashes($ArrStr[$i]).'%") OR '; 512 512 $SqlOK = true; 513 513 } 514 514 } 515 515 $where = substr($where,0,strlen($where)-4); … … 519 519 // echo ($sql.'|'.$where.'|'.$groupby); 520 520 while($Line = mysql_fetch_assoc($ID)) { 521 521 $buff[] = array($Line['ID'],GetIDbyName($Table),$Line[$Column],$Line['Tran']); 522 522 } 523 523 } 524 524 } 525 525 } 526 526 return $buff; 527 527 } 528 529 function ProgressBar($Width, $Percent, $Text = '') 530 { 531 $Pixels = $Width * ($Percent / 100); 532 if($Pixels > $Width) $Pixels = $Width; 533 if($Text == '') $Text = $Percent; 534 535 return('<div class="progressbar" style="width: '.$Width.'px">'. 536 '<div class="bar" style="width: '.$Pixels.'px;"></div>'. 537 '<div class="text" style="width: '.$Width.'px">'.$Text.'</div>'. 538 '</div>'); 539 } 540 541 function GetLevelMinMax($XP) 542 { 543 $IndexLevel = 100; 544 545 if($XP > 0) $Level = floor(sqrt($XP / $IndexLevel)); 546 else $Level = 0; 547 $MinXP = $Level * $Level * $IndexLevel; 548 $MaxXP = ($Level + 1) * ($Level + 1) * $IndexLevel; 549 $MaxXP = $MaxXP - $MinXP; 550 $XP = $XP - $MinXP; 551 return(array('Level' => $Level, 'XP' => $XP, 'MaxXP' => $MaxXP)); 552 } 553 528 554 ?>
Note:
See TracChangeset
for help on using the changeset viewer.