Beispiel #1
0
         $cover = new Imagick($tmpfname);
         unlink($tmpfname);
     } catch (ImagickException $e) {
         $error = _('Error: ' . $e->getMessage());
     }
     if ($cover) {
         if (!$cover->resizeImage(240, 320, Imagick::FILTER_LANCZOS, 1)) {
             $error = _('Error: could not resize cover');
         }
         $cover_filename = substr($_POST['cover_big'], strrpos($_POST['cover_big'], '/') + 1);
         $cover_id = Mysql::getInstance()->insert('screenshots', array('name' => $cover_filename))->insert_id();
         if (empty($_SESSION['upload'])) {
             $_SESSION['upload'] = array();
         }
         $_SESSION['upload'][] = $cover_id;
         $img_path = get_save_folder($cover_id);
         umask(0);
         if (!$error && !$cover->writeImage($img_path . '/' . $cover_id . '.jpg')) {
             $error = _('Error: could not save cover image');
         }
         $cover->destroy();
     }
 }
 $type = '';
 if (!$error) {
     if (@$_POST['censored'] == 'on') {
         $censored = 1;
     } else {
         $censored = 0;
     }
     if (@$_POST['hd'] == 'on') {
//print_r($_SESSION);
echo '</pre>';
if (!$_SERVER['QUERY_STRING']) {
    unset($_SESSION['upload']);
}
$ext = '';
if (@$_GET['path']) {
    preg_match("/[(\\S+)](.)[(\\S+)]\$/", $_GET['path'], $arr);
    $ext = @$arr[0];
}
if (isset($_FILES['screenshot'])) {
    if (is_uploaded_file($_FILES['screenshot']['tmp_name'])) {
        if (preg_match("/jpeg/", $_FILES['screenshot']['type'])) {
            $upload_id = Mysql::getInstance()->insert('screenshots', array('name' => $_FILES['screenshot']['name'], 'size' => $_FILES['screenshot']['size'], 'type' => $_FILES['screenshot']['type']))->insert_id();
            $_SESSION['upload'][] = $upload_id;
            $img_path = get_save_folder($upload_id);
            rename($_FILES['screenshot']['tmp_name'], $img_path . '/' . $upload_id . '.jpg');
        }
    }
}
if (isset($_GET['accessed']) && @$_GET['id']) {
    Admin::checkAccess(AdminAccess::ACCESS_CONTEXT_ACTION);
    set_karaoke_accessed(@$_GET['id'], @$_GET['accessed']);
    $id = $_GET['id'];
    if ($_GET['accessed'] == 1) {
        chmod(KARAOKE_STORAGE_DIR . '/' . $id . '.mpg', 0444);
    } else {
        chmod(KARAOKE_STORAGE_DIR . '/' . $id . '.mpg', 0666);
    }
    header("Location: add_karaoke.php?letter=" . @$_GET['letter'] . "&search=" . @urldecode($_GET['search']) . "&page=" . @$_GET['page']);
    exit;