-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsettings.php
executable file
·227 lines (183 loc) · 5.1 KB
/
settings.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<?php
/**
* Filename: settings.php
* Function: This file which contains settings for Phpdivinglog which don't need to be changed normally
* @author Lloyd Borrett - www.borrett.id.au ; Rob Lensen <[email protected]>
* @license LGPL v3 http://www.gnu.org/licenses/lgpl-3.0.txt
* @package phpdivinglog
* @version $Rev: 202 $
* Last Modified: $Date$
*
*/
/**
* APPLICATION DETAILS
* application name and revision number
*/
$_config['app_name'] = "phpDivingLog";
$_config['app_version'] = "3.2";
$_config['app_url'] = "https://github.com/Infern1/phpDivinglog";
$_config['dlog_url'] = "http://www.divinglog.de/";
$_config['dlog_version'] = "6.0.22";
/**
* FILE LOCATIONS
* set the file locations of the various graphic images you
* want to be able to display
*/
/**
* logbook pics
*/
$_config['picpath_web'] = "images/pictures/";
/**
* thumbnail logbook pics
*/
$_config['picpath_web_thumb'] = "images/pictures/thumb";
/**
* missing image icon
*/
$_config['pic_missing'] = "images/icons8-no-image-50.png";
/**
* place maps
*/
$_config['mappath_web'] = "images/maps/";
/**
* equipment pics
*/
$_config['equippath_web'] = "images/equipment/";
/**
* country flags
*/
$_config['flagpath_web'] = "images/flags/";
/**
* user photo and certificate scans
*/
$_config['userpath_web'] = "images/userinfo/";
/**
* buddy photos
*/
$_config['buddypath_web'] = "images/buddies/";
/**
* shop photos
*/
$_config['shoppath_web'] = "images/shops/";
/**
* trip photos
*/
$_config['trippath_web'] = "images/trips/";
/**
* path to sql select statements
*/
$_config['sqlpath'] = $_config['app_root'] . "/sql/";
/**
*
* Normally no need to change below here!!!
* If that's the case maybe support a BUG
*
*/
/**
* Path to .ihtml (template) files
*/
define('TEMPLATE_DIR', $_config['app_root'] . '/tpl/');
if (!defined("PATH_SEPARATOR")) {
if (strpos($_ENV["OS"], "Win") !== false)
define("PATH_SEPARATOR", ";");
else define("PATH_SEPARATOR", ":");
}
ini_set(
'include_path',
get_include_path() . PATH_SEPARATOR .
$_config['app_root'] . "includes/" . PATH_SEPARATOR
);
/**
* Fix $_SERVER['REQUEST_URI'] which is not set on Windows hosts
*/
if (!isset($_SERVER['REQUEST_URI'])) {
if (isset($_SERVER['SCRIPT_NAME']))
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
else
$_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}
}
require_once(ABSPATH_DIVELOG . 'includes/misc.inc.php');
if (!isset($_config['abs_url_path'])) {
$a = base_url(NULL, NULL, TRUE);
$b = rtrim($a['path'], '/');
$_config['abs_url_path'] = $b;
}
if (!isset($_config['web_root'])) {
$url = rtrim(base_url(), '/');
$_config['web_root'] = $url;
}
// hack version example that works on both *nix and windows
// Smarty is assumend to be in 'includes/' dir under current script
define('SMARTY_DIR', str_replace("\\", "/", getcwd()) . '/includes/smarty/');
require_once(SMARTY_DIR . 'Smarty.class.php');
require_once 'classes.inc.php';
if ($_config['enable_debug']) {
include_once(ABSPATH_DIVELOG . 'includes/dBug.php');
}
/**
* Smarty part shouldn't need a change
*/
$t = new Smarty;
$t->setTemplateDir(TEMPLATE_DIR);
$t->setCompileDir($_config['app_root'] . DIRECTORY_SEPARATOR . 'compile');
/**
* Before smarty we gonna check the rights in the compile dir
*/
if (!is__writeable($t->getCompileDir() . "/")) {
echo "Change the right on " . $t->compile_dir . " so the webuser can write<br>
chmod -R 777 " . $t->compile_dir;
}
$t->setCacheDir($_config['app_root'] . DIRECTORY_SEPARATOR . 'cache');
$t->setPluginsDir(array($_config['app_root'] . 'includes/smarty/plugins'));
/**
* Change comment on these when you're done developing to improve performance
*/
//$t->force_compile = false;
//$t->caching = false;
/**
* GLOBAL SMARTY VALUES
* Assign any global smarty values here.
*/
$t->assign('title', 'My divelog online');
$t->assign('web_root', $_config['web_root']);
$t->assign('app_path', $_config['abs_url_path']);
$t->assign('thumb_width', $_config['thumb-width']);
$t->assign('thumb_height', $_config['thumb-height']);
$t->assign('num_records', $_config['max_list']);
if (($_config['embed_mode'])) {
$t->assign('embed', true);
}
/**
* DEBUG MODE DETAILS
* Set to true for debug mode
*/
$_config['debug'] = false;
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);
/**
* Load the database class file and instantiate the `$wpdb` global.
*
* @since 2.5.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*/
function require_wp_db() {
global $wpdb , $_config;
require ABSPATH_DIVELOG . DIRECTORY_SEPARATOR . 'includes/wp-db.php';
if ( isset( $wpdb ) ) {
return;
}
$username = $_config['database_username'];
$password = $_config['database_password'];
$server = $_config['database_server'];
$db = $_config['database_db'];
$wpdb = new wpdb( $username, $password, $db, $server );
}
global $wpdb;
// Include the wpdb class and, if present, a db.php database drop-in.
require_wp_db();
## GLOBALS: $db, $t
session_start();