本文整理匯總了PHP中ImpExData::import_post方法的典型用法代碼示例。如果您正苦於以下問題:PHP ImpExData::import_post方法的具體用法?PHP ImpExData::import_post怎麽用?PHP ImpExData::import_post使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ImpExData
的用法示例。
在下文中一共展示了ImpExData::import_post方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sizeof
function parse_message($data)
{
if ($discussion =& $this->get_first_tag('discussion')) {
/*
echo str_repeat('--', sizeof($this->stack)) . " message<br />\n";
flush();
*/
$user_names = $this->get_username($this->Db_object, $this->target_db_type, $this->target_db_prefix);
$users_ids = $this->get_user_ids($Db_target, $target_database_type, $target_table_prefix);
$userid = hexdec($data['attributes']['author']);
$post_object = new ImpExData($this->Db_object, $this->session, 'post');
$post_object->set_value('mandatory', 'threadid', $this->session->get_session_var('currentthread'));
$post_object->set_value('mandatory', 'userid', $users_ids[$userid]);
$post_object->set_value('mandatory', 'importthreadid', '1');
$post_object->set_value('nonmandatory', 'visible', '1');
$post_object->set_value('nonmandatory', 'dateline', strtotime(str_replace('.', ' ', $data['attributes']['date'])));
$post_object->set_value('nonmandatory', 'allowsmilie', '1');
$post_object->set_value('nonmandatory', 'showsignature', '1');
$post_object->set_value('nonmandatory', 'username', $user_names[$userid]);
$post_object->set_value('nonmandatory', 'ipaddress', $data['attributes']['sourceIp']);
$post_object->set_value('nonmandatory', 'title', htmlspecialchars($data['attributes']['title']));
$post_object->set_value('nonmandatory', 'pagetext', $this->html_2_bb($data['attributes']['body']));
$post_object->set_value('nonmandatory', 'importpostid', '1');
if ($post_object->import_post($this->Db_object, $this->target_db_type, $this->target_db_prefix)) {
echo "<br /><span class=\"isucc\">Post -- <b>" . $post_object->how_complete() . "%</b></span> :: Post from - " . $post_object->get_value('nonmandatory', 'username');
flush();
} else {
echo "<br />Post not imported";
}
unset($post_object);
}
}