-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.php
54 lines (48 loc) · 1.9 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
<?php
/**
* @package SMF Redirector
* @file add_settings.php
* @author digger <[email protected]> <http://mysmf.ru>
* @copyright Copyright (c) 2015-2017, digger
* @license The MIT License (MIT) https://opensource.org/licenses/MIT
* @version 1.2
*
* To run this install manually please make sure you place this
* in the same place and SSI.php and index.php
*/
global $context, $user_info, $boardurl;
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF')) {
require_once(dirname(__FILE__) . '/SSI.php');
} elseif (!defined('SMF')) {
die('<b>Error:</b> Cannot install - please verify that you put this file in the same place as SMF\'s index.php and SSI.php files.');
}
if ((SMF == 'SSI') && !$user_info['is_admin']) {
die('Admin privileges required.');
}
// List settings here in the format: setting_key => default_value. Escape any "s. (" => \")
$mod_settings = [
'redirector_enabled' => 0,
'redirector_guest_only' => 0,
'redirector_mode' => 'immediate',
'redirector_delay' => 5,
'redirector_whitelist' => parse_url(
$boardurl,
PHP_URL_HOST
) . "\nlink.tapatalk.com\nyoutu.be\nyoutube.com\nwww.youtube.com",
'redirector_hide_guest_links' => 0,
'redirector_hide_guest_custom_message' => '',
'redirector_page_guests_text' => '',
'redirector_page_members_text' => '',
'redirector_check_referrer' => 0,
'redirector_check_session' => 0,
'redirector_action_name' => '',
];
// Update mod settings if applicable
foreach ($mod_settings as $new_setting => $new_value) {
if (!isset($modSettings[$new_setting])) {
updateSettings([$new_setting => $new_value]);
}
}
if (SMF == 'SSI') {
echo 'Database changes are complete! <a href="/">Return to the main page</a>.';
}