<?php // Clear fluxbb database truncate_tables(); // Remove all indexes // remove_indexes(); // Add guest account if ($_SESSION['pun_version'] == '1.1') { $db->query('INSERT INTO ' . $db->prefix . "users (username, password, email) VALUES('Guest', 'Guest', 'Guest')") or myerror('Unable to add guest user', __FILE__, __LINE__, $db->error()); } else { $db->query('INSERT INTO ' . $db->prefix . "users (group_id, username, password, email) VALUES(3, 'Guest', 'Guest', 'Guest')") or myerror('Unable to add guest user', __FILE__, __LINE__, $db->error()); } // Insert the four preset groups $db->query('INSERT INTO ' . $db->prefix . 'groups (' . ($db_type != 'pgsql' ? 'g_id, ' : '') . 'g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood) VALUES(' . ($db_type != 'pgsql' ? '1, ' : '') . "'Administrators', 'Administrator', 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0)") or myerror('Unable to add group', __FILE__, __LINE__, $db->error()); $db->query('INSERT INTO ' . $db->prefix . 'groups (' . ($db_type != 'pgsql' ? 'g_id, ' : '') . 'g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood) VALUES(' . ($db_type != 'pgsql' ? '2, ' : '') . "'Moderators', 'Moderator', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0)") or myerror('Unable to add group', __FILE__, __LINE__, $db->error()); $db->query('INSERT INTO ' . $db->prefix . 'groups (' . ($db_type != 'pgsql' ? 'g_id, ' : '') . 'g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood) VALUES(' . ($db_type != 'pgsql' ? '3, ' : '') . "'Guest', NULL, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 60, 30, 0)") or myerror('Unable to add group', __FILE__, __LINE__, $db->error()); $db->query('INSERT INTO ' . $db->prefix . 'groups (' . ($db_type != 'pgsql' ? 'g_id, ' : '') . 'g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood) VALUES(' . ($db_type != 'pgsql' ? '4, ' : '') . "'Members', NULL, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 60, 30, 60)") or myerror('Unable to add group', __FILE__, __LINE__, $db->error());
<?php $tables_views = array_merge((array) $_POST["tables"], (array) $_POST["views"]); if ($tables_views && !$error && !$_POST["search"]) { $result = true; $message = ""; if ($jush == "sql" && count($_POST["tables"]) > 1 && ($_POST["drop"] || $_POST["truncate"] || $_POST["copy"])) { queries("SET foreign_key_checks = 0"); // allows to truncate or drop several tables at once } if ($_POST["truncate"]) { if ($_POST["tables"]) { $result = truncate_tables($_POST["tables"]); } $message = lang('Tables have been truncated.'); } elseif ($_POST["move"]) { $result = move_tables((array) $_POST["tables"], (array) $_POST["views"], $_POST["target"]); $message = lang('Tables have been moved.'); } elseif ($_POST["copy"]) { $result = copy_tables((array) $_POST["tables"], (array) $_POST["views"], $_POST["target"]); $message = lang('Tables have been copied.'); } elseif ($_POST["drop"]) { if ($_POST["views"]) { $result = drop_views($_POST["views"]); } if ($result && $_POST["tables"]) { $result = drop_tables($_POST["tables"]); } $message = lang('Tables have been dropped.'); } elseif ($jush != "sql") { $result = $jush == "sqlite" ? queries("VACUUM") : apply_queries("VACUUM" . ($_POST["optimize"] ? "" : " ANALYZE"), $_POST["tables"]);
} } } } foreach ($imports[2]['POFF_CINEMAS'] as $cinema) { if (in_array($cinema['@attributes']['CINEMA_ID'], $related_cinemas)) { $cinemas[] = '(' . $cinema['@attributes']['CINEMA_ID'] . ',"' . mysql_real_escape_string($cinema['@attributes']['CINEMA_ENGLISH']) . '","' . mysql_real_escape_string($cinema['@attributes']['CINEMA_ESTONIAN']) . '")'; } } $sql_countries .= implode(',', $countries) . ';'; $sql_sections .= implode(',', $sections) . ';'; if (isset($cinemas)) { $sql_cinemas .= implode(',', $cinemas) . ';'; } else { $sql_cinemas = ''; } $sql_films .= implode(',', $films) . ';'; $sql_films_variables .= implode(',', $variables) . ';'; $sql_films_categoris .= implode(',', $categories) . ';'; $sql_directors .= implode(',', $directors) . ';'; if (isset($screenings)) { $sql_screenings .= implode(',', $screenings) . ';'; } else { $sql_screenings = ''; } $tables = array('newcms2_catalog_variable_selection', 'newcms2_catalog_category', 'newcms2_catalog_product_cinemas', 'newcms2_catalog_product', 'newcms2_catalog_product_value', 'newcms2_catalog_product_category', 'newcms2_catalog_product_directors', 'newcms2_catalog_product_screenings'); truncate_tables($tables); perform_queries(array($sql_countries, $sql_sections, $sql_cinemas, $sql_films, $sql_films_variables, $sql_films_categoris, $sql_directors, $sql_screenings)); } echo '<span style="font-weight: bold; color: green;">XML\'i importimine oli edukas!</span>'; page_end();