-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdetect.php
executable file
·74 lines (70 loc) · 1.37 KB
/
detect.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
$isDSi = false;
$width = "320";
$height1 = "215";
$height2 = "240";
if(strpos($_SERVER["HTTP_USER_AGENT"], "Nintendo DSi") !== false){
$width = "240";
$height1 = "176";
$height2 = "176";
$isDSi = true;
} else {
$width = "320";
}
$cbp = (78.125 / 100) * intval($width);
$cbp1 = strval($cbp);
if(!(isset($noXtraDetect))){
echo "<style>
body {
font-size: 10px !important;
}
</style>
<script>setTimeout(\"document.body.scrollTop = " . $height1 . ";\", 4000);</script>";
}
if(count(get_included_files()) == 1 && count(get_required_files()) == 1){
echo "Top screen: ". $width . "x" . $height1 . ", bottom screen: " . $width . "x" . $height2;
}
?>
<?php
// Totally not stolen from Triniate...
function eregi($input, $check)
{
return strpos(strtolower($check), strtolower($input));
}
// This is a secondary detect system script, used for Venmite
function detect_system()
{
$user_agent = $_SERVER['HTTP_USER_AGENT'];
if(eregi('Nintendo 3DS', $_SERVER['HTTP_USER_AGENT']))
{
if(eregi('New', $_SERVER['HTTP_USER_AGENT']))
{
return 'new3ds';
}
return '3ds';
}
else if(eregi('mobile', $_SERVER['HTTP_USER_AGENT']))
{
return '3ds';
}
else
{
return 'wiiu';
}
if(true)
{
}
elseif(eregi('Nintendo DSi', $_SERVER['HTTP_USER_AGENT']))
{
return 'dsi';
}
elseif(eregi('Nintendo WiiU', $_SERVER['HTTP_USER_AGENT']))
{
return 'wiiu';
}
else
{
return 'pc';
}
}
?>