1 | <?php |
---|
2 | // current subversion revision |
---|
3 | if (file_exists('cache/svnrev.php')) |
---|
4 | { |
---|
5 | include('cache/svnrev.php'); |
---|
6 | } |
---|
7 | else |
---|
8 | { |
---|
9 | $svn_rev = '386'; |
---|
10 | } |
---|
11 | define('SVN_REV', $svn_rev); |
---|
12 | |
---|
13 | // current version: major.minor.sub |
---|
14 | // unpair numbers for minor = development version |
---|
15 | define('KB_VERSION', '2.0.0 RC1'); |
---|
16 | define('KB_RELEASE', '(Apocrypha)'); |
---|
17 | |
---|
18 | // set the running-server for id-syncs here |
---|
19 | define('KB_SYNCURL', 'http://sync.eve-dev.net/?a=sync_server'); |
---|
20 | |
---|
21 | // add new corporations here once you've added the logo to img/corps/ |
---|
22 | $corp_npc = array('Guristas', 'Serpentis Corporation', 'Sansha\'s Nation', 'CONCORD', |
---|
23 | 'Mordus Legion', 'Blood Raider', 'Archangels', 'Guardian Angels', 'True Power'); |
---|
24 | |
---|
25 | function shorten($shorten, $by = 22) |
---|
26 | { |
---|
27 | if (strlen($shorten) > $by) |
---|
28 | { |
---|
29 | $s = substr($shorten, 0, $by) . "..."; |
---|
30 | } |
---|
31 | else $s = $shorten; |
---|
32 | |
---|
33 | return $s; |
---|
34 | } |
---|
35 | |
---|
36 | function slashfix($fix) |
---|
37 | { |
---|
38 | return addslashes(stripslashes($fix)); |
---|
39 | } |
---|
40 | |
---|
41 | function roundsec($sec) |
---|
42 | { |
---|
43 | if ($sec <= 0) |
---|
44 | $s = 0.0; |
---|
45 | else |
---|
46 | $s = $sec; |
---|
47 | |
---|
48 | return number_format(round($s, 1), 1); |
---|
49 | } |
---|
50 | |
---|
51 | function get_tpl($name) |
---|
52 | { |
---|
53 | if (IS_IGB) |
---|
54 | { |
---|
55 | if (file_exists('./templates/igb_'.$name.'.tpl')) |
---|
56 | { |
---|
57 | return 'igb_'.$name.'.tpl'; |
---|
58 | } |
---|
59 | } |
---|
60 | return $name.'.tpl'; |
---|
61 | } |
---|
62 | |
---|
63 | // this is currently only a wrapper but might get |
---|
64 | // timestamp adjustment options in the future |
---|
65 | function kbdate($format, $timestamp = null) |
---|
66 | { |
---|
67 | if ($timestamp === null) |
---|
68 | { |
---|
69 | $timestamp = time(); |
---|
70 | } |
---|
71 | |
---|
72 | if (config::get('date_gmtime')) |
---|
73 | { |
---|
74 | return gmdate($format, $timestamp); |
---|
75 | } |
---|
76 | return date($format, $timestamp); |
---|
77 | } |
---|
78 | |
---|
79 | function getYear() |
---|
80 | { |
---|
81 | $test = kbdate('o'); |
---|
82 | if ($test == 'o') |
---|
83 | { |
---|
84 | $test = kbdate('Y'); |
---|
85 | } |
---|
86 | return $test; |
---|
87 | } |
---|