-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.php
More file actions
128 lines (116 loc) · 4.58 KB
/
Copy pathinstall.php
File metadata and controls
128 lines (116 loc) · 4.58 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
117
118
119
120
121
122
123
124
125
126
127
128
<?php
/**
*
* @module Forum
* @version 0.5.10
* @authors Julian Schuh, Bernd Michna, "Herr Rilke", Dietrich Roland Pehlke (last)
* @license GNU General Public License
* @platform 2.8.x
* @requirements PHP 5.6.x and higher
*
*/
if (!defined('WB_URL')) die();
$database->query("
CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "mod_forum_forum` (
forumid int(10) unsigned NOT NULL auto_increment,
section_id int(10) NOT NULL,
page_id int(10) NOT NULL,
title varchar(255) NOT NULL,
description mediumtext NOT NULL,
parentid int(10) unsigned NOT NULL default '0',
displayorder int(10) unsigned NOT NULL default '0',
lastpostinfo mediumtext NOT NULL,
readaccess enum('reg','unreg','both') NOT NULL default 'both',
writeaccess enum('reg','unreg','both') NOT NULL default 'both',
PRIMARY KEY (forumid)
);
");
$database->query("
CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "mod_forum_cache` (
varname varchar(255) NOT NULL,
section_id int(10) unsigned NOT NULL default '0',
page_id int(10) unsigned NOT NULL default '0',
`data` mediumtext NOT NULL,
UNIQUE KEY `UNIQUE` (varname,section_id,page_id)
);
");
$database->query("
CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "mod_forum_post` (
postid int(10) unsigned NOT NULL auto_increment,
threadid int(10) unsigned NOT NULL default '0',
username varchar(250) NOT NULL,
userid int(10) unsigned NOT NULL default '0',
title varchar(250) NOT NULL,
dateline int(10) unsigned NOT NULL default '0',
`text` mediumtext NOT NULL,
`search_text` mediumtext NOT NULL,
page_id int(10) unsigned NOT NULL default '0',
section_id int(10) unsigned NOT NULL default '0',
PRIMARY KEY (postid),
KEY threadid (threadid),
FULLTEXT KEY Volltext (title,search_text)
);
");
$database->query("
CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "mod_forum_thread` (
threadid int(10) unsigned NOT NULL auto_increment,
user_id int(10) unsigned NOT NULL default '0',
username varchar(250) NOT NULL,
title varchar(250) NOT NULL,
firstpostid int(10) unsigned NOT NULL default '0',
lastpostid int(10) unsigned NOT NULL default '0',
lastpost int(10) unsigned NOT NULL default '0',
forumid int(10) unsigned NOT NULL default '0',
`open` int(2) NOT NULL,
replycount int(10) unsigned NOT NULL default '0',
dateline int(10) unsigned NOT NULL default '0',
sticky tinyint(1) NOT NULL default '0',
page_id int(10) unsigned NOT NULL default '0',
section_id int(10) unsigned NOT NULL default '0',
PRIMARY KEY (threadid),
KEY titel (title),
KEY forumid (forumid)
);
");
$database->query("
CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "mod_forum_settings` (
`id` tinyint(4) NOT NULL AUTO_INCREMENT,
`section_id` smallint(6) NOT NULL,
`FORUMDISPLAY_PERPAGE` tinyint(4) NOT NULL,
`SHOWTHREAD_PERPAGE` tinyint(4) NOT NULL,
`PAGENAV_SIZES` tinyint(4) NOT NULL,
`DISPLAY_SUBFORUMS` tinyint(4) NOT NULL,
`DISPLAY_SUBFORUMS_FORUMDISPLAY` tinyint(4) NOT NULL,
`FORUM_USE_CAPTCHA` tinyint(4) NOT NULL,
`ADMIN_GROUP_ID` smallint(6) NOT NULL,
`VIEW_FORUM_SEARCH` tinyint(4) NOT NULL,
`FORUM_MAX_SEARCH_HITS` smallint(6) NOT NULL,
`FORUM_SENDMAILS_ON_NEW_POSTS` tinyint(4) NOT NULL,
`FORUM_ADMIN_INFO_ON_NEW_POSTS` varchar(30) COLLATE utf8_unicode_ci,
`FORUM_MAIL_SENDER` varchar(30) COLLATE utf8_unicode_ci,
`FORUM_MAIL_SENDER_REALNAME` varchar(30) COLLATE utf8_unicode_ci,
`FORUM_USE_SMILEYS` tinyint(4) NOT NULL,
`FORUM_HIDE_EDITOR` tinyint(4) NOT NULL,
`FORUM_USERS` mediumtext NOT NULL,
PRIMARY KEY (`id`)
);
");
// STEP 2.1: Module query info
$field_info = array(
'page_id' => 'page_id',
'title' => 'title',
'link' => 'link'
);
$field_info = serialize($field_info);
$database->query("INSERT INTO `".TABLE_PREFIX."search` (`name`, `value`, `extra`) VALUES ('module', 'forum', '".$field_info."')");
$query_start_code = "SELECT [TP]pages.page_id, [TP]pages.page_title, [TP]mod_forum_post.threadid AS link FROM [TP]mod_forum_post, [TP]pages WHERE ";
$database->query("INSERT INTO `".TABLE_PREFIX."search` (`name`, `value`, `extra`) VALUES ('query_start', '".$query_start_code."', 'forum')");
$query_body_code = "
[TP]pages.page_id = [TP]mod_forum_post.page_id AND [TP]mod_forum_post.title [O] \'[W][STRING][W]\' AND [TP]pages.searching = \'1\' OR
[TP]pages.page_id = [TP]mod_forum_post.page_id AND [TP]mod_forum_post.text [O] \'[W][STRING][W]\' AND [TP]pages.searching = \'1\'
";
$database->query("INSERT INTO `".TABLE_PREFIX."search` (`name`, `value`, `extra`) VALUES ('query_body', '".$query_body_code."', 'forum')");
// STEP 2.4.: Query end
$query_end_code = "";
$database->query("INSERT INTO `".TABLE_PREFIX."search` (`name`, `value`, `extra`) VALUES ('query_end', '".$query_end_code."', 'forum')");
?>