Example

Example converter base impoprter template for bbPress.

Defined (1)

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

/includes/admin/converters/Example.php  
  1. class Example extends BBP_Converter_Base { 
  2.  
  3. /** 
  4. * Main Constructor 
  5. * @uses Example_Converter::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. // Setup table joins for the forum section at the base of this section 
  19.  
  20. // Forum id (Stored in postmeta) 
  21. $this->field_map[] = array( 
  22. 'from_tablename' => 'forums_table',  
  23. 'from_fieldname' => 'the_forum_id',  
  24. 'to_type' => 'forum',  
  25. 'to_fieldname' => '_bbp_forum_id' 
  26. ); 
  27.  
  28. // Forum parent id (If no parent, then 0. Stored in postmeta) 
  29. $this->field_map[] = array( 
  30. 'from_tablename' => 'forums_table',  
  31. 'from_fieldname' => 'the_parent_id',  
  32. 'to_type' => 'forum',  
  33. 'to_fieldname' => '_bbp_forum_parent_id' 
  34. ); 
  35.  
  36. // Forum topic count (Stored in postmeta) 
  37. $this->field_map[] = array( 
  38. 'from_tablename' => 'forums_table',  
  39. 'from_fieldname' => 'the_topic_count',  
  40. 'to_type' => 'forum',  
  41. 'to_fieldname' => '_bbp_topic_count' 
  42. ); 
  43.  
  44. // Forum reply count (Stored in postmeta) 
  45. $this->field_map[] = array( 
  46. 'from_tablename' => 'forums_table',  
  47. 'from_fieldname' => 'the_reply_count',  
  48. 'to_type' => 'forum',  
  49. 'to_fieldname' => '_bbp_reply_count' 
  50. ); 
  51.  
  52. // Forum total topic count (Stored in postmeta) 
  53. $this->field_map[] = array( 
  54. 'from_tablename' => 'forums_table',  
  55. 'from_fieldname' => 'the_total_topic_count',  
  56. 'to_type' => 'forum',  
  57. 'to_fieldname' => '_bbp_total_topic_count' 
  58. ); 
  59.  
  60. // Forum total reply count (Stored in postmeta) 
  61. $this->field_map[] = array( 
  62. 'from_tablename' => 'forums_table',  
  63. 'from_fieldname' => 'the_total_reply_count',  
  64. 'to_type' => 'forum',  
  65. 'to_fieldname' => '_bbp_total_reply_count' 
  66. ); 
  67.  
  68. // Forum title. 
  69. $this->field_map[] = array( 
  70. 'from_tablename' => 'forums_table',  
  71. 'from_fieldname' => 'the_forum_title',  
  72. 'to_type' => 'forum',  
  73. 'to_fieldname' => 'post_title' 
  74. ); 
  75.  
  76. // Forum slug (Clean name to avoid confilcts) 
  77. $this->field_map[] = array( 
  78. 'from_tablename' => 'forums_table',  
  79. 'from_fieldname' => 'the_forum_slug',  
  80. 'to_type' => 'forum',  
  81. 'to_fieldname' => 'post_name',  
  82. 'callback_method' => 'callback_slug' 
  83. ); 
  84.  
  85. // Forum description. 
  86. $this->field_map[] = array( 
  87. 'from_tablename' => 'forums_table',  
  88. 'from_fieldname' => 'the_forum_description',  
  89. 'to_type' => 'forum',  
  90. 'to_fieldname' => 'post_content',  
  91. 'callback_method' => 'callback_null' 
  92. ); 
  93.  
  94. // Forum display order (Starts from 1) 
  95. $this->field_map[] = array( 
  96. 'from_tablename' => 'forums_table',  
  97. 'from_fieldname' => 'the_forum_order',  
  98. 'to_type' => 'forum',  
  99. 'to_fieldname' => 'menu_order' 
  100. ); 
  101.  
  102. // Forum dates. 
  103. $this->field_map[] = array( 
  104. 'to_type' => 'forum',  
  105. 'to_fieldname' => 'post_date',  
  106. 'default' => date('Y-m-d H:i:s') 
  107. ); 
  108. $this->field_map[] = array( 
  109. 'to_type' => 'forum',  
  110. 'to_fieldname' => 'post_date_gmt',  
  111. 'default' => date('Y-m-d H:i:s') 
  112. ); 
  113. $this->field_map[] = array( 
  114. 'to_type' => 'forum',  
  115. 'to_fieldname' => 'post_modified',  
  116. 'default' => date('Y-m-d H:i:s') 
  117. ); 
  118. $this->field_map[] = array( 
  119. 'to_type' => 'forum',  
  120. 'to_fieldname' => 'post_modified_gmt',  
  121. 'default' => date('Y-m-d H:i:s') 
  122. ); 
  123.  
  124. // Setup the table joins for the forum section 
  125. $this->field_map[] = array( 
  126. 'from_tablename' => 'groups_table',  
  127. 'from_fieldname' => 'forum_id',  
  128. 'join_tablename' => 'forums_table',  
  129. 'join_type' => 'INNER',  
  130. 'join_expression' => 'USING groups_table.forum_id = forums_table.forum_id',  
  131. // 'from_expression' => 'WHERE forums_table.forum_id != 1',  
  132. 'to_type' => 'forum' 
  133. ); 
  134.  
  135. /** Topic Section *****************************************************/ 
  136.  
  137. // Setup table joins for the topic section at the base of this section 
  138.  
  139. // Topic id (Stored in postmeta) 
  140. $this->field_map[] = array( 
  141. 'from_tablename' => 'topics_table',  
  142. 'from_fieldname' => 'the_topic_id',  
  143. 'to_type' => 'topic',  
  144. 'to_fieldname' => '_bbp_topic_id' 
  145. ); 
  146.  
  147. // Topic reply count (Stored in postmeta) 
  148. $this->field_map[] = array( 
  149. 'from_tablename' => 'topics_table',  
  150. 'from_fieldname' => 'the_topic_reply_count',  
  151. 'to_type' => 'topic',  
  152. 'to_fieldname' => '_bbp_reply_count',  
  153. 'callback_method' => 'callback_topic_reply_count' 
  154. ); 
  155.  
  156. // Topic total reply count (Stored in postmeta) 
  157. $this->field_map[] = array( 
  158. 'from_tablename' => 'topics_table',  
  159. 'from_fieldname' => 'the_total_topic_reply_count',  
  160. 'to_type' => 'topic',  
  161. 'to_fieldname' => '_bbp_total_reply_count',  
  162. 'callback_method' => 'callback_topic_reply_count' 
  163. ); 
  164.  
  165. // Topic parent forum id (If no parent, then 0. Stored in postmeta) 
  166. $this->field_map[] = array( 
  167. 'from_tablename' => 'topics_table',  
  168. 'from_fieldname' => 'the_topic_parent_forum_id',  
  169. 'to_type' => 'topic',  
  170. 'to_fieldname' => '_bbp_forum_id',  
  171. 'callback_method' => 'callback_forumid' 
  172. ); 
  173.  
  174. // Topic author. 
  175. $this->field_map[] = array( 
  176. 'from_tablename' => 'topics_table',  
  177. 'from_fieldname' => 'the_topic_author_id',  
  178. 'to_type' => 'topic',  
  179. 'to_fieldname' => 'post_author',  
  180. 'callback_method' => 'callback_userid' 
  181. ); 
  182.  
  183. // Topic author ip (Stored in postmeta) 
  184. $this->field_map[] = array( 
  185. 'from_tablename' => 'topics_table',  
  186. 'from_fieldname' => 'the_topic_author_ip_address',  
  187. 'to_type' => 'topic',  
  188. 'to_fieldname' => '_bbp_author_ip' 
  189. ); 
  190.  
  191. // Topic content. 
  192. $this->field_map[] = array( 
  193. 'from_tablename' => 'topics_table',  
  194. 'from_fieldname' => 'the_topic_content',  
  195. 'to_type' => 'topic',  
  196. 'to_fieldname' => 'post_content',  
  197. 'callback_method' => 'callback_html' 
  198. ); 
  199.  
  200. // Topic title. 
  201. $this->field_map[] = array( 
  202. 'from_tablename' => 'topics_table',  
  203. 'from_fieldname' => 'the_topic_title',  
  204. 'to_type' => 'topic',  
  205. 'to_fieldname' => 'post_title' 
  206. ); 
  207.  
  208. // Topic slug (Clean name to avoid conflicts) 
  209. $this->field_map[] = array( 
  210. 'from_tablename' => 'topics_table',  
  211. 'from_fieldname' => 'the_topic_slug',  
  212. 'to_type' => 'topic',  
  213. 'to_fieldname' => 'post_name',  
  214. 'callback_method' => 'callback_slug' 
  215. ); 
  216.  
  217. // Topic parent forum id (If no parent, then 0) 
  218. $this->field_map[] = array( 
  219. 'from_tablename' => 'topics_table',  
  220. 'from_fieldname' => 'the_topic_parent_forum_id',  
  221. 'to_type' => 'topic',  
  222. 'to_fieldname' => 'post_parent',  
  223. 'callback_method' => 'callback_forumid' 
  224. ); 
  225.  
  226. // Sticky status (Stored in postmeta)) 
  227. $this->field_map[] = array( 
  228. 'from_tablename' => 'topics_table',  
  229. 'from_fieldname' => 'the_topic_sticky_status',  
  230. 'to_type' => 'topic',  
  231. 'to_fieldname' => '_bbp_old_sticky_status',  
  232. 'callback_method' => 'callback_sticky_status' 
  233. ); 
  234.  
  235. // Topic dates. 
  236. $this->field_map[] = array( 
  237. 'from_tablename' => 'topics_table',  
  238. 'from_fieldname' => 'the_topic_creation_date',  
  239. 'to_type' => 'topic',  
  240. 'to_fieldname' => 'post_date',  
  241. 'callback_method' => 'callback_datetime' 
  242. ); 
  243. $this->field_map[] = array( 
  244. 'from_tablename' => 'topics_table',  
  245. 'from_fieldname' => 'the_topic_creation_date',  
  246. 'to_type' => 'topic',  
  247. 'to_fieldname' => 'post_date_gmt',  
  248. 'callback_method' => 'callback_datetime' 
  249. ); 
  250. $this->field_map[] = array( 
  251. 'from_tablename' => 'topics_table',  
  252. 'from_fieldname' => 'the_topic_modified_date',  
  253. 'to_type' => 'topic',  
  254. 'to_fieldname' => 'post_modified',  
  255. 'callback_method' => 'callback_datetime' 
  256. ); 
  257. $this->field_map[] = array( 
  258. 'from_tablename' => 'topics_table',  
  259. 'from_fieldname' => 'the_topic_modified_date',  
  260. 'to_type' => 'topic',  
  261. 'to_fieldname' => 'post_modified_gmt',  
  262. 'callback_method' => 'callback_datetime' 
  263. ); 
  264. $this->field_map[] = array( 
  265. 'from_tablename' => 'topics_table',  
  266. 'from_fieldname' => 'the_topic_modified_date',  
  267. 'to_type' => 'topic',  
  268. 'to_fieldname' => '_bbp_last_active_time',  
  269. 'callback_method' => 'callback_datetime' 
  270. ); 
  271.  
  272. // Setup any table joins needed for the topic section 
  273. $this->field_map[] = array( 
  274. 'from_tablename' => 'replies_table',  
  275. 'from_fieldname' => 'the_topic_id',  
  276. 'join_tablename' => 'topics_table',  
  277. 'join_type' => 'INNER',  
  278. 'join_expression' => 'USING replies_table.the_topic_id = topics_table.the_topic_id',  
  279. 'from_expression' => 'WHERE forums_table.the_topic_id = 0',  
  280. 'to_type' => 'topic' 
  281. ); 
  282.  
  283. /** Tags Section ******************************************************/ 
  284.  
  285. // Setup table joins for the tag section at the base of this section 
  286. // Setup any table joins needed for the tags section 
  287. $this->field_map[] = array( 
  288. 'from_tablename' => 'tag_table',  
  289. 'from_fieldname' => 'the_topic_id',  
  290. 'join_tablename' => 'tagcontent_table',  
  291. 'join_type' => 'INNER',  
  292. 'join_expression' => 'USING tagcontent_table.tag_id = tags_table.tag_id',  
  293. 'from_expression' => 'WHERE tagcontent_table.tag_id = tag_table.tag_id',  
  294. 'to_type' => 'tags' 
  295. ); 
  296.  
  297. // Topic id. 
  298. $this->field_map[] = array( 
  299. 'from_tablename' => 'tagcontent_table',  
  300. 'from_fieldname' => 'contentid',  
  301. 'to_type' => 'tags',  
  302. 'to_fieldname' => 'objectid',  
  303. 'callback_method' => 'callback_topicid' 
  304. ); 
  305.  
  306. // Taxonomy ID. 
  307. $this->field_map[] = array( 
  308. 'from_tablename' => 'tagcontent_table',  
  309. 'from_fieldname' => 'tagid',  
  310. 'to_type' => 'tags',  
  311. 'to_fieldname' => 'taxonomy' 
  312. ); 
  313.  
  314. // Term text. 
  315. $this->field_map[] = array( 
  316. 'from_tablename' => 'tag_table',  
  317. 'from_fieldname' => 'tagtext',  
  318. 'to_type' => 'tags',  
  319. 'to_fieldname' => 'name' 
  320. ); 
  321.  
  322. // Term slug. 
  323. $this->field_map[] = array( 
  324. 'from_tablename' => 'tag_table',  
  325. 'from_fieldname' => 'tagslug',  
  326. 'to_type' => 'tags',  
  327. 'to_fieldname' => 'slug',  
  328. 'callback_method' => 'callback_slug' 
  329. ); 
  330.  
  331. // Term description. 
  332. $this->field_map[] = array( 
  333. 'from_tablename' => 'tag_table',  
  334. 'from_fieldname' => 'tagdescription',  
  335. 'to_type' => 'tags',  
  336. 'to_fieldname' => 'description' 
  337. ); 
  338.  
  339. /** Reply Section *****************************************************/ 
  340.  
  341. // Setup table joins for the reply section at the base of this section 
  342.  
  343. // Reply id (Stored in postmeta) 
  344. $this->field_map[] = array( 
  345. 'from_tablename' => 'replies_table',  
  346. 'from_fieldname' => 'the_reply_id',  
  347. 'to_type' => 'reply',  
  348. 'to_fieldname' => '_bbp_post_id' 
  349. ); 
  350.  
  351. // Reply parent forum id (If no parent, then 0. Stored in postmeta) 
  352. $this->field_map[] = array( 
  353. 'from_tablename' => 'replies_table',  
  354. 'from_fieldname' => 'the_reply_parent_forum_id',  
  355. 'to_type' => 'reply',  
  356. 'to_fieldname' => '_bbp_forum_id',  
  357. 'callback_method' => 'callback_topicid_to_forumid' 
  358. ); 
  359.  
  360. // Reply parent topic id (If no parent, then 0. Stored in postmeta) 
  361. $this->field_map[] = array( 
  362. 'from_tablename' => 'replies_table',  
  363. 'from_fieldname' => 'the_reply_parent_topic_id',  
  364. 'to_type' => 'reply',  
  365. 'to_fieldname' => '_bbp_topic_id',  
  366. 'callback_method' => 'callback_topicid' 
  367. ); 
  368.  
  369. // Reply author ip (Stored in postmeta) 
  370. $this->field_map[] = array( 
  371. 'from_tablename' => 'replies_table',  
  372. 'from_fieldname' => 'the_reply_author_ip_address',  
  373. 'to_type' => 'reply',  
  374. 'to_fieldname' => '_bbp_author_ip' 
  375. ); 
  376.  
  377. // Reply author. 
  378. $this->field_map[] = array( 
  379. 'from_tablename' => 'replies_table',  
  380. 'from_fieldname' => 'the_reply_author_id',  
  381. 'to_type' => 'reply',  
  382. 'to_fieldname' => 'post_author',  
  383. 'callback_method' => 'callback_userid' 
  384. ); 
  385.  
  386. // Reply title. 
  387. $this->field_map[] = array( 
  388. 'from_tablename' => 'replies_table',  
  389. 'from_fieldname' => 'the_reply_title',  
  390. 'to_type' => 'reply',  
  391. 'to_fieldname' => 'post_title' 
  392. ); 
  393.  
  394. // Reply slug (Clean name to avoid conflicts) 
  395. $this->field_map[] = array( 
  396. 'from_tablename' => 'replies_table',  
  397. 'from_fieldname' => 'the_reply_slug',  
  398. 'to_type' => 'reply',  
  399. 'to_fieldname' => 'post_name',  
  400. 'callback_method' => 'callback_slug' 
  401. ); 
  402.  
  403. // Reply content. 
  404. $this->field_map[] = array( 
  405. 'from_tablename' => 'replies_table',  
  406. 'from_fieldname' => 'the_reply_content',  
  407. 'to_type' => 'reply',  
  408. 'to_fieldname' => 'post_content',  
  409. 'callback_method' => 'callback_html' 
  410. ); 
  411.  
  412. // Reply order. 
  413. $this->field_map[] = array( 
  414. 'from_tablename' => 'replies_table',  
  415. 'from_fieldname' => 'the_reply_order',  
  416. 'to_type' => 'reply',  
  417. 'to_fieldname' => 'menu_order' 
  418. ); 
  419.  
  420. // Reply parent topic id (If no parent, then 0) 
  421. $this->field_map[] = array( 
  422. 'from_tablename' => 'replies_table',  
  423. 'from_fieldname' => 'the_reply_parent_topic_id',  
  424. 'to_type' => 'reply',  
  425. 'to_fieldname' => 'post_parent',  
  426. 'callback_method' => 'callback_topicid' 
  427. ); 
  428.  
  429. // Reply dates. 
  430. $this->field_map[] = array( 
  431. 'from_tablename' => 'replies_table',  
  432. 'from_fieldname' => 'the_reply_creation_date',  
  433. 'to_type' => 'reply',  
  434. 'to_fieldname' => 'post_date',  
  435. 'callback_method' => 'callback_datetime' 
  436. ); 
  437. $this->field_map[] = array( 
  438. 'from_tablename' => 'replies_table',  
  439. 'from_fieldname' => 'the_reply_creation_date',  
  440. 'to_type' => 'reply',  
  441. 'to_fieldname' => 'post_date_gmt',  
  442. 'callback_method' => 'callback_datetime' 
  443. ); 
  444. $this->field_map[] = array( 
  445. 'from_tablename' => 'replies_table',  
  446. 'from_fieldname' => 'the_reply_modified_date',  
  447. 'to_type' => 'reply',  
  448. 'to_fieldname' => 'post_modified',  
  449. 'callback_method' => 'callback_datetime' 
  450. ); 
  451. $this->field_map[] = array( 
  452. 'from_tablename' => 'replies_table',  
  453. 'from_fieldname' => 'the_reply_modified_date',  
  454. 'to_type' => 'reply',  
  455. 'to_fieldname' => 'post_modified_gmt',  
  456. 'callback_method' => 'callback_datetime' 
  457. ); 
  458.  
  459. // Setup any table joins needed for the reply section 
  460. $this->field_map[] = array( 
  461. 'from_tablename' => 'topics_table',  
  462. 'from_fieldname' => 'the_topic_id',  
  463. 'join_tablename' => 'replies_table',  
  464. 'join_type' => 'INNER',  
  465. 'join_expression' => 'USING topics_table.the_topic_id = replies_table.the_topic_id',  
  466. 'from_expression' => 'WHERE topics_table.first_post != 0',  
  467. 'to_type' => 'reply' 
  468. ); 
  469.  
  470. /** User Section ******************************************************/ 
  471.  
  472. // Setup table joins for the user section at the base of this section 
  473.  
  474. // Store old User id (Stored in usermeta) 
  475. $this->field_map[] = array( 
  476. 'from_tablename' => 'users_table',  
  477. 'from_fieldname' => 'the_users_id',  
  478. 'to_type' => 'user',  
  479. 'to_fieldname' => '_bbp_user_id' 
  480. ); 
  481.  
  482. // Store old User password (Stored in usermeta serialized with salt) 
  483. $this->field_map[] = array( 
  484. 'from_tablename' => 'users_table',  
  485. 'from_fieldname' => 'the_users_password',  
  486. 'to_type' => 'user',  
  487. 'to_fieldname' => '_bbp_password',  
  488. 'callback_method' => 'callback_savepass' 
  489. ); 
  490.  
  491. // Store old User Salt (This is only used for the SELECT row info for the above password save) 
  492. $this->field_map[] = array( 
  493. 'from_tablename' => 'users_table',  
  494. 'from_fieldname' => 'the_users_password_salt',  
  495. 'to_type' => 'user',  
  496. 'to_fieldname' => '' 
  497. ); 
  498.  
  499. // User password verify class (Stored in usermeta for verifying password) 
  500. $this->field_map[] = array( 
  501. 'to_type' => 'user',  
  502. 'to_fieldname' => '_bbp_class',  
  503. 'default' => 'Example' 
  504. ); 
  505.  
  506. // User name. 
  507. $this->field_map[] = array( 
  508. 'from_tablename' => 'users_table',  
  509. 'from_fieldname' => 'the_users_username',  
  510. 'to_type' => 'user',  
  511. 'to_fieldname' => 'user_login' 
  512. ); 
  513.  
  514. // User nice name. 
  515. $this->field_map[] = array( 
  516. 'from_tablename' => 'users_table',  
  517. 'from_fieldname' => 'the_users_nicename',  
  518. 'to_type' => 'user',  
  519. 'to_fieldname' => 'user_nicename' 
  520. ); 
  521.  
  522. // User email. 
  523. $this->field_map[] = array( 
  524. 'from_tablename' => 'users_table',  
  525. 'from_fieldname' => 'the_users_email_address',  
  526. 'to_type' => 'user',  
  527. 'to_fieldname' => 'user_email' 
  528. ); 
  529.  
  530. // User homepage. 
  531. $this->field_map[] = array( 
  532. 'from_tablename' => 'users_table',  
  533. 'from_fieldname' => 'the_users_homepage_url',  
  534. 'to_type' => 'user',  
  535. 'to_fieldname' => 'user_url' 
  536. ); 
  537.  
  538. // User registered. 
  539. $this->field_map[] = array( 
  540. 'from_tablename' => 'users_table',  
  541. 'from_fieldname' => 'the_users_registration_date',  
  542. 'to_type' => 'user',  
  543. 'to_fieldname' => 'user_registered',  
  544. 'callback_method' => 'callback_datetime' 
  545. ); 
  546.  
  547. // User status. 
  548. $this->field_map[] = array( 
  549. 'from_tablename' => 'users_table',  
  550. 'from_fieldname' => 'the_users_status',  
  551. 'to_type' => 'user',  
  552. 'to_fieldname' => 'user_status' 
  553. ); 
  554.  
  555. // User display name. 
  556. $this->field_map[] = array( 
  557. 'from_tablename' => 'users_table',  
  558. 'from_fieldname' => 'the_users_display_name',  
  559. 'to_type' => 'user',  
  560. 'to_fieldname' => 'display_name' 
  561. ); 
  562.  
  563. // User AIM (Stored in usermeta) 
  564. $this->field_map[] = array( 
  565. 'from_tablename' => 'users_table',  
  566. 'from_fieldname' => 'the_users_aim',  
  567. 'to_type' => 'user',  
  568. 'to_fieldname' => 'aim' 
  569. ); 
  570.  
  571. // User Yahoo (Stored in usermeta) 
  572. $this->field_map[] = array( 
  573. 'from_tablename' => 'users_table',  
  574. 'from_fieldname' => 'the_users_yahoo',  
  575. 'to_type' => 'user',  
  576. 'to_fieldname' => 'yim' 
  577. ); 
  578.  
  579. // User Jabber (Stored in usermeta) 
  580. $this->field_map[] = array( 
  581. 'from_tablename' => 'users_table',  
  582. 'from_fieldname' => 'the_users_jabber',  
  583. 'to_type' => 'user',  
  584. 'to_fieldname' => 'jabber' 
  585. ); 
  586.  
  587. // Setup any table joins needed for the user section 
  588. $this->field_map[] = array( 
  589. 'from_tablename' => 'users_profile_table',  
  590. 'from_fieldname' => 'the_users_id',  
  591. 'join_tablename' => 'users_table',  
  592. 'join_type' => 'INNER',  
  593. 'join_expression' => 'USING users_profile_table.the_user_id = users_table.the_user_id',  
  594. 'from_expression' => 'WHERE users_table.the_user_id != -1',  
  595. 'to_type' => 'user' 
  596. ); 
  597.  
  598. /** 
  599. * This method allows us to indicates what is or is not converted for each 
  600. * converter. 
  601. */ 
  602. public function info() { 
  603. return ''; 
  604.  
  605. /** 
  606. * This method is to save the salt and password together. That 
  607. * way when we authenticate it we can get it out of the database 
  608. * as one value. Array values are auto sanitized by WordPress. 
  609. */ 
  610. public function callback_savepass( $field, $row ) { 
  611. $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] ); 
  612. return $pass_array; 
  613.  
  614. /** 
  615. * This method is to take the pass out of the database and compare 
  616. * to a pass the user has typed in. 
  617. */ 
  618. public function authenticate_pass( $password, $serialized_pass ) { 
  619. $pass_array = unserialize( $serialized_pass ); 
  620. return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) );