AlaK4X
Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64



Your IP : 3.129.211.190


Current Path : /var/www/lhjmq-records.qc.ca/public_html/xsl/records/booknew/cms/includes/
Upload File :
Current File : /var/www/lhjmq-records.qc.ca/public_html/xsl/records/booknew/cms/includes/functions.php.bak

<?php

function display_message($message_key)
{
	if (isset($_SESSION['message'][$message_key])) echo $_SESSION['message'][$message_key];
}

function display_post($post_key)
{
	if (isset($_SESSION['post'][$post_key])) echo $_SESSION['post'][$post_key];
}

function is_empty($string)
{
	$string = trim($string);
	return (empty($string)) ? true : false;
}

function check_login($username, $password)
{
	
	if ($username == 'ddemers@lhjmq.qc.ca' && $password=="123456"){
		return true;
	}
	
	return false;
	
}

function search_player($player)
{
	include('results.php');
	return json_encode($results);
}

function is_logged()
{
	if (!isset($_SESSION['user']))
	{
		header('location: login.php');
		exit();
	}
}


function get_tgi_player_id($ls_player_id){	
	global $db;
	
	//$ls_player_id = mysql_fetch_assoc(mysql_query($sql='SELECT id_personnel,info_lname,info_fname FROM register_v3 WHERE LSRegisterLink = "'.$ls_player_id.'" ', $mysql_link));
	$sql='SELECT id_personnel,info_lname,info_fname FROM register_v3 WHERE LSRegisterLink = "'.$ls_player_id.'" ';
	$ls_player_id = $db->query($sql,'');
	
	return $ls_player_id;
}



function get_tgi_player_media($ls_player_id){	
	global $db;
		
	$sql='SELECT LSRegisterLink, media_type, media_selected, media FROM register_data WHERE LSRegisterLink = "'.$ls_player_id.'" ';
	$ls_player_id = $db->query($sql,'');
	
	return $ls_player_id;
}


function get_player_info($ls_player_id){
	
	
	//echo "http://cluster.leaguestat.com/feed/?feed=modulekit&view=player&key=e5ca48e3db8a3e9b&fmt=json&client_code=lhjmq&lang=en&person_id=".$ls_player_id."&category=media";
	
	$player_media = json_decode(file_get_contents("http://cluster.leaguestat.com/feed/?feed=modulekit&view=player&key=e5ca48e3db8a3e9b&fmt=json&client_code=lhjmq&lang=en&person_id=".$ls_player_id."&category=media"), true);
	
	
	//$player_info = $player_media['SiteKit']['Player'];
	
	$player_media_images = $player_media['SiteKit']['Player'];
	
	if ($player_media_images['error'] == 'no such person/player found'){
		$player_image_url = '';
	}
	else
	{	
		foreach($player_media_images as &$image){	
			if ($image['height'] == '141'){
				//echo $image['height'].'<hr>';
				$player_image_url[] = $image['url'];
			
			}
		}	
	}
	
	return $player_image_url;
	
}


function get_player_image62x62($player_id){
	
	$player_media = json_decode(file_get_contents("http://cluster.leaguestat.com/feed/?feed=modulekit&view=player&key=c680916776709578&fmt=json&client_code=lhjmq&lang=en&person_id=".$player_id."&category=media"), true);
	$player_media_images = $player_media['SiteKit']['Player'];
	if ($player_media_images['error'] == 'no such person/player found'){
		$player_image_url = '';
	}
	else
	{	
		foreach($player_media_images as &$image){	
			if ($image['height'] == '62'){
				//echo $image['height'].'<hr>';
				$player_image_url = $image['url'];
				break;
			}
		}	
	}
	
	return $player_image_url;
	
}




function get_player_image141($ls_player_image){
	
	if ($ls_player_image != ''){

			$filename = file_get_contents($ls_player_image);
			//header("Content-type: image/jpeg");
			echo $filename;
			
	}
	else
	{		
			$link = 'http://'.$_SERVER['HTTP_HOST'].'/images/records_no_images.jpg';
			$filename = file_get_contents($link);
			//header("Content-type: image/jpeg");
			echo  $filename;	
	}		
	
	
	
}