当前位置: 首页>>代码示例>>PHP>>正文


PHP deleteImage函数代码示例

本文整理汇总了PHP中deleteImage函数的典型用法代码示例。如果您正苦于以下问题:PHP deleteImage函数的具体用法?PHP deleteImage怎么用?PHP deleteImage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了deleteImage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deleteImg

function deleteImg($shorten, $api_key)
{
    if (isUrlOwned($shorten, $api_key)) {
        deleteImage($shorten);
    } else {
        echo "Error";
    }
}
开发者ID:Konosprod,项目名称:ciconia,代码行数:8,代码来源:index.php

示例2: _before_delete

 protected function _before_delete($option)
 {
     if (is_array($option['where']['id'])) {
         $this->error = '不支持批量删除';
         return FALSE;
     }
     $images = $this->field('brand_logo,big_brand_logo,mid_brand_logo,sm_brand_logo')->find($option['where']['id']);
     deleteImage($images);
 }
开发者ID:HeRedBo,项目名称:jinxishop,代码行数:9,代码来源:BrandModel.class.php

示例3: deleteAlbum

function deleteAlbum($album_id)
{
    if (albumExists($album_id)) {
        $images = getAlbumImages($album_id);
        foreach ($images as $img) {
            $image_id = $img['ImageID'];
            deleteImage($image_id);
        }
        mysql_query("DELETE FROM `mbg_albums` WHERE `AlbumID` = '{$album_id}'");
        return true;
    }
    return false;
}
开发者ID:bossmanpl,项目名称:SzklaneZabudowy,代码行数:13,代码来源:functions.php

示例4: deleteNameFiles

function deleteNameFiles($nameId)
{
    global $dbConnect;
    $dbresult = $dbConnect->getLuasByNameId($nameId);
    while ($row = mysql_fetch_assoc($dbresult)) {
        deleteFilesByLuaId($row['Id']);
    }
    $dbresult = $dbConnect->getImagesByNameId($nameId);
    while ($row = mysql_fetch_assoc($dbresult)) {
        deleteImage($row['Id']);
    }
    //delete thumbnail
    unlink("thumbnails/" . $nameId);
}
开发者ID:TurBoss,项目名称:Zero-K-Infrastructure,代码行数:14,代码来源:admin.php

示例5: product_update

function product_update()
{
    $id = $_POST['id'];
    if (isset($_POST['update'])) {
        $data['product_object'] = model('product')->getOne($id);
        //var_dump($data);die;
        $data['template_file'] = 'product/update.php';
        render('layout.php', $data);
    }
    if (isset($_POST['saveUpdate'])) {
        unset($_POST['saveUpdate']);
        $postData = postData();
        if ($_FILES["fileImage"]['name'] != "") {
            $postData['image'] = uploadImage();
            deleteImage($_POST['image']);
        }
        if (model('product')->updateProduct($postData, $id)) {
            redirect('/index.php?c=product&m=list');
        }
    }
}
开发者ID:nguyenlevietphi,项目名称:MyBlog,代码行数:21,代码来源:product.php

示例6: deleteImage

<?php

include_once 'procedures.php';
deleteImage(intval($_POST['id']));
开发者ID:CSchool,项目名称:AIBattle,代码行数:4,代码来源:jqueryDeleteImage.php

示例7: delete_post

function delete_post($post_id)
{
    delete_tags_from_post($post_id);
    deleteImage($post_id);
    global $db;
    // vymažeme článok z tabuľky článkov
    $query = $db->prepare("DELETE FROM posts WHERE id = :id");
    $delete = $query->execute(array("id" => $post_id));
    if (!$delete) {
        add_message("Nepodarilo sa vymazať článok.");
        return false;
    }
    add_message("Článok bol vymazaný.");
    return true;
}
开发者ID:petrofcikmatus,项目名称:simple-blog,代码行数:15,代码来源:functions-post.php

