function Action2($siteid) { global $db; $dbbooks = $db->get_books($siteid); print_r("db-book count: " . count($dbbooks) . "\n"); $i = 0; foreach ($dbbooks as $bookid => $dbbook) { $i++; $name = $dbbook["name"]; print_r("AddChapter([{$i}]{$bookid} - {$name})\n"); if (0 != AddChapter($siteid, $bookid, $dbbook, False)) { sleep(20); } } }
function Action2($update_mode) { global $db; $dbbooks = $db->get_books(CYSTS8::$siteid); print_r("db-book count: " . count($dbbooks) . "\n"); // 2. add chapter $i = 0; foreach ($dbbooks as $bookid => $dbbook) { $i++; //if($i < 10000) continue; $name = $dbbook["name"]; print_r("AddChapter([{$i}]{$bookid} - {$name})\n"); if (0 != AddChapter($bookid, $name, $update_mode)) { sleep(20); } } }