-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.php
53 lines (39 loc) · 1.63 KB
/
config.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
<?
// Put down all configs in the file.
$PERMITTED_LANG = array("zh-hk","en","fr","de","da","th","es","jp","kr");
function is_permitted_lang($test_lang) {
global $PERMITTED_LANG;
return in_array($test_lang, $PERMITTED_LANG);
}
$HAS_ABOUT_LANG = array("zh-hk","en","de","jp");
function has_about_lang($test_lang) {
global $HAS_ABOUT_LANG;
return in_array($test_lang, $HAS_ABOUT_LANG);
}
$IMAGE_URL_PREFIX = 'https://dfg63nb4d89j7.cloudfront.net/';
$IMAGE_ZH_JSON = generate_image_json($IMAGE_URL_PREFIX, "zh-hk", 28);
$IMAGE_EN_JSON = generate_image_json($IMAGE_URL_PREFIX, "en", 28);
$IMAGE_FR_JSON = generate_image_json($IMAGE_URL_PREFIX, "fr", 28);
$IMAGE_DE_JSON = generate_image_json($IMAGE_URL_PREFIX, "de", 28);
$IMAGE_DA_JSON = generate_image_json($IMAGE_URL_PREFIX, "da", 28);
$IMAGE_TH_JSON = generate_image_json($IMAGE_URL_PREFIX, "th", 28);
$IMAGE_ES_JSON = generate_image_json($IMAGE_URL_PREFIX, "es", 28);
$IMAGE_JP_JSON = generate_image_json($IMAGE_URL_PREFIX, "jp", 28);
$IMAGE_KR_JSON = generate_image_json($IMAGE_URL_PREFIX, "kr", 28);
function generate_image_json ($prefix_url, $lang ,$count) {
if (isset($result_json))
$result_json .= '[';
else
$result_json = '[';
for ($i = 1; $i<=$count; $i++) {
$result_json .= '{';
$result_json .= '"src":"'.$prefix_url.$lang.'/md/'.$i.'.png",';
$result_json .= '"thumb":"'.$prefix_url.$lang.'/sm/'.$i.'.png",';
$result_json .= '"mobileSrc":"'.$prefix_url.$lang.'/sm/'.$i.'.png"';
$result_json .= '}';
if ($i != $count) {$result_json .= ',';}
}
$result_json .= ']';
return $result_json;
}
?>