-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule.php
More file actions
116 lines (96 loc) · 3.09 KB
/
module.php
File metadata and controls
116 lines (96 loc) · 3.09 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
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
<?php
/*
Module Development Kit v1.0 For MangosWeb Enhanced
Built for MangosWeb v3 Module System v1.0
Always Keep the following lines until you see
where i say END OF REQUIRED. Very Important
*/
//========================//
if(INCLUDED !== TRUE)
{
echo "No Direct File Linking Allowed!";
exit;
}
// ==================== //
// Define the module name
define('MODULE_NAME', $_GET['module']);
// Lets get the module path, so when we include images we can go " echo "MODULE_PATH .'images/image.png'"
// rather then "modules/test/images/image.png"
define('MODULE_PATH', 'modules/'. MODULE_NAME .'/');
// !!! - If you have a functions file that needs loading before the header, put here. - !!!
// include( MODULE_PATH.'functions.php');
// =============== START OF TEMPLATE HEADER INTEGRATION ===============//
// Remove the following lines (28 - 50) if you DONT want to
// implement into the current template. Also remove lines in the
// footer. Look below
// Start include of template header and functions file
if(file_exists($Template['functions']))
{
include($Template['functions']);
}
ob_start();
include($Template['header']);
ob_end_flush();
// To start the div's of our module for template integration
// Official templates will have this function
if(function_exists('Content_Div_Start'))
{
echo "<br />";
Content_Div_Start();
}
// ================ END OF TEMPLATE HEADER INTEGRATION ================//
/***************************************************************
* END OF REQUIRED - Edit below this line!
***************************************************************/
// include the module config file(s)
include(MODULE_PATH .'config/config.php');
include(MODULE_PATH .'config/lang_'.$GLOBALS["user_cur_lang"].'.php');
//getting module theme from site theme
If (isset($user['theme']))
{
$template_list = explode(",", $Config->get('templates'));
$modulethemenum = $user['theme'];
foreach ($template_list as $template)
{
$currtmp2[] = $template ;
}
$moduletheme = $currtmp2[$modulethemenum];
}
else
$moduletheme = 'WotLK';
if (file_exists('templates/'.$moduletheme.'/frame/_.gif'))
{
$moduletheme = $moduletheme;
}
else
$moduletheme = 'WotLK';
// If URL looks like this ?module= xxx $sub= xxx
if(isset($_GET['page']))
{
$page=$_GET['page'];
include(MODULE_PATH . $_GET['sub'] .'.php');
}
elseif(isset($_GET['sub']))
{
include(MODULE_PATH . $_GET['sub'] .'.php');
}
else
{
include(MODULE_PATH . 'index.php');
}
/***************************************************************
* REQUIRED - Donot Edit below this line unless you know what your doing!
***************************************************************/
// =============== START OF TEMPLATE FOOTER INTEGRATION ===============//
// To end the div's of our module for template integration
if(function_exists('Content_Div_End'))
{
Content_Div_End();
}
// Set our time end, so we can see how fast the page loaded.
define('TIME_END', microtime(1));
define('PAGE_LOAD_TIME', TIME_END - TIME_START);
// Include the template footer
include($Template['footer']);
// ================ END OF TEMPLATE FOOTER INTEGRATION ================//
?>