本文整理匯總了PHP中ImpExData::set_value方法的典型用法代碼示例。如果您正苦於以下問題:PHP ImpExData::set_value方法的具體用法?PHP ImpExData::set_value怎麽用?PHP ImpExData::set_value使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ImpExData
的用法示例。
在下文中一共展示了ImpExData::set_value方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: resume
function resume(&$sessionobject, &$displayobject, &$Db_target, &$Db_source)
{
// Setup some working variables
$displayobject->update_basic('displaymodules', 'FALSE');
$target_db_type = $sessionobject->get_session_var('targetdatabasetype');
$target_table_prefix = $sessionobject->get_session_var('targettableprefix');
$source_db_type = $sessionobject->get_session_var('sourcedatabasetype');
$source_table_prefix = $sessionobject->get_session_var('sourcetableprefix');
$class_num = substr(get_class($this), -3);
$databasedone = true;
if (!$sessionobject->get_session_var($class_num . '_start')) {
$sessionobject->timing($class_num, 'start', $sessionobject->get_session_var('autosubmit'));
}
$displayobject->update_basic('title', 'Modifying database');
$displayobject->display_now("<h4>Altering tables</h4>");
$displayobject->display_now("<p>ImpEx will now Alter the tables in the vB database to include <i>import id numbers</i>.</p>");
$displayobject->display_now("This is needed during the import process for maintaining refrences between the tables during an import.");
$displayobject->display_now("If you have large tables (i.e. lots of posts) this can take some time.</p>");
$displayobject->display_now("<p> They will also be left after the import if you need to link back to the origional vB userid.</p>");
// Add an importids now
foreach ($this->_import_ids as $id => $table_array) {
foreach ($table_array as $tablename => $column) {
if ($this->add_import_id($Db_target, $target_db_type, $target_table_prefix, $tablename, $column)) {
$displayobject->display_now("\n<br /><b>{$tablename}</b> - {$column} <i>OK</i>");
} else {
$sessionobject->add_error('fatal', $this->_modulestring, get_class($this) . "::resume failed trying to modify table {$tablename} to add {$column}", 'Check database permissions');
}
}
}
// Add the importpostid for the attachment imports and the users for good measure
$this->add_index($Db_target, $target_db_type, $target_table_prefix, 'post');
$this->add_index($Db_target, $target_db_type, $target_table_prefix, 'user');
if ($sessionobject->get_session_var('added_default_unknown_group') != 'yup') {
$try = new ImpExData($Db_target, $sessionobject, 'usergroup');
$try->set_value('mandatory', 'importusergroupid', '69');
$try->set_value('nonmandatory', 'title', 'Imported Users');
$try->import_usergroup($Db_target, $target_db_type, $target_table_prefix);
$sessionobject->add_session_var('added_default_unknown_group', 'yup');
unset($try);
}
// Check the database connection
$result = $this->check_database($Db_source, $source_db_type, $source_table_prefix, $sessionobject->get_session_var('sourceexists'));
$displayobject->display_now($result['text']);
if ($result['code']) {
$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->add_session_var($class_num . '_objects_done', intval($sessionobject->get_session_var($class_num . '_objects_done')) + 1);
$sessionobject->set_session_var(substr(get_class($this), -3), 'FINISHED');
$sessionobject->set_session_var('module', '000');
$displayobject->update_basic('displaymodules', 'FALSE');
$displayobject->update_html($displayobject->print_redirect_001('index.php', $sessionobject->get_session_var('pagespeed')));
} else {
$sessionobject->add_session_var($class_num . '_objects_failed', intval($sessionobject->get_session_var($class_num . '_objects_failed')) + 1);
$displayobject->update_html($displayobject->make_description("{$displayobject->phrases['failed']} {$displayobject->phrases['check_db_permissions']}"));
$sessionobject->set_session_var('001', 'FAILED');
$sessionobject->set_session_var('module', '000');
$displayobject->update_html($displayobject->print_redirect_001('index.php', $sessionobject->get_session_var('pagespeed')));
}
}
示例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');
$over_write_smilies = $sessionobject->get_session_var('over_write_smilies');
$smilie_array = $this->get_details($Db_source, $source_database_type, $source_table_prefix, 0, -1, 'smilie', 'smilieid');
$class_num = substr(get_class($this), -3);
if (!$sessionobject->get_session_var($class_num . '_start')) {
$sessionobject->timing($class_num, 'start', $sessionobject->get_session_var('autosubmit'));
}
// If the image category dosn't exsist for the imported smilies, create it
$imported_smilie_group = new ImpExData($Db_target, $sessionobject, 'imagecategory');
$imported_smilie_group->set_value('nonmandatory', 'title', 'Imported Smilies');
$imported_smilie_group->set_value('nonmandatory', 'imagetype', '3');
$imported_smilie_group->set_value('nonmandatory', 'displayorder', '1');
$smilie_group_id = $imported_smilie_group->import_smilie_image_group($Db_target, $target_database_type, $target_table_prefix);
$displayobject->display_now("<h4>{$displayobject->phrases['importing']} " . count($smilie_array) . " {$displayobject->phrases['smilies']}</h4>");
$smilie_object = new ImpExData($Db_target, $sessionobject, 'smilie');
foreach ($smilie_array as $smilie_id => $details) {
$try = phpversion() < '5' ? $smilie_object : clone $smilie_object;
// Mandatory
$try->set_value('mandatory', 'smilietext', $details['smilietext']);
$try->set_value('mandatory', 'importsmilieid', $smilie_id);
// Non Mandatory
$try->set_value('nonmandatory', 'title', $details['title']);
$try->set_value('nonmandatory', 'smiliepath', substr($details['smiliepath'], strrpos($details['smiliepath'], '/') + 1));
$try->set_value('nonmandatory', 'imagecategoryid', $smilie_group_id);
$try->set_value('nonmandatory', 'displayorder', $details['displayorder']);
if ($try->is_valid()) {
if ($try->import_smilie($Db_target, $target_database_type, $target_table_prefix)) {
$displayobject->display_now('<br /><span class="isucc"><b>' . $try->how_complete() . '%</b></span> :: ' . $displayobject->phrases['smilie'] . ' -> ' . $try->get_value('mandatory', 'smilietext'));
$sessionobject->add_session_var($class_num . '_objects_done', intval($sessionobject->get_session_var($class_num . '_objects_done')) + 1);
} else {
$sessionobject->set_session_var($class_num . '_objects_failed', $sessionobject->get_session_var($class_num . '_objects_failed') + 1);
$sessionobject->add_error($smilie_id, $displayobject->phrases['smilie_not_imported'], $displayobject->phrases['smilie_not_imported_rem']);
$displayobject->display_now("<br />{$displayobject->phrases['failed']} :: {$displayobject->phrases['smilie_not_imported']}");
}
} else {
$displayobject->display_now("<br />{$displayobject->phrases['invalid_object']}" . $try->_failedon);
$sessionobject->set_session_var($class_num . '_objects_failed', $sessionobject->get_session_var($class_num . '_objects_failed') + 1);
}
unset($try);
}
$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('module', '000');
$sessionobject->set_session_var('autosubmit', '0');
$displayobject->update_html($displayobject->print_redirect('index.php', $sessionobject->get_session_var('pagespeed')));
}
示例3: init
function init(&$sessionobject, &$displayobject, &$Db_target, &$Db_source)
{
if ($this->check_order($sessionobject, $this->_dependent)) {
if ($this->_restart) {
if ($this->restart($sessionobject, $displayobject, $Db_target, $Db_source, 'clear_imported_usergroups')) {
$displayobject->display_now("<h4>{$displayobject->phrases['usergroups_cleared']}</h4>");
$this->_restart = true;
} else {
$sessionobject->add_error(substr(get_class($this), -3), $displayobject->phrases['usergroup_restart_failed'], $displayobject->phrases['check_db_permissions']);
}
}
// Start up the table
$displayobject->update_basic('title', $displayobject->phrases['import_usergroup']);
$displayobject->update_html($displayobject->do_form_header('index', substr(get_class($this), -3)));
$displayobject->update_html($displayobject->make_hidden_code(substr(get_class($this), -3), 'WORKING'));
$displayobject->update_html($displayobject->make_table_header($this->_modulestring));
// Ask some questions
$displayobject->update_html($displayobject->make_input_code($displayobject->phrases['usergroups_per_page'], 'usergroupperpage', 50));
// End the table
$displayobject->update_html($displayobject->do_form_footer($displayobject->phrases['continue'], $displayobject->phrases['reset']));
// Incative usergroup
$target_db_type = $sessionobject->get_session_var('targetdatabasetype');
$target_table_prefix = $sessionobject->get_session_var('targettableprefix');
$usergroup_object = new ImpExData($Db_target, $sessionobject, 'usergroup');
$try = phpversion() < '5' ? $usergroup_object : clone $usergroup_object;
$try->set_value('mandatory', 'importusergroupid', '69');
$try->set_value('nonmandatory', 'title', "Active {$displayobject->phrases['imported']} {$displayobject->phrases['users']}");
$try->import_usergroup($Db_target, $target_db_type, $target_table_prefix);
unset($try);
$try = phpversion() < '5' ? $usergroup_object : clone $usergroup_object;
$try = new ImpExData($Db_target, $sessionobject, 'usergroup');
$try->set_value('mandatory', 'importusergroupid', '70');
$try->set_value('nonmandatory', 'title', "Inactive {$displayobject->phrases['imported']} {$displayobject->phrases['users']}");
$try->import_usergroup($Db_target, $target_db_type, $target_table_prefix);
$sessionobject->add_session_var('added_default_unknown_group', 'yup');
unset($try);
// Reset/Setup counters for this
$sessionobject->add_session_var(substr(get_class($this), -3) . '_objects_done', '0');
$sessionobject->add_session_var(substr(get_class($this), -3) . '_objects_failed', '0');
$sessionobject->add_session_var('usergroupstartat', '0');
} else {
// Dependant has not been run
$displayobject->update_html($displayobject->do_form_header('index', ''));
$displayobject->update_html($displayobject->make_description("<p>{$displayobject->phrases['dependant_on']}<i><b> " . $sessionobject->get_module_title($this->_dependent) . "</b> {$displayobject->phrases['cant_run']}</i> ."));
$displayobject->update_html($displayobject->do_form_footer($displayobject->phrases['continue'], ''));
$sessionobject->set_session_var(substr(get_class($this), -3), 'FALSE');
$sessionobject->set_session_var('module', '000');
}
}
示例4: init
function init(&$sessionobject, &$displayobject, &$Db_target, &$Db_source)
{
$class_num = substr(get_class($this), -3);
if ($this->check_order($sessionobject, $this->_dependent)) {
if ($this->_restart) {
if ($this->restart($sessionobject, $displayobject, $Db_target, $Db_source, 'clear_imported_forums')) {
$displayobject->display_now("<h4>{$displayobject->phrases['forums_cleared']}</h4>");
$this->_restart = true;
} else {
$sessionobject->add_error($Db_target, 'fatal', $class_num, 0, $displayobject->phrases['forum_restart_failed'], $displayobject->phrases['check_db_permissions']);
}
}
// Start up the table
$displayobject->update_basic('title', $displayobject->phrases['import_forum']);
$displayobject->update_html($displayobject->do_form_header('index', $class_num));
$displayobject->update_html($displayobject->make_hidden_code($class_num, 'WORKING'));
$displayobject->update_html($displayobject->make_table_header($this->_modulestring));
// Ask some questions
$displayobject->update_html($displayobject->make_input_code($displayobject->phrases['units_per_page'], 'perpage', 1000));
// End the table
$displayobject->update_html($displayobject->do_form_footer($displayobject->phrases['continue'], $displayobject->phrases['reset']));
// Reset/Setup counters for this
$sessionobject->add_session_var("{$class_num}_objects_done", '0');
$sessionobject->add_session_var("{$class_num}_objects_failed", '0');
$sessionobject->add_session_var('startat', '0');
$t_db_type = $sessionobject->get_session_var('targetdatabasetype');
$t_tb_prefix = $sessionobject->get_session_var('targettableprefix');
// Default Category
$try = new ImpExData($Db_target, $sessionobject, 'forum');
$try->set_value('mandatory', 'title', 'ImpEx');
$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', 'This is a default category for imported forums');
$try->import_category($Db_target, $t_db_type, $t_tb_prefix);
unset($try);
} else {
// Dependant has not been run
$displayobject->update_html($displayobject->do_form_header('index', ''));
$displayobject->update_html($displayobject->make_description("<p>{$displayobject->phrases['dependant_on']}<i><b> " . $sessionobject->get_module_title($this->_dependent) . "</b> {$displayobject->phrases['cant_run']}</i> ."));
$displayobject->update_html($displayobject->do_form_footer($displayobject->phrases['continue'], ''));
$sessionobject->set_session_var($class_num, 'FALSE');
$sessionobject->set_session_var('module', '000');
}
}
示例5: 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'));
}
示例6: 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
$smilie_start_at = $sessionobject->get_session_var('smiliestartat');
$smilie_per_page = $sessionobject->get_session_var('smilieperpage');
$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'));
}
// Get an array of smilie details
$smilie_array = $this->get_PNphpBB_smilie_details($Db_source, $source_database_type, $source_table_prefix, $smilie_start_at, $smilie_per_page);
// If the image category dosn't exsist for the imported smilies, create it
$imported_smilie_group = new ImpExData($Db_target, $sessionobject, 'imagecategory');
$imported_smilie_group->set_value('nonmandatory', 'title', 'Imported Smilies');
$imported_smilie_group->set_value('nonmandatory', 'imagetype', '3');
$imported_smilie_group->set_value('nonmandatory', 'displayorder', '1');
$smilie_group_id = $imported_smilie_group->import_smilie_image_group($Db_target, $target_database_type, $target_table_prefix);
// Display count and pass time
$displayobject->display_now('<h4>Importing ' . count($smilie_array) . ' smilies</h4><p><b>From</b> : ' . $smilie_start_at . ' :: <b>To</b> : ' . ($smilie_start_at + count($smilie_array)) . '</p>');
$smilie_object = new ImpExData($Db_target, $sessionobject, 'smilie');
foreach ($smilie_array as $smilie_id => $smilie_details) {
$try = phpversion() < '5' ? $smilie_object : clone $smilie_object;
$import_smilie = false;
// Set the correct key names to pass.
$pass_array = array('title' => $smilie_details['emoticon'], 'smilietext' => $smilie_details['code'], 'smiliepath' => $smilie_details['smile_url']);
// Check the lenght of it
if (strlen($pass_array['smilietext']) > 20) {
$truncation = substr($pass_array['smilietext'], 0, 19) . ':';
$displayobject->display_now("<br /><font color=\"red\"><b>Too long</font></b> ' " . $pass_array['smilietext'] . "'" . "<br /><font color=\"red\"><b>Truncating to</font></b> '" . $truncation . "'");
$pass_array['smilietext'] = $truncation;
}
$pass_array['smilietext'] = addslashes($pass_array['smilietext']);
// Is it a duplicate ?
$it_is_a_duplicate = $this->does_smilie_exists($Db_target, $target_database_type, $target_table_prefix, addslashes($pass_array['smilietext']));
if ($it_is_a_duplicate) {
if ($over_write_smilies) {
$import_smilie = true;
}
} else {
$import_smilie = true;
}
$try->set_value('mandatory', 'smilietext', $pass_array['smilietext']);
$try->set_value('nonmandatory', 'title', $pass_array['title']);
$try->set_value('nonmandatory', 'smiliepath', $pass_array['smiliepath']);
$try->set_value('nonmandatory', 'imagecategoryid', $smilie_group_id);
$try->set_value('nonmandatory', 'displayorder', '1');
$try->set_value('mandatory', 'importsmilieid', $smilie_id);
if ($try->is_valid()) {
if ($import_smilie) {
if ($try->import_smilie($Db_target, $target_database_type, $target_table_prefix)) {
$displayobject->display_now("<br /><span class=\"isucc\"><b>" . $try->how_complete() . "%</b></span> :: Smilie -> " . $try->get_value('mandatory', 'smilietext'));
$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_smilie failed for " . $pass_array['smilietext'] . ".", 'Check database permissions and smilie table');
$sessionobject->set_session_var($class_num . '_objects_failed', $sessionobject->get_session_var($class_num . '_objects_failed') + 1);
$displayobject->display_now("<br />Got smilie " . $pass_array['smilietext'] . " and <b>DID NOT</b> imported to the " . $target_database_type . " database");
}
} else {
$displayobject->display_now("<br /><font color=\"orange\"><b>Duplicate</span> ' " . $pass_array['smilietext'] . "' -> '" . $pass_array['title'] . "'");
}
} else {
$displayobject->display_now("<br />Invalid smilie object, skipping." . $try->_failedon);
}
unset($try);
}
// End foreach
// Check for page end
if (count($smilie_array) == 0 or count($smilie_array) < $smilie_per_page) {
$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('import_smilie', '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('smiliestartat', $smilie_start_at + $smilie_per_page);
$displayobject->update_html($displayobject->print_redirect('index.php'));
}
示例7: 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'));
}
// Get an array of forum details
$forum_array = $this->get_freethreads_forum_details($Db_source, $source_database_type, $source_table_prefix, $forum_start_at, $forum_per_page);
if ($sessionobject->get_session_var('categoriesfinished') == 'FALSE') {
$category_object = new ImpExData($Db_target, $sessionobject, 'forum');
$category_object->set_value('mandatory', 'title', 'free threads category');
$category_object->set_value('mandatory', 'displayorder', '1');
$category_object->set_value('mandatory', 'parentid', '-1');
$category_object->set_value('mandatory', 'importforumid', '0');
$category_object->set_value('mandatory', 'importcategoryid', '1');
$category_object->set_value('mandatory', 'options', $this->_default_cat_permissions);
$category_object->import_category($Db_target, $target_database_type, $target_table_prefix);
$sessionobject->add_session_var('categoriesfinished', 'TRUE');
}
$cat_ids_array = $this->get_category_ids($Db_target, $target_database_type, $target_table_prefix);
// Display count and pass time
$displayobject->display_now('<h4>Importing ' . count($forum_array) . ' forums</h4><p><b>From</b> : ' . $forum_start_at . ' :: <b>To</b> : ' . ($forum_start_at + count($forum_array)) . '</p>');
$forum_object = new ImpExData($Db_target, $sessionobject, 'forum');
foreach ($forum_array as $forum_id => $forum_details) {
$try = phpversion() < '5' ? $forum_object : clone $forum_object;
// Mandatory
$try->set_value('mandatory', 'title', $forum_details['NAME']);
$try->set_value('mandatory', 'displayorder', $forum_details['RANK']);
$try->set_value('mandatory', 'parentid', $cat_ids_array[1]);
$try->set_value('mandatory', 'importforumid', $forum_id);
$try->set_value('mandatory', 'importcategoryid', '1');
$try->set_value('mandatory', 'options', $this->_default_forum_permissions);
// Non Mandatory
$try->set_value('nonmandatory', 'description', $forum_details['DESCRIPTION']);
$try->set_value('nonmandatory', 'replycount', $forum_details['TOTAL']);
$try->set_value('nonmandatory', 'lastpost', $forum_details['LAST']);
// Check if forum object is valid
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> :: forum -> ' . $forum_details['NAME']);
$sessionobject->add_session_var($class_num . '_objects_done', intval($sessionobject->get_session_var($class_num . '_objects_done')) + 1);
} else {
$sessionobject->set_session_var($class_num . '_objects_failed', $sessionobject->get_session_var($class_num . '_objects_failed') + 1);
$sessionobject->add_error('warning', $this->_modulestring, get_class($this) . '::import_custom_profile_pic failed.', 'Check database permissions and database table');
$displayobject->display_now("<br />Found avatar forum 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);
}
// End foreach
// 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->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'));
}
示例8: 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
$smilie_start_at = $sessionobject->get_session_var('smiliestartat');
$smilie_per_page = $sessionobject->get_session_var('smilieperpage');
$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'));
}
// Get an array of smilie details
$smilie_array = $this->get_details($Db_source, $source_database_type, $source_table_prefix, $smilie_start_at, $smilie_per_page, 'smiley', 'id');
// If the image category dosn't exsist for the imported smilies, create it
$imported_smilie_group = new ImpExData($Db_target, $sessionobject, 'imagecategory');
$imported_smilie_group->set_value('nonmandatory', 'title', 'Imported Smilies');
$imported_smilie_group->set_value('nonmandatory', 'imagetype', '3');
$imported_smilie_group->set_value('nonmandatory', 'displayorder', '1');
$smilie_group_id = $imported_smilie_group->import_smilie_image_group($Db_target, $target_database_type, $target_table_prefix);
// Display count and pass time
$displayobject->display_now('<h4>Importing ' . count($smilie_array) . ' smilies</h4><p><b>From</b> : ' . $smilie_start_at . ' :: <b>To</b> : ' . ($smilie_start_at + count($smilie_array)) . '</p>');
$smilie_object = new ImpExData($Db_target, $sessionobject, 'smilie');
foreach ($smilie_array as $smilie_id => $smilie_details) {
$try = phpversion() < '5' ? $smilie_object : clone $smilie_object;
// Mandatory
$try->set_value('mandatory', 'smilietext', $smilie_details['code']);
$try->set_value('mandatory', 'importsmilieid', $smilie_details['id']);
// Non Mandatory
$try->set_value('nonmandatory', 'title', $smilie_details['descr']);
$try->set_value('nonmandatory', 'smiliepath', $smilie_details['img']);
$try->set_value('nonmandatory', 'imagecategoryid', $smilie_group_id);
$try->set_value('nonmandatory', 'displayorder', $smilie_details['vieworder']);
// Check if smilie object is valid
if ($try->is_valid()) {
if ($try->import_smilie($Db_target, $target_database_type, $target_table_prefix)) {
$displayobject->display_now('<br /><span class="isucc"><b>' . $try->how_complete() . '%</b></span> :: smilie -> ' . $smilie_details['descr']);
$sessionobject->add_session_var($class_num . '_objects_done', intval($sessionobject->get_session_var($class_num . '_objects_done')) + 1);
} else {
$sessionobject->set_session_var($class_num . '_objects_failed', $sessionobject->get_session_var($class_num . '_objects_failed') + 1);
$sessionobject->add_error('warning', $this->_modulestring, get_class($this) . '::import_custom_profile_pic failed.', 'Check database permissions and database table');
$displayobject->display_now("<br />Found avatar smilie and <b>DID NOT</b> imported to the {$target_database_type} database");
}
} else {
$displayobject->display_now("<br />Invalid smilie object, skipping." . $try->_failedon);
}
unset($try);
}
// End foreach
// Check for page end
if (count($smilie_array) == 0 or count($smilie_array) < $smilie_per_page) {
$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('import_smilie', '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('smiliestartat', $smilie_start_at + $smilie_per_page);
$displayobject->update_html($displayobject->print_redirect('index.php'));
}
示例9: 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);
}
}
示例10: 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
$smilie_start_at = $sessionobject->get_session_var('smiliestartat');
$smilie_per_page = $sessionobject->get_session_var('smilieperpage');
$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'));
}
// Get an array of smilie details
$smilie_array = $this->get_smf_smilie_details($Db_source, $source_database_type, $source_table_prefix, $smilie_start_at, $smilie_per_page);
// Display count and pass time
$displayobject->display_now("<h4>{$displayobject->phrases['importing']} " . count($smilie_array) . " {$displayobject->phrases['smilies']}</h4>");
// If the image category dosn't exsist for the imported smilies, create it
$imported_smilie_group = new ImpExData($Db_target, $sessionobject, 'imagecategory');
$imported_smilie_group->set_value('nonmandatory', 'title', 'Imported Smilies');
$imported_smilie_group->set_value('nonmandatory', 'imagetype', '3');
$imported_smilie_group->set_value('nonmandatory', 'displayorder', '1');
$smilie_group_id = $imported_smilie_group->import_smilie_image_group($Db_target, $target_database_type, $target_table_prefix);
$smilie_object = new ImpExData($Db_target, $sessionobject, 'smilie');
foreach ($smilie_array as $smilie_id => $smilie_details) {
$try = phpversion() < '5' ? $smilie_object : clone $smilie_object;
// Mandatory
$try->set_value('mandatory', 'smilietext', $smilie_details['code']);
$try->set_value('mandatory', 'importsmilieid', $smilie_id);
// Non Mandatory
$try->set_value('nonmandatory', 'title', $smilie_details['description']);
$try->set_value('nonmandatory', 'smiliepath', $smilie_details['filename']);
$try->set_value('nonmandatory', 'imagecategoryid', $smilie_group_id);
$try->set_value('nonmandatory', 'displayorder', $smilie_details['smileyOrder']);
// Is it a duplicate ?
$it_is_a_duplicate = $this->does_smilie_exists($Db_target, $target_database_type, $target_table_prefix, addslashes($pass_array['smilietext']));
if ($it_is_a_duplicate) {
if ($over_write_smilies) {
$import_smilie = true;
}
} else {
$import_smilie = true;
}
// Check if smilie object is valid
if ($try->is_valid()) {
if ($import_smilie) {
if ($try->import_smilie($Db_target, $target_database_type, $target_table_prefix)) {
$displayobject->display_now('<br /><span class="isucc"><b>' . $try->how_complete() . '%</b></span> :: ' . $displayobject->phrases['smilie'] . ' -> ' . $try->get_value('mandatory', 'smilietext'));
$sessionobject->add_session_var($class_num . '_objects_done', intval($sessionobject->get_session_var($class_num . '_objects_done')) + 1);
} else {
$sessionobject->set_session_var($class_num . '_objects_failed', $sessionobject->get_session_var($class_num . '_objects_failed') + 1);
$sessionobject->add_error($smilie_id, $displayobject->phrases['smilie_not_imported'], $displayobject->phrases['smilie_not_imported_rem']);
$displayobject->display_now("<br />{$displayobject->phrases['failed']} :: {$displayobject->phrases['smilie_not_imported']}");
}
}
} else {
$displayobject->display_now("<br />{$displayobject->phrases['invalid_object']}" . $try->_failedon);
$sessionobject->set_session_var($class_num . '_objects_failed', $sessionobject->get_session_var($class_num . '_objects_failed') + 1);
}
unset($try);
}
// End resume
// Check for page end
if (count($smilie_array) == 0 or count($smilie_array) < $smilie_per_page) {
$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('import_smilie', 'done');
$sessionobject->set_session_var('module', '000');
$sessionobject->set_session_var('autosubmit', '0');
}
$sessionobject->set_session_var('smiliestartat', $smilie_start_at + $smilie_per_page);
$displayobject->update_html($displayobject->print_redirect('index.php', $sessionobject->get_session_var('pagespeed')));
}