forked from vanilla/porter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tpl_package.txt
111 lines (88 loc) · 2.59 KB
/
tpl_package.txt
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
<?php
/**
* __NAME__ exporter tool.
*
* @copyright 2009-2016 Vanilla Forums Inc.
* @license http://opensource.org/licenses/gpl-2.0.php GNU GPL2
* @package VanillaPorter
*/
$supported['__NAME__'] = array('name'=> '__NAME__', 'prefix'=>'');
$supported['__NAME__']['features'] = array('Users' => 1);
class __NAME__ extends ExportController {
/**
* Main export process.
*
* @param ExportModel $ex
* @see $_structures in ExportModel for allowed destination tables & columns.
*/
public function forumExport($ex) {
// Get the characterset for the comments.
// Usually the comments table is the best target for this.
$characterSet = $ex->getCharacterSet('posts');
if ($characterSet) {
$ex->characterSet = $characterSet;
}
// Reiterate the platform name here to be included in the porter file header.
$ex->beginExport('', '__NAME__');
// User.
$user_Map = array(
//'Source' => 'Vanilla',
);
$ex->exportTable('User', "
select u.*
from :_tblUser u
", $user_Map);
// Role.
$role_Map = array(
//'Source' => 'Vanilla',
);
$ex->exportTable('Role', "
select *
from :_tblGroup
", $role_Map);
// User Role.
$userRole_Map = array(
//'SourceName' => 'VanillaName',
);
$ex->exportTable('UserRole', "
select u.*
from :_tblAuthor u
", $userRole_Map);
// Category.
$category_Map = array(
//'SourceName' => 'VanillaName',
);
$ex->exportTable('Category', "
select *
from :_tblCategory c
", $category_Map);
// Discussion.
$discussion_Map = array(
//'SourceName' => 'VanillaName',
//'SourceName' => array('Column' => 'VanillaName', 'Filter' => 'HTMLDecoder'),
);
$ex->exportTable('Discussion', "
select
*,
FROM_UNIXTIME(Message_date) as Message_date
from :_tblTopic t
", $discussion_Map);
// Comment.
$comment_Map = array(
//'SourceName' => 'VanillaName',
);
$ex->exportTable('Comment', "
select th.*
from :_tblThread th
", $comment_Map);
// UserDiscussion.
// Permission.
// UserMeta.
// Media.
// Conversations.
// Polls.
$ex->endExport();
}
}
// Closing PHP tag required. (make.php)
?>