-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathload-stylesV1.php
More file actions
85 lines (64 loc) · 2.07 KB
/
Copy pathload-stylesV1.php
File metadata and controls
85 lines (64 loc) · 2.07 KB
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
75
76
77
78
79
80
81
82
83
84
85
<?php
$dir = __DIR__ . '/';
//echo $dir . "\n";
header("Etag: " . file_get_contents($dir . 'VERSION', 1));
header('Content-Type: text/css; charset=UTF-8');
$expires_offset = 31536000; // 1 year
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires_offset) . ' GMT');
header("Cache-Control: public, max-age=$expires_offset");
//print_r( $_GET );
if (!isset($_GET['load']) || $_GET['load'] == '') {
die('/* no money no load! */');
}
$load = $_GET['load'];
$load = explode(',', $load);
$dir2 = '';
$out = '';
foreach ($load as $v) {
// echo $v . "\n";
// nếu có trong thư mục mặc định của js echbaydotcom
if (is_file($dir . 'css/' . $v)) {
$out .= file_get_contents($dir . 'css/' . $v, 1);
} else if (is_file($dir . 'css/default/' . $v)) {
$out .= file_get_contents($dir . 'css/default/' . $v, 1);
} else if (is_file($dir . 'css/template/' . $v)) {
$out .= file_get_contents($dir . 'css/template/' . $v, 1);
}
// details
else if (is_file($dir . 'html/details/' . $v)) {
$out .= file_get_contents($dir . 'html/details/' . $v, 1);
} else if (is_file($dir . 'html/details/mobilemua/' . $v)) {
$out .= file_get_contents($dir . 'html/details/mobilemua/' . $v, 1);
} else if (is_file($dir . 'html/details/pcmua/' . $v)) {
$out .= file_get_contents($dir . 'html/details/pcmua/' . $v, 1);
}
// search
else if (is_file($dir . 'html/search/' . $v)) {
$out .= file_get_contents($dir . 'html/search/' . $v, 1);
}
// theme
else if (is_file($dir . 'themes/css/' . $v)) {
$out .= file_get_contents($dir . 'themes/css/' . $v, 1);
} else {
// nếu chưa có dir2 -> tìm dir2
if ($dir2 == '') {
$get_dir = $dir;
for ($i = 0; $i < 10; $i++) {
$get_dir = dirname($get_dir);
// echo $get_dir . "\n";
if (is_file($get_dir . '/' . $v)) {
$dir2 = $get_dir . '/';
break;
}
}
}
// kiểm tra lại lần nữa
// if ( $dir2 != '' ) {
$out .= file_get_contents($dir2 . $v, 1);
// }
}
}
// thay đổi lại URL ảnh cho chuẩn xác
$out = str_replace('../images-global/', 'images-global/', $out);
echo $out;
exit();