示例8: deleteCategory

    case "deleteCategory":
        deleteCategory($_GET['id']);
        break;
    case "edit":
        editBlogEntry($_GET['id']);
        break;
    case "finishEdit":
        finishEditBlogEntry($_POST['id'], $_POST['editBlogCategory'], $_POST['editBlogTitle'], $_POST['editBlogText'], $_POST['editBlogExtText']);
        break;
    case "delete":
        deleteBlogEntry($_GET['id']);
        break;
    case "upload":
        upload($_GET['id'], isset($_GET['error']) ? $_GET['error'] : "");
        break;
    case "finishUpload":
        finishUpload($_POST['blog_id'], $_POST['description'], $_FILES['image_file']['tmp_name'], $_FILES['image_file']['type'], $_FILES['image_file']['size'], $_FILES['image_file']['name']);
        break;
    case "editImage":
        editImage($_GET['id']);
        break;
    case "finishEditImage":
        finishEditImage($_POST['id'], $_POST['description'], $_POST['blog_id']);
        break;
    case "deleteImage":
        deleteImage($_GET['id'], $_GET['blog_id']);
        break;
    default:
        main(isset($_GET['PHP_SELF']) ? $_GET['PHP_SELF'] : "");
        break;
}
开发者ID:BackupTheBerlios,项目名称:jonescms,代码行数:31,代码来源:blog.php

