Пример #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;
}
Пример #2
0
    } else {
        $template .= 'right';
    }
    $template .= '"><p><img src="' . $ROOT . 'spacer.gif" style="background: url(\'' . $ROOT . 'game-images/awards/perspective/' . $PlayerAwards[$i][0][AWD] . '.jpg\');" width="128" height="128" alt="" />
		
		<strong>' . $PlayerAwards[$i][0][NAME] . '</strong></p><ul>
		<li>First received: ' . earned($PlayerAwards[$i][0][EARNED]) . '</li></ul></div></div>';
}
$template .= '
		
		
				<tr><td>SF Badges<br />&amp; Medals</td>

			<td class="awards-row">';
$oldcount = $count;
$awdcount = getSFBadgeCount();
$count = $oldcount + $awdcount;
for ($i = $oldcount; $i < $count; $i++) {
    $awardlevel = getBadgeLevel($PlayerAwards[$i]);
    if ($i - $oldcount < 10) {
        $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 ($awardlevel > 0) {
            $template .= 'front/' . $PlayerAwards[$i][$awardlevel][AWD] . '_' . $awardlevel;
        } else {
            $template .= 'locked/' . $PlayerAwards[$i][$awardlevel][AWD] . '_0';
        }
        $template .= '.png\');" width="42" height="42" alt="" />
		<div class="award-pop dir-';
        if ($i - $oldcount < $awdcount / 2) {