Project

General

Profile

« Previous | Next » 

Revision 1284

Added by Dietmar almost 15 years ago

to hold content, install don't drop existing tables (code, form, menu_link, news, wrapper, wysiwyg)
otherwise do it with uninstall

View differences:

branches/2.8.x/CHANGELOG
11 11
! = Update/Change
12 12
 
13 13
------------------------------------- 2.8.1 -------------------------------------
14
01-Feb-2010 Dietmar Woellbrink (Luisehahne)
15
!	to hold content, install don't drop existing tables (code, form, menu_link, news, wrapper, wysiwyg) 
16
!	otherwise do it with uninstall
14 17
30-Jan-2010 Dietmar Woellbrink (Luisehahne)
15 18
#	Ticket #931 bug in admin/access/index.php
16 19
30-Jan-2010 Dietmar Woellbrink (Luisehahne)
branches/2.8.x/wb/admin/interface/version.php
52 52

  
53 53
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
54 54
if(!defined('VERSION')) define('VERSION', '2.8.1');
55
if(!defined('REVISION')) define('REVISION', '1283');
55
if(!defined('REVISION')) define('REVISION', '1284');
56 56

  
57 57
?>
branches/2.8.x/wb/modules/wrapper/install.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2009, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
if(defined('WB_URL')) {
27
	
28
	// Create table
29
	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_wrapper`");
30
	$mod_wrapper = 'CREATE TABLE `'.TABLE_PREFIX.'mod_wrapper` ('
31
		. ' `section_id` INT NOT NULL DEFAULT \'0\','
32
		. ' `page_id` INT NOT NULL DEFAULT \'0\','
33
		. ' `url` TEXT NOT NULL,'
34
		. ' `height` INT NOT NULL DEFAULT \'0\','
35
		. ' PRIMARY KEY ( `section_id` ) '
36
		. ' )';
37
	$database->query($mod_wrapper);
38
	
39
}
40

  
1
<?php
2
/**
3
 *
4
 * @category        modules
5
 * @package         wrapper
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2010, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 4.3.4 and higher
13
 * @version      	$Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
18

  
19
if(defined('WB_URL')) {
20
	
21
	// Create table
22
	// $database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_wrapper`");
23
	$mod_wrapper = 'CREATE TABLE IF NOT EXISTS `'.TABLE_PREFIX.'mod_wrapper` ('
24
		. ' `section_id` INT NOT NULL DEFAULT \'0\','
25
		. ' `page_id` INT NOT NULL DEFAULT \'0\','
26
		. ' `url` TEXT NOT NULL,'
27
		. ' `height` INT NOT NULL DEFAULT \'0\','
28
		. ' PRIMARY KEY ( `section_id` ) '
29
		. ' )';
30
	$database->query($mod_wrapper);
31
}
32

  
41 33
?>
42 34

  
branches/2.8.x/wb/modules/menu_link/install.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2009, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
// prevent this file from being accessed directly
27
if(defined('WB_PATH') == false) {
28
	exit("Cannot access this file directly"); 
29
}
30

  
31
$table = TABLE_PREFIX ."mod_menu_link";
32
$database->query("DROP TABLE IF EXISTS `$table`");
33

  
34
$database->query("
35
	CREATE TABLE `$table` (
36
		`section_id` INT(11) NOT NULL DEFAULT '0',
37
		`page_id` INT(11) NOT NULL DEFAULT '0',
38
		`target_page_id` INT(11) NOT NULL DEFAULT '0',
39
		`redirect_type` INT NOT NULL DEFAULT '302',
40
		`anchor` VARCHAR(255) NOT NULL DEFAULT '0' ,
41
		`extern` VARCHAR(255) NOT NULL DEFAULT '' ,
42
		PRIMARY KEY (`section_id`)
43
	)
44
");
45

  
46
?>
1
<?php
2
/**
3
 *
4
 * @category        modules
5
 * @package         menu_link
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2010, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 4.3.4 and higher
13
 * @version      	$Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
18

  
19
// prevent this file from being accessed directly
20
if(defined('WB_PATH') == false) {
21
	exit("Cannot access this file directly"); 
22
}
23

  
24
$table = TABLE_PREFIX ."mod_menu_link";
25
// $database->query("DROP TABLE IF EXISTS `$table`");
26

  
27
$database->query("
28
	CREATE TABLE IF NOT EXISTS `$table` (
29
		`section_id` INT(11) NOT NULL DEFAULT '0',
30
		`page_id` INT(11) NOT NULL DEFAULT '0',
31
		`target_page_id` INT(11) NOT NULL DEFAULT '0',
32
		`redirect_type` INT NOT NULL DEFAULT '302',
33
		`anchor` VARCHAR(255) NOT NULL DEFAULT '0' ,
34
		`extern` VARCHAR(255) NOT NULL DEFAULT '' ,
35
		PRIMARY KEY (`section_id`)
36
	)
37
");
38

  
39
?>
47 40

  
branches/2.8.x/wb/modules/wysiwyg/install.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2009, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
if(defined('WB_URL')) {
27
	
28
	// Create table
29
	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_wysiwyg`");
30
	$mod_wysiwyg = 'CREATE TABLE `'.TABLE_PREFIX.'mod_wysiwyg` ( '
31
		. ' `section_id` INT NOT NULL DEFAULT \'0\','
32
		. ' `page_id` INT NOT NULL DEFAULT \'0\','
33
		. ' `content` LONGTEXT NOT NULL ,'
34
		. ' `text` LONGTEXT NOT NULL ,'
35
		. ' PRIMARY KEY ( `section_id` ) '
36
		. ' )';
37
	$database->query($mod_wysiwyg);
38
	
39
	// Insert info into the search table
40
	// Module query info
41
	$field_info = array();
42
	$field_info['page_id'] = 'page_id';
43
	$field_info['title'] = 'page_title';
44
	$field_info['link'] = 'link';
45
	$field_info['description'] = 'description';
46
	$field_info['modified_when'] = 'modified_when';
47
	$field_info['modified_by'] = 'modified_by';
48
	$field_info = serialize($field_info);
49
	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('module', 'wysiwyg', '$field_info')");
50
	// Query start
51
	$query_start_code = "SELECT [TP]pages.page_id, [TP]pages.page_title,	[TP]pages.link, [TP]pages.description, [TP]pages.modified_when, [TP]pages.modified_by	FROM [TP]mod_wysiwyg, [TP]pages WHERE ";
52
	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_start', '$query_start_code', 'wysiwyg')");
53
	// Query body
54
	$query_body_code = " [TP]pages.page_id = [TP]mod_wysiwyg.page_id AND [TP]mod_wysiwyg.text [O] \'[W][STRING][W]\' AND [TP]pages.searching = \'1\'";	
55
	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_body', '$query_body_code', 'wysiwyg')");
56
	// Query end
57
	$query_end_code = "";	
58
	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_end', '$query_end_code', 'wysiwyg')");
59
	
60
	// Insert blank row (there needs to be at least on row for the search to work)
61
	$database->query("INSERT INTO ".TABLE_PREFIX."mod_wysiwyg (page_id,section_id) VALUES ('0','0')");
62
	
63
}
64

  
1
<?php
2
/**
3
 *
4
 * @category        modules
5
 * @package         wysiwyg
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2010, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 4.3.4 and higher
13
 * @version      	$Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
18

  
19
if(defined('WB_URL'))
20
{
21
	
22
	// Create table
23
	//$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_wysiwyg`");
24
	$mod_wysiwyg = 'CREATE TABLE IF NOT EXISTS `'.TABLE_PREFIX.'mod_wysiwyg` ( '
25
		. ' `section_id` INT NOT NULL DEFAULT \'0\','
26
		. ' `page_id` INT NOT NULL DEFAULT \'0\','
27
		. ' `content` LONGTEXT NOT NULL ,'
28
		. ' `text` LONGTEXT NOT NULL ,'
29
		. ' PRIMARY KEY ( `section_id` ) '
30
		. ' )';
31
	$database->query($mod_wysiwyg);
32
	
33

  
34
    $mod_search = "SELECT * FROM ".TABLE_PREFIX."search  WHERE value = 'wysiwyg'";
35
    $insert_search = $database->query($mod_search);
36
    if( $insert_search->numRows() == 0 )
37
    {
38
    	// Insert info into the search table
39
    	// Module query info
40
    	$field_info = array();
41
    	$field_info['page_id'] = 'page_id';
42
    	$field_info['title'] = 'page_title';
43
    	$field_info['link'] = 'link';
44
    	$field_info['description'] = 'description';
45
    	$field_info['modified_when'] = 'modified_when';
46
    	$field_info['modified_by'] = 'modified_by';
47
    	$field_info = serialize($field_info);
48
    	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('module', 'wysiwyg', '$field_info')");
49
    	// Query start
50
    	$query_start_code = "SELECT [TP]pages.page_id, [TP]pages.page_title,	[TP]pages.link, [TP]pages.description, [TP]pages.modified_when, [TP]pages.modified_by	FROM [TP]mod_wysiwyg, [TP]pages WHERE ";
51
    	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_start', '$query_start_code', 'wysiwyg')");
52
    	// Query body
53
    	$query_body_code = " [TP]pages.page_id = [TP]mod_wysiwyg.page_id AND [TP]mod_wysiwyg.text [O] \'[W][STRING][W]\' AND [TP]pages.searching = \'1\'";
54
    	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_body', '$query_body_code', 'wysiwyg')");
55
    	// Query end
56
    	$query_end_code = "";
57
    	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_end', '$query_end_code', 'wysiwyg')");
58

  
59
    	// Insert blank row (there needs to be at least on row for the search to work)
60
    	$database->query("INSERT INTO ".TABLE_PREFIX."mod_wysiwyg (page_id,section_id) VALUES ('0','0')");
61

  
62

  
63
    }
64
}
65

  
65 66
?>
66 67

  
branches/2.8.x/wb/modules/form/install.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2009, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
/*
27
The Website Baker Project would like to thank Rudolph Lartey <www.carbonect.com>
28
for his contributions to this module - adding extra field types
29
*/
30

  
31
if(defined('WB_URL')) {
32
		
33
	// Create tables
34
	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_form_fields`");
35
	$mod_form = 'CREATE TABLE `'.TABLE_PREFIX.'mod_form_fields` ( `field_id` INT NOT NULL AUTO_INCREMENT,'
36
		. ' `section_id` INT NOT NULL DEFAULT \'0\' ,'
37
		. ' `page_id` INT NOT NULL DEFAULT \'0\' ,'
38
		. ' `position` INT NOT NULL DEFAULT \'0\' ,'
39
		. ' `title` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
40
		. ' `type` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
41
		. ' `required` INT NOT NULL DEFAULT \'0\' ,'
42
		. ' `value` TEXT NOT NULL ,'
43
		. ' `extra` TEXT NOT NULL ,'
44
		. ' PRIMARY KEY ( `field_id` ) '
45
		. ' )';
46
	$database->query($mod_form);
47
	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_form_settings`");
48
	$mod_form = 'CREATE TABLE `'.TABLE_PREFIX.'mod_form_settings` ('
49
		. ' `section_id` INT NOT NULL DEFAULT \'0\' ,'
50
		. ' `page_id` INT NOT NULL DEFAULT \'0\' ,'
51
		. ' `header` TEXT NOT NULL ,'
52
		. ' `field_loop` TEXT NOT NULL ,'
53
		. ' `footer` TEXT NOT NULL ,'
54
		. ' `email_to` TEXT NOT NULL ,'
55
		. ' `email_from` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
56
		. ' `email_fromname` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
57
		. ' `email_subject` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
58
		. ' `success_page` TEXT NOT NULL ,'
59
		. ' `success_email_to` TEXT NOT NULL ,'
60
		. ' `success_email_from` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
61
		. ' `success_email_fromname` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
62
		. ' `success_email_text` TEXT NOT NULL ,'
63
		. ' `success_email_subject` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
64
		. ' `stored_submissions` INT NOT NULL DEFAULT \'0\' ,'
65
		. ' `max_submissions` INT NOT NULL DEFAULT \'0\' ,'
66
		. ' `use_captcha` INT NOT NULL DEFAULT \'0\' ,'
67
		. ' PRIMARY KEY ( `section_id` ) '
68
		. ' )';
69
	$database->query($mod_form);
70
	
71
	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_form_submissions`");
72
	$mod_form = 'CREATE TABLE `'.TABLE_PREFIX.'mod_form_submissions` ( `submission_id` INT NOT NULL AUTO_INCREMENT,'
73
		. ' `section_id` INT NOT NULL DEFAULT \'0\' ,'
74
		. ' `page_id` INT NOT NULL DEFAULT \'0\' ,'
75
		. ' `submitted_when` INT NOT NULL DEFAULT \'0\' ,'
76
		. ' `submitted_by` INT NOT NULL DEFAULT \'0\','
77
		. ' `body` TEXT NOT NULL,'
78
		. ' PRIMARY KEY ( `submission_id` ) '
79
		. ' )';
80
	$database->query($mod_form);
81
		
82
	// Insert info into the search table
83
	// Module query info
84
	$field_info = array();
85
	$field_info['page_id'] = 'page_id';
86
	$field_info['title'] = 'page_title';
87
	$field_info['link'] = 'link';
88
	$field_info['description'] = 'description';
89
	$field_info['modified_when'] = 'modified_when';
90
	$field_info['modified_by'] = 'modified_by';
91
	$field_info = serialize($field_info);
92
	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('module', 'form', '$field_info')");
93
	// Query start
94
	$query_start_code = "SELECT [TP]pages.page_id, [TP]pages.page_title,	[TP]pages.link, [TP]pages.description, [TP]pages.modified_when, [TP]pages.modified_by	FROM [TP]mod_form_fields, [TP]mod_form_settings, [TP]pages WHERE ";
95
	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_start', '$query_start_code', 'form')");
96
	// Query body
97
	$query_body_code = " [TP]pages.page_id = [TP]mod_form_settings.page_id AND [TP]mod_form_settings.header LIKE \'%[STRING]%\'
98
	OR [TP]pages.page_id = [TP]mod_form_settings.page_id AND [TP]mod_form_settings.footer LIKE \'%[STRING]%\'
99
	OR [TP]pages.page_id = [TP]mod_form_fields.page_id AND [TP]mod_form_fields.title LIKE \'%[STRING]%\' ";
100
	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_body', '$query_body_code', 'form')");
101
	// Query end
102
	$query_end_code = "";
103
	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_end', '$query_end_code', 'form')");
104
	
105
	// Insert blank row (there needs to be at least on row for the search to work)
106
	$database->query("INSERT INTO ".TABLE_PREFIX."mod_form_fields (page_id,section_id) VALUES ('0','0')");
107
	$database->query("INSERT INTO ".TABLE_PREFIX."mod_form_settings (page_id,section_id) VALUES ('0','0')");
108

  
109
}
110

  
1
<?php
2
/**
3
 *
4
 * @category        modules
5
 * @package         form
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2010, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 4.3.4 and higher
13
 * @version      	$Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
18

  
19
if(defined('WB_URL'))
20
{
21
		
22
	// $database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_form_fields`");
23
	// $database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_form_submissions`");
24
	// $database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_form_settings`");
25

  
26
	// Create tables
27
	$mod_form = 'CREATE TABLE IF NOT EXISTS `'.TABLE_PREFIX.'mod_form_fields` ( `field_id` INT NOT NULL AUTO_INCREMENT,'
28
		. ' `section_id` INT NOT NULL DEFAULT \'0\' ,'
29
		. ' `page_id` INT NOT NULL DEFAULT \'0\' ,'
30
		. ' `position` INT NOT NULL DEFAULT \'0\' ,'
31
		. ' `title` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
32
		. ' `type` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
33
		. ' `required` INT NOT NULL DEFAULT \'0\' ,'
34
		. ' `value` TEXT NOT NULL ,'
35
		. ' `extra` TEXT NOT NULL ,'
36
		. ' PRIMARY KEY ( `field_id` ) '
37
		. ' )';
38
	$database->query($mod_form);
39

  
40
	$mod_form = 'CREATE TABLE IF NOT EXISTS `'.TABLE_PREFIX.'mod_form_settings` ('
41
		. ' `section_id` INT NOT NULL DEFAULT \'0\' ,'
42
		. ' `page_id` INT NOT NULL DEFAULT \'0\' ,'
43
		. ' `header` TEXT NOT NULL ,'
44
		. ' `field_loop` TEXT NOT NULL ,'
45
		. ' `footer` TEXT NOT NULL ,'
46
		. ' `email_to` TEXT NOT NULL ,'
47
		. ' `email_from` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
48
		. ' `email_fromname` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
49
		. ' `email_subject` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
50
		. ' `success_page` TEXT NOT NULL ,'
51
		. ' `success_email_to` TEXT NOT NULL ,'
52
		. ' `success_email_from` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
53
		. ' `success_email_fromname` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
54
		. ' `success_email_text` TEXT NOT NULL ,'
55
		. ' `success_email_subject` VARCHAR(255) NOT NULL DEFAULT \'\' ,'
56
		. ' `stored_submissions` INT NOT NULL DEFAULT \'0\' ,'
57
		. ' `max_submissions` INT NOT NULL DEFAULT \'0\' ,'
58
		. ' `use_captcha` INT NOT NULL DEFAULT \'0\' ,'
59
		. ' PRIMARY KEY ( `section_id` ) '
60
		. ' )';
61
	$database->query($mod_form);
62
	
63
	$mod_form = 'CREATE TABLE IF NOT EXISTS `'.TABLE_PREFIX.'mod_form_submissions` ( `submission_id` INT NOT NULL AUTO_INCREMENT,'
64
		. ' `section_id` INT NOT NULL DEFAULT \'0\' ,'
65
		. ' `page_id` INT NOT NULL DEFAULT \'0\' ,'
66
		. ' `submitted_when` INT NOT NULL DEFAULT \'0\' ,'
67
		. ' `submitted_by` INT NOT NULL DEFAULT \'0\','
68
		. ' `body` TEXT NOT NULL,'
69
		. ' PRIMARY KEY ( `submission_id` ) '
70
		. ' )';
71
	$database->query($mod_form);
72
		
73
    $mod_search = "SELECT * FROM ".TABLE_PREFIX."search  WHERE value = 'form'";
74
    $insert_search = $database->query($mod_search);
75
    if( $insert_search->numRows() == 0 )
76
    {
77
    	// Insert info into the search table
78
    	// Module query info
79
    	$field_info = array();
80
    	$field_info['page_id'] = 'page_id';
81
    	$field_info['title'] = 'page_title';
82
    	$field_info['link'] = 'link';
83
    	$field_info['description'] = 'description';
84
    	$field_info['modified_when'] = 'modified_when';
85
    	$field_info['modified_by'] = 'modified_by';
86
    	$field_info = serialize($field_info);
87
    	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('module', 'form', '$field_info')");
88
    	// Query start
89
    	$query_start_code = "SELECT [TP]pages.page_id, [TP]pages.page_title,	[TP]pages.link, [TP]pages.description, [TP]pages.modified_when, [TP]pages.modified_by	FROM [TP]mod_form_fields, [TP]mod_form_settings, [TP]pages WHERE ";
90
    	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_start', '$query_start_code', 'form')");
91
    	// Query body
92
    	$query_body_code = " [TP]pages.page_id = [TP]mod_form_settings.page_id AND [TP]mod_form_settings.header LIKE \'%[STRING]%\'
93
    	OR [TP]pages.page_id = [TP]mod_form_settings.page_id AND [TP]mod_form_settings.footer LIKE \'%[STRING]%\'
94
    	OR [TP]pages.page_id = [TP]mod_form_fields.page_id AND [TP]mod_form_fields.title LIKE \'%[STRING]%\' ";
95
    	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_body', '$query_body_code', 'form')");
96
    	// Query end
97
    	$query_end_code = "";
98
    	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_end', '$query_end_code', 'form')");
99

  
100
    	// Insert blank row (there needs to be at least on row for the search to work)
101
    	$database->query("INSERT INTO ".TABLE_PREFIX."mod_form_fields (page_id,section_id) VALUES ('0','0')");
102
    	$database->query("INSERT INTO ".TABLE_PREFIX."mod_form_settings (page_id,section_id) VALUES ('0','0')");
103

  
104
    }
105
}
106

  
111 107
?>
112 108

  
branches/2.8.x/wb/modules/code/install.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2009, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
if(defined('WB_URL')) {
27
	
28
	// Create table
29
	$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_code`");
30
	$mod_code = 'CREATE TABLE `'.TABLE_PREFIX.'mod_code` ('
31
		. ' `section_id` INT NOT NULL DEFAULT \'0\','
32
		. ' `page_id` INT NOT NULL DEFAULT \'0\','
33
		. ' `content` TEXT NOT NULL,'
34
		. ' PRIMARY KEY ( `section_id` )'
35
		. ' )';
36
	$database->query($mod_code);
37
	
38
	// Insert info into the search table
39
	// Module query info
40
	$field_info = array();
41
	$field_info['page_id'] = 'page_id';
42
	$field_info['title'] = 'page_title';
43
	$field_info['link'] = 'link';
44
	$field_info['description'] = 'description';
45
	$field_info['modified_when'] = 'modified_when';
46
	$field_info['modified_by'] = 'modified_by';
47
	$field_info = serialize($field_info);
48
	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('module', 'code', '$field_info')");
49
	// Query start
50
	$query_start_code = "SELECT [TP]pages.page_id, [TP]pages.page_title,	[TP]pages.link, [TP]pages.description, [TP]pages.modified_when, [TP]pages.modified_by	FROM [TP]mod_code, [TP]pages WHERE ";
51
	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_start', '$query_start_code', 'code')");
52
	// Query body
53
	$query_body_code = " [TP]pages.page_id = [TP]mod_code.page_id AND [TP]mod_code.content [O] \'[W][STRING][W]\' AND [TP]pages.searching = \'1\'";	
54
	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_body', '$query_body_code', 'code')");
55
	// Query end
56
	$query_end_code = "";	
57
	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_end', '$query_end_code', 'code')");
58
	
59
	// Insert blank row (there needs to be at least on row for the search to work)
60
	$database->query("INSERT INTO ".TABLE_PREFIX."mod_code (page_id,section_id) VALUES ('0','0')");
61
	
62
}
63

  
1
<?php
2
/**
3
 *
4
 * @category        modules
5
 * @package         code
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2010, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 4.3.4 and higher
13
 * @version      	$Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
18

  
19
if(defined('WB_URL'))
20
{
21
	
22
	// Create table
23
	//$database->query("DROP TABLE IF EXISTS `".TABLE_PREFIX."mod_code`");
24
	$mod_code = 'CREATE TABLE IF NOT EXISTS `'.TABLE_PREFIX.'mod_code` ('
25
		. ' `section_id` INT NOT NULL DEFAULT \'0\','
26
		. ' `page_id` INT NOT NULL DEFAULT \'0\','
27
		. ' `content` TEXT NOT NULL,'
28
		. ' PRIMARY KEY ( `section_id` )'
29
		. ' )';
30
	$database->query($mod_code);
31

  
32
    $mod_search = "SELECT * FROM ".TABLE_PREFIX."search  WHERE value = 'code'";
33
    $insert_search = $database->query($mod_search);
34
    if( $insert_search->numRows() == 0 )
35
    {
36
    	// Insert info into the search table
37
    	// Module query info
38
    	$field_info = array();
39
    	$field_info['page_id'] = 'page_id';
40
    	$field_info['title'] = 'page_title';
41
    	$field_info['link'] = 'link';
42
    	$field_info['description'] = 'description';
43
    	$field_info['modified_when'] = 'modified_when';
44
    	$field_info['modified_by'] = 'modified_by';
45
    	$field_info = serialize($field_info);
46
    	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('module', 'code', '$field_info')");
47
    	// Query start
48
    	$query_start_code = "SELECT [TP]pages.page_id, [TP]pages.page_title,	[TP]pages.link, [TP]pages.description, [TP]pages.modified_when, [TP]pages.modified_by	FROM [TP]mod_code, [TP]pages WHERE ";
49
    	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_start', '$query_start_code', 'code')");
50
    	// Query body
51
    	$query_body_code = " [TP]pages.page_id = [TP]mod_code.page_id AND [TP]mod_code.content [O] \'[W][STRING][W]\' AND [TP]pages.searching = \'1\'";
52
    	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_body', '$query_body_code', 'code')");
53
    	// Query end
54
    	$query_end_code = "";
55
    	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_end', '$query_end_code', 'code')");
56

  
57
    	// Insert blank row (there needs to be at least on row for the search to work)
58
    	$database->query("INSERT INTO ".TABLE_PREFIX."mod_code (page_id,section_id) VALUES ('0','0')");
59

  
60
    }
61
}
62

  
64 63
?>
65 64

  
branches/2.8.x/wb/modules/news/install.php
89 89

  
90 90
	$database->query($mod_news);
91 91
		
92
    $mod_search = "SELECT * FROM ".TABLE_PREFIX."search  WHERE value = 'mod_wysiwyg_query'";
93
    $database->query($mod_search);
94
    $insert_search = $database->is_error();
95

  
96
    if( $insert_search )
92
    $mod_search = "SELECT * FROM ".TABLE_PREFIX."search WHERE value = 'news'";
93
    $insert_search = $database->query($mod_search);
94
    if( $insert_search->numRows() == 0 )
97 95
    {
98 96
    	// Insert info into the search table
99 97
    	// Module query info

Also available in: Unified diff