示例9: deleteImages

    /**
     * Delete product images from database
     *
     * @return array Deletion result
     */
    public function deleteImages()
    {
        $result = Db::getInstance()->ExecuteS('
		SELECT `id_image`
		FROM `' . _DB_PREFIX_ . 'image`
		WHERE `id_product` = ' . (int) $this->id);
        foreach ($result as $row) {
            if (!deleteImage((int) $this->id, $row['id_image']) or !Db::getInstance()->Execute('DELETE FROM `' . _DB_PREFIX_ . 'image_lang` WHERE `id_image` = ' . (int) $row['id_image'])) {
                return false;
            }
        }
        return Db::getInstance()->Execute('DELETE FROM `' . _DB_PREFIX_ . 'image` WHERE `id_product` = ' . (int) $this->id);
    }
开发者ID:hecbuma,项目名称:quali-fisioterapia,代码行数:18,代码来源:Product.php

示例10: delete

    public function delete()
    {
        if ($this->id == 1) {
            return false;
        }
        /* Get childs categories */
        $toDelete = array(intval($this->id));
        $this->recursiveDelete($toDelete, intval($this->id));
        $toDelete = array_unique($toDelete);
        /* Delete category and its child from database */
        $list = sizeof($toDelete) > 1 ? implode(',', $toDelete) : intval($this->id);
        Db::getInstance()->Execute('DELETE FROM `' . _DB_PREFIX_ . 'category` WHERE `id_category` IN (' . $list . ')');
        Db::getInstance()->Execute('DELETE FROM `' . _DB_PREFIX_ . 'category_lang` WHERE `id_category` IN (' . $list . ')');
        Db::getInstance()->Execute('DELETE FROM `' . _DB_PREFIX_ . 'category_product` WHERE `id_category` IN (' . $list . ')');
        /* Delete categories images */
        foreach ($toDelete as $id_category) {
            deleteImage(intval($id_category));
        }
        /* Delete products which were\'t in others categories */
        $result = Db::getInstance()->ExecuteS('
		SELECT `id_product`
		FROM `' . _DB_PREFIX_ . 'product`
		WHERE `id_product` NOT IN (SELECT `id_product` FROM `' . _DB_PREFIX_ . 'category_product`)');
        foreach ($result as $p) {
            $product = new Product(intval($p['id_product']));
            if (Validate::isLoadedObject($product)) {
                $product->delete();
            }
        }
        /* Set category default to 1 where categorie no more exists */
        $result = Db::getInstance()->Execute('
		UPDATE `' . _DB_PREFIX_ . 'product`
		SET `id_category_default` = 1
		WHERE `id_category_default`
		NOT IN (SELECT `id_category` FROM `' . _DB_PREFIX_ . 'category`)');
        return true;
    }
开发者ID:raulgimenez,项目名称:dreamongraphics_shop,代码行数:37,代码来源:Category.php

示例11: mysql_real_escape_string

            $select_sql_string = 'SELECT albums.id, albums.name FROM imagesToAlbums, albums WHERE imagesToAlbums.imageId=' . mysql_real_escape_string($imageId) . ' AND imagesToAlbums.albumId=albums.id';
            $result = $db->query($select_sql_string);
            if (isset($_POST["Delete"])) {
                $albums = $_POST['album'];
                if (!empty($albums)) {
                    foreach ($albums as $albumId) {
                        $query_for_album = "SELECT parentAlbumId, id, ownerId, name FROM albums WHERE id='" . mysql_real_escape_string($albumId) . "'";
                        $album_data = mysql_fetch_array($db->query($query_for_album));
                        if (!empty($album_data)) {
                            if ($album_data['ownerId'] == $currentUser['id']) {
                                $delete_sql_string = 'DELETE FROM imagesToAlbums WHERE albumId="' . mysql_real_escape_string($albumId) . '" AND imageId ="' . $imageId . '"';
                                $db->query($delete_sql_string);
                            }
                        }
                    }
                    deleteImage($currentUser['id'], $db, $imageId);
                }
                if (!$phpunit['isTest']) {
                    header('Location: ./index.html?id=' . $_GET['albumId']);
                    exit;
                }
            }
        }
        if (!$phpunit['isTest']) {
            if ($error) {
                print $message;
            } else {
                $select_sql_string = 'SELECT albums.id, albums.name FROM imagesToAlbums, albums WHERE imagesToAlbums.imageId=' . mysql_real_escape_string($imageId) . ' AND imagesToAlbums.albumId=albums.id';
                $result = $db->query($select_sql_string);
                ?>
开发者ID:hochla-simon,项目名称:Pitter,代码行数:30,代码来源:photoDelete.php

示例12: _before_delete

 protected function _before_delete($option)
 {
     if (is_array($option['where']['id'])) {
         $this->error = '不支持批量删除';
         return FALSE;
     }
     $images = $this->field('goods_ori,goods_thumb')->find($option['where']['id']);
     deleteImage($images);
     /*********** 先删除商品的其他信息 ***************/
     // 扩展分类
     $model = M('GoodsCat');
     $model->where(array('goods_id' => array('eq', $option['where']['id'])))->delete();
     // 会员价格
     $model = M('MemberPirce');
     $model->where(array('goods_id' => array('eq', $option['where']['id'])))->delete();
     //商品属性
     $model = M('Goods_attr');
     $model->where(array('goods_id' => array('eq', $option['where']['id'])))->delete();
     //商品库存量
     $model = M('GoodsNumber');
     $model->where(array('goods_id' => array('eq', $option['where']['id'])))->delete();
     //商品相册图片
     $model = M('GoodsPics');
     //想取出图片的路径
     $pics = $model->where()->select();
     foreach ($pics as $p) {
         deleteImage($p);
     }
     $model->where(array('goods_id' => array('eq', $option['where']['id'])))->delete();
 }
开发者ID:HeRedBo,项目名称:jinxishop,代码行数:30,代码来源:GoodsModel.class.php

示例13: delete_ads_files

function delete_ads_files($ad_id)
{
    $sql = "select * from form_fields where form_id=1 ";
    $result = mysql_query($sql) or die(mysql_error());
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
        $field_id = $row['field_id'];
        $field_type = $row['field_type'];
        if ($field_type == "FILE") {
            deleteFile("ads", "ad_id", $ad_id, $field_id);
        }
        if ($field_type == "IMAGE") {
            deleteImage("ads", "ad_id", $ad_id, $field_id);
        }
    }
}
开发者ID:cLESE02,项目名称:2Mproj,代码行数:15,代码来源:ads.inc.php

示例14: imageWidth

    print "something went wrong ...\n";
    exit;
}
if (encodeImageFile($image, "test.jpg", 80, "")) {
    print "image written all fine.\n";
} else {
    print "something went wrong writing the image ...\n";
    exit;
}
# advanced use, use in memory locations
$image_bits = `cat testsuite/tif/5.1.13.tif`;
if (decodeImage($image, $image_bits)) {
    print "image read from RAM.\n";
} else {
    print "something went wrong decoding the RAM\n";
    exit;
}
# image properties
print "Width: " . imageWidth($image) . "\n";
print "Height: " . imageHeight($image) . "\n";
print "Xres: " . imageXres($image) . "\n";
print "Yres: " . imageYres($image) . "\n";
print "Channels: " . imageChannels($image) . "\n";
print "Channel depth: " . imageChannelDepth($image) . "\n";
# setable as well
imageSetXres($image, 144);
imageSetYres($image, 144);
print "Xres: " . imageXres($image) . "\n";
print "Yres: " . imageYres($image) . "\n";
deleteImage($image);
开发者ID:joshua-chavanne,项目名称:unix-toolbox.js-exact-image,代码行数:30,代码来源:test.php

示例15: get_sql_update_values

function get_sql_update_values($form_id, $table_name, $object_name, $object_id, $user_id)
{
    $sql = "SELECT * FROM form_fields WHERE form_id='{$form_id}' AND field_type != 'SEPERATOR' AND field_type != 'BLANK' AND field_type != 'NOTE'  ";
    $result = mysql_query($sql) or die(mysql_error());
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
        $tmp = '';
        $comma = '';
        switch ($row['field_type']) {
            case "IMAGE":
                if ($_FILES[$row['field_id']]['name'] != '') {
                    //echo "Image:<b>***$table_name, $object_name, $object_id, $user_id</b>";
                    $file_name = saveImage($row['field_id']);
                    $_REQUEST[$row['field_id']] = $file_name;
                    // delete the old image
                    if ($object_id != '') {
                        deleteImage($table_name, $object_name, $object_id, $row[field_id]);
                    }
                    $str .= ", `" . $row['field_id'] . "` = '" . $file_name . "' ";
                }
                break;
            case "FILE":
                if ($_FILES[$row['field_id']]['name'] != '') {
                    $file_name = saveFile($row['field_id']);
                    $mime_type = $_FILES[$row['field_id']]['type'];
                    //$_REQUEST[$row[field_id]] = $file_name;
                    // delete the old image
                    if ($object_id != '') {
                        deleteFile($table_name, $object_name, $object_id, $row['field_id']);
                    }
                    //$str .= ", `".$row['field_id']."` = '".$file_name."' , `".$row[field_id]."9193` = '".$mime_type."'";
                    $str .= ", `" . $row['field_id'] . "` = '" . $file_name . "' ";
                }
                break;
            case "DATE":
                $day = $_REQUEST[$row['field_id'] . "d"];
                $month = $_REQUEST[$row['field_id'] . "m"];
                $year = $_REQUEST[$row['field_id'] . "y"];
                $_REQUEST[$row['field_id']] = $year . "-" . $month . "-" . $day;
                $str .= ", `" . $row['field_id'] . "` = '" . $_REQUEST[$row['field_id']] . "' ";
                break;
            case "DATE_CAL":
                $temp_time = strtotime($_REQUEST[$row['field_id']] . " GMT");
                $day = date('d', $temp_time);
                $month = date('m', $temp_time);
                $year = date('y', $temp_time);
                $str .= ", `" . $row['field_id'] . "` = '" . $year . "-" . $month . "-" . $day . "' ";
                break;
            case "CHECK":
                $selected_codes = array();
                $selected_codes = $_REQUEST[$row['field_id']];
                // the field comes in as an array
                for ($i = 0; $i < sizeof($selected_codes); $i++) {
                    if ($i > 0) {
                        $comma = ',';
                    }
                    $tmp .= $comma . $selected_codes[$i] . "";
                }
                $_REQUEST[$row['field_id']] = $tmp;
                $str .= ", `" . $row['field_id'] . "` = '" . $_REQUEST[$row['field_id']] . "' ";
                break;
            case "MSELECT":
                $selected_codes = array();
                $selected_codes = $_REQUEST[$row['field_id']];
                // the field comes in as an array
                for ($i = 0; $i < sizeof($selected_codes); $i++) {
                    if ($i > 0) {
                        $comma = ',';
                    }
                    $tmp .= $comma . $selected_codes[$i] . "";
                }
                $_REQUEST[$row['field_id']] = $tmp;
                $str .= ", `" . $row['field_id'] . "` = '" . $_REQUEST[$row['field_id']] . "' ";
                break;
            case "SKILL_MATRIX":
                save_skill_matrix_data($row['field_id'], $object_id, $user_id);
                $str .= ", `" . $row['field_id'] . "` = '" . $_REQUEST[$row['field_id']] . "' ";
                break;
            case "TEXT":
                $str .= ", `" . $row['field_id'] . "` = '" . html_entity_decode($_REQUEST[$row['field_id']]) . "' ";
                break;
            default:
                $str .= ", `" . $row['field_id'] . "` = '" . $_REQUEST[$row['field_id']] . "' ";
                break;
        }
    }
    //echo "$str<br>";
    return $str;
}
开发者ID:cLESE02,项目名称:2Mproj,代码行数:88,代码来源:dynamic_forms.php


注:本文中的deleteImage函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。