示例#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
        $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][FIRST]) . '</li>
		<li>Last awarded: ' . earned($PlayerAwards[$i][0][EARNED]) . '</li>
		<li>Total awards: ' . $PlayerAwards[$i][0][LEVEL] . '</li></ul></div></div>';
}
$template .= '</tr>

		<tr><td>Ribbons</td>
			<td class="awards-row extra-space">';
$oldcount = $count;
$awdcount = getRibbonCount();
$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 {