當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Gallery::savethumb方法代碼示例

本文整理匯總了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'] . "'");
開發者ID:Blaz3r,項目名稱:webSPELL,代碼行數:31,代碼來源:usergallery.php

示例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 {
開發者ID:Blaz3r,項目名稱:webSPELL,代碼行數:31,代碼來源:gallery.php


注:本文中的Gallery::savethumb方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。