-
Notifications
You must be signed in to change notification settings - Fork 4
/
functions.php
41 lines (39 loc) · 1.21 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
function minecraftcache($username) {
global $mcuuid;
if (!isset($mcuuid[$username])) {
$data = json_decode(file_get_contents("https://api.mojang.com/users/profiles/minecraft/$username"));
$uuid = $data->id;
$data = '$mcuuid[\''.$username.'\'] = "'. $uuid .'";';
if (!file_exists("query/cron/cache/minecraft.php")) {
file_put_contents("query/cron/cache/minecraft.php", "<?php\n".$data."\n", FILE_APPEND);
} else {
file_put_contents("query/cron/cache/minecraft.php", $data . "\n", FILE_APPEND);
}
return $uuid;
} else {
return $mcuuid[$username];
}
}
function convertos($Os)
{
$Opers = array(
'l' => 'Linux',
'w' => 'Windows',
'm' => 'Mac'
);
return $Opers[$Os];
}
function get_title($url){
$str = file_get_contents($url);
if(strlen($str)>0){
$str = trim(preg_replace('/\s+/', ' ', $str)); // supports line breaks inside <title>
preg_match("/\<title\>(.*)\<\/title\>/i",$str,$title); // ignore case
return $title[1];
}
}
function convertcsgomapname($mapname)
{
include ('html/type/csgo/maplist.php');
return $mapname['CsgoMapName'][$mapname];
}