Changeset 5170 for trunk/includes/admin/converters/phpBB.php
- Timestamp:
- 11/23/2013 11:19:34 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/admin/converters/phpBB.php
r5150 r5170 194 194 ); 195 195 196 // Topic Author ip (Stored in postmeta) 197 $this->field_map[] = array( 198 'from_tablename' => 'posts', 199 'from_fieldname' => 'poster_ip', 200 'join_tablename' => 'topics', 201 'join_type' => 'INNER', 202 'join_expression' => 'USING (topic_id) WHERE posts.post_id = topics.topic_first_post_id', 203 'to_type' => 'topic', 204 'to_fieldname' => '_bbp_author_ip' 205 ); 206 196 207 // Topic content. 197 // Note: We join the 'posts' table because 'topics' do not havecontent.208 // Note: We join the 'posts' table because 'topics' does not include topic content. 198 209 $this->field_map[] = array( 199 210 'from_tablename' => 'posts', … … 224 235 ); 225 236 237 // Topic status (Open or Closed) 238 $this->field_map[] = array( 239 'from_tablename' => 'topics', 240 'from_fieldname' => 'topic_status', 241 'to_type' => 'topic', 242 'to_fieldname' => 'post_status', 243 'callback_method' => 'callback_topic_status' 244 ); 245 226 246 // Topic parent forum id (If no parent, then 0) 227 247 $this->field_map[] = array( … … 231 251 'to_fieldname' => 'post_parent', 232 252 'callback_method' => 'callback_forumid' 253 ); 254 255 // Sticky status (Stored in postmeta)) 256 $this->field_map[] = array( 257 'from_tablename' => 'topics', 258 'from_fieldname' => 'topic_type', 259 'to_type' => 'topic', 260 'to_fieldname' => '_bbp_old_sticky_status', 261 'callback_method' => 'callback_sticky_status' 233 262 ); 234 263 … … 268 297 'to_fieldname' => '_bbp_last_active_time', 269 298 'callback_method' => 'callback_datetime' 270 );271 272 // Topic status (Open or Closed)273 $this->field_map[] = array(274 'from_tablename' => 'topics',275 'from_fieldname' => 'topic_status',276 'to_type' => 'topic',277 'to_fieldname' => 'post_status',278 'callback_method' => 'callback_topic_status'279 );280 281 // Topic Author ip (Stored in postmeta)282 $this->field_map[] = array(283 'from_tablename' => 'posts',284 'from_fieldname' => 'poster_ip',285 'join_tablename' => 'topics',286 'join_type' => 'INNER',287 'join_expression' => 'USING (topic_id) WHERE posts.post_id = topics.topic_first_post_id',288 'to_type' => 'topic',289 'to_fieldname' => '_bbp_author_ip'290 299 ); 291 300 … … 760 769 761 770 /** 771 * Translate the topic sticky status type from phpBB 3.x numeric's to WordPress's strings. 772 * 773 * @param int $status phpBB 3.x numeric forum type 774 * @return string WordPress safe 775 */ 776 public function callback_sticky_status( $status = 0 ) { 777 switch ( $status ) { 778 case 3 : 779 $status = 'super-sticky'; // phpBB Global Sticky 'topic_type = 3' 780 break; 781 782 case 2 : 783 $status = 'super-sticky'; // phpBB Announcement Sticky 'topic_type = 2' 784 break; 785 786 case 1 : 787 $status = 'sticky'; // phpBB Sticky 'topic_type = 1' 788 break; 789 790 case 0 : 791 default : 792 $status = 'normal'; // phpBB normal topic 'topic_type = 0' 793 break; 794 } 795 return $status; 796 } 797 798 /** 762 799 * Verify the topic reply count. 763 800 *
Note: See TracChangeset
for help on using the changeset viewer.