Esempio n. 1
0
function getAwardsByPID($PID)
{
    $PlayerAwards = array();
    # grab all badges
    # $PlayerAwards[$awd]
    # $PlayerAwards[$awd][$level]
    # $PlayerAwards[$awd][$level]['earned']
    # $PlayerAwards[$awd][$level]['first']
    $PlayerAwards = array();
    #get badges
    $count = getBadgeCount();
    for ($i = 0; $i < $count; $i++) {
        $AWD = trim(getBadge($i));
        for ($LEVEL = 0; $LEVEL < 4; $LEVEL++) {
            $award = getAwardByPID_and_AWD($PID, $AWD, $LEVEL);
            $PlayerAwards[$i][$LEVEL][AWD] = isset($AWD) ? $AWD : 0;
            $PlayerAwards[$i][$LEVEL][LEVEL] = $LEVEL;
            $PlayerAwards[$i][$LEVEL][EARNED] = isset($award[0]['earned']) ? $award[0]['earned'] : 0;
            $PlayerAwards[$i][$LEVEL][FIRST] = isset($award[0]['first']) ? $award[0]['first'] : 0;
            $PlayerAwards[$i][$LEVEL][NAME] = getBadgeByID($AWD);
        }
    }
    #append next after those
    #get Medals
    $oldcount = $count;
    $count = $oldcount + getMedalCount();
    for ($i = $oldcount; $i < $count; $i++) {
        $AWD = trim(getMedal($i - $oldcount));
        $LEVEL = 0;
        // levels!
        $award = getAwardByPID_and_AWD_NOLEVEL($PID, $AWD);
        $PlayerAwards[$i][$LEVEL][AWD] = isset($AWD) ? $AWD : 0;
        $PlayerAwards[$i][$LEVEL][LEVEL] = isset($award[0]['level']) ? $award[0]['level'] : 0;
        $PlayerAwards[$i][$LEVEL][EARNED] = isset($award[0]['earned']) ? $award[0]['earned'] : 0;
        $PlayerAwards[$i][$LEVEL][FIRST] = isset($award[0]['first']) ? $award[0]['first'] : 0;
        $PlayerAwards[$i][$LEVEL][NAME] = getMedalByID($AWD);
    }
    #append next after those
    #get Ribbons
    $oldcount = $count;
    $count = $oldcount + getRibbonCount();
    for ($i = $oldcount; $i < $count; $i++) {
        $AWD = trim(getRibbon($i - $oldcount));
        $LEVEL = 0;
        // levels!
        $award = getAwardByPID_and_AWD_NOLEVEL($PID, $AWD);
        $PlayerAwards[$i][$LEVEL][AWD] = isset($AWD) ? $AWD : 0;
        $PlayerAwards[$i][$LEVEL][LEVEL] = isset($award[0]['level']) ? $award[0]['level'] : 0;
        $PlayerAwards[$i][$LEVEL][EARNED] = isset($award[0]['earned']) ? $award[0]['earned'] : 0;
        $PlayerAwards[$i][$LEVEL][FIRST] = isset($award[0]['first']) ? $award[0]['first'] : 0;
        $PlayerAwards[$i][$LEVEL][NAME] = getRibbonByID($AWD);
    }
    #append next after those
    #get SFbadges
    $oldcount = $count;
    $count = $oldcount + getSFBadgeCount();
    for ($i = $oldcount; $i < $count; $i++) {
        $AWD = trim(getSFBadge($i - $oldcount));
        for ($LEVEL = 0; $LEVEL < 4; $LEVEL++) {
            $award = getAwardByPID_and_AWD($PID, $AWD, $LEVEL);
            $PlayerAwards[$i][$LEVEL][AWD] = isset($AWD) ? $AWD : 0;
            $PlayerAwards[$i][$LEVEL][LEVEL] = $LEVEL;
            $PlayerAwards[$i][$LEVEL][EARNED] = isset($award[0]['earned']) ? $award[0]['earned'] : 0;
            $PlayerAwards[$i][$LEVEL][FIRST] = isset($award[0]['first']) ? $award[0]['first'] : 0;
            $PlayerAwards[$i][$LEVEL][NAME] = getSFBadgeByID($AWD);
        }
    }
    #append next after those
    #get SFRibbons
    $oldcount = $count;
    $count = $oldcount + getSFRibbonCount();
    for ($i = $oldcount; $i < $count; $i++) {
        $AWD = trim(getSFRibbon($i - $oldcount));
        $LEVEL = 0;
        // levels!
        $award = getAwardByPID_and_AWD_NOLEVEL($PID, $AWD);
        $PlayerAwards[$i][$LEVEL][AWD] = isset($AWD) ? $AWD : 0;
        $PlayerAwards[$i][$LEVEL][LEVEL] = isset($award[0]['level']) ? $award[0]['level'] : 0;
        $PlayerAwards[$i][$LEVEL][EARNED] = isset($award[0]['earned']) ? $award[0]['earned'] : 0;
        $PlayerAwards[$i][$LEVEL][FIRST] = isset($award[0]['first']) ? $award[0]['first'] : 0;
        $PlayerAwards[$i][$LEVEL][NAME] = getSFRibbonByID($AWD);
    }
    return $PlayerAwards;
}
Esempio n. 2
0
    } else {
        $template .= 'right';
    }
    $template .= '"><p><img src="' . $ROOT . 'spacer.gif" style="background: url(\'' . $ROOT . 'game-images/awards/perspective/' . $PlayerAwards[$i][$awardlevel][AWD] . '_' . $awardlevel . '.jpg\');" width="128" height="128" alt="" />
		
		<strong>' . $PlayerAwards[$i][$awardlevel][NAME] . '</strong></p><ul>
		
		<li><strong>Basic</strong>' . earned($PlayerAwards[$i][1][EARNED]) . '</li>
		<li><strong>Veteran</strong>' . earned($PlayerAwards[$i][2][EARNED]) . '</li>
		<li><strong>Expert</strong>' . earned($PlayerAwards[$i][3][EARNED]) . '</li></ul></div></div>';
}
$template .= '</tr>
		<tr><td>Medals</td>
			<td class="awards-row extra-space">		';
$oldcount = $count;
$awdcount = getMedalCount();
$count = $oldcount + $awdcount;
for ($i = $oldcount; $i < $count; $i++) {
    $template .= '
		<div class="award-inline" onMouseOver="show_mine(this);" onMouseOut="hide_mine(this);">
		<img src="' . $ROOT . 'spacer.gif" style="background: url(\'' . $ROOT . 'game-images/awards/';
    if ($PlayerAwards[$i][0][LEVEL] > 0) {
        $template .= 'front/' . $PlayerAwards[$i][0][AWD];
    } else {
        $template .= 'locked/' . $PlayerAwards[$i][0][AWD];
    }
    $template .= '.png\');" width="42" height="42" alt="" />
		<div class="award-pop dir-';
    if ($i - $oldcount < $awdcount / 2) {
        $template .= 'left';
    } else {