예제 #1
0
 function convert_data($data)
 {
     $insert_data = array();
     // phpBB 2 values
     $insert_data['import_tid'] = $data['topic_id'];
     $insert_data['sticky'] = $data['topic_type'];
     $insert_data['fid'] = $this->get_import->fid_f($data['forum_id']);
     $insert_data['import_firstpost'] = $data['topic_first_post_id'];
     $insert_data['dateline'] = $data['topic_time'];
     $insert_data['subject'] = encode_to_utf8(utf8_unhtmlentities($data['topic_title']), "topics", "threads");
     $insert_data['uid'] = $this->get_import->uid($data['topic_poster']);
     $insert_data['import_uid'] = $data['topic_poster'];
     $insert_data['views'] = $data['topic_views'];
     $insert_data['closed'] = $data['topic_status'];
     if ($insert_data['closed'] == "no") {
         $insert_data['closed'] = '';
     }
     // Shadow topic?
     if ($insert_data['closed'] == 2) {
         $insert_data['closed'] = 0;
     }
     if ($data['topic_moved_id']) {
         $insert_data['closed'] .= "|" . $this->get_import->tid($data['topic_moved_id']);
     }
     // phpBB 2 has a sticky value of '2' which stands for announcement threads. Our announcements system is seperate.
     if ($insert_data['sticky'] > 1) {
         $insert_data['sticky'] = 1;
     }
     return $insert_data;
 }
예제 #2
0
 function convert_data($data)
 {
     global $db;
     $insert_data = array();
     $query = $this->old_db->simple_select("pm_recipients", "*", "id_pm = '{$data['id_pm']}'");
     $sep = '';
     while ($recip = $this->old_db->fetch_field($query, 'id_member')) {
         $recip_list .= $sep . $recip;
         $sep = ',';
     }
     $this->old_db->free_result($query);
     $recip_list = explode(",", $recip_list);
     // SMF values
     $insert_data['pmid'] = null;
     $insert_data['import_pmid'] = $data['id_pm'];
     $insert_data['uid'] = $this->get_import->uid($data['id_member']);
     $insert_data['fromid'] = $this->get_import->uid($data['id_member_from']);
     $insert_data['toid'] = $this->get_import->uid($recip_list['0']);
     $insert_data['recipients'] = serialize($recip_list);
     $insert_data['folder'] = '1';
     $insert_data['subject'] = encode_to_utf8($data['subject'], "personal_messages", "privatemessages");
     $insert_data['status'] = $data['is_read'];
     $insert_data['dateline'] = $data['msgtime'];
     $insert_data['message'] = encode_to_utf8($this->bbcode_parser->convert(utf8_unhtmlentities($data['body'])), "personal_messages", "privatemessages");
     if ($insert_data['status'] == '1') {
         $insert_data['readtime'] = TIME_NOW;
         $insert_data['receipt'] = '2';
     }
     // Hack to work around SMF 2's way of storing multiple recipients in the db...
     // NOT a very efficient way to handle this, but it works for now.
     $this->insert_extra_pms($recip_list, $insert_data);
     return $insert_data;
 }
예제 #3
0
파일: posts.php 프로젝트: dgrp/merge-system
 function convert_data($data)
 {
     $insert_data = array();
     // phpBB 2 values
     $insert_data['import_pid'] = $data['post_id'];
     $insert_data['tid'] = $this->get_import->tid($data['topic_id']);
     // Check the last post for any NULL's, converted by phpBB's parser to a default topic
     if ($data['post_subject'] === 'NULL') {
         $data['post_subject'] = 'Welcome to phpBB 2';
     }
     // Get Username
     $topic_poster = $this->get_user($data['poster_id']);
     // Check to see if we need to inherit any post subjects from the thread
     if (empty($data['post_subject'])) {
         $query = $this->old_db->simple_select("topics", "topic_first_post_id, topic_title", "topic_first_post_id='{$data['post_id']}'", array('limit' => 1));
         $topic = $this->old_db->fetch_array($query);
         $this->old_db->free_result($query);
         if ($topic['topic_first_post_id'] == $data['post_id']) {
             $data['post_subject'] = 'RE: ' . $topic['topic_title'];
         }
     }
     $insert_data['fid'] = $this->get_import->fid_f($data['forum_id']);
     $insert_data['subject'] = encode_to_utf8(utf8_unhtmlentities($data['post_subject']), "posts", "posts");
     $insert_data['uid'] = $this->get_import->uid($data['poster_id']);
     $insert_data['import_uid'] = $data['poster_id'];
     $insert_data['username'] = $this->get_import->username($data['poster_id'], $topic_poster['username']);
     $insert_data['dateline'] = $data['post_time'];
     $insert_data['message'] = encode_to_utf8($this->bbcode_parser->convert($data['post_text'], $data['bbcode_uid']), "posts", "posts");
     $insert_data['ipaddress'] = $this->decode_ip($data['poster_ip']);
     $insert_data['includesig'] = $data['enable_sig'];
     $insert_data['smilieoff'] = int_to_01($data['enable_smilies']);
     return $insert_data;
 }
