-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhooks.php
45 lines (37 loc) · 1.13 KB
/
hooks.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
<?php
/**
* @package SMF Watermark
* @author digger http://mysmf.ru
* @copyright 2009-2016
* @license The MIT License (MIT)
* @version 1.6
*
*
* 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;
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.');
}
if (!empty($context['uninstalling'])) {
$call = 'remove_integration_function';
} else {
$call = 'add_integration_function';
}
$hooks = array(
'integrate_pre_include' => '$sourcedir/Mod-Watermark.php',
'integrate_pre_load' => 'loadWatermarkHooks',
);
$call('integrate_menu_buttons', '');
foreach ($hooks as $hook => $function) {
$call($hook, $function);
}
if (SMF == 'SSI') {
echo 'Database changes are complete! <a href="/">Return to the main page</a>.';
}