-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcad_ihooks.php
More file actions
executable file
·47 lines (42 loc) · 1.11 KB
/
Copy pathcad_ihooks.php
File metadata and controls
executable file
·47 lines (42 loc) · 1.11 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
44
45
46
47
<?php
/**
* Childboards as Dropdown
*
* @file cad_ihooks.php
* @author Labradoodle-360
* @copyright Matthew Kerle 2012-2013
*
* @version 2.0.4
*/
// Using SSI?
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
require_once(dirname(__FILE__) . '/SSI.php');
elseif (!defined('SMF'))
die('<strong>Error:</strong> Cannot install - please make sure that this file in the same directory as SMF\'s SSI.php file.');
// One final security check.
global $user_info;
if (!$user_info['is_admin'])
die('<strong>Error:</strong> Only forum administrators are able to execute this file.');
// Array of Hooks.
$hooks = array(
'integrate_pre_include' => array(
'$sourcedir/cad_source/resources/hooks.php',
),
'integrate_general_mod_settings' => array(
'hook__cad_modsettings',
),
);
// Add them!
foreach ($hooks as $key => $value)
{
if (is_array($hooks[$key]))
{
foreach ($hooks[$key] as $sValue)
add_integration_function($key, $sValue);
}
else
add_integration_function($key, $value);
}
// And, we're done!
if (SMF == 'SSI')
echo 'Hooks Successfully Added!';