This repository has been archived by the owner on Sep 1, 2023. It is now read-only.
forked from valerio-bozzolan/LinuxDay-Torino-website
-
Notifications
You must be signed in to change notification settings - Fork 1
/
load-post.php
110 lines (81 loc) · 3.2 KB
/
load-post.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
# Linux Day 2016 - Boz-PHP configuration
# Copyright (C) 2016, 2017, 2018, 2019 Valerio Bozzolan, Linux Day Torino
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
// Die if called directly
defined('BOZ_PHP') or exit;
// Custom Sessionuser class
define('SESSIONUSER_CLASS', 'User');
define('INCLUDES', 'includes');
// Autoload classes
spl_autoload_register( function($c) {
$path = ABSPATH . __ . INCLUDES . __ . "class-$c.php";
if( is_file( $path ) ) {
require $path;
}
} );
// One day I will push these 2 functions in Boz-PHP
require ABSPATH . '/includes/functions.php';
// user permissions
register_permissions( 'user', [] );
// translator permissions
inherit_permissions( 'translator', 'user', [
'translate',
] );
// admin permissions
inherit_permissions( 'admin', 'translator', [
'add-event',
'edit-users',
'edit-events',
] );
define_default( 'LATEST_CONFERENCE_UID', '2019' );
define_default( 'CURRENT_CONFERENCE_UID', LATEST_CONFERENCE_UID );
define_default( 'CONTACT_PHONE_PREFIX', '+39' );
define_default( 'REPO', 'https://github.com/LinuxDayTorino/LinuxDay-Torino-website' );
define_default( 'LIBMARKDOWN_PATH', '/usr/share/php/markdown.php' );
define_default( 'JQUERY', '/javascript/jquery/jquery.min.js' );
define_default( 'LEAFLET_DIR', '/javascript/leaflet' );
define_default( 'NOINDEX', false );
// /{conference_uid}/
define_default( 'PERMALINK_CONFERENCE', '%s/' );
// /{conference_uid}/{$chapter_uid}/{event_uid}
define_default( 'PERMALINK_EVENT', '%1$s/%3$s/%2$s' );
// /2016/{user_uid}
define_default( 'PERMALINK_USER', '%1$s/user/%2$s' );
define_default( 'FORCE_PERMALINK', 1 );
// timezone of database dates
define_default( 'DEFAULT_TIMEZONE', 'Europe/Rome' );
register_js( 'jquery', JQUERY );
register_js( 'leaflet', LEAFLET_DIR . '/leaflet.js' );
register_css( 'leaflet', LEAFLET_DIR . '/leaflet.css' );
register_js('typed', ROOT . '/2017/static/typed/typed.min.js');
// GNU Gettext configuration
define( 'GETTEXT_DOMAIN', 'linuxday' );
define( 'GETTEXT_DIRECTORY', ABSPATH . __ . 'l10n' );
define( 'GETTEXT_DEFAULT_ENCODE', 'utf8' );
// register languages
register_language( 'it_IT', ['it', 'it-it'], null, null, 'Italiano' );
register_language( 'en_US', ['en', 'en-us', 'en-en'], null, null, 'English' );
register_language( 'pms', [ 'pms' ], null, null, 'Piemontèis' );
register_default_language( 'it_IT' );
// apply the global timezone
date_default_timezone_set( DEFAULT_TIMEZONE );
// apply a language for this request only
if( isset( $_GET['l'] ) ) {
apply_language( $_GET['l'] );
} else {
// as last resource, take from browser language
apply_language();
}