diff --git a/Rocksolid_Light/rslight/scripts/import-db3.php b/Rocksolid_Light/rslight/scripts/import-db3.php index c24294f..7710769 100755 --- a/Rocksolid_Light/rslight/scripts/import-db3.php +++ b/Rocksolid_Light/rslight/scripts/import-db3.php @@ -1,7 +1,10 @@ /
/groups.txt manually\n"; + echo "-remove: Remove all data for a group (-remove alt.test)\n"; + echo " You must also remove group name from /
/groups.txt manually\n"; + echo "-reset: Reset a group to restart from zero messages (-reset alt.test)\n"; + break; } exit(); } else { exit(); } -$group_list = get_group_list(); -$group = trim($argv[1]); -if($group == '') { - $group_files = scandir($workpath); - foreach($group_files as $this_file) { - if(strpos($this_file, '-articles.db3') === false) { - continue; - } - $group = preg_replace('/-articles.db3/', '', $this_file); - if (in_array($group, $group_list)) { - echo "Importing: ".$group."\n"; - import_articles($group); - } else { - echo "Removing: ".$group."\n"; - remove_articles($group); +function import($group = '') { + global $logfile; + $workpath=$spooldir."/"; + $path=$workpath."articles/"; + $group_list = get_group_list(); + $group = trim($group); + if($group == '') { + $group_files = scandir($workpath); + foreach($group_files as $this_file) { + if(strpos($this_file, '-articles.db3') === false) { + continue; + } + $group = preg_replace('/-articles.db3/', '', $this_file); + if (in_array($group, $group_list)) { + echo "Importing: ".$group."\n"; + import_articles($group); + } else { + echo "Removing: ".$group."\n"; + remove_articles($group); + reset_group($group, 1); + } } + } else { + echo "Importing: ".$group."\n"; + import_articles($group); } -} else { - echo "Importing: ".$group."\n"; - import_articles($group); + echo "\nImport Done\r\n"; } -echo "\nImport Done\r\n"; function get_group_list() { global $config_dir;