本文整理汇总了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";
}
}
示例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);
}
示例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;
}
示例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);
}
示例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');
}
}
}
示例6: deleteImage
<?php
include_once 'procedures.php';
deleteImage(intval($_POST['id']));
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
?>
示例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();
}
示例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);
}
}
}
示例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);
示例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;
}