本文整理汇总了PHP中encode_to_utf8函数的典型用法代码示例。如果您正苦于以下问题:PHP encode_to_utf8函数的具体用法?PHP encode_to_utf8怎么用?PHP encode_to_utf8使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了encode_to_utf8函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: convert_data
function convert_data($data)
{
$insert_data = array();
// Invision Power Board 2 values
$insert_data['import_pid'] = $data['pid'];
$insert_data['tid'] = $this->get_import->tid($data['topic_id']);
$thread = $this->get_thread($data['topic_id']);
$insert_data['fid'] = $this->get_import->fid($thread['forum_id']);
$insert_data['subject'] = encode_to_utf8($thread['title'], "topics", "posts");
if ($data['queued'] == 0) {
$insert_data['visible'] = 1;
} else {
$insert_data['visible'] = 0;
}
$insert_data['uid'] = $this->get_import->uid($data['author_id']);
$insert_data['import_uid'] = $data['author_id'];
$insert_data['username'] = $this->get_import->username($insert_data['import_uid']);
$insert_data['dateline'] = $data['post_date'];
$insert_data['message'] = encode_to_utf8($this->bbcode_parser->convert($data['post']), "posts", "posts");
$insert_data['ipaddress'] = $data['ip_address'];
$insert_data['includesig'] = $data['use_sig'];
$insert_data['smilieoff'] = int_to_01($data['allowsmilie']);
$insert_data['edituid'] = $this->get_import->uid($this->get_uid_from_username($data['edit_name']));
$insert_data['edittime'] = $data['edit_time'];
$insert_data['posthash'] = $data['post_key'];
return $insert_data;
}
示例2: convert_data
function convert_data($data)
{
$insert_data = array();
// vBulletin 3 values
$insert_data['import_tid'] = $data['threadid'];
$insert_data['sticky'] = $data['sticky'];
$insert_data['fid'] = $this->get_import->fid($data['forumid']);
$insert_data['import_firstpost'] = $data['firstpostid'];
$insert_data['dateline'] = $data['dateline'];
$insert_data['subject'] = encode_to_utf8(str_replace('"', '"', $data['title']), "thread", "threads");
$insert_data['import_poll'] = $data['pollid'];
$insert_data['uid'] = $this->get_import->uid($data['postuserid']);
$insert_data['import_uid'] = $data['postuserid'];
$insert_data['views'] = $data['views'];
$insert_data['closed'] = int_to_01($data['open']);
if ($insert_data['closed'] == 'no') {
$insert_data['closed'] = '';
}
if ($data['open'] == '10') {
$insert_data['closed'] = 'moved|' . $this->get_import->tid($data['pollid']);
}
$insert_data['totalratings'] = $data['votetotal'];
$insert_data['notes'] = $data['notes'];
$insert_data['visible'] = $data['visible'];
$insert_data['numratings'] = $data['votenum'];
$insert_data['attachmentcount'] = $data['attach'];
return $insert_data;
}
示例3: convert_data
function convert_data($data)
{
global $db;
// vBulletin 3 values
$insert_data['import_pmid'] = $data['pmid'];
$insert_data['uid'] = $this->get_import->uid($data['userid']);
$insert_data['fromid'] = $this->get_import->uid($data['fromuserid']);
$insert_data['toid'] = $this->get_import->uid($data['touserid']);
$touserarray = unserialize($data['touserarray']);
// Rebuild the recipients array
$recipients = array();
if (is_array($touserarray['cc']) && !empty($touserarray['cc'])) {
foreach ($touserarray['cc'] as $key => $to) {
$username = $this->get_username($to);
$recipients['to'][] = $this->get_import->uid($username['userid']);
}
}
$insert_data['recipients'] = serialize($recipients);
if ($data['folderid'] == -1) {
$insert_data['folder'] = 2;
} else {
$insert_data['folder'] = 0;
}
$insert_data['subject'] = encode_to_utf8($data['subject'], "pm", "privatemessages");
$insert_data['status'] = $data['messageread'];
$insert_data['dateline'] = $data['dateline'];
$insert_data['message'] = encode_to_utf8($this->bbcode_parser->convert($data['message']), "pmtext", "privatemessages");
$insert_data['includesig'] = $data['showsignature'];
$insert_data['smilieoff'] = int_to_01($data['allowsmilie']);
if ($data['messageread'] == 1) {
$insert_data['readtime'] = time();
}
return $insert_data;
}
示例4: convert_data
function convert_data($data)
{
global $db;
static $field_info;
if (!isset($field_info)) {
// Get columns so we avoid any 'unknown column' errors
$field_info = $db->show_fields_from("forums");
}
$insert_data = array();
foreach ($field_info as $key => $field) {
if ($field['Extra'] == 'auto_increment') {
if ($db->type != "sqlite") {
$insert_data[$field['Field']] = '';
}
continue;
}
if (isset($data[$field['Field']])) {
$insert_data[$field['Field']] = $data[$field['Field']];
}
}
// MyBB 1.6 values
$insert_data['import_fid'] = $data['fid'];
$insert_data['import_pid'] = $data['pid'];
$insert_data['description'] = encode_to_utf8($insert_data['description'], "forums", "forums");
// This value NEEDS to be here for the cleanup() to work
$insert_data['pid'] = 0;
return $insert_data;
}
示例5: convert_data
function convert_data($data)
{
global $db;
static $field_info;
if (!isset($field_info)) {
// Get columns so we avoid any 'unknown column' errors
$field_info = $db->show_fields_from("users");
}
$insert_data = array();
foreach ($field_info as $key => $field) {
if ($field['Extra'] == 'auto_increment') {
if ($db->type != "sqlite") {
$insert_data[$field['Field']] = '';
}
continue;
}
if (isset($data[$field['Field']])) {
$insert_data[$field['Field']] = $data[$field['Field']];
}
}
// MyBB 1.6 values
$insert_data['import_uid'] = $data['uid'];
$insert_data['usergroup'] = $this->board->get_group_id($data['usergroup'], array("not_multiple" => true));
$insert_data['additionalgroups'] = str_replace($insert_data['usergroup'], '', $this->board->get_group_id($data['usergroup']));
$insert_data['username'] = encode_to_utf8($insert_data['username'], "users", "users");
$insert_data['signature'] = encode_to_utf8($data['signature'], "users", "users");
$insert_data['displaygroup'] = $this->board->get_group_id($data['displaygroup'], array("not_multiple" => true));
$insert_data['import_usergroup'] = $data['usergroup'];
$insert_data['import_additionalgroups'] = $data['additionalgroups'];
return $insert_data;
}
示例6: check_for_duplicates
public function check_for_duplicates(&$user)
{
global $db, $output, $import_session;
if (!$this->total_users) {
// Count the total number of users so we can generate a unique id if we have a duplicate user
$query = $db->simple_select("users", "COUNT(*) as totalusers");
$this->total_users = $db->fetch_field($query, "totalusers");
$db->free_result($query);
}
$username = $user[$this->settings['username_column']];
$encoded_username = encode_to_utf8($user[$this->settings['username_column']], $this->settings['encode_table'], "users");
// Check for duplicate users
$where = "username='" . $db->escape_string($username) . "' OR username='" . $db->escape_string($encoded_username) . "'";
$query = $db->simple_select("users", "username,email,uid,postnum", $where, array('limit' => 1));
$duplicate_user = $db->fetch_array($query);
$db->free_result($query);
// Using strtolower and my_strtolower to check, instead of in the query, is exponentially faster
// If we used LOWER() function in the query the index wouldn't be used by MySQL
if (strtolower($duplicate_user['username']) == strtolower($username) || my_strtolower($duplicate_user['username']) == strtolower($encoded_username)) {
if ($user[$this->settings['email_column']] == $duplicate_user['email']) {
$output->print_progress("start");
$output->print_progress("merge_user", array('import_uid' => $user[$this->settings['progress_column']], 'duplicate_uid' => $duplicate_user['uid']));
$db->update_query("users", array('import_uid' => $user[$this->settings['progress_column']], 'postnum' => $duplicate_user['postnum'] + $user[$this->settings['postnum_column']]), "uid = '{$duplicate_user['uid']}'");
return false;
} else {
$user[$this->settings['username_column']] = $duplicate_user['username'] . "_" . $import_session['board'] . "_import" . $this->total_users;
}
}
return true;
}
示例7: convert_data
function convert_data($data)
{
$insert_data = array();
// SMF values
$insert_data['import_fid'] = intval($data['id_cat']);
$insert_data['name'] = encode_to_utf8(str_replace("&", "&", $data['name']), "categories", "forums");
$insert_data['disporder'] = $data['cat_order'];
$insert_data['type'] = "c";
return $insert_data;
}
示例8: convert_data
function convert_data($data)
{
$insert_data = array();
// vBulletin 3 values
$insert_data['import_eid'] = $data['eventid'];
$insert_data['name'] = encode_to_utf8($data['title'], "event", "events");
$insert_data['description'] = encode_to_utf8($this->bbcode_parser->convert($data['event']), "event", "events");
$insert_data['uid'] = $this->get_import->uid($data['userid']);
$insert_data['dateline'] = $data['dateline'];
$insert_data['starttime'] = $data['dateline_from'];
$insert_data['endtime'] = $data['dateline_to'];
return $insert_data;
}