コード例 #1
0
ファイル: awards.inc.php プロジェクト: Alwnikrotikz/bf2stats
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
ファイル: sl_verify.php プロジェクト: realfluid/umbaugh
	* 	http://www.securelive.net/Information/product-terms-of-use.html									*
	* 																									*
	* 	If you are a SecureLive customer and this program causes problems or does not meet your needs,	*
	* 	contact support@securelive.net or call 888-300-4546 for assistance.								*
	****************************************************************************************************/
	
	#FOR SERVER EDITION

	define("MOD_PATH", ".");
	define("IMG_PATH", MOD_PATH."/images");
	
	if(!isset($_GET['mode']) || $_GET['mode'] == 'ajax'){
		define("IMG_PATH", "images");
		$isIE7 = (bool)(strpos($_SERVER['HTTP_USER_AGENT'], "MSIE 7") !== false);
		$popup_div = false;
		$badge = getBadge(null, $popup_div, $isIE7);
		echo "	<HTML>
					<head>
						".getJS($popup_div)."
					</head>
					<body style='background: #D00000;'>
						
					</body>
				</HTML>";
	}
	
	if(!class_exists('adminFuncs')){
		class adminFuncs{
			public $connected;
			public $config_fp;
			public function sl_get_path(){
コード例 #3
0
ファイル: securepress.php プロジェクト: realfluid/umbaugh
function sl_widget($args){
    extract($args);
    $options = explode('#sl#', get_option('sl_badge_widget'));
    $base_url = plugins_url() . '/' . dirname(plugin_basename(__FILE__)) . '/';

    #Get $params
    {
	    $arr = array('sl_badge_series','sl_badge_type','sl_badge_color','sl_position','custom_pad_top','custom_pad_right','custom_pad_left','custom_pad_bottom','custom_margin_top','custom_margin_right','custom_margin_left','custom_margin_bottom','custom_position','custom_zindex','sl_popup','moduleclass_sfx');
	    $params = new ParamWrapper();
	    for($i=0;$i<count($arr);$i++){
			$params->set($arr[$i],$options[$i]);
	    }
	}
    
	$isIE7 = (bool)(strpos($_SERVER['HTTP_USER_AGENT'], "MSIE 7") !== false);
	$popup_div = false;
	$badge = getBadge($params, $popup_div, $isIE7);

	echo $before_widget;
	echo getJS($popup_div);
	echo $badge;
	echo $after_widget;
}