diff --git a/bbPress/admin/converters/BuddyPress.php b/bbPress/admin/converters/BuddyPress.php
index d54481c..580a2b4 100644
a
|
b
|
|
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /** |
4 | | * bbPress 1.1 Converter |
| 4 | * BuddyPress Group Forums (bbPress 1.1) Converter |
| 5 | * - Default WordPress Install with shared database tables |
| 6 | * - BuddyPress 1.6x _bp_* |
| 7 | * - bbPress 1.x _bb_* |
| 8 | * |
5 | 9 | * |
6 | | * @since bbPress (rxxxx) |
| 10 | * @since bbPress (r4564) |
7 | 11 | */ |
8 | | class bbPress1 extends BBP_Converter_Base { |
| 12 | class BuddyPress extends BBP_Converter_Base { |
9 | 13 | |
10 | 14 | /** |
11 | 15 | * Main constructor |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
26 | 30 | |
27 | 31 | // Forum id (Stored in postmeta) |
28 | 32 | $this->field_map[] = array( |
29 | | 'from_tablename' => 'forums', |
| 33 | 'from_tablename' => 'bb_forums', |
30 | 34 | 'from_fieldname' => 'forum_id', |
31 | 35 | 'to_type' => 'forum', |
32 | 36 | 'to_fieldname' => '_bbp_forum_id' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
34 | 38 | |
35 | 39 | // Forum parent id (If no parent, 0. Stored in postmeta) |
36 | 40 | $this->field_map[] = array( |
37 | | 'from_tablename' => 'forums', |
| 41 | 'from_tablename' => 'bb_forums', |
38 | 42 | 'from_fieldname' => 'forum_parent', |
39 | 43 | 'to_type' => 'forum', |
40 | 44 | 'to_fieldname' => '_bbp_forum_parent_id' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
42 | 46 | |
43 | 47 | // Forum topic count (Stored in postmeta) |
44 | 48 | $this->field_map[] = array( |
45 | | 'from_tablename' => 'forums', |
| 49 | 'from_tablename' => 'bb_forums', |
46 | 50 | 'from_fieldname' => 'topics', |
47 | 51 | 'to_type' => 'forum', |
48 | 52 | 'to_fieldname' => '_bbp_topic_count' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
50 | 54 | |
51 | 55 | // Forum reply count (Stored in postmeta) |
52 | 56 | $this->field_map[] = array( |
53 | | 'from_tablename' => 'forums', |
| 57 | 'from_tablename' => 'bb_forums', |
54 | 58 | 'from_fieldname' => 'posts', |
55 | 59 | 'to_type' => 'forum', |
56 | 60 | 'to_fieldname' => '_bbp_reply_count' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
58 | 62 | |
59 | 63 | // Forum topic count (Stored in postmeta) |
60 | 64 | $this->field_map[] = array( |
61 | | 'from_tablename' => 'forums', |
| 65 | 'from_tablename' => 'bb_forums', |
62 | 66 | 'from_fieldname' => 'topics', |
63 | 67 | 'to_type' => 'forum', |
64 | 68 | 'to_fieldname' => '_bbp_total_topic_count' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
66 | 70 | |
67 | 71 | // Forum reply count (Stored in postmeta) |
68 | 72 | $this->field_map[] = array( |
69 | | 'from_tablename' => 'forums', |
| 73 | 'from_tablename' => 'bb_forums', |
70 | 74 | 'from_fieldname' => 'posts', |
71 | 75 | 'to_type' => 'forum', |
72 | 76 | 'to_fieldname' => '_bbp_total_reply_count' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
74 | 78 | |
75 | 79 | // Forum title. |
76 | 80 | $this->field_map[] = array( |
77 | | 'from_tablename' => 'forums', |
| 81 | 'from_tablename' => 'bb_forums', |
78 | 82 | 'from_fieldname' => 'forum_name', |
79 | 83 | 'to_type' => 'forum', |
80 | 84 | 'to_fieldname' => 'post_title' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
82 | 86 | |
83 | 87 | // Forum slug (Clean name to avoid confilcts) |
84 | 88 | $this->field_map[] = array( |
85 | | 'from_tablename' => 'forums', |
| 89 | 'from_tablename' => 'bb_forums', |
86 | 90 | 'from_fieldname' => 'forum_slug', |
87 | 91 | 'to_type' => 'forum', |
88 | 92 | 'to_fieldname' => 'post_name', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
91 | 95 | |
92 | 96 | // Forum description. |
93 | 97 | $this->field_map[] = array( |
94 | | 'from_tablename' => 'forums', |
| 98 | 'from_tablename' => 'bb_forums', |
95 | 99 | 'from_fieldname' => 'forum_desc', |
96 | 100 | 'to_type' => 'forum', |
97 | 101 | 'to_fieldname' => 'post_content', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
100 | 104 | |
101 | 105 | // Forum display order (Starts from 1) |
102 | 106 | $this->field_map[] = array( |
103 | | 'from_tablename' => 'forums', |
| 107 | 'from_tablename' => 'bb_forums', |
104 | 108 | 'from_fieldname' => 'forum_order', |
105 | 109 | 'to_type' => 'forum', |
106 | 110 | 'to_fieldname' => 'menu_order' |
107 | 111 | ); |
108 | 112 | |
| 113 | // Forum visibily |
| 114 | // Note: Join BuddyPress Group Status (*_bp_groups.id) with bbPress (*_bb_forums.forum_id) to determine visibilty. |
| 115 | $this->field_map[] = array( |
| 116 | 'from_tablename' => 'bp_groups', |
| 117 | 'from_fieldname' => 'status', |
| 118 | 'join_tablename' => 'bp_groups_groupmeta', |
| 119 | 'join_type' => 'INNER', |
| 120 | 'join_expression' => 'USING (something) WHERE this = that', |
| 121 | 'to_type' => 'forum', |
| 122 | 'to_fieldname' => 'post_status', |
| 123 | 'callback_method' => 'callback_null' |
| 124 | ); |
| 125 | |
109 | 126 | // Forum dates. |
110 | 127 | $this->field_map[] = array( |
111 | 128 | 'to_type' => 'forum', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
132 | 149 | |
133 | 150 | // Topic id (Stored in postmeta) |
134 | 151 | $this->field_map[] = array( |
135 | | 'from_tablename' => 'topics', |
| 152 | 'from_tablename' => 'bb_topics', |
136 | 153 | 'from_fieldname' => 'topic_id', |
137 | 154 | 'to_type' => 'topic', |
138 | 155 | 'to_fieldname' => '_bbp_topic_id' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
140 | 157 | |
141 | 158 | // Reply count (Stored in postmeta) |
142 | 159 | $this->field_map[] = array( |
143 | | 'from_tablename' => 'topics', |
| 160 | 'from_tablename' => 'bb_topics', |
144 | 161 | 'from_fieldname' => 'topic_posts', |
145 | 162 | 'to_type' => 'topic', |
146 | 163 | 'to_fieldname' => '_bbp_reply_count', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
149 | 166 | |
150 | 167 | // Forum id (Stored in postmeta) |
151 | 168 | $this->field_map[] = array( |
152 | | 'from_tablename' => 'topics', |
| 169 | 'from_tablename' => 'bb_topics', |
153 | 170 | 'from_fieldname' => 'forum_id', |
154 | 171 | 'to_type' => 'topic', |
155 | 172 | 'to_fieldname' => '_bbp_forum_id', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
158 | 175 | |
159 | 176 | // Topic author. |
160 | 177 | $this->field_map[] = array( |
161 | | 'from_tablename' => 'topics', |
| 178 | 'from_tablename' => 'bb_topics', |
162 | 179 | 'from_fieldname' => 'topic_poster', |
163 | 180 | 'to_type' => 'topic', |
164 | 181 | 'to_fieldname' => 'post_author', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
167 | 184 | |
168 | 185 | // Topic title. |
169 | 186 | $this->field_map[] = array( |
170 | | 'from_tablename' => 'topics', |
| 187 | 'from_tablename' => 'bb_topics', |
171 | 188 | 'from_fieldname' => 'topic_title', |
172 | 189 | 'to_type' => 'topic', |
173 | 190 | 'to_fieldname' => 'post_title' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
175 | 192 | |
176 | 193 | // Topic slug (Clean name to avoid conflicts) |
177 | 194 | $this->field_map[] = array( |
178 | | 'from_tablename' => 'topics', |
| 195 | 'from_tablename' => 'bb_topics', |
179 | 196 | 'from_fieldname' => 'topic_title', |
180 | 197 | 'to_type' => 'topic', |
181 | 198 | 'to_fieldname' => 'post_name', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
185 | 202 | // Topic content. |
186 | 203 | // Note: We join the posts table because topics do not have content. |
187 | 204 | $this->field_map[] = array( |
188 | | 'from_tablename' => 'posts', |
| 205 | 'from_tablename' => 'bb_posts', |
189 | 206 | 'from_fieldname' => 'post_text', |
190 | | 'join_tablename' => 'topics', |
| 207 | 'join_tablename' => 'bb_topics', |
191 | 208 | 'join_type' => 'INNER', |
192 | | 'join_expression' => 'USING (topic_id) WHERE posts.post_position IN (0,1)', |
| 209 | 'join_expression' => 'USING (topic_id) WHERE bb_posts.post_position IN (0,1)', |
193 | 210 | 'to_type' => 'topic', |
194 | 211 | 'to_fieldname' => 'post_content', |
195 | 212 | 'callback_method' => 'callback_html' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
198 | 215 | // Topic status. |
199 | 216 | // Note: post_status is more accurate than topic_status |
200 | 217 | $this->field_map[] = array( |
201 | | 'from_tablename' => 'posts', |
| 218 | 'from_tablename' => 'bb_posts', |
202 | 219 | 'from_fieldname' => 'post_status', |
203 | | 'join_tablename' => 'topics', |
| 220 | 'join_tablename' => 'bb_topics', |
204 | 221 | 'join_type' => 'INNER', |
205 | | 'join_expression' => 'USING (topic_id) WHERE posts.post_position IN (0,1)', |
| 222 | 'join_expression' => 'USING (topic_id) WHERE bb_posts.post_position IN (0,1)', |
206 | 223 | 'to_type' => 'topic', |
207 | 224 | 'to_fieldname' => 'post_status', |
208 | 225 | 'callback_method' => 'callback_status' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
210 | 227 | |
211 | 228 | // Author ip. |
212 | 229 | $this->field_map[] = array( |
213 | | 'from_tablename' => 'posts', |
| 230 | 'from_tablename' => 'bb_posts', |
214 | 231 | 'from_fieldname' => 'poster_ip', |
215 | | 'join_tablename' => 'topics', |
| 232 | 'join_tablename' => 'bb_topics', |
216 | 233 | 'join_type' => 'INNER', |
217 | | 'join_expression' => 'USING (topic_id) WHERE posts.post_position IN (0,1)', |
| 234 | 'join_expression' => 'USING (topic_id) WHERE bb_posts.post_position IN (0,1)', |
218 | 235 | 'to_type' => 'topic', |
219 | 236 | 'to_fieldname' => '_bbp_author_ip' |
220 | 237 | ); |
221 | 238 | |
222 | 239 | // Forum id (If no parent, 0) |
223 | 240 | $this->field_map[] = array( |
224 | | 'from_tablename' => 'topics', |
| 241 | 'from_tablename' => 'bb_topics', |
225 | 242 | 'from_fieldname' => 'forum_id', |
226 | 243 | 'to_type' => 'topic', |
227 | 244 | 'to_fieldname' => 'post_parent', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
230 | 247 | |
231 | 248 | // Topic dates. |
232 | 249 | $this->field_map[] = array( |
233 | | 'from_tablename' => 'topics', |
| 250 | 'from_tablename' => 'bb_topics', |
234 | 251 | 'from_fieldname' => 'topic_start_time', |
235 | 252 | 'to_type' => 'topic', |
236 | 253 | 'to_fieldname' => 'post_date' |
237 | 254 | ); |
238 | 255 | $this->field_map[] = array( |
239 | | 'from_tablename' => 'topics', |
| 256 | 'from_tablename' => 'bb_topics', |
240 | 257 | 'from_fieldname' => 'topic_start_time', |
241 | 258 | 'to_type' => 'topic', |
242 | 259 | 'to_fieldname' => 'post_date_gmt' |
243 | 260 | ); |
244 | 261 | $this->field_map[] = array( |
245 | | 'from_tablename' => 'topics', |
| 262 | 'from_tablename' => 'bb_topics', |
246 | 263 | 'from_fieldname' => 'topic_time', |
247 | 264 | 'to_type' => 'topic', |
248 | 265 | 'to_fieldname' => 'post_modified' |
249 | 266 | ); |
250 | 267 | $this->field_map[] = array( |
251 | | 'from_tablename' => 'topics', |
| 268 | 'from_tablename' => 'bb_topics', |
252 | 269 | 'from_fieldname' => 'topic_time', |
253 | 270 | 'to_type' => 'topic', |
254 | 271 | 'to_fieldname' => 'post_modified_gmt' |
255 | 272 | ); |
256 | 273 | $this->field_map[] = array( |
257 | | 'from_tablename' => 'topics', |
| 274 | 'from_tablename' => 'bb_topics', |
258 | 275 | 'from_fieldname' => 'topic_time', |
259 | 276 | 'to_type' => 'topic', |
260 | 277 | 'to_fieldname' => '_bbp_last_active_time' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
264 | 281 | |
265 | 282 | // Topic id. |
266 | 283 | $this->field_map[] = array( |
267 | | 'from_tablename' => 'term_relationships', |
| 284 | 'from_tablename' => 'bb_term_relationships', |
268 | 285 | 'from_fieldname' => 'object_id', |
269 | 286 | 'to_type' => 'tags', |
270 | 287 | 'to_fieldname' => 'objectid', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
273 | 290 | |
274 | 291 | // Taxonomy ID. |
275 | 292 | $this->field_map[] = array( |
276 | | 'from_tablename' => 'term_taxonomy', |
| 293 | 'from_tablename' => 'bb_term_taxonomy', |
277 | 294 | 'from_fieldname' => 'term_taxonomy_id', |
278 | | 'join_tablename' => 'term_relationships', |
| 295 | 'join_tablename' => 'bb_term_relationships', |
279 | 296 | 'join_type' => 'INNER', |
280 | 297 | 'join_expression' => 'USING (term_taxonomy_id)', |
281 | 298 | 'to_type' => 'tags', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
284 | 301 | |
285 | 302 | // Term text. |
286 | 303 | $this->field_map[] = array( |
287 | | 'from_tablename' => 'terms', |
| 304 | 'from_tablename' => 'bb_terms', |
288 | 305 | 'from_fieldname' => 'name', |
289 | | 'join_tablename' => 'term_taxonomy', |
| 306 | 'join_tablename' => 'bb_term_taxonomy', |
290 | 307 | 'join_type' => 'INNER', |
291 | 308 | 'join_expression' => 'USING (term_id)', |
292 | 309 | 'to_type' => 'tags', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
297 | 314 | |
298 | 315 | // Post id. Stores in postmeta. |
299 | 316 | $this->field_map[] = array( |
300 | | 'from_tablename' => 'posts', |
| 317 | 'from_tablename' => 'bb_posts', |
301 | 318 | 'from_fieldname' => 'post_id', |
302 | 319 | 'to_type' => 'reply', |
303 | 320 | 'to_fieldname' => '_bbp_post_id' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
305 | 322 | |
306 | 323 | // Topic id (Stores in postmeta) |
307 | 324 | $this->field_map[] = array( |
308 | | 'from_tablename' => 'posts', |
| 325 | 'from_tablename' => 'bb_posts', |
309 | 326 | 'from_fieldname' => 'topic_id', |
310 | 327 | 'to_type' => 'reply', |
311 | 328 | 'to_fieldname' => '_bbp_topic_id', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
314 | 331 | |
315 | 332 | // Forum id (Stored in postmeta) |
316 | 333 | $this->field_map[] = array( |
317 | | 'from_tablename' => 'posts', |
| 334 | 'from_tablename' => 'bb_posts', |
318 | 335 | 'from_fieldname' => 'forum_id', |
319 | 336 | 'to_type' => 'reply', |
320 | 337 | 'to_fieldname' => '_bbp_forum_id', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
323 | 340 | |
324 | 341 | // Topic title (for reply title). |
325 | 342 | $this->field_map[] = array( |
326 | | 'from_tablename' => 'topics', |
| 343 | 'from_tablename' => 'bb_topics', |
327 | 344 | 'from_fieldname' => 'topic_title', |
328 | | 'join_tablename' => 'posts', |
| 345 | 'join_tablename' => 'bb_posts', |
329 | 346 | 'join_type' => 'INNER', |
330 | | 'join_expression' => 'USING (topic_id) WHERE posts.post_position NOT IN (0,1)', |
| 347 | 'join_expression' => 'USING (topic_id) WHERE bb_posts.post_position NOT IN (0,1)', |
331 | 348 | 'to_type' => 'reply', |
332 | 349 | 'to_fieldname' => 'post_title', |
333 | 350 | 'callback_method' => 'callback_reply_title' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
335 | 352 | |
336 | 353 | // Author ip. |
337 | 354 | $this->field_map[] = array( |
338 | | 'from_tablename' => 'posts', |
| 355 | 'from_tablename' => 'bb_posts', |
339 | 356 | 'from_fieldname' => 'poster_ip', |
340 | 357 | 'to_type' => 'reply', |
341 | 358 | 'to_fieldname' => '_bbp_author_ip' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
343 | 360 | |
344 | 361 | // Reply author. |
345 | 362 | $this->field_map[] = array( |
346 | | 'from_tablename' => 'posts', |
| 363 | 'from_tablename' => 'bb_posts', |
347 | 364 | 'from_fieldname' => 'poster_id', |
348 | 365 | 'to_type' => 'reply', |
349 | 366 | 'to_fieldname' => 'post_author', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
352 | 369 | |
353 | 370 | // Reply status |
354 | 371 | $this->field_map[] = array( |
355 | | 'from_tablename' => 'posts', |
| 372 | 'from_tablename' => 'bb_posts', |
356 | 373 | 'from_fieldname' => 'post_status', |
357 | 374 | 'to_type' => 'reply', |
358 | 375 | 'to_fieldname' => 'post_status', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
361 | 378 | |
362 | 379 | // Reply content. |
363 | 380 | $this->field_map[] = array( |
364 | | 'from_tablename' => 'posts', |
| 381 | 'from_tablename' => 'bb_posts', |
365 | 382 | 'from_fieldname' => 'post_text', |
366 | 383 | 'to_type' => 'reply', |
367 | 384 | 'to_fieldname' => 'post_content', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
370 | 387 | |
371 | 388 | // Reply order. |
372 | 389 | $this->field_map[] = array( |
373 | | 'from_tablename' => 'posts', |
| 390 | 'from_tablename' => 'bb_posts', |
374 | 391 | 'from_fieldname' => 'post_position', |
375 | 392 | 'to_type' => 'reply', |
376 | 393 | 'to_fieldname' => 'menu_order' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
378 | 395 | |
379 | 396 | // Topic id. If no parent, than 0. |
380 | 397 | $this->field_map[] = array( |
381 | | 'from_tablename' => 'posts', |
| 398 | 'from_tablename' => 'bb_posts', |
382 | 399 | 'from_fieldname' => 'topic_id', |
383 | 400 | 'to_type' => 'reply', |
384 | 401 | 'to_fieldname' => 'post_parent', |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
387 | 404 | |
388 | 405 | // Reply dates. |
389 | 406 | $this->field_map[] = array( |
390 | | 'from_tablename' => 'posts', |
| 407 | 'from_tablename' => 'bb_posts', |
391 | 408 | 'from_fieldname' => 'post_time', |
392 | 409 | 'to_type' => 'reply', |
393 | 410 | 'to_fieldname' => 'post_date' |
394 | 411 | ); |
395 | 412 | $this->field_map[] = array( |
396 | | 'from_tablename' => 'posts', |
| 413 | 'from_tablename' => 'bb_posts', |
397 | 414 | 'from_fieldname' => 'post_time', |
398 | 415 | 'to_type' => 'reply', |
399 | 416 | 'to_fieldname' => 'post_date_gmt' |
400 | 417 | ); |
401 | 418 | $this->field_map[] = array( |
402 | | 'from_tablename' => 'posts', |
| 419 | 'from_tablename' => 'bb_posts', |
403 | 420 | 'from_fieldname' => 'post_time', |
404 | 421 | 'to_type' => 'reply', |
405 | 422 | 'to_fieldname' => 'post_modified' |
406 | 423 | ); |
407 | 424 | $this->field_map[] = array( |
408 | | 'from_tablename' => 'posts', |
| 425 | 'from_tablename' => 'bb_posts', |
409 | 426 | 'from_fieldname' => 'post_time', |
410 | 427 | 'to_type' => 'reply', |
411 | 428 | 'to_fieldname' => 'post_modified_gmt' |
… |
… |
class bbPress1 extends BBP_Converter_Base { |
477 | 494 | 'to_fieldname' => 'user_status' |
478 | 495 | ); |
479 | 496 | |
480 | | // User status. |
| 497 | // User display name. |
481 | 498 | $this->field_map[] = array( |
482 | 499 | 'from_tablename' => 'users', |
483 | 500 | 'from_fieldname' => 'display_name', |