Esempio n. 1
0
         case Config::ATTACHMENT_TYPE_VIDEO:
             posts_videos_add($post['id'], $attachment_id, 0);
             break;
         default:
             throw new ParanoicException("Attachment type {$attachment_type} " . "not supported.");
     }
 }
 // Update password and redirection.
 if ($_SESSION['user'] != Config::GUEST_ID && $should_update_password) {
     users_set_password($_SESSION['user'], $password);
 }
 if ($_SESSION['user'] != Config::GUEST_ID && $should_update_goto) {
     users_set_goto($_SESSION['user'], $goto);
 }
 // Popdown threads.
 foreach (popdown_handlers_get_all() as $popdown_handler) {
     if ($board['popdown_handler'] == $popdown_handler['id']) {
         $popdown_handler['name']($board['id']);
         break;
     }
 }
 unset($_SESSION['oekaki']);
 // Redirect.
 if ($_SESSION['goto'] == 't') {
     header('Location: ' . Config::DIR_PATH . "/{$board['name']}/{$post['number']}/");
 } else {
     header('Location: ' . Config::DIR_PATH . "/{$board['name']}/");
 }
 // Temporary code for highload tests!
 if (ctype_digit($thread['id'])) {
     echo "{$thread['id']}";
            Logging::close_log();
            display_error_page($smarty, kotoba_last_error());
            exit(1);
        }
        popdown_handlers_add($_);
        $reload_popdown_handlers = true;
    }
    // Delete popdown handlers.
    foreach ($popdown_handlers as $handler) {
        if (isset($_POST['delete_' . $handler['id']])) {
            popdown_handlers_delete($handler['id']);
            $reload_popdown_handlers = true;
        }
    }
    if ($reload_popdown_handlers) {
        $popdown_handlers = popdown_handlers_get_all();
    }
    // Generate html code of edit popdown handlers page and display it.
    $smarty->assign('show_control', is_admin() || is_mod());
    $smarty->assign('boards', boards_get_visible($_SESSION['user']));
    $smarty->assign('popdown_handlers', $popdown_handlers);
    $smarty->display('edit_popdown_handlers.tpl');
    // Cleanup.
    DataExchange::releaseResources();
    Logging::close_log();
    exit(0);
} catch (KotobaException $e) {
    // Cleanup.
    DataExchange::releaseResources();
    Logging::close_log();
    display_exception_page($smarty, $e, is_admin() || is_mod());