本文整理汇总了PHP中Tab::Tab方法的典型用法代码示例。如果您正苦于以下问题:PHP Tab::Tab方法的具体用法?PHP Tab::Tab怎么用?PHP Tab::Tab使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tab
的用法示例。
在下文中一共展示了Tab::Tab方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: guil
function Tab_Full_Fight_Graphs($name, $char, $start_id, $end_id, $eventtext=1, $class='') {
$data = "<div class='accordion_ajax_ajax'>
<h4><a href='linechart_google.php?log_id=".$_SESSION['log_id']."&min_id=".$start_id."&max_id=".$end_id."§ion[0]=hpprogress&cond[0][]=target_name=".$char."§ion[1]=damage&cond[1][]=target_name=".$char."§ion[2]=heal&cond[2][]=target_name=".$char."'>HP Verlauf</a></h4><div></div>
<h4><a href='linechart_google.php?log_id=".$_SESSION['log_id']."&min_id=".$start_id."&max_id=".$end_id."§ion[0]=damage&cond[0][]=target_name=".$char."'>Damage an $char</a></h4><div></div>
<h4><a href='linechart_google.php?log_id=".$_SESSION['log_id']."&min_id=".$start_id."&max_id=".$end_id."§ion[0]=damage&cond[0][]=source_name=".$char."'>Damage durch $char</a></h4><div></div>
<h4><a href='linechart_google.php?log_id=".$_SESSION['log_id']."&min_id=".$start_id."&max_id=".$end_id."§ion[0]=allhealers'>Heilung an $char</a></h4><div></div>
<h4><a href='linechart_google.php?log_id=".$_SESSION['log_id']."&min_id=".$start_id."&max_id=".$end_id."§ion[0]=heal&cond[0][]=source_name=".$char."'>Heilung durch $char</a></h4><div></div>
<h4><a href='linechart_google.php?log_id=".$_SESSION['log_id']."&min_id=".$start_id."&max_id=".$end_id."§ion[0]=threat&cond[0][]=source_name=".$char."'>Bedrohung durch $char</a></h4><div></div>
<!--h4><a href='linechart_google.php?log_id=".$_SESSION['log_id']."&min_id=".$start_id."&max_id=".$end_id."§ion[0]=threat&cond[0][]=source_name=".$char."&overall[0]=1'>Summierte Bedrohung durch $char</a></h4><div></div-->
</div>";
parent::Tab(
$name,
guil('fightprogress').' ('.guil('graphs').')',
'',
$data,
$html,
$class
);
}
示例2: unset
function Tab_Full_Fight_Stats($name, $char, $start_id, $end_id, $eventtext=1, $class='') {
global $parser, $benchmark;
$data = '';
$html = '';
$hitpoint_gain_overall=0;
$threat_gain_overall=0;
$resource_gain_overall=0;
$last_fetch = $start_id;
for($id=$start_id; $id <= $end_id; $id++) {
if($id >= $last_fetch + PARSER_MAX_FETCH) {
$last_fetch +=PARSER_MAX_FETCH;
unset($parser->loglines);
unset($parser->logdata);
$parser->read_loglines($id, $id+PARSER_MAX_FETCH);
$parser->gather_logdata();
}
$logdata = $parser->logdata[$id];
if($logdata) {
$damage_received=0;
$heal_received=0;
$damage_done=0;
$heal_done=0;
$threat_gain=0;
$resource='';
$resource_spend = 0;
$resource_restored = 0;
switch($parser->logchar2userchar[$char]['class_id']) {
case KNIGHT:
case GUARDIAN:
case SENTINEL:
$resource = 'focus';
break;
case WARRIOR:
case JUGGERNAUT:
case MARAUDER:
$resource = 'rage';
break;
case CONSULAR:
case INQUISITOR:
case SAGE:
case SORCERER:
case SHADOW:
case ASSASSIN:
$resource = 'force';
break;
case TROOPER:
case COMMANDO:
case VANGUARD:
$resource = 'ammo';
break;
case BOUNTYHUNTER:
case MERCENARY:
case POWERTECH:
$resource = 'heat';
break;
case SMUGGLER:
case IMPERIALAGENT:
case GUNSLINGER:
case SNIPER:
case SCOUNDREL:
case OPERATIVE:
$resource = 'energy';
break;
}
switch($logdata['effect_type_id']) {
case SPEND:
switch($logdata['effect_id']) {
case HITPOINT:
$damage_received = $logdata['hitpoints'];
break;
case FORCE:
case ENERGY:
case RAGE:
case AMMO:
case FOCUS:
case HEAT:
$resource_spend = $logdata['hitpoints'];
break;
}
break;
case RESTORE:
switch($logdata['effect_id']) {
case HITPOINT:
$heal_received = $logdata['hitpoints'];
break;
case FORCE:
case ENERGY:
case RAGE:
case AMMO:
case FOCUS:
case HEAT:
$resource_restored = $logdata['hitpoints'];
break;
}
break;
//.........这里部分代码省略.........
示例3: array
function Tab_Char_HpsTps_per_Ability($name, $char, $start_id, $end_id, $class='', $hidexps=0) {
global $parser;
$data = '';
$html = '';
$used_abilities = array();
$overall = array();
$last_fetch = $start_id;
for($id=$start_id; $id <= $end_id; $id++) {
if($id >= $last_fetch + PARSER_MAX_FETCH) {
$last_fetch +=PARSER_MAX_FETCH;
unset($parser->loglines);
unset($parser->logdata);
$parser->read_loglines($id, $id+PARSER_MAX_FETCH);
$parser->gather_logdata($id, $id+PARSER_MAX_FETCH);
}
$logdata = $parser->logdata[$id];
if($id == $start_id) {
$start_timestamp = $logdata['timestamp'];
} elseif ($id == $end_id) {
$end_timestamp = $logdata['timestamp'];
}
if(preg_match('/^'.$char.'(:(.+))?/', $logdata['source_name'], $matches)) {
$ability_name = $logdata['ability_name'];
if($logdata['source_type'] == 'companion') {
$ability_name = $matches[2].': '.$ability_name;
}
switch($logdata['effect_id']) {
case HEAL:
$used_abilities[$ability_name]['id'] = $logdata['ability_id'];
$used_abilities[$ability_name]['heal'] += $logdata['hitpoints'];
$used_abilities[$ability_name]['threat'] += $logdata['threat'];
$used_abilities[$ability_name]['hit'] += $logdata['hit'];
$used_abilities[$ability_name]['crit'] += $logdata['crit'];
$used_abilities[$ability_name]['count']++;
$overall['heal'] += $logdata['hitpoints'];
$overall['threat'] += $logdata['threat'];
$overall['hit'] += $logdata['hit'];
$overall['crit'] += $logdata['crit'];
$overall['count']++;
}
}
}
$duration = $end_timestamp - $start_timestamp;
if($overall['count']>0) {
$overall['overheal'] = 0;
foreach($used_abilities as $ability_name => $ability) {
// experimental!
// see crudedragos comments on http://mmo-mechanics.com/swtor/forums/Thread-Batalyser-SWTOR-Combat-Analyser
switch($ability['id']) {
// Medpacs
case "813312187039744" :
case "2176191209406464":
case "864164599824384" :
case "843162209746944" :
case "2176199799341056":
case "813316482007040" :
case "813320776974336" :
case "2628395431100416":
case "807518276157440" :
case "1143320294195200":
case "1481411529801728":
case "2176212684242944":
case "1481402939867136":
case "1481407234834432":
case "807544045961216" :
case "2176216979210240":
case "1481398644899840":
case "2471474505973760":
if($ability['threat']/$ability['heal']>0.5) {
// tank
$threatcoefficient = 0.75;
} else {
// healer, dd
$threatcoefficient = 0.50;
}
break;
// Healing Resonance
case "2785827457335296":
case "2882455631560704":
case "2772083561988096":
case "2785805982498816":
$threatcoefficient = 0.50;
break;
default:
switch($parser->logchar2userchar[$char]['class_id']) {
case MERCENARY:
case COMMANDO:
// healer
$threatcoefficient = 0.45;
break;
case SCOUNDREL:
case OPERATIVE:
// healer
$threatcoefficient = 0.45;
//.........这里部分代码省略.........
示例4: array
function Tab_Enemies_Damage_to_Char($name, $char, $start_id, $end_id, $class='', $hidexps=0) {
global $parser;
$enemies = array();
$enemies_abilities = array();
$overall = array();
$last_fetch = $start_id;
for($id=$start_id; $id <= $end_id; $id++) {
if($id >= $last_fetch + PARSER_MAX_FETCH) {
$last_fetch +=PARSER_MAX_FETCH;
unset($parser->loglines);
unset($parser->logdata);
$parser->read_loglines($id, $id+PARSER_MAX_FETCH);
$parser->gather_logdata($id, $id+PARSER_MAX_FETCH);
}
$logdata = $parser->logdata[$id];
if($id == $start_id) {
$start_timestamp = $logdata['timestamp'];
} elseif ($id == $end_id) {
$end_timestamp = $logdata['timestamp'];
}
if($logdata['target_name'] == $char) {
$enemy_name = $logdata['source_name'];
$ability_name = $logdata['ability_name'];
switch($logdata['effect_id']) {
case DAMAGE:
$enemies[$enemy_name]['attack_count']++;
$enemies[$enemy_name]['damage'] += $logdata['hitpoints'];
$enemies[$enemy_name]['threat'] += $logdata['threat'];
$enemies[$enemy_name]['hit'] += $logdata['hit'];
$enemies[$enemy_name]['crit'] += $logdata['crit'];
$enemies[$enemy_name]['miss'] += $logdata['miss'];
$enemies[$enemy_name]['dodge'] += $logdata['dodge'];
$enemies[$enemy_name]['parry'] += $logdata['parry'];
$enemies[$enemy_name]['deflect'] += $logdata['deflect'];
$enemies[$enemy_name]['immune'] += $logdata['immune'];
$enemies[$enemy_name]['resist'] += $logdata['resist'];
$overall['count']++;
$overall['damage'] += $logdata['hitpoints'];
$overall['threat'] += $logdata['threat'];
$overall['hit'] += $logdata['hit'];
$overall['crit'] += $logdata['crit'];
$overall['miss'] += $logdata['miss'];
$overall['dodge'] += $logdata['dodge'];
$overall['parry'] += $logdata['parry'];
$overall['deflect'] += $logdata['deflect'];
$overall['immune'] += $logdata['immune'];
$overall['resist'] += $logdata['resist'];
$enemies_abilities[$enemy_name][$ability_name]['count']++;
$enemies_abilities[$enemy_name][$ability_name]['damage'] += $logdata['hitpoints'];
$enemies_abilities[$enemy_name][$ability_name]['threat'] += $logdata['threat'];
$enemies_abilities[$enemy_name][$ability_name]['hit'] += $logdata['hit'];
$enemies_abilities[$enemy_name][$ability_name]['crit'] += $logdata['crit'];
$enemies_abilities[$enemy_name][$ability_name]['miss'] += $logdata['miss'];
$enemies_abilities[$enemy_name][$ability_name]['dodge'] += $logdata['dodge'];
$enemies_abilities[$enemy_name][$ability_name]['parry'] += $logdata['parry'];
$enemies_abilities[$enemy_name][$ability_name]['deflect'] += $logdata['deflect'];
$enemies_abilities[$enemy_name][$ability_name]['immune'] += $logdata['immune'];
$enemies_abilities[$enemy_name][$ability_name]['resist'] += $logdata['resist'];
break;
}
}
}
if(count($enemies) > 0) {
$html = "<p>".guil('tankstats_note1');
$html .= "</p>
<div class='accordion'>";
$_html = '';
$duration = $end_timestamp - $start_timestamp;
foreach($enemies as $enemy_name => $enemy) {
$_html .= "<h4><a href='#'>".$enemy_name." (".$enemy['damage']." ".guil('damage');
if(! $hidexps) {
$_html .= ", ".round($enemy['damage'] / $duration, 2)." DPS";
}
$_html .= ")</a></h4>
<div>
<table class='".($class?$class:'dataTable')."'>
<thead>
<tr>
<th>".guil('ability')."</th>
<th>Use</th>
<th>".guil('damage')."</th>
<th>Dmg/Use</th>";
if(! $hidexps) {
$_html .= "<th>DPS</th>";
}
// enemies generate Thread to chars, but I just don't see any sense in it
//<th>Threat</th>
//<th>Threat/Use</th>
//<th>TPS</th>
$_html .= "<th>Hit (alle)</th>
<th>Hit (-crit)</th>
<th>Crit</th>
<th>Miss</th>
//.........这里部分代码省略.........
示例5: array
function Tab_DpsHpsTps_per_Target($name, $char, $start_id, $end_id, $class='', $hidexps=0) {
global $parser;
$targets = array();
$last_fetch = $start_id;
for($id=$start_id; $id <= $end_id; $id++) {
if($id >= $last_fetch + PARSER_MAX_FETCH) {
$last_fetch +=PARSER_MAX_FETCH;
unset($parser->loglines);
unset($parser->logdata);
$parser->read_loglines($id, $id+PARSER_MAX_FETCH);
$parser->gather_logdata($id, $id+PARSER_MAX_FETCH);
}
$logdata = $parser->logdata[$id];
if($id == $start_id) {
$start_timestamp = $logdata['timestamp'];
} elseif ($id == $end_id) {
$end_timestamp = $logdata['timestamp'];
}
if(preg_match('/^'.$char.'(:.+)?/', $logdata['source_name'])) {
$target_name = $logdata['target_name'];
switch($logdata['effect_id']) {
case HEAL:
$targets[$target_name]['healed'] += $logdata['hitpoints'];
break;
case DAMAGE:
$targets[$target_name]['damage'] += $logdata['hitpoints'];
}
$targets[$target_name]['threat'] += $logdata['threat'];
$targets[$target_name]['target_type'] = $logdata['target_type'];
}
}
$data = '';
$duration = $end_timestamp - $start_timestamp;
if($duration) {
foreach($targets as $target_name => $target) {
if($target['target_type'] == 'companion') {
$target_name = preg_replace('/'.$char.':/', '', $target_name).' (Companion)';
}
if($target['damage']>0 || $target['healed']>0 || $target['threat']>0) {
switch($target['target_type']) {
case 'player':
if($target_name == $char) {
// self
$bgcolor = 'style="background-color:#ddffdd"';
} else {
// other player
$bgcolor = 'style="background-color:#ffffdd"';
}
break;
case 'companion': $bgcolor = 'style="background-color:#ddddff"'; break;
default: $bgcolor = 'style="background-color:#ffdddd"'; break;
}
$data .= "<tr>
<td ".$bgcolor.">".$target_name."</td>
<td>".$target['damage']."</td>
<td>".$target['healed']."</td>
<td>".$target['threat']."</td>";
if(!$hidexps) {
$data .= "<td>".round($target['damage'] / $duration, 2)."</td>
<td>".round($target['healed'] / $duration, 2)."</td>
<td>".round($target['threat'] / $duration, 2)."</td>";
}
$data .= "</tr>";
}
}
}
$headers = array(guil('target'), guil('damage'), guil('heal'), guil('threat'));
if(!$hidexps) {
$title = guil('xpspertarget');
$headers = array_merge($headers, array('DPS', 'HPS', 'TPS'));
} else {
$title = guil('damagehealthreatpertarget');
}
parent::Tab(
$name,
$title,
$headers,
$data,
$html,
$class
);
}
示例6: array
function Tab_Char_DpsTps_per_Ability($name, $char, $start_id, $end_id, $class='', $hidexps=0) {
global $parser;
$data = '';
$html = '';
$used_abilities = array();
$overall = array();
$last_fetch = $start_id;
for($id=$start_id; $id <= $end_id; $id++) {
if($id >= $last_fetch + PARSER_MAX_FETCH) {
$last_fetch +=PARSER_MAX_FETCH;
unset($parser->loglines);
unset($parser->logdata);
$parser->read_loglines($id, $id+PARSER_MAX_FETCH);
$parser->gather_logdata($id, $id+PARSER_MAX_FETCH);
}
$logdata = $parser->logdata[$id];
if($id == $start_id) {
$start_timestamp = $logdata['timestamp'];
} elseif ($id == $end_id) {
$end_timestamp = $logdata['timestamp'];
}
if(preg_match('/^'.$char.'(:(.+))?/', $logdata['source_name'], $matches)) {
$ability_name = $logdata['ability_name'];
if($logdata['source_type'] == 'companion') {
$ability_name = $matches[2].': '.$ability_name;
}
switch($logdata['effect_id']) {
case DAMAGE:
$used_abilities[$ability_name]['damage'] += $logdata['hitpoints'];
$used_abilities[$ability_name]['threat'] += $logdata['threat'];
$used_abilities[$ability_name]['hit'] += $logdata['hit'];
$used_abilities[$ability_name]['crit'] += $logdata['crit'];
$used_abilities[$ability_name]['miss'] += $logdata['miss'];
$used_abilities[$ability_name]['dodge'] += $logdata['dodge'];
$used_abilities[$ability_name]['parry'] += $logdata['parry'];
$used_abilities[$ability_name]['deflect'] += $logdata['deflect'];
$used_abilities[$ability_name]['immune'] += $logdata['immune'];
$used_abilities[$ability_name]['resist'] += $logdata['resist'];
$used_abilities[$ability_name]['count']++;
$overall['damage'] += $logdata['hitpoints'];
$overall['threat'] += $logdata['threat'];
$overall['hit'] += $logdata['hit'];
$overall['crit'] += $logdata['crit'];
$overall['miss'] += $logdata['miss'];
$overall['dodge'] += $logdata['dodge'];
$overall['parry'] += $logdata['parry'];
$overall['deflect'] += $logdata['deflect'];
$overall['immune'] += $logdata['immune'];
$overall['resist'] += $logdata['resist'];
$overall['count']++;
}
}
}
$duration = $end_timestamp - $start_timestamp;
if($overall['count']>0 && $duration) {
foreach($used_abilities as $ability_name => $ability) {
if($ability['damage']>0) {
$data .= "<tr>
<td>".$ability_name."</td>
<td>".$ability['count']."</td>
<td>".$ability['damage']."</td>";
if(!$hidexps) {
$data .= "<td>".round($ability['damage'] / $duration, 2)."</td>";
}
$data .= "<td>".round($ability['damage'] / $ability['count'], 2)."</td>
<td>".$ability['threat']."</td>";
if(!$hidexps) {
$data .= "<td>".round($ability['threat'] / $duration, 2)."</td>";
}
$data .= "<td>".round($ability['threat'] / $ability['count'], 2)."</td>
<td>".round($ability['threat'] / $ability['damage'], 2)."</td>
<td>".($ability['hit']+$ability['crit'])."</td>
<td>".$ability['hit']."</td>
<td>".$ability['crit']."</td>
<td>".$ability['miss']."</td>
<td>".$ability['dodge']."</td>
<td>".$ability['parry']."</td>
<td>".$ability['deflect']."</td>
<td>".$ability['resist']."</td>
<td>".$ability['immune']."</td>
<td>".round(100/$ability['count']*($ability['hit']+$ability['crit']), 2)."%</td>
<td>".round(100/$ability['count']*$ability['hit'], 2)."%</td>
<td>".round(100/$ability['count']*$ability['crit'], 2)."%</td>
<td>".round(100/$ability['count']*$ability['miss'], 2)."%</td>
<td>".round(100/$ability['count']*$ability['dodge'], 2)."%</td>
<td>".round(100/$ability['count']*$ability['parry'], 2)."%</td>
<td>".round(100/$ability['count']*$ability['deflect'], 2)."%</td>
<td>".round(100/$ability['count']*$ability['resist'], 2)."%</td>
<td>".round(100/$ability['count']*$ability['immune'], 2)."%</td>
</tr>";
}
}
$html = "<div style='border-top: 1px solid silver'>Gesamt:<table>
<tr>
<td>
//.........这里部分代码省略.........