예제 #4
0
 /**
  * Converts messages containing phpBB code to MyBB BBcode
  *
  * @param string the text to convert
  * @param int user id of the text
  * @return string the converted text
  */
 function convert($text, $uid = 0)
 {
     $text = str_replace(':' . $uid, '', utf8_unhtmlentities($text));
     $text = str_replace("[/list:u]", "[/list]", $text);
     $text = str_replace("[/list:o]", "[/list]", $text);
     $text = str_replace("[code:1]", "[code]", $text);
     $text = str_replace("[/code:1]", "[/code]", $text);
     return $text;
 }
예제 #5
0
파일: users.php 프로젝트: dgrp/merge-system
 function convert_data($data)
 {
     $insert_data = array();
     // phpBB 2 values
     $insert_data['usergroup'] = $this->board->get_group_id($data, array("not_multiple" => true));
     $insert_data['additionalgroups'] = str_replace($insert_data['usergroup'], '', $this->board->get_group_id($data));
     $insert_data['displaygroup'] = $this->board->get_group_id($data, array("not_multiple" => true));
     $insert_data['import_usergroup'] = $this->board->get_group_id($data, array("not_multiple" => true, "original" => true));
     $insert_data['import_additionalgroups'] = $this->board->get_group_id($data, array("original" => true));
     $insert_data['import_displaygroup'] = $data['group_id'];
     $insert_data['import_uid'] = $data['user_id'];
     $insert_data['username'] = encode_to_utf8($data['username'], "users", "users");
     $insert_data['email'] = $data['user_email'];
     $insert_data['regdate'] = $data['user_regdate'];
     $insert_data['lastactive'] = $data['user_lastvisit'];
     $insert_data['lastvisit'] = $data['user_lastvisit'];
     $insert_data['website'] = $data['user_website'];
     $insert_data['avatar'] = $data['user_avatar'];
     list($width, $height) = @getimagesize($data['user_avatar']);
     $insert_data['avatardimensions'] = $width . '|' . $height;
     if ($insert_data['avatar'] == '') {
         $insert_data['avatartype'] = "";
     } else {
         $insert_data['avatartype'] = 'remote';
     }
     $last_post = $this->get_last_post($data['user_id']);
     $insert_data['lastpost'] = intval($last_post['post_time']);
     $insert_data['icq'] = $data['user_icq'];
     $insert_data['aim'] = $data['user_aim'];
     $insert_data['yahoo'] = $data['user_yim'];
     $insert_data['msn'] = $data['user_msnm'];
     $insert_data['hideemail'] = $data['hideEmail'];
     $insert_data['invisible'] = int_to_01($data['user_allow_viewonline']);
     $insert_datar['allownotices'] = $data['user_notify'];
     if ($data['user_notify'] == 1) {
         $subscription_method == 2;
     } else {
         $subscription_method = 0;
     }
     $insert_data['subscriptionmethod'] = $subscription_method;
     $insert_data['receivepms'] = $data['user_allow_pm'];
     $insert_data['pmnotice'] = $data['user_popup_pm'];
     $insert_data['pmnotify'] = $data['pm_email_notify'];
     $insert_data['showsigs'] = $data['user_attachsig'];
     $insert_data['showavatars'] = $data['user_allowavatar'];
     $insert_data['timeformat'] = $data['user_dateformat'];
     $insert_data['timezone'] = $data['user_timezone'];
     $insert_data['regip'] = $last_post['poster_ip'];
     $insert_data['totalpms'] = $this->get_private_messages($data['user_id']);
     $insert_data['unreadpms'] = $data['user_unread_privmsg'];
     $insert_data['salt'] = generate_salt();
     $insert_data['signature'] = encode_to_utf8(str_replace(':' . $data['user_sig_bbcode_uid'], '', utf8_unhtmlentities($data['user_sig'])), "users", "users");
     $insert_data['password'] = salt_password($data['user_password'], $insert_data['salt']);
     $insert_data['loginkey'] = generate_loginkey();
     return $insert_data;
 }
예제 #6
0
 function convert_data($data)
 {
     global $db;
     $insert_data = array();
     // SMF values
     $insert_data['pmid'] = null;
     $insert_data['import_pmid'] = $data['ID_PM'];
     $insert_data['uid'] = $this->get_import->uid($data['ID_MEMBER']);
     $insert_data['fromid'] = $this->get_import->uid($data['ID_MEMBER_FROM']);
     $insert_data['toid'] = $insert_data['uid'];
     $insert_data['recipients'] = serialize(array("to" => $insert_data['toid']));
     $insert_data['folder'] = '1';
     $insert_data['subject'] = encode_to_utf8($data['subject'], "personal_messages", "privatemessages");
     $insert_data['status'] = $data['is_read'];
     $insert_data['dateline'] = $data['msgtime'];
     $insert_data['message'] = encode_to_utf8($this->bbcode_parser->convert(utf8_unhtmlentities($data['body'])), "personal_messages", "privatemessages");
     if ($insert_data['status'] == '1') {
         $insert_data['readtime'] = TIME_NOW;
         $insert_data['receipt'] = '2';
     }
     return $insert_data;
 }
