예제 #1
0
                 $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) {
         $file_names = create_filenames($upload_type['store_extension']);
     }
 }
 if ($attachment_type == Config::ATTACHMENT_TYPE_FILE) {
     if ($file_exists) {
         $attachment_id = $same_attachments[0]['id'];
     } else {
         $abs_file_path = Config::ABS_PATH . "/{$board['name']}/other/{$file_names[0]}";
         move_uploded_file($uploaded_file_path, $abs_file_path);
         $attachment_id = files_add($file_hash, $file_names[0], $uploaded_file_size, $upload_type['thumbnail_image'], Config::THUMBNAIL_WIDTH, Config::THUMBNAIL_HEIGHT);
     }
 } elseif ($attachment_type === Config::ATTACHMENT_TYPE_IMAGE) {
     if ($file_exists) {
         $attachment_id = $same_attachments[0]['id'];
     } else {
         $img_dimensions = image_get_dimensions($upload_type, $uploaded_file_path);
예제 #2
0
            // Cleanup.
            DataExchange::releaseResources();
            display_error_page($smarty, kotoba_last_error());
            exit(1);
        }
        $smarty->assign('board', $board_name);
    }
    if (isset($_POST['thread'])) {
        $smarty->assign('thread', threads_check_original_post($_POST['thread']));
    }
    if ($_POST['painter'] == 'shi_pro') {
        $tools = 'pro';
    } elseif ($_POST['painter'] == 'shi_normal') {
        $tools = 'normal';
    }
    $file_names = create_filenames('png');
    $smarty->assign('image_width', $_POST['x']);
    $smarty->assign('image_height', $_POST['y']);
    $smarty->assign('thumbnail_width', Config::THUMBNAIL_WIDTH);
    $smarty->assign('thumbnail_height', Config::THUMBNAIL_HEIGHT);
    $smarty->assign('tools', $tools);
    $smarty->assign('ip', $_SERVER['REMOTE_ADDR']);
    $smarty->assign('time', time());
    $smarty->assign('file', $file_names[2]);
    $smarty->display('shi_applet.tpl');
    // Cleanup.
    DataExchange::releaseResources();
    exit(0);
} catch (KotobaException $e) {
    // Cleanup.
    DataExchange::releaseResources();