-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhooks.php
More file actions
43 lines (36 loc) · 1.08 KB
/
hooks.php
File metadata and controls
43 lines (36 loc) · 1.08 KB
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
<?php
/**
* @package SMF MathJax Mod
* @author digger
* @copyright 2011—2016
* @license GPLv3
* @file hooks.php
* @version 1.4
*
* 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-MathJax.php',
'integrate_pre_load' => 'loadMathJaxHooks'
);
foreach ($hooks as $hook => $function) {
$call($hook, $function);
}
if (SMF == 'SSI') {
echo 'Database changes are complete! <a href="/">Return to the main page</a>.';
}