Example #1
0
                             //               move_uploaded_file($fileuploads['$i']['tmp_name'], "images/gallery/gal_".$CAT."/".$fileuploads['$i']['name']."");
                             $original_image = "images/gallery/gal_" . $CAT . "/" . $_FILES["fileUpload"]['name'][$k];
                             $width = _IGALLERYT_W;
                             $height = _IGALLERYT_H;
                             $desired_width = $size[0];
                             $desired_height = $size[1];
                             if ($desired_width > $width) {
                                 $im = $desired_width / $width;
                                 $imheight = $desired_height / $im;
                                 $image = new hft_image($original_image);
                                 $image->resize($width, $imheight, '0');
                             } else {
                                 $im = $size[1] / $height;
                                 $imwidth = $size[0] / $im;
                                 $image = new hft_image($original_image);
                                 $image->resize($imwidth, $height, '0');
                             }
                             $image->output_resized("images/gallery/gal_" . $CAT . "/thb_" . $_FILES["fileUpload"]['name'][$k] . "", "PNG");
                             $db->connectdb(DB_NAME, DB_USERNAME, DB_PASSWORD);
                             $db->add_db(TB_GALLERY, array("category" => "" . $_POST['CATEGORY'] . "", "posted" => "" . $admin_user . "", "post_date" => "" . TIMESTAMP . "", "pic" => "" . $_FILES["fileUpload"]['name'][$k] . "", "enable_comment" => "1"));
                             $db->closedb();
                         } else {
                             $ProcessOutput .= "<BR><BR>";
                             $ProcessOutput .= "<center><font color='red'>" . _ADMIN_GALLERY_MESSAGE_NOUP . " " . $_FILES["fileUpload"]['name'][$k] . "  " . _DOWNLOAD_MOD_ERROR2 . "</font><br>";
                         }
                     }
                 }
             }
         }
     }
 }
Example #2
0
 }
 if ($FILE['name']) {
     require "includes/class.resizepic.php";
     if ($FILE['type'] != "image/jpg" and $FILE['type'] != "image/jpeg" and $FILE['type'] != "image/pjpeg" and $FILE['size']) {
         echo "<script language='javascript'>";
         echo "alert('" . _JAVA_IMG_ACC . "')";
         echo "</script>";
         echo "<script language='javascript'>javascript:history.back()</script>";
         exit;
     }
     @copy($FILE['tmp_name'], "icon/knowledge_" . $arr['knowledge']['post_date'] . ".jpg");
     $original_image = "icon/knowledge_" . $arr['knowledge']['post_date'] . ".jpg";
     $desired_width = _IKNOW_W;
     $desired_height = _IKNOW_H;
     $image = new hft_image($original_image);
     $image->resize($desired_width, $desired_height, '0');
     $image->output_resized("icon/knowledge_" . $arr['knowledge']['post_date'] . ".jpg", "JPG");
     $pic = '1';
 } else {
     if ($arr['knowledge']['pic'] == 1) {
         $pic = '1';
     } else {
         $pic = '0';
     }
 }
 if ($FILESS['name']) {
     //·Ó¡ÒÃà¾ÔèÁ¢éÍÁÙÅŧ´ÒµéÒàºÊ
     $db->connectdb(DB_NAME, DB_USERNAME, DB_PASSWORD);
     $db->update_db(TB_KNOWLEDGE, array("category" => "" . $_POST['CATEGORY'] . "", "topic" => "" . addslashes(htmlspecialchars($_POST['TOPIC'])) . "", "headline" => "" . $_POST['HEADLINE'] . "", "detail" => "" . $_POST['DETAIL'] . "", "posted" => "" . $_SESSION['admin_user'] . "", "post_date" => "" . $arr['knowledge']['post_date'] . "", "update_date" => "" . $arr['knowledge']['post_date'] . "", "attach" => "" . $arr['knowledge']['post_date'] . "_" . $FILESS['name'] . "", "pic" => "" . $pic . "", "enable_comment" => "" . $ENABLE_COMMENT . ""), " id=" . $_GET['id'] . "");
     $db->closedb();
     @copy($FILESS['tmp_name'], "attach/knowledge_" . $arr['knowledge']['post_date'] . "_" . $FILESS['name'] . "");
Example #3
0
     $showmsg = "<br><br><center><font size='3' face='MS Sans Serif'><b>" . _MEMBER_MOD_FORM_PIC_NOWIDTH . " " . _MEMBER_LIMIT_UPLOAD / 1024 . " kB " . _MEMBER_MOD_FORM_PIC_NOWIDTH1 . "</b></font><br><br>\n\t<input type='button' value='" . _MEMBER_MOD_FORM_JAVA_RETERN . "' onclick='history.back();'></center>";
     showerror($showmsg);
     exit;
 }
 if ($FILE['type'] == 'image/jpg' || $FILE['type'] == 'image/jpeg' || $FILE['type'] == 'image/pjpeg' || $FILE['type'] == 'image/JPG' || $FILE['type'] == 'image/gif' || $FILE['type'] == 'image/x-png' || $FILE['type'] == 'image/png') {
     if ($widths > _MEMBER_LIMIT_PICWIDTH) {
         $images = $FILE["tmp_name"];
         $new_images = "members_" . TIMESTAMP . "_" . $FILE["name"];
         @copy($FILE["tmp_name"], "icon/members_" . TIMESTAMP . "_" . $FILE["name"]);
         $original_image = "icon/members_" . TIMESTAMP . "_" . $FILE["name"] . "";
         $width = _MEMBER_LIMIT_PICWIDTH;
         //		$size=GetimageSize($images);
         $im = $widths / $width;
         $imheight = $heights / $im;
         $image = new hft_image($original_image);
         $image->resize($width, $imheight, '0');
         if ($FILE['type'] == 'image/jpg' || $FILE['type'] == 'image/jpeg' || $FILE['type'] == 'image/pjpeg' || $FILE['type'] == 'image/JPG') {
             $image->output_resized("icon/members_" . TIMESTAMP . "_" . $FILE["name"] . "", "JPG");
         }
         if ($FILE['type'] == 'image/gif') {
             $image->output_resized("icon/members_" . TIMESTAMP . "_" . $FILE["name"] . "", "GIF");
         }
         if ($FILE['type'] == 'image/x-png' || $FILE['type'] == 'image/png') {
             $image->output_resized("icon/members_" . TIMESTAMP . "_" . $FILE["name"] . "", "PNG");
         }
         $Filenames = "members_" . TIMESTAMP . "_" . $FILE["name"] . "";
     } else {
         @copy($FILE['tmp_name'], "icon/members_" . TIMESTAMP . "_" . $FILE["name"]);
         $Filenames = "members_" . TIMESTAMP . "_" . $FILE["name"] . "";
     }
 } else {
     //max ein drittel der seitenbreite
     $maxHoehe = $y;
     //maximal die hoehe der karte
     //create the image from JPEG file
     $img = new hft_image($_FILES['bild']['tmp_name']);
     $origWidth = $img->image_original_width;
     $origHeight = $img->image_original_height;
     if ($origWidth < $maxBreite) {
         $maxBreite = $origWidth;
     }
     if ($origHeight < $maxHoehe) {
         $maxHoehe = $origHeight;
     }
     //keep X to Y ratio
     //so there will be no geometrical distortions:
     $img->resize($maxBreite, $maxHoehe, "-");
     //save the resized image to file
     //commented to save server load
     $img->output_resized($_FILES['bild']['tmp_name']);
     //file-upload war erfolgreich:
     $pfad = $_FILES['bild']['tmp_name'];
     $bild_id = setBild($pfad, 'Picture for table card ' . $tableCardId, $img->image_resized_width, $img->image_resized_height, $fileExtension);
     setTableCardPic($bild_id, $tableCardId);
     if (!empty($old_id)) {
         //altes bild loeschen
         deleteBild($old_id);
     }
 }
 $nachricht = "Das Design der Tischkarte wurde erfolgreich gespeichert.";
 $nachricht = getUebersetzung($nachricht);
 $info = true;
    $nachricht = "Bitte wählen sie ein Bild!";
    $nachricht = getUebersetzung($nachricht, $sprache, $link);
    $fehler = true;
    include_once "./bilderHochladen.php";
    exit;
}
$uploaddir = "../../upload/";
$mimeType = $_FILES['bild']['type'];
$file_save_as = uniqid("utilo_") . getFileExtension($mimeType);
//create the image from JPEG file
$img = new hft_image($_FILES['bild']['tmp_name']);
//keep X to Y ratio
//so there will be no geometrical distortions:
$bildXMax = getPropertyValue(BILDER_SUCHE_WIDTH, $unterkunft_id, $link);
$bildYMax = getPropertyValue(BILDER_SUCHE_HEIGHT, $unterkunft_id, $link);
$img->resize($bildXMax, $bildYMax, "-");
//save the resized image to file
//commented to save server load
$img->output_resized($_FILES['bild']['tmp_name']);
if (move_uploaded_file($_FILES['bild']['tmp_name'], $uploaddir . $file_save_as)) {
    chmod($uploaddir . $file_save_as, 0755);
    //file-upload war erfolgreich:
    $id = setBild($uploaddir . $file_save_as, $standardDescription, $zimmer_id, $img->image_resized_width, $img->image_resized_height, $link);
    //set descriptions in other languages:
    $spr = getSprachenForBelegungsplan($link);
    while ($s = mysqli_fetch_array($spr)) {
        $lang = $s['Sprache_ID'];
        if (isset($_POST["beschreibung_{$lang}"])) {
            $besc = $_POST["beschreibung_{$lang}"];
            if ($lang != $standardsprache && $besc != "") {
                setUebersetzungUnterkunft($besc, $standardDescription, $lang, $standardsprache, $unterkunft_id, $link);
Example #6
0
                     {
        DefinedImage::load("$root/upload/orig/$id.$ext")
     
            ->resize(320, 240)
            ->save("$root/upload/small/$id.$ext")
     
            ->resize(100, 75)
            ->save("$root/upload/thumb/$id.$ext");
                     }
     */
     if (class_exists('hft_image')) {
         $img = new hft_image("{$root}/upload/orig/{$id}.{$ext}");
         $img->resize(320, 240);
         $img->output_resized("{$root}/upload/small/{$id}.{$ext}");
         $img = new hft_image("{$root}/upload/orig/{$id}.{$ext}");
         $img->resize(100, 75);
         $img->output_resized("{$root}/upload/thumb/{$id}.{$ext}");
     } else {
         copy("{$root}/upload/orig/{$id}.{$ext}", "{$root}/upload/small/{$id}.{$ext}");
         copy("{$root}/upload/orig/{$id}.{$ext}", "{$root}/upload/thumb/{$id}.{$ext}");
     }
     mysql_query("INSERT INTO errors ( id, name, url, posted )\n                     VALUES ( '{$id}', '{$_POST['name']}', '{$_POST['url']}', '{$time}' )");
     $tags = explode(' ', $_POST['tags']);
     foreach ($tags as $tag) {
         $tag = strtolower($tag);
         $tag = str_replace(',', '', $tag);
         mysql_query("INSERT INTO errors_tags ( id, tag )\n                         VALUES ( '{$id}', '{$tag}' )");
     }
     header("Location: {$rootURL}/{$id}");
     exit;
 }
Example #7
0
    }
    return $str;
}
function getArrayVal(array $array, $name)
{
    if (array_key_exists($name, $array)) {
        return strip_only_tags($array[$name], "script");
    }
}
error_reporting(0);
$pic = getArrayVal($_GET, "pic");
$height = getArrayVal($_GET, "height");
$width = getArrayVal($_GET, "width");
include CL_ROOT . "/include/class.hft_image.php";
$imagehw = GetImageSize($pic);
$imagewidth = $imagehw[0];
$imageheight = $imagehw[1];
$myThumb = new hft_image(CL_ROOT . "/" . $pic);
$myThumb->jpeg_quality = 80;
if (!isset($height)) {
    $ratio = $imageheight / $imagewidth;
    $height = $width * $ratio;
    $height = round($height);
}
if (!isset($width)) {
    $ratio = $imagewidth / $imageheight;
    $width = $height * $ratio;
}
$myThumb->resize($width, $height, 0);
HEADER("Content-Type: image/jpeg");
$myThumb->output_resized("");
Example #8
0
     $uploadfile = $azon . substr(basename($f1), -4);
     if (move_uploaded_file($_FILES['userfile3']['tmp_name'], $uploaddir . $uploadfile)) {
         $orig = $uploaddir . $uploadfile;
     }
     require_once "hft_image.php";
     $img = new hft_image($orig);
     $img->resize(600, 600, "-");
     $x = strlen($orig) - 4;
     $ext = substr($orig, $x, 4);
     $fname = substr($orig, 0, $x);
     $outputfile = $fname . $ext;
     $img->output_resized($outputfile);
     $outputfile = substr($outputfile, -14);
     $originfilename = substr($fname . $ext, -14);
     $img = new hft_image($orig);
     $img->resize(250, 250, "-");
     $outputfiletmb = $fname . '_tmb' . $ext;
     $img->output_resized($outputfiletmb);
     $outputfiletmb = substr($outputfiletmb, -18);
     $beszuras = 'Update kep Set kicsi="' . $outputfiletmb . '", nagy="' . $originfilename . '", megjegyzes="' . $felirat . '" where id=3;';
     mysql_query("{$beszuras}", $abc);
 }
 if ($in = 4) {
     $felirat = $_POST["text1"];
     $beszuras = 'Update kep Set megjegyzes="' . $felirat . '" where id=3;';
     mysql_query("{$beszuras}", $abc);
 }
 if ($in = 5) {
     $felirat = $_POST["text2"];
     $beszuras = 'Update kep Set megjegyzes="' . $felirat . '" where id=3;';
     mysql_query("{$beszuras}", $abc);
Example #9
0
    function draft()
    {
    	createHiddenInput(\'draft\', \'true\');
        post();
    }
    ') . '
-->
</script>';
            break;
        case 'upload':
            if ($_FILES['file']['size'] > 0) {
                if (strpos($_FILES['file']['type'], 'image') !== false) {
                    list($filename, $ext) = explode('.', strtolower($_FILES['file']['name']));
                    $image = new hft_image($_FILES['file']['tmp_name']);
                    $image->output_original('../upload/' . $filename . '_orig.' . $ext);
                    $image->resize($preferences['thumb_width'], $preferences['thumb_height']);
                    $image->output_resized('../upload/' . $filename . '_thumb.' . $ext);
                } else {
                    move_uploaded_file($_FILES['file']['tmp_name'], '../upload/' . strtolower($_FILES['file']['name']));
                }
                redirect('?rand=' . rand());
            }
            $page_title = 'Upload';
            $content = '
        You can upload files up to ' . ini_get('upload_max_filesize') . '.
        This will be saved en <em>upload</em> folder.
        To link to your upload file you need to refer as <em>\'upload/filename.ext\'</em>.
        If you upload an image, it will create two files: <em>\'filename_orig.ext\'</em> and <em>\'filename_thumb.ext\'</em>.
        <form name="frm" id="frm" action="" method="post" enctype="multipart/form-data">
            <label for="file">Upload file</label><input type="file" name="file" id="file" /><br />
            <div align="center"><a href="javascript:send();">upload</a>&nbsp;<a href="?rand=' . rand() . '">back</a></div>