0xFF){ return deny("Could not seal /{$literal}/{$id}: fragments are broken."); } if(!SQL::q("UPDATE `node_{$literal}` SET `spec` = {$spell} WHERE `id` = {$id}")){ return deny("Unable to cast spell on /{$literal}/{$id} (database issue)."); } Generate::catalist($literal,$id,true); # pass id to rebuild specific thread and true to shift (e.g. thread is now invisible) Generate::thread($literal,$thread); # regenerate full version of thread Generate::chunk($literal,$thread); # regenerate thread head $data = SQL::kq("SELECT `id`,`rl`,`spec` FROM `node_{$literal}` WHERE `id` = {$id}", SQL::ONE|SQL::KEY); $thread = $data[1]; $thread = intval($post[1]); if($thread == 0) $thread = $id; if($post[2]&$spell) $mode = $post[2] - $spell; else $mode = $post[2] + $spell; if(SQL::q("UPDATE `node_{$literal}` SET `spec` = {$mode} WHERE `id` = {$id}")){ import(X::GENERATE); Generate::catalist($literal); Generate::thread($literal,$thread); Generate::chunk($literal,$thread); new Note("Enchanted >>/{$literal}/{$id} to {$spell}."); } } static function seal($literal, $seal_combine = false){ # recombine board seal import(System::SQL); import(Module::BUILD); $seal = X::$mode; $fragment = 0; foreach($seal_combine as $seal_fragment){ $fragment = abs(intval($seal_fragment)); if($seal&$fragment) $seal -= $fragment; else $seal += $fragment; } if($seal < 0 || $seal > 0xFFFF){ return deny("Could not seal /{$literal}/: fragments are broken."); } if(!SQL::q("UPDATE `nodes` set `mode` = {$seal} where `lt` = '{$literal}'")){ return deny("Unable to seal /{$literal}/ (database issue)."); } Build::boardlist(); new Note("Sealed /{$literal}/ to {$seal}."); } static function teleport($literal,$id,$destination_board,$destination_thread){ # move thread to another space if(!isset(X::$tree[$literal],X::$tree[$destination_board])) return deny("Illegal teleportation parameters"); Katana::cata($literal); $id = abs(intval($id)); $destination_thread = abs(intval($destination_thread)); if(!isset(X::$cata[$id])) return deny("Thread #{$id} does not exist in /{$literal}/"); import(System::SQL); $info = SQL::kq("SELECT * FROM `node_{$literal}` WHERE `id` = {$id}", SQL::ONE|SQL::NUM); if(empty($info)){ return deny("Unable to find thread #{$id}"); } SQL::q("DELETE FROM `node_{$literal}` WHERE `id` = {$id}"); SQL::q("INSERT INTO `node_{$destination_board}` () VALUES ()"); if(SQL::q("UPDATE `node_{$literal}` SET `nd` = '{$destination_board}', `rl` = {$destination_thread} WHERE `id` = {$id}")){ Generate::catalist($literal) and Generate::pages($literal); Generate::catalist($destination_board) and Generate::pages($destination_board); new Note("Teleported >>/{$literal}/{$id} to >>/{$destination_board}/{$destination_thread}."); return; } return deny("Unable to teleport post."); } }