<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<?php
require_once('./include.php');
$p_source = $_POST['source'];
$p_index = $_POST['index'];
$p_what = $_POST['what'];
if ($p_source == "Sitemap") {
$source = SRC_SITEMAP;
} elseif ($p_source == "Downloads") {
$source = SRC_DL;
} elseif ($p_source == "News archive") {
$source = SRC_ARCHIV;
}
if ($p_index == "Whole site") {
$path = PATH_ALL;
} elseif ($p_source == "Downloads") {
$path = PATH_DL;
}
$cur_index = new search_index($path);
echo "<p>Index is stored in <strong>" . $path."</strong></p>\n";
$cur_list = new sites_list($source);
if ($p_what == "append") {
// APPEND Index
echo "<p>Appending <strong>".$source."</strong> ...</p>\n";
$cur_index->append($cur_list->get_list());
} elseif ($p_what == "create new / overwrite") {
// CREATE new index / overwrite index
echo "<p>Creating new index for <strong>".$source."</strong> ...</p>\n";
$cur_index->create($cur_list->get_list());
}
?>
</body>
</html>