-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
67 lines (58 loc) · 2.13 KB
/
functions.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
<?php
function flogiston_translations(){
// english
$T['en']['date format'] = 'F j, Y H:i:s';
$T['en']['not found'] = 'Not found';
$T['en']['back home'] = 'Page not found. Please, return to the {homepage}.';
$T['en']['read more'] = 'read more »';
$T['en']['newer posts'] = 'newer';
$T['en']['older posts'] = 'older';
$T['en']['prev article'] = '« previous article';
$T['en']['next article'] = 'next article »';
$T['en']['blog empty'] = 'There are no articles yet.';
$T['en']['article category'] = 'Enlisted in {category} category.';
$T['en']['category name'] = 'category: {category}';
// czech
$T['cs']['date format'] = 'j.n.Y H:i:s';
$T['cs']['not found'] = 'Nenalezeno';
$T['cs']['back home'] = 'Stránka nenalezena. Prosím, vraťte se na {začátek}.';
$T['cs']['read more'] = 'celý článek »';
$T['cs']['newer posts'] = 'novější články';
$T['cs']['older posts'] = 'starší články';
$T['cs']['prev article'] = '« předchozí článek';
$T['cs']['next article'] = 'následující článek »';
$T['cs']['blog empty'] = 'Zatím nebyly napsány žádné články.';
$T['cs']['article category'] = 'Zařazeno do kategorie {category}.';
$T['cs']['category name'] = 'kategorie: {category}';
$currentLang = site_meta('flogiston_locale', 'en');
return isset($T[$currentLang]) ? $T[$currentLang] : $T['en'];
}
function flogiston_background()
{
return theme_url('backgrounds/' . site_meta('flogiston_background', 'foggy.jpg'));
}
function flogiston_translate($key, $replace=array())
{
$translations = flogiston_translations();
if (!isset($translations[$key])) {
throw new Exception('Translation of "' . $key . '" not found.');
}
return str_replace(array_keys($replace), array_values($replace), $translations[$key]);
}
function flogiston_server_uri()
{
$s = !empty($_SERVER['HTTPS']) ? 's' : '';
return 'http'.$s.'://' . $_SERVER['HTTP_HOST'];
}
function flogiston_category_name()
{
return Registry::prop('post_category', 'title');
}
function flogiston_category_description()
{
return Registry::prop('post_category', 'description');
}
function flogiston_category_url()
{
return base_url('category/' . Registry::prop('post_category', 'slug'));
}