forked from vanilla/porter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtpl_package.txt
104 lines (80 loc) · 2.35 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
<?php
/**
* __NAME__ exporter tool.
*
* @copyright Vanilla Forums Inc. 2010-2014
* @license GNU GPL2
* @package VanillaPorter
* @see functions.commandline.php for command line usage.
*/
$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();
}
}
?>