exit(1); } $page = 1; if (isset($_REQUEST['page'])) { $page = check_page($_REQUEST['page']); } $password = NULL; if (isset($_SESSION['password'])) { $password = $_SESSION['password']; } $board = NULL; $banners_board_id = NULL; $posts_attachments = array(); $attachments = array(); $categories = categories_get_all(); $boards = boards_get_visible($_SESSION['user']); make_category_boards_tree($categories, $boards); // Конгломерат. Разкомментируйте и отредактируйте. //array_push( // $categories, // array('id' => 'Conglomerate', // 'name' => 'Conglomerate', // 'boards' => array(array('url' => 'http://wakachan.org/unyl/', // 'title' => 'Унылчан', // 'name' => 'unyl'), // array('url' => 'http://ii.dollchan.org/di/', // 'title' => 'Канакочан', // 'name' => 'di'))) //); foreach ($boards as $b) { if ($b['name'] == $board_name) {
if ($attachment_type == Config::ATTACHMENT_TYPE_FILE || $attachment_type == Config::ATTACHMENT_TYPE_IMAGE) { $file_hash = calculate_file_hash($uploaded_file_path); $file_exists = false; $same_attachments = null; switch ($board['same_upload']) { case 'once': $same_attachments = attachments_get_same($board['id'], $_SESSION['user'], $file_hash); if (count($same_attachments) > 0) { $file_exists = true; } break; case 'no': $same_attachments = attachments_get_same($board['id'], $_SESSION['user'], $file_hash); if (count($same_attachments) > 0) { $smarty->assign('show_control', is_admin() || is_mod()); $smarty->assign('boards', boards_get_visible($_SESSION['user'])); $smarty->assign('board', $board); $smarty->assign('same_attachments', $same_attachments); $smarty->display('same_attachments.tpl'); // Cleanup. DataExchange::releaseResources(); exit(0); } break; case 'yes': break; default: throw new ParanoicException('Unknown same uploads ' . 'behaviour.'); break; } if (!$file_exists) {