corrade-http-templates – Diff between revs 2 and 12
?pathlinks?
Rev 2 | Rev 12 | |||
---|---|---|---|---|
Line 11... | Line 11... | |||
11 | |
11 | |
|
12 | ########################################################################### |
12 | ########################################################################### |
|
13 | ## CONFIGURATION ## |
13 | ## CONFIGURATION ## |
|
Line 14... | Line 14... | |||
14 | ########################################################################### |
14 | ########################################################################### |
|
15 | |
15 | |
|
- | 16 | # The configuration file for this script containing the settings. |
||
Line 16... | Line 17... | |||
16 | // The configuration file for this script containing the settings. |
17 | require_once("config.php"); |
|
17 | include_once("config.php"); |
18 | require_once('functions.php'); |
|
18 | |
19 | |
|
Line 19... | Line -... | |||
19 | ########################################################################### |
- | ||
20 | ## INTERNALS ## |
- | ||
21 | ########################################################################### |
- | ||
22 | |
- | ||
23 | ########################################################################### |
- | ||
24 | ## Copyright (C) Wizardry and Steamworks 2015 - License: GNU GPLv3 ## |
- | ||
25 | ########################################################################### |
- | ||
26 | function wasKeyValueGet($key, $data) { |
- | ||
27 | return array_reduce( |
- | ||
28 | explode( |
- | ||
29 | "&", |
- | ||
30 | $data |
- | ||
31 | ), |
- | ||
32 | function($o, $p) { |
- | ||
33 | $x = explode("=", $p); |
- | ||
34 | return array_shift($x) != $o ? $o : array_shift($x); |
- | ||
35 | }, |
- | ||
36 | $key |
- | ||
37 | ); |
- | ||
38 | } |
- | ||
39 | |
- | ||
40 | ########################################################################### |
- | ||
41 | ## Copyright (C) Wizardry and Steamworks 2015 - License: GNU GPLv3 ## |
- | ||
42 | ########################################################################### |
- | ||
43 | function mapValueToRange($value, $xMin, $xMax, $yMin, $yMax) { |
- | ||
44 | return $yMin + ( |
- | ||
45 | ( |
- | ||
46 | $yMax - $yMin |
- | ||
47 | ) |
- | ||
48 | * |
- | ||
49 | ( |
- | ||
50 | $value - $xMin |
- | ||
51 | ) |
- | ||
52 | / |
- | ||
53 | ( |
- | ||
54 | $xMax - $xMin |
- | ||
55 | ) |
20 | ########################################################################### |
|
56 | ); |
21 | ## INTERNALS ## |
|
57 | } |
22 | ########################################################################### |
|
58 | |
23 | |
|
59 | #### |
24 | #### |