Changeset 5170 for trunk/includes/admin/converters/PunBB.php
- Timestamp:
- 11/23/2013 11:19:34 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/admin/converters/PunBB.php
r5154 r5170 223 223 ); 224 224 225 // Topic dates.226 $this->field_map[] = array(227 'from_tablename' => 'topics',228 'from_fieldname' => 'posted',229 'to_type' => 'topic',230 'to_fieldname' => 'post_date',231 'callback_method' => 'callback_datetime'232 );233 $this->field_map[] = array(234 'from_tablename' => 'topics',235 'from_fieldname' => 'posted',236 'to_type' => 'topic',237 'to_fieldname' => 'post_date_gmt',238 'callback_method' => 'callback_datetime'239 );240 $this->field_map[] = array(241 'from_tablename' => 'topics',242 'from_fieldname' => 'last_post',243 'to_type' => 'topic',244 'to_fieldname' => 'post_modified',245 'callback_method' => 'callback_datetime'246 );247 $this->field_map[] = array(248 'from_tablename' => 'topics',249 'from_fieldname' => 'last_post',250 'to_type' => 'topic',251 'to_fieldname' => 'post_modified_gmt',252 'callback_method' => 'callback_datetime'253 );254 $this->field_map[] = array(255 'from_tablename' => 'topics',256 'from_fieldname' => 'last_post',257 'to_type' => 'topic',258 'to_fieldname' => '_bbp_last_active_time',259 'callback_method' => 'callback_datetime'260 );261 262 225 // Topic status (Open or Closed, PunBB v1.4.2 0=open & 1=closed) 263 226 $this->field_map[] = array( … … 267 230 'to_fieldname' => 'post_status', 268 231 'callback_method' => 'callback_topic_status' 232 ); 233 234 // Sticky status (Stored in postmeta)) 235 $this->field_map[] = array( 236 'from_tablename' => 'topics', 237 'from_fieldname' => 'sticky', 238 'to_type' => 'topic', 239 'to_fieldname' => '_bbp_old_sticky_status', 240 'callback_method' => 'callback_sticky_status' 241 ); 242 // Topic dates. 243 $this->field_map[] = array( 244 'from_tablename' => 'topics', 245 'from_fieldname' => 'posted', 246 'to_type' => 'topic', 247 'to_fieldname' => 'post_date', 248 'callback_method' => 'callback_datetime' 249 ); 250 $this->field_map[] = array( 251 'from_tablename' => 'topics', 252 'from_fieldname' => 'posted', 253 'to_type' => 'topic', 254 'to_fieldname' => 'post_date_gmt', 255 'callback_method' => 'callback_datetime' 256 ); 257 $this->field_map[] = array( 258 'from_tablename' => 'topics', 259 'from_fieldname' => 'last_post', 260 'to_type' => 'topic', 261 'to_fieldname' => 'post_modified', 262 'callback_method' => 'callback_datetime' 263 ); 264 $this->field_map[] = array( 265 'from_tablename' => 'topics', 266 'from_fieldname' => 'last_post', 267 'to_type' => 'topic', 268 'to_fieldname' => 'post_modified_gmt', 269 'callback_method' => 'callback_datetime' 270 ); 271 $this->field_map[] = array( 272 'from_tablename' => 'topics', 273 'from_fieldname' => 'last_post', 274 'to_type' => 'topic', 275 'to_fieldname' => '_bbp_last_active_time', 276 'callback_method' => 'callback_datetime' 269 277 ); 270 278 … … 630 638 631 639 /** 640 * Translate the topic sticky status type from PunBB v1.4.2 numeric's to WordPress's strings. 641 * 642 * @param int $status PunBB v1.4.2 numeric forum type 643 * @return string WordPress safe 644 */ 645 public function callback_sticky_status( $status = 0 ) { 646 switch ( $status ) { 647 case 1 : 648 $status = 'sticky'; // PunBB Sticky 'topic_sticky = 1' 649 break; 650 651 case 0 : 652 default : 653 $status = 'normal'; // PunBB Normal Topic 'topic_sticky = 0' 654 break; 655 } 656 return $status; 657 } 658 659 /** 632 660 * Verify the topic/reply count. 633 661 *
Note: See TracChangeset
for help on using the changeset viewer.