本文整理匯總了PHP中ImpExData::get_value方法的典型用法代碼示例。如果您正苦於以下問題:PHP ImpExData::get_value方法的具體用法?PHP ImpExData::get_value怎麽用?PHP ImpExData::get_value使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ImpExData
的用法示例。
在下文中一共展示了ImpExData::get_value方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: resume
function resume(&$sessionobject, &$displayobject, &$Db_target, &$Db_source)
{
// Set up working variables.
$displayobject->update_basic('displaymodules', 'FALSE');
$target_database_type = $sessionobject->get_session_var('targetdatabasetype');
$target_table_prefix = $sessionobject->get_session_var('targettableprefix');
$source_database_type = $sessionobject->get_session_var('sourcedatabasetype');
$source_table_prefix = $sessionobject->get_session_var('sourcetableprefix');
// Per page vars
$forum_start_at = $sessionobject->get_session_var('forumstartat');
$forum_per_page = $sessionobject->get_session_var('forumperpage');
$class_num = substr(get_class($this), -3);
// Start the timing
if (!$sessionobject->get_session_var($class_num . '_start')) {
$sessionobject->timing($class_num, 'start', $sessionobject->get_session_var('autosubmit'));
}
if ($sessionobject->get_session_var('categoriesfinished') == 'FALSE') {
$try = new ImpExData($Db_target, $sessionobject, 'forum');
$try->set_value('mandatory', 'title', 'Default vB Lite Category');
$try->set_value('mandatory', 'displayorder', '1');
$try->set_value('mandatory', 'parentid', '-1');
$try->set_value('mandatory', 'importforumid', '0');
$try->set_value('mandatory', 'importcategoryid', '1');
$try->set_value('mandatory', 'options', $this->_default_cat_permissions);
$try->set_value('nonmandatory', 'description', 'Default vB Lite Category Description');
$cat_id = $try->import_category($Db_target, $target_database_type, $target_table_prefix);
$displayobject->display_now("<br /><span class=\"isucc\"><b>" . $try->how_complete() . "%</b></span> :: " . $try->get_value('mandatory', 'title'));
$sessionobject->add_session_var($class_num . '_objects_done', intval($sessionobject->get_session_var($class_num . '_objects_done')) + 1);
$sessionobject->add_session_var('categoriesfinished', 'TRUE');
} else {
// Sort out the forums
$forum_array = $this->get_vblite_forum_details($Db_source, $source_database_type, $source_table_prefix, $forum_start_at, $forum_per_page);
$cat_ids = $this->get_category_ids($Db_target, $target_database_type, $target_table_prefix);
$displayobject->display_now("<h4>Importing " . count($forum_array) . " forums</h4><p><b>From</b> : " . $forum_start_at . " :: <b>To</b> : " . ($forum_start_at + $forum_per_page) . "</p>");
$forum_object = new ImpExData($Db_target, $sessionobject, 'forum');
foreach ($forum_array as $forum_id => $forum) {
$try = phpversion() < '5' ? $forum_object : clone $forum_object;
$try->set_value('mandatory', 'title', $forum['title']);
$try->set_value('mandatory', 'displayorder', $forum['displayorder']);
$try->set_value('mandatory', 'parentid', $cat_ids[1]);
$try->set_value('mandatory', 'importforumid', $forum['forumid']);
$try->set_value('mandatory', 'importcategoryid', '0');
$try->set_value('mandatory', 'options', $this->_default_forum_permissions);
$try->set_value('nonmandatory', 'description', $forum['description']);
$try->set_value('nonmandatory', 'visible', $forum['active']);
if ($try->is_valid()) {
if ($try->import_forum($Db_target, $target_database_type, $target_table_prefix)) {
$displayobject->display_now("<br /><span class=\"isucc\"><b>" . $try->how_complete() . "%</b></span> :: " . $try->get_value('mandatory', 'title'));
$sessionobject->add_session_var($class_num . '_objects_done', intval($sessionobject->get_session_var($class_num . '_objects_done')) + 1);
$imported = true;
} else {
$sessionobject->add_error('warning', $this->_modulestring, get_class($this) . "::import_category failed for " . $cat['cat_title'] . " get_phpbb2_categories_details was ok.", 'Check database permissions and user table');
$sessionobject->set_session_var($class_num . '_objects_failed', $sessionobject->get_session_var($class_num . '_objects_failed') + 1);
$displayobject->display_now("<br />Got category " . $cat['cat_title'] . " and <b>DID NOT</b> imported to the " . $target_database_type . " database");
}
} else {
$displayobject->display_now("<br />Invalid forum object, skipping." . $try->_failedon);
}
unset($try);
}
if (count($forum_array) == 0 or count($forum_array) < $forum_per_page) {
$this->build_forum_child_lists($Db_target, $target_database_type, $target_table_prefix);
$sessionobject->timing($class_num, 'stop', $sessionobject->get_session_var('autosubmit'));
$sessionobject->remove_session_var($class_num . '_start');
$displayobject->update_html($displayobject->module_finished($this->_modulestring, $sessionobject->return_stats($class_num, '_time_taken'), $sessionobject->return_stats($class_num, '_objects_done'), $sessionobject->return_stats($class_num, '_objects_failed')));
$sessionobject->set_session_var($class_num, 'FINISHED');
$sessionobject->set_session_var('forums', 'done');
$sessionobject->set_session_var('module', '000');
$sessionobject->set_session_var('autosubmit', '0');
}
$sessionobject->set_session_var('forumsstartat', $forum_start_at + $forum_per_page);
}
$displayobject->update_html($displayobject->print_redirect('index.php'));
}
示例2: resume
function resume(&$sessionobject, &$displayobject, &$Db_target, &$Db_source)
{
// Set up working variables.
$displayobject->update_basic('displaymodules', 'FALSE');
$target_database_type = $sessionobject->get_session_var('targetdatabasetype');
$target_table_prefix = $sessionobject->get_session_var('targettableprefix');
$source_database_type = $sessionobject->get_session_var('sourcedatabasetype');
$source_table_prefix = $sessionobject->get_session_var('sourcetableprefix');
// Per page vars
$forum_start_at = $sessionobject->get_session_var('forumstartat');
$forum_per_page = $sessionobject->get_session_var('forumperpage');
$class_num = substr(get_class($this), -3);
// Start the timing
if (!$sessionobject->get_session_var($class_num . '_start')) {
$sessionobject->timing($class_num, 'start', $sessionobject->get_session_var('autosubmit'));
}
######################################
# Temp
######################################
$forum_object = new ImpExData($Db_target, $sessionobject, 'forum');
$try = phpversion() < '5' ? $forum_object : clone $forum_object;
$try->set_value('mandatory', 'title', 'Default Yahoo Category');
$try->set_value('mandatory', 'displayorder', '1');
$try->set_value('mandatory', 'parentid', '-1');
$try->set_value('mandatory', 'importforumid', '0');
$try->set_value('mandatory', 'importcategoryid', '1');
$try->set_value('mandatory', 'options', $this->_default_cat_permissions);
$try->set_value('nonmandatory', 'description', 'Default Yahoo Category Description');
$cat_id = $try->import_category($Db_target, $target_database_type, $target_table_prefix);
$displayobject->display_now("<br /><span class=\"isucc\"><b>" . $try->how_complete() . "%</b></span> :: " . $try->get_value('mandatory', 'title'));
$sessionobject->add_session_var($class_num . '_objects_done', intval($sessionobject->get_session_var($class_num . '_objects_done')) + 1);
unset($try);
$try = phpversion() < '5' ? $forum_object : clone $forum_object;
$try->set_value('mandatory', 'title', 'Default Yahoo Forum');
$try->set_value('mandatory', 'displayorder', '1');
$try->set_value('mandatory', 'parentid', $cat_id);
$try->set_value('mandatory', 'importforumid', '1');
$try->set_value('mandatory', 'importcategoryid', '0');
$try->set_value('nonmandatory', 'description', 'Default Yahoo Forum');
$try->set_value('nonmandatory', 'visible', '1');
$try->set_value('mandatory', 'options', $this->_default_forum_permissions);
$forum_id = $try->import_forum($Db_target, $target_database_type, $target_table_prefix);
$displayobject->display_now("<br /><span class=\"isucc\"><b>" . $try->how_complete() . "%</b></span> :: " . $try->get_value('mandatory', 'title'));
$sessionobject->add_session_var($class_num . '_objects_done', intval($sessionobject->get_session_var($class_num . '_objects_done')) + 1);
unset($try);
$try = new ImpExData($Db_target, $sessionobject, 'thread');
$try->set_value('mandatory', 'title', 'Yahoo catchments thread');
$try->set_value('mandatory', 'forumid', $forum_id);
$try->set_value('mandatory', 'importthreadid', '2');
$try->set_value('mandatory', 'importforumid', '1');
// Non Mandatory
$try->set_value('nonmandatory', 'visible', '1');
$try->set_value('nonmandatory', 'open', '1');
$try->set_value('nonmandatory', 'dateline', time());
$displayobject->display_now("<br /><span class=\"isucc\"><b>" . $try->how_complete() . "%</b></span> :: " . $try->get_value('mandatory', 'title'));
$sessionobject->add_session_var($class_num . '_objects_done', intval($sessionobject->get_session_var($class_num . '_objects_done')) + 1);
$thread_id = $try->import_thread($Db_target, $target_database_type, $target_table_prefix);
$sessionobject->set_session_var('catch_thread', $thread_id);
######################################
# Temp
######################################
// Check for page end
if (count($forum_array) == 0 or count($forum_array) < $forum_per_page) {
$sessionobject->timing($class_num, 'stop', $sessionobject->get_session_var('autosubmit'));
$sessionobject->remove_session_var($class_num . '_start');
$forum_ids_array = $this->get_forum_ids($Db_target, $target_database_type, $target_table_prefix);
$this->clean_nested_forums($Db_target, $target_database_type, $target_table_prefix, $forum_ids_array);
$this->build_forum_child_lists($Db_target, $target_database_type, $target_table_prefix);
$displayobject->update_html($displayobject->module_finished($this->_modulestring, $sessionobject->return_stats($class_num, '_time_taken'), $sessionobject->return_stats($class_num, '_objects_done'), $sessionobject->return_stats($class_num, '_objects_failed')));
$sessionobject->set_session_var($class_num, 'FINISHED');
$sessionobject->set_session_var('import_forum', 'done');
$sessionobject->set_session_var('module', '000');
$sessionobject->set_session_var('autosubmit', '0');
$displayobject->update_html($displayobject->print_redirect('index.php', '1'));
}
$sessionobject->set_session_var('forumstartat', $forum_start_at + $forum_per_page);
$displayobject->update_html($displayobject->print_redirect('index.php'));
}
示例3: 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);
}
}