AEF

Implementation of AEF Forum converter.

Defined (1)

The class is defined in the following location(s).

/includes/admin/converters/AEF.php  
  1. class AEF extends BBP_Converter_Base { 
  2.  
  3. /** 
  4. * Main Constructor 
  5. * @uses AEF::setup_globals() 
  6. */ 
  7. function __construct() { 
  8. parent::__construct(); 
  9. $this->setup_globals(); 
  10.  
  11. /** 
  12. * Sets up the field mappings 
  13. */ 
  14. public function setup_globals() { 
  15.  
  16. /** Forum Section *****************************************************/ 
  17.  
  18. // Forum id (Stored in postmeta) 
  19. $this->field_map[] = array( 
  20. 'from_tablename' => 'forums',  
  21. 'from_fieldname' => 'fid',  
  22. 'to_type' => 'forum',  
  23. 'to_fieldname' => '_bbp_forum_id' 
  24. ); 
  25.  
  26. // Forum parent id (If no parent, then 0, Stored in postmeta) 
  27. $this->field_map[] = array( 
  28. 'from_tablename' => 'forums',  
  29. 'from_fieldname' => 'par_board_id',  
  30. 'to_type' => 'forum',  
  31. 'to_fieldname' => '_bbp_forum_parent_id' 
  32. ); 
  33.  
  34. // Forum topic count (Stored in postmeta) 
  35. $this->field_map[] = array( 
  36. 'from_tablename' => 'forums',  
  37. 'from_fieldname' => 'ntopic',  
  38. 'to_type' => 'forum',  
  39. 'to_fieldname' => '_bbp_topic_count' 
  40. ); 
  41.  
  42. // Forum reply count (Stored in postmeta) 
  43. $this->field_map[] = array( 
  44. 'from_tablename' => 'forums',  
  45. 'from_fieldname' => 'nposts',  
  46. 'to_type' => 'forum',  
  47. 'to_fieldname' => '_bbp_reply_count' 
  48. ); 
  49.  
  50. // Forum total topic count (Stored in postmeta) 
  51. $this->field_map[] = array( 
  52. 'from_tablename' => 'forums',  
  53. 'from_fieldname' => 'ntopic',  
  54. 'to_type' => 'forum',  
  55. 'to_fieldname' => '_bbp_total_topic_count' 
  56. ); 
  57.  
  58. // Forum total reply count (Stored in postmeta) 
  59. $this->field_map[] = array( 
  60. 'from_tablename' => 'forums',  
  61. 'from_fieldname' => 'nposts',  
  62. 'to_type' => 'forum',  
  63. 'to_fieldname' => '_bbp_total_reply_count' 
  64. ); 
  65.  
  66. // Forum title. 
  67. $this->field_map[] = array( 
  68. 'from_tablename' => 'forums',  
  69. 'from_fieldname' => 'fname',  
  70. 'to_type' => 'forum',  
  71. 'to_fieldname' => 'post_title' 
  72. ); 
  73.  
  74. // Forum slug (Clean name to avoid conflicts) 
  75. $this->field_map[] = array( 
  76. 'from_tablename' => 'forums',  
  77. 'from_fieldname' => 'fname',  
  78. 'to_type' => 'forum',  
  79. 'to_fieldname' => 'post_name',  
  80. 'callback_method' => 'callback_slug' 
  81. ); 
  82.  
  83. // Forum description. 
  84. $this->field_map[] = array( 
  85. 'from_tablename' => 'forums',  
  86. 'from_fieldname' => 'description',  
  87. 'to_type' => 'forum',  
  88. 'to_fieldname' => 'post_content',  
  89. 'callback_method' => 'callback_null' 
  90. ); 
  91.  
  92. // Forum display order (Starts from 1) 
  93. $this->field_map[] = array( 
  94. 'from_tablename' => 'forums',  
  95. 'from_fieldname' => 'forum_order',  
  96. 'to_type' => 'forum',  
  97. 'to_fieldname' => 'menu_order' 
  98. ); 
  99.  
  100. // Forum status (Unlocked = 1 or Locked = 0, Stored in postmeta) 
  101. $this->field_map[] = array( 
  102. 'from_tablename' => 'forums',  
  103. 'from_fieldname' => 'status',  
  104. 'to_type' => 'forum',  
  105. 'to_fieldname' => '_bbp_status',  
  106. 'callback_method' => 'callback_forum_status' 
  107. ); 
  108.  
  109. // Forum dates. 
  110. $this->field_map[] = array( 
  111. 'to_type' => 'forum',  
  112. 'to_fieldname' => 'post_date',  
  113. 'default' => date('Y-m-d H:i:s') 
  114. ); 
  115. $this->field_map[] = array( 
  116. 'to_type' => 'forum',  
  117. 'to_fieldname' => 'post_date_gmt',  
  118. 'default' => date('Y-m-d H:i:s') 
  119. ); 
  120. $this->field_map[] = array( 
  121. 'to_type' => 'forum',  
  122. 'to_fieldname' => 'post_modified',  
  123. 'default' => date('Y-m-d H:i:s') 
  124. ); 
  125. $this->field_map[] = array( 
  126. 'to_type' => 'forum',  
  127. 'to_fieldname' => 'post_modified_gmt',  
  128. 'default' => date('Y-m-d H:i:s') 
  129. ); 
  130.  
  131. /** Topic Section *****************************************************/ 
  132.  
  133. // Topic id (Stored in postmeta) 
  134. $this->field_map[] = array( 
  135. 'from_tablename' => 'topics',  
  136. 'from_fieldname' => 'tid',  
  137. 'to_type' => 'topic',  
  138. 'to_fieldname' => '_bbp_topic_id' 
  139. ); 
  140.  
  141. // Topic reply count (Stored in postmeta) 
  142. $this->field_map[] = array( 
  143. 'from_tablename' => 'topics',  
  144. 'from_fieldname' => 'n_posts',  
  145. 'to_type' => 'topic',  
  146. 'to_fieldname' => '_bbp_reply_count',  
  147. 'callback_method' => 'callback_topic_reply_count' 
  148. ); 
  149.  
  150. // Topic total reply count (Includes unpublished replies, Stored in postmeta) 
  151. $this->field_map[] = array( 
  152. 'from_tablename' => 'topics',  
  153. 'from_fieldname' => 'n_posts',  
  154. 'to_type' => 'topic',  
  155. 'to_fieldname' => '_bbp_total_reply_count',  
  156. 'callback_method' => 'callback_topic_reply_count' 
  157. ); 
  158.  
  159. // Topic parent forum id (If no parent, then 0, Stored in postmeta) 
  160. $this->field_map[] = array( 
  161. 'from_tablename' => 'topics',  
  162. 'from_fieldname' => 't_bid',  
  163. 'to_type' => 'topic',  
  164. 'to_fieldname' => '_bbp_forum_id',  
  165. 'callback_method' => 'callback_forumid' 
  166. ); 
  167.  
  168. // Topic author. 
  169. // Note: We join the 'posts' table because 'topics' table does not include author id. 
  170. $this->field_map[] = array( 
  171. 'from_tablename' => 'posts',  
  172. 'from_fieldname' => 'poster_id',  
  173. 'join_tablename' => 'topics',  
  174. 'join_type' => 'INNER',  
  175. 'join_expression' => 'ON topics.first_post_id = posts.pid',  
  176. 'to_type' => 'topic',  
  177. 'to_fieldname' => 'post_author',  
  178. 'callback_method' => 'callback_userid' 
  179. ); 
  180.  
  181. // Topic Author ip (Stored in postmeta) 
  182. // Note: We join the 'posts' table because 'topics' table does not include author ip. 
  183. $this->field_map[] = array( 
  184. 'from_tablename' => 'posts',  
  185. 'from_fieldname' => 'poster_ip',  
  186. 'join_tablename' => 'topics',  
  187. 'join_type' => 'INNER',  
  188. 'join_expression' => 'ON topics.first_post_id = posts.pid',  
  189. 'to_type' => 'topic',  
  190. 'to_fieldname' => '_bbp_author_ip' 
  191. ); 
  192.  
  193. // Topic content. 
  194. // Note: We join the 'posts' table because 'topics' table does not include topic content. 
  195. $this->field_map[] = array( 
  196. 'from_tablename' => 'posts',  
  197. 'from_fieldname' => 'post',  
  198. 'join_tablename' => 'topics',  
  199. 'join_type' => 'INNER',  
  200. 'join_expression' => 'ON topics.first_post_id = posts.pid',  
  201. 'to_type' => 'topic',  
  202. 'to_fieldname' => 'post_content',  
  203. 'callback_method' => 'callback_html' 
  204. ); 
  205.  
  206. // Topic title. 
  207. $this->field_map[] = array( 
  208. 'from_tablename' => 'topics',  
  209. 'from_fieldname' => 'topic',  
  210. 'to_type' => 'topic',  
  211. 'to_fieldname' => 'post_title' 
  212. ); 
  213.  
  214. // Topic slug (Clean name to avoid conflicts) 
  215. $this->field_map[] = array( 
  216. 'from_tablename' => 'topics',  
  217. 'from_fieldname' => 'topic',  
  218. 'to_type' => 'topic',  
  219. 'to_fieldname' => 'post_name',  
  220. 'callback_method' => 'callback_slug' 
  221. ); 
  222.  
  223. // Topic parent forum id (If no parent, then 0) 
  224. $this->field_map[] = array( 
  225. 'from_tablename' => 'topics',  
  226. 'from_fieldname' => 't_bid',  
  227. 'to_type' => 'topic',  
  228. 'to_fieldname' => 'post_parent',  
  229. 'callback_method' => 'callback_forumid' 
  230. ); 
  231.  
  232. // Sticky status (Stored in postmeta)) 
  233. $this->field_map[] = array( 
  234. 'from_tablename' => 'topics',  
  235. 'from_fieldname' => 't_sticky',  
  236. 'to_type' => 'topic',  
  237. 'to_fieldname' => '_bbp_old_sticky_status',  
  238. 'callback_method' => 'callback_sticky_status' 
  239. ); 
  240.  
  241. // Topic dates. 
  242. // Note: We join the 'posts' table because 'topics' table does not include topic dates. 
  243. $this->field_map[] = array( 
  244. 'from_tablename' => 'posts',  
  245. 'from_fieldname' => 'ptime',  
  246. 'join_tablename' => 'topics',  
  247. 'join_type' => 'INNER',  
  248. 'join_expression' => 'ON topics.first_post_id = posts.pid',  
  249. 'to_type' => 'topic',  
  250. 'to_fieldname' => 'post_date',  
  251. 'callback_method' => 'callback_datetime' 
  252. ); 
  253. $this->field_map[] = array( 
  254. 'from_tablename' => 'posts',  
  255. 'from_fieldname' => 'ptime',  
  256. 'join_tablename' => 'topics',  
  257. 'join_type' => 'INNER',  
  258. 'join_expression' => 'ON topics.first_post_id = posts.pid',  
  259. 'to_type' => 'topic',  
  260. 'to_fieldname' => 'post_date_gmt',  
  261. 'callback_method' => 'callback_datetime' 
  262. ); 
  263. $this->field_map[] = array( 
  264. 'from_tablename' => 'posts',  
  265. 'from_fieldname' => 'ptime',  
  266. 'join_tablename' => 'topics',  
  267. 'join_type' => 'INNER',  
  268. 'join_expression' => 'ON topics.first_post_id = posts.pid',  
  269. 'to_type' => 'topic',  
  270. 'to_fieldname' => 'post_modified',  
  271. 'callback_method' => 'callback_datetime' 
  272. ); 
  273. $this->field_map[] = array( 
  274. 'from_tablename' => 'posts',  
  275. 'from_fieldname' => 'ptime',  
  276. 'join_tablename' => 'topics',  
  277. 'join_type' => 'INNER',  
  278. 'join_expression' => 'ON topics.first_post_id = posts.pid',  
  279. 'to_type' => 'topic',  
  280. 'to_fieldname' => 'post_modified_gmt',  
  281. 'callback_method' => 'callback_datetime' 
  282. ); 
  283. $this->field_map[] = array( 
  284. 'from_tablename' => 'posts',  
  285. 'from_fieldname' => 'ptime',  
  286. 'join_tablename' => 'topics',  
  287. 'join_type' => 'INNER',  
  288. 'join_expression' => 'ON topics.first_post_id = posts.pid',  
  289. 'to_type' => 'topic',  
  290. 'to_fieldname' => '_bbp_last_active_time',  
  291. 'callback_method' => 'callback_datetime' 
  292. ); 
  293.  
  294. // Topic status (Open = 1 or Closed = 0, AEF v1.0.9) 
  295. $this->field_map[] = array( 
  296. 'from_tablename' => 'topics',  
  297. 'from_fieldname' => 't_status',  
  298. 'to_type' => 'topic',  
  299. 'to_fieldname' => 'post_status',  
  300. 'callback_method' => 'callback_topic_status' 
  301. ); 
  302.  
  303. /** Tags Section ******************************************************/ 
  304.  
  305. /** 
  306. * AEF v1.0.9 Forums do not support topic tags out of the box 
  307. */ 
  308.  
  309. /** Reply Section *****************************************************/ 
  310.  
  311. // Reply id (Stored in postmeta) 
  312. $this->field_map[] = array( 
  313. 'from_tablename' => 'posts',  
  314. 'from_fieldname' => 'pid',  
  315. 'to_type' => 'reply',  
  316. 'to_fieldname' => '_bbp_post_id' 
  317. ); 
  318.  
  319. // Reply parent forum id (If no parent, then 0, Stored in postmeta) 
  320. $this->field_map[] = array( 
  321. 'from_tablename' => 'posts',  
  322. 'from_fieldname' => 'post_fid',  
  323. 'to_type' => 'reply',  
  324. 'to_fieldname' => '_bbp_forum_id',  
  325. 'callback_method' => 'callback_topicid_to_forumid' 
  326. ); 
  327.  
  328. // Reply parent topic id (If no parent, then 0, Stored in postmeta) 
  329. $this->field_map[] = array( 
  330. 'from_tablename' => 'posts',  
  331. 'from_fieldname' => 'post_tid',  
  332. 'to_type' => 'reply',  
  333. 'to_fieldname' => '_bbp_topic_id',  
  334. 'callback_method' => 'callback_topicid' 
  335. ); 
  336.  
  337. // Reply author ip (Stored in postmeta) 
  338. $this->field_map[] = array( 
  339. 'from_tablename' => 'posts',  
  340. 'from_fieldname' => 'poster_ip',  
  341. 'to_type' => 'reply',  
  342. 'to_fieldname' => '_bbp_author_ip' 
  343. ); 
  344.  
  345. // Reply author. 
  346. $this->field_map[] = array( 
  347. 'from_tablename' => 'posts',  
  348. 'from_fieldname' => 'poster_id',  
  349. 'to_type' => 'reply',  
  350. 'to_fieldname' => 'post_author',  
  351. 'callback_method' => 'callback_userid' 
  352. ); 
  353.  
  354. // Reply title. 
  355. // Note: We join the 'topics' table because 'posts' table does not include reply title. 
  356. $this->field_map[] = array( 
  357. 'from_tablename' => 'topics',  
  358. 'from_fieldname' => 'topic',  
  359. 'join_tablename' => 'posts',  
  360. 'join_type' => 'INNER',  
  361. 'join_expression' => 'ON topics.tid = posts.post_tid WHERE topics.first_post_id != posts.pid',  
  362. 'to_type' => 'reply',  
  363. 'to_fieldname' => 'post_title',  
  364. 'callback_method' => 'callback_reply_title' 
  365. ); 
  366.  
  367. // Reply slug (Clean name to avoid conflicts) 
  368. // Note: We join the 'topics' table because 'posts' table does not include reply slug. 
  369. $this->field_map[] = array( 
  370. 'from_tablename' => 'topics',  
  371. 'from_fieldname' => 'topic',  
  372. 'join_tablename' => 'posts',  
  373. 'join_type' => 'INNER',  
  374. 'join_expression' => 'ON topics.tid = posts.post_tid WHERE topics.first_post_id != posts.pid',  
  375. 'to_type' => 'reply',  
  376. 'to_fieldname' => 'post_name',  
  377. 'callback_method' => 'callback_slug' 
  378. ); 
  379.  
  380. // Reply content. 
  381. $this->field_map[] = array( 
  382. 'from_tablename' => 'posts',  
  383. 'from_fieldname' => 'post',  
  384. 'to_type' => 'reply',  
  385. 'to_fieldname' => 'post_content',  
  386. 'callback_method' => 'callback_html' 
  387. ); 
  388.  
  389. // Reply parent topic id (If no parent, then 0) 
  390. $this->field_map[] = array( 
  391. 'from_tablename' => 'posts',  
  392. 'from_fieldname' => 'post_tid',  
  393. 'to_type' => 'reply',  
  394. 'to_fieldname' => 'post_parent',  
  395. 'callback_method' => 'callback_topicid' 
  396. ); 
  397.  
  398. // Reply dates. 
  399. $this->field_map[] = array( 
  400. 'from_tablename' => 'posts',  
  401. 'from_fieldname' => 'ptime',  
  402. 'to_type' => 'reply',  
  403. 'to_fieldname' => 'post_date',  
  404. 'callback_method' => 'callback_datetime' 
  405. ); 
  406. $this->field_map[] = array( 
  407. 'from_tablename' => 'posts',  
  408. 'from_fieldname' => 'ptime',  
  409. 'to_type' => 'reply',  
  410. 'to_fieldname' => 'post_date_gmt',  
  411. 'callback_method' => 'callback_datetime' 
  412. ); 
  413. $this->field_map[] = array( 
  414. 'from_tablename' => 'posts',  
  415. 'from_fieldname' => 'ptime',  
  416. 'to_type' => 'reply',  
  417. 'to_fieldname' => 'post_modified',  
  418. 'callback_method' => 'callback_datetime' 
  419. ); 
  420. $this->field_map[] = array( 
  421. 'from_tablename' => 'posts',  
  422. 'from_fieldname' => 'ptime',  
  423. 'to_type' => 'reply',  
  424. 'to_fieldname' => 'post_modified_gmt',  
  425. 'callback_method' => 'callback_datetime' 
  426. ); 
  427.  
  428. /** User Section ******************************************************/ 
  429.  
  430. // Store old User id (Stored in usermeta) 
  431. $this->field_map[] = array( 
  432. 'from_tablename' => 'users',  
  433. 'from_fieldname' => 'id',  
  434. 'to_type' => 'user',  
  435. 'to_fieldname' => '_bbp_user_id' 
  436. ); 
  437.  
  438. // Store old User password (Stored in usermeta serialized with salt) 
  439. $this->field_map[] = array( 
  440. 'from_tablename' => 'users',  
  441. 'from_fieldname' => 'password',  
  442. 'to_type' => 'user',  
  443. 'to_fieldname' => '_bbp_password',  
  444. 'callback_method' => 'callback_savepass' 
  445. ); 
  446.  
  447. // Store old User Salt (This is only used for the SELECT row info for the above password save) 
  448. $this->field_map[] = array( 
  449. 'from_tablename' => 'users',  
  450. 'from_fieldname' => 'salt',  
  451. 'to_type' => 'user',  
  452. 'to_fieldname' => '' 
  453. ); 
  454.  
  455. // User password verify class (Stored in usermeta for verifying password) 
  456. $this->field_map[] = array( 
  457. 'to_type' => 'users',  
  458. 'to_fieldname' => '_bbp_class',  
  459. 'default' => 'AEF' 
  460. ); 
  461.  
  462. // User name. 
  463. $this->field_map[] = array( 
  464. 'from_tablename' => 'users',  
  465. 'from_fieldname' => 'username',  
  466. 'to_type' => 'user',  
  467. 'to_fieldname' => 'user_login' 
  468. ); 
  469.  
  470. // User nice name. 
  471. $this->field_map[] = array( 
  472. 'from_tablename' => 'users',  
  473. 'from_fieldname' => 'username',  
  474. 'to_type' => 'user',  
  475. 'to_fieldname' => 'user_nicename' 
  476. ); 
  477.  
  478. // User email. 
  479. $this->field_map[] = array( 
  480. 'from_tablename' => 'users',  
  481. 'from_fieldname' => 'email',  
  482. 'to_type' => 'user',  
  483. 'to_fieldname' => 'user_email' 
  484. ); 
  485.  
  486. // User homepage. 
  487. $this->field_map[] = array( 
  488. 'from_tablename' => 'users',  
  489. 'from_fieldname' => 'www',  
  490. 'to_type' => 'user',  
  491. 'to_fieldname' => 'user_url' 
  492. ); 
  493.  
  494. // User registered. 
  495. $this->field_map[] = array( 
  496. 'from_tablename' => 'users',  
  497. 'from_fieldname' => 'r_time',  
  498. 'to_type' => 'user',  
  499. 'to_fieldname' => 'user_registered',  
  500. 'callback_method' => 'callback_datetime' 
  501. ); 
  502.  
  503. // User AIM (Stored in usermeta) 
  504. $this->field_map[] = array( 
  505. 'from_tablename' => 'users',  
  506. 'from_fieldname' => 'aim',  
  507. 'to_type' => 'user',  
  508. 'to_fieldname' => 'aim' 
  509. ); 
  510.  
  511. // User Yahoo (Stored in usermeta) 
  512. $this->field_map[] = array( 
  513. 'from_tablename' => 'users',  
  514. 'from_fieldname' => 'yim',  
  515. 'to_type' => 'user',  
  516. 'to_fieldname' => 'yim' 
  517. ); 
  518.  
  519. // Store ICQ (Stored in usermeta) 
  520. $this->field_map[] = array( 
  521. 'from_tablename' => 'users',  
  522. 'from_fieldname' => 'icq',  
  523. 'to_type' => 'user',  
  524. 'to_fieldname' => '_bbp_aef_user_icq' 
  525. ); 
  526.  
  527. // Store MSN (Stored in usermeta) 
  528. $this->field_map[] = array( 
  529. 'from_tablename' => 'users',  
  530. 'from_fieldname' => 'msn',  
  531. 'to_type' => 'user',  
  532. 'to_fieldname' => '_bbp_aef_user_msn' 
  533. ); 
  534.  
  535. // Store Gmail (Stored in usermeta) 
  536. $this->field_map[] = array( 
  537. 'from_tablename' => 'users',  
  538. 'from_fieldname' => 'gmail',  
  539. 'to_type' => 'user',  
  540. 'to_fieldname' => '_bbp_aef_user_gmail' 
  541. ); 
  542.  
  543. // Store Signature (Stored in usermeta) 
  544. $this->field_map[] = array( 
  545. 'from_tablename' => 'users',  
  546. 'from_fieldname' => 'sig',  
  547. 'to_type' => 'user',  
  548. 'to_fieldname' => '_bbp_aef_user_sig',  
  549. 'callback_method' => 'callback_html' 
  550. ); 
  551.  
  552. // Store Location (Stored in usermeta) 
  553. $this->field_map[] = array( 
  554. 'from_tablename' => 'users',  
  555. 'from_fieldname' => 'location',  
  556. 'to_type' => 'user',  
  557. 'to_fieldname' => '_bbp_aef_user_location' 
  558. ); 
  559.  
  560. // Store PrivateText (Stored in usermeta) 
  561. $this->field_map[] = array( 
  562. 'from_tablename' => 'users',  
  563. 'from_fieldname' => 'users_text',  
  564. 'to_type' => 'user',  
  565. 'to_fieldname' => '_bbp_aef_user_private_text' 
  566. ); 
  567.  
  568.  
  569. /** 
  570. * This method allows us to indicates what is or is not converted for each 
  571. * converter. 
  572. */ 
  573. public function info() 
  574. return ''; 
  575.  
  576. /** 
  577. * This method is to save the salt and password together. That 
  578. * way when we authenticate it we can get it out of the database 
  579. * as one value. Array values are auto sanitized by WordPress. 
  580. */ 
  581. public function callback_savepass( $field, $row ) 
  582. $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] ); 
  583. return $pass_array; 
  584.  
  585. /** 
  586. * This method is to take the pass out of the database and compare 
  587. * to a pass the user has typed in. 
  588. */ 
  589. public function authenticate_pass( $password, $serialized_pass ) 
  590. $pass_array = unserialize( $serialized_pass ); 
  591. return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) ); 
  592.  
  593. /** 
  594. * Translate the forum status from AEF v1.0.9 numeric's to WordPress's strings. 
  595. * @param int $status AEF v1.0.9 numeric forum status 
  596. * @return string WordPress safe 
  597. */ 
  598. public function callback_forum_status( $status = 1 ) { 
  599. switch ( $status ) { 
  600. case 0 : 
  601. $status = 'closed'; 
  602. break; 
  603.  
  604. case 1 : 
  605. default : 
  606. $status = 'open'; 
  607. break; 
  608. return $status; 
  609.  
  610. /** 
  611. * Translate the post status from AEF v1.0.9 numeric's to WordPress's strings. 
  612. * @param int $status AEF v1.0.9 numeric topic status 
  613. * @return string WordPress safe 
  614. */ 
  615. public function callback_topic_status( $status = 1 ) { 
  616. switch ( $status ) { 
  617. case 0 : 
  618. $status = 'closed'; 
  619. break; 
  620.  
  621. case 1 : 
  622. default : 
  623. $status = 'publish'; 
  624. break; 
  625. return $status; 
  626.  
  627. /** 
  628. * Translate the topic sticky status type from AEF 1.x numeric's to WordPress's strings. 
  629. * @param int $status AEF 1.x numeric forum type 
  630. * @return string WordPress safe 
  631. */ 
  632. public function callback_sticky_status( $status = 0 ) { 
  633. switch ( $status ) { 
  634. case 1 : 
  635. $status = 'sticky'; // AEF Sticky 't_sticky = 1' 
  636. break; 
  637.  
  638. case 0 : 
  639. default : 
  640. $status = 'normal'; // AEF normal topic 't_sticky = 0' 
  641. break; 
  642. return $status; 
  643.  
  644. /** 
  645. * Verify the topic/reply count. 
  646. * @param int $count AEF v1.0.9 topic/reply counts 
  647. * @return string WordPress safe 
  648. */ 
  649. public function callback_topic_reply_count( $count = 1 ) { 
  650. $count = absint( (int) $count - 1 ); 
  651. return $count; 
  652.  
  653. /** 
  654. * Set the reply title 
  655. * @param string $title AEF v1.0.9 topic title of this reply 
  656. * @return string Prefixed topic title, or empty string 
  657. */ 
  658. public function callback_reply_title( $title = '' ) { 
  659. $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : ''; 
  660. return $title;