本文整理匯總了PHP中ImpExData::import_blog_category方法的典型用法代碼示例。如果您正苦於以下問題:PHP ImpExData::import_blog_category方法的具體用法?PHP ImpExData::import_blog_category怎麽用?PHP ImpExData::import_blog_category使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ImpExData
的用法示例。
在下文中一共展示了ImpExData::import_blog_category方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: resume
function resume(&$sessionobject, &$displayobject, &$Db_target, &$Db_source)
{
if (!$sessionobject->get_session_var('sourceexists')) {
$displayobject->display_error($displayobject->phrases['sourceexists_is_false']);
exit;
}
// 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);
if (!$sessionobject->get_session_var($class_num . '_start')) {
$sessionobject->timing($class_num, 'start', $sessionobject->get_session_var('autosubmit'));
}
$displayobject->update_basic('title', $displayobject->phrases['altering_tables']);
$displayobject->display_now("<h4>{$displayobject->phrases['altering_tables']}</h4>");
$displayobject->display_now($displayobject->phrases['alter_desc_1']);
$displayobject->display_now($displayobject->phrases['alter_desc_2']);
$displayobject->display_now($displayobject->phrases['alter_desc_3']);
$displayobject->display_now($displayobject->phrases['alter_desc_4']);
// Add an importids now
foreach ($this->_import_blog_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>{$displayobject->phrases['completed']}</i>");
} else {
$sessionobject->add_error($Db_target, 'fatal', $class_num, 0, $displayobject->phrases['table_alter_fail'], $displayobject->phrases['table_alter_fail_rem']);
exit;
}
}
}
// Add the importpostid indexs
$this->add_index($Db_target, $target_db_type, $target_table_prefix, 'user');
#$this->add_index($Db_target, $target_db_type, $target_table_prefix, 'post');
#$this->add_index($Db_target, $target_db_type, $target_table_prefix, 'thread');
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', "{$displayobject->phrases['imported']} {$displayobject->phrases['blog']} {$displayobject->phrases['users']}");
$try->import_usergroup($Db_target, $target_db_type, $target_table_prefix);
unset($try);
// Default blog cat
$try = new ImpExData($Db_target, $sessionobject, 'blog_category', 'blog');
$try->set_value('mandatory', 'title', "{$displayobject->phrases['imported']} {$displayobject->phrases['blog']}");
$try->set_value('mandatory', 'importblogcategoryid', '69');
$try->set_value('nonmandatory', 'description', "{$displayobject->phrases['imported']} {$displayobject->phrases['blog']}");
$try->import_blog_category($Db_target, $target_db_type, $target_table_prefix);
unset($try);
$sessionobject->add_session_var('added_default_unknown_group', 'yup');
}
// Check correct target
if ($this->_target_system != 'blog') {
echo "<br><br>";
die($displayobject->phrases['invalid_target_selected']);
}
// 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);
$sessionobject->add_error($Db_target, 'fatal', $class_num, 0, $displayobject->phrases['table_check_error'], $displayobject->phrases['check_db_permissions']);
$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')));
}
}