예제 #7
0
 function convert_data($data)
 {
     $insert_data = array();
     // SMF values
     $insert_data['import_tid'] = $data['id_topic'];
     $insert_data['sticky'] = $data['is_sticky'];
     $insert_data['fid'] = $this->get_import->fid($data['id_board']);
     $first_post = $this->board->get_post($data['id_first_msg']);
     $insert_data['dateline'] = $first_post['poster_time'];
     $insert_data['subject'] = encode_to_utf8(utf8_unhtmlentities($first_post['subject']), "messages", "threads");
     $insert_data['import_poll'] = $data['id_poll'];
     $insert_data['uid'] = $this->get_import->uid($data['id_member_started']);
     $insert_data['import_uid'] = $data['id_member_started'];
     $insert_data['import_firstpost'] = $data['id_first_msg'];
     $insert_data['views'] = $data['num_views'];
     $insert_data['closed'] = $data['locked'];
     if ($insert_data['closed'] == "no") {
         $insert_data['closed'] = '';
     }
     $insert_data['attachmentcount'] = $this->get_attachment_count($data['id_topic']);
     return $insert_data;
 }
예제 #8
0
파일: posts.php 프로젝트: dgrp/merge-system
 function convert_data($data)
 {
     global $db;
     $insert_data = array();
     // SMF values
     $insert_data['import_pid'] = $data['ID_MSG'];
     $insert_data['tid'] = $this->get_import->tid($data['ID_TOPIC']);
     // Find if this is the first post in thread
     $first_post = $this->cache_first_post($data['ID_TOPIC']);
     // Make the replyto the first post of thread unless it is the first post
     if ($first_post == $data['ID_MSG']) {
         $insert_data['replyto'] = 0;
     } else {
         $insert_data['replyto'] = $this->get_import->pid($first_post);
     }
     $insert_data['fid'] = $this->get_import->fid($data['ID_BOARD']);
     $insert_data['subject'] = encode_to_utf8(utf8_unhtmlentities($data['subject']), "messages", "posts");
     $insert_data['uid'] = $this->get_import->uid($data['ID_MEMBER']);
     $insert_data['import_uid'] = $data['ID_MEMBER'];
     $insert_data['username'] = $data['posterName'];
     $insert_data['dateline'] = $data['posterTime'];
     $insert_data['message'] = encode_to_utf8($this->bbcode_parser->convert(utf8_unhtmlentities($data['body'])), "messages", "posts");
     $insert_data['ipaddress'] = $data['posterIP'];
     if ($data['smileysEnabled'] == '1') {
         $insert_data['smilieoff'] = 0;
     } else {
         $insert_data['smilieoff'] = 1;
     }
     // Get edit name
     if (!empty($data['modifiedName'])) {
         $query = $db->simple_select("users", "uid", "username='******'modifiedName']) . "'", array('limit' => 1));
         $insert_data['edituid'] = $db->fetch_field($query, "uid");
         $db->free_result($query);
     } else {
         $insert_data['edituid'] = 0;
     }
     $insert_data['edittime'] = $data['modifiedTime'];
     return $insert_data;
 }
예제 #9
0
 function convert_data($data)
 {
     $insert_data = array();
     // SMF values
     $insert_data['import_tid'] = $data['ID_TOPIC'];
     $insert_data['sticky'] = $data['isSticky'];
     $insert_data['fid'] = $this->get_import->fid($data['ID_BOARD']);
     $first_post = $this->board->get_post($data['ID_FIRST_MSG']);
     $insert_data['dateline'] = $first_post['posterTime'];
     $insert_data['subject'] = encode_to_utf8(utf8_unhtmlentities($first_post['subject']), "messages", "threads");
     $insert_data['import_poll'] = $data['ID_POLL'];
     $insert_data['uid'] = $this->get_import->uid($data['ID_MEMBER_STARTED']);
     $insert_data['import_uid'] = $data['ID_MEMBER_STARTED'];
     $insert_data['import_firstpost'] = $data['ID_FIRST_MSG'];
     $insert_data['views'] = $data['numViews'];
     $insert_data['closed'] = $data['locked'];
     if ($insert_data['closed'] == "no") {
         $insert_data['closed'] = '';
     }
     $insert_data['attachmentcount'] = $this->get_attachment_count($data['ID_TOPIC']);
     return $insert_data;
 }
예제 #10
0
 function convert_title($text)
 {
     $text = utf8_unhtmlentities($text);
     return $text;
 }