-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadd.php
103 lines (88 loc) · 3.36 KB
/
add.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
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
<?php
/**
*
* @category modules
* @package oneforall
* @author WBCE Community
* @copyright 2004-2009, Ryan Djurovich
* @copyright 2009-2010, Website Baker Org. e.V.
* @copyright 2019-, WBCE Community
* @link https://www.wbce.org/
* @license http://www.gnu.org/licenses/gpl.html
* @platform WBCE
*
*/
//Prevent this file from being accessed directly
if (defined('WB_PATH') == false) {
exit('Cannot access this file directly');
}
// Include path
$inc_path = dirname(__FILE__);
// Get module name
require_once($inc_path.'/info.php');
// Look for language File
if (LANGUAGE_LOADED) {
require_once($inc_path.'/languages/EN.php');
if (file_exists($inc_path.'/languages/'.LANGUAGE.'.php')) {
require_once($inc_path.'/languages/'.LANGUAGE.'.php');
}
}
// Layout
$header = $admin->add_slashes('
<h1>Hello '.$_SESSION['DISPLAY_NAME'].'</h1>
<p>This is your module '.$module_name.' speaking:</p>
<p>Before taking off there have to been made some modifications.</p>
<h2>Adding custom fields</h2>
<ol>
<li>Login to your WBCE installation.</li>
<li>Add a new page with page type "'.$module_name.'".</li>
<li>Go to the "Fields Settings" and add the customized fields you intend to collect the data.</li>
<li>Select the field type and modify the field templates to fit your needs.</li>
<li>Note that every field must have a unique field name. Allowed characters are a-z, A-Z, 0-9, . (dot), _ (underscore) and - (hyphen).</li>
<li>Consider the displayed placeholders. You will need them later when adding the item templates.</li>
</ol>
<h2>Adding item templates</h2>
<p>Create your own item templates using the generated and general placeholders:</p>
<ol>
<li>Go to the "Page Settings" and use the mentioned placeholders in your templates to view the items just the way you want.</li>
<li>Replace this text by them HTML code of your template.</li>
<li>[PLACEHOLDERS] are uppercase and enclosed by square brackets.</li>
<li>For a list of more general placeholders to accomplish your template click the "Help"-button on top of the "Page Settings" page.</li>
<li>Add an item or two, enter some data and have fun!</li>
</ol>
');
$item_loop = $admin->add_slashes('
<div class="mod_'.$mod_name.'_item_loop_f">
[THUMB]
<h3 class="mod_'.$mod_name.'_main_title_f"><a href="[LINK]">[TITLE]</a></h3>
<!-- ADD YOUR PLACEHOLDERS LIKE THIS: -->
[FIELD_1]
[FIELD_2]
</div>
');
$footer = $admin->add_slashes('
<table class="mod_'.$mod_name.'_pagination_f" style="display: [DISPLAY_PREVIOUS_NEXT_LINKS]">
<tr>
<td width="35%" align="left">[PREVIOUS_PAGE_LINK]</td>
<td width="30%" align="center">[TXT_ITEM] [OF] </td>
<td width="35%" align="right">[NEXT_PAGE_LINK]</td>
</tr>
</table>
');
$item_header = $header;
$item_footer = $admin->add_slashes('
<div class="mod_'.$mod_name.'_item_f">
[THUMBS]
<h2 class="mod_'.$mod_name.'_item_title_f">[TITLE]</h2>
<!-- ADD YOUR PLACEHOLDERS LIKE THIS: -->
[FIELD_1]
[FIELD_2]
</div>
<div class="mod_'.$mod_name.'_prev_next_links_f">
[PREVIOUS] | <a href="[BACK]">[TXT_BACK]</a> | [NEXT]
</div>
');
// Insert default values into table page_settings
$database->query("INSERT INTO `".TABLE_PREFIX."mod_".$mod_name."_page_settings` (section_id, page_id, header, item_loop, footer, item_header, item_footer)
VALUES ('$section_id', '$page_id', '$header', '$item_loop', '$footer', '$item_header', '$item_footer')");
?>