Changeset 5153
- Timestamp:
- 11/12/2013 08:08:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/admin/converters/vBulletin.php
r4824 r5153 58 58 ); 59 59 60 // Forum total topic count (Includes unpublished topics, Stored in postmeta) 61 $this->field_map[] = array( 62 'from_tablename' => 'forum', 63 'from_fieldname' => 'threadcount', 64 'to_type' => 'forum', 65 'to_fieldname' => '_bbp_total_topic_count' 66 ); 67 68 // Forum total reply count (Includes unpublished replies, Stored in postmeta) 69 $this->field_map[] = array( 70 'from_tablename' => 'forum', 71 'from_fieldname' => 'replycount', 72 'to_type' => 'forum', 73 'to_fieldname' => '_bbp_total_reply_count' 74 ); 75 60 76 // Forum title. 61 77 $this->field_map[] = array( … … 92 108 ); 93 109 110 // Forum type (Category = -1 or Forum > 0, Stored in postmeta) 111 $this->field_map[] = array( 112 'from_tablename' => 'forum', 113 'from_fieldname' => 'parentid', 114 'to_type' => 'forum', 115 'to_fieldname' => '_bbp_forum_type', 116 'callback_method' => 'callback_forum_type' 117 ); 118 94 119 // Forum dates. 95 120 $this->field_map[] = array( … … 142 167 ); 143 168 169 // Topic total reply count (Includes unpublished replies, Stored in postmeta) 170 $this->field_map[] = array( 171 'from_tablename' => 'thread', 172 'from_fieldname' => 'replycount', 173 'to_type' => 'topic', 174 'to_fieldname' => '_bbp_total_reply_count', 175 'callback_method' => 'callback_topic_reply_count' 176 ); 177 144 178 // Topic author. 145 179 $this->field_map[] = array( … … 149 183 'to_fieldname' => 'post_author', 150 184 'callback_method' => 'callback_userid' 185 ); 186 187 // Topic Author ip (Stored in postmeta) 188 // Note: We join the 'post' table because 'thread' table does not include topic content. 189 $this->field_map[] = array( 190 'from_tablename' => 'post', 191 'from_fieldname' => 'ipaddress', 192 'join_tablename' => 'thread', 193 'join_type' => 'INNER', 194 'join_expression' => 'USING (threadid) WHERE post.parentid = 0', 195 'to_type' => 'topic', 196 'to_fieldname' => '_bbp_author_ip' 151 197 ); 152 198 … … 178 224 179 225 // Topic content. 180 // Note: We join the posts table because topics do not havecontent.226 // Note: We join the 'post' table because 'thread' table does not include topic content. 181 227 $this->field_map[] = array( 182 228 'from_tablename' => 'post', … … 277 323 278 324 // Reply parent forum id (If no parent, then 0. Stored in postmeta) 325 // Note: We join the 'thread' table because 'post' table does not include forum id. 279 326 $this->field_map[] = array( 280 327 'from_tablename' => 'thread', … … 288 335 ); 289 336 290 // Reply parent topic id (If no parent, then 0 .Stored in postmeta)337 // Reply parent topic id (If no parent, then 0, Stored in postmeta) 291 338 $this->field_map[] = array( 292 339 'from_tablename' => 'post', … … 315 362 316 363 // Reply title. 317 // Note: We join the thread table because post table does not include topictitle.364 // Note: We join the 'thread' table because 'post' table does not include reply title. 318 365 $this->field_map[] = array( 319 366 'from_tablename' => 'thread', … … 326 373 'callback_method' => 'callback_reply_title' 327 374 ); 375 376 // Reply slug (Clean name to avoid conflicts) 377 // Note: We join the 'thread' table because 'post' table does not include reply slug. 378 $this->field_map[] = array( 379 'from_tablename' => 'thread', 380 'from_fieldname' => 'title', 381 'join_tablename' => 'post', 382 'join_type' => 'INNER', 383 'join_expression' => 'USING (threadid) WHERE post.parentid != 0', 384 'to_type' => 'reply', 385 'to_fieldname' => 'post_name', 386 'callback_method' => 'callback_slug' 387 ); 328 388 329 389 // Reply content. … … 399 459 'from_fieldname' => 'salt', 400 460 'to_type' => 'user', 401 'to_fieldname' => ' '461 'to_fieldname' => '_bbp_salt' 402 462 ); 403 463 … … 498 558 */ 499 559 public function callback_savepass( $field, $row ) { 500 $pass_array = array( 'hash' => $field, 'salt'=> $row['salt'] );560 $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] ); 501 561 return $pass_array; 502 562 } … … 506 566 * to a pass the user has typed in. 507 567 * 508 * vBulletin passwords do not work. Maybe use the below plugin's approach?509 *510 * @link http://wordpress.org/extend/plugins/vb-user-copy/511 * @link http://plugins.trac.wordpress.org/browser/vb-user-copy/trunk/vb_user_copy.php512 568 */ 513 569 public function authenticate_pass( $password, $serialized_pass ) { 514 570 $pass_array = unserialize( $serialized_pass ); 515 571 return ( $pass_array['hash'] == md5( md5( $password ) . $pass_array['salt'] ) ); 572 } 573 574 /** 575 * Translate the forum type from vBulletin v4.x numeric's to WordPress's strings. 576 * 577 * @param int $status vBulletin v4.x numeric forum type 578 * @return string WordPress safe 579 */ 580 public function callback_forum_type( $status = 0 ) { 581 if ( $status == -1 ) { 582 $status = 'category'; 583 } else { 584 $status = 'forum'; 585 } 586 return $status; 516 587 } 517 588
Note: See TracChangeset
for help on using the changeset viewer.