本文整理匯總了PHP中Gallery::savethumb方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gallery::savethumb方法的具體用法?PHP Gallery::savethumb怎麽用?PHP Gallery::savethumb使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gallery
的用法示例。
在下文中一共展示了Gallery::savethumb方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: switch
$insertid = mysql_insert_id();
if (is_array($typ)) {
switch ($typ[2]) {
case 1:
$endung = '.gif';
break;
case 3:
$endung = '.png';
break;
default:
$endung = '.jpg';
break;
}
move_uploaded_file($picture['tmp_name'], $dir . 'large/' . $insertid . $endung);
@chmod($dir . 'large/' . $insertid . $endung, $new_chmod);
$galclass->savethumb($dir . 'large/' . $insertid . $endung, $dir . 'thumb/' . $insertid . '.jpg');
if ($galclass->getuserspace($userID) + filesize($dir . 'large/' . $insertid . $endung) + filesize($dir . 'thumb/' . $insertid . '.jpg') > $maxusergalleries) {
@unlink($dir . 'large/' . $insertid . $endung);
@unlink($dir . 'thumb/' . $insertid . '.jpg');
safe_query("DELETE FROM " . PREFIX . "gallery_pictures WHERE picID='" . $insertid . "'");
echo '<p style="color:' . $loosecolor . '">' . $_language->module['no_space_left'] . '</p>';
}
} else {
safe_query("DELETE FROM " . PREFIX . "gallery_pictures WHERE picID='" . $insertid . "'");
}
}
} elseif (isset($_GET['delete'])) {
//SQL
if (safe_query("DELETE FROM " . PREFIX . "gallery WHERE galleryID='" . $_GET['galleryID'] . "' AND userID='" . $userID . "'")) {
//FILES
$ergebnis = safe_query("SELECT picID FROM " . PREFIX . "gallery_pictures WHERE galleryID='" . $_GET['galleryID'] . "'");
示例2: VALUES
case 2:
$typ = '.jpg';
break;
case 3:
$typ = '.png';
break;
}
if ($name[$i]) {
$insertname = $name[$i];
} else {
$insertname = $picture;
}
safe_query("INSERT INTO " . PREFIX . "gallery_pictures ( galleryID, name, comment, comments) VALUES ('" . $_POST['galleryID'] . "', '" . $insertname . "', '" . $comment[$i] . "', '" . $_POST['comments'] . "' )");
$insertid = mysql_insert_id();
copy($dir . $picture, $dir . 'large/' . $insertid . $typ);
$galclass->savethumb($dir . 'large/' . $insertid . $typ, $dir . 'thumb/' . $insertid . '.jpg');
@unlink($dir . $picture);
$i++;
}
} else {
echo $_language->module['transaction_invalid'];
}
} elseif (isset($_POST['saveform'])) {
$dir = '../images/gallery/';
$picture = $_FILES['picture'];
$CAPCLASS = new Captcha();
if ($CAPCLASS->check_captcha(0, $_POST['captcha_hash'])) {
if ($picture['name'] != "") {
if ($_POST['name']) {
$insertname = $_POST['name'];
} else {