本文整理汇总了PHP中delete_upload函数的典型用法代码示例。如果您正苦于以下问题:PHP delete_upload函数的具体用法?PHP delete_upload怎么用?PHP delete_upload使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了delete_upload函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: video_delete_object
function video_delete_object($args)
{
$obj = $args['obj'];
if (!isset($obj['type']) || $obj['type'] != 'video') {
return false;
}
load_modules('glue');
if (!empty($obj['video-file'])) {
$pn = array_shift(expl('.', $obj['name']));
delete_upload(array('pagename' => $pn, 'file' => $obj['video-file'], 'max_cnt' => 1));
}
}
示例2: download_delete_object
function download_delete_object($args)
{
$obj = $args['obj'];
if (!isset($obj['type']) || $obj['type'] != 'download') {
return false;
}
load_modules('glue');
$a = expl('.', $obj['name']);
$ret = delete_upload(array('pagename' => $a[0], 'file' => $obj['download-file'], 'max_cnt' => 1));
if ($ret['#error']) {
log_error('error', 'upload_delete_object: delete_upload returned ' . quot($ret['#error']));
}
}
示例3: defined
<?php
defined('IN_DESTOON') or exit('Access Denied');
@ignore_user_abort(true);
$session = new dsession();
if ($_SESSION['uploads']) {
foreach ($_SESSION['uploads'] as $file) {
delete_upload($file, $_userid);
}
$_SESSION['uploads'] = array();
}
示例4: delete_file
$status = delete_file($id);
generate_sitemap();
exec_action('page-delete');
redirect("pages.php?upd=edit-" . $status . "&id=" . $id . "&type=delete");
}
}
// are we deleting archives?
if (isset($_GET['zip'])) {
$zip = $_GET['zip'];
$status = delete_zip($zip);
redirect("archive.php?upd=del-" . $status . "&id=" . $zip);
}
// are we deleting uploads?
if (isset($_GET['file'])) {
$path = isset($_GET['path']) ? $_GET['path'] : "";
$file = $_GET['file'];
$status = delete_upload($file, $path);
redirect("upload.php?upd=del-" . $status . "&id=" . $file . "&path=" . $path);
}
// are we deleting a folder?
if (isset($_GET['folder'])) {
$path = isset($_GET['path']) ? $_GET['path'] : "";
$folder = $_GET['folder'];
$target = GSDATAUPLOADPATH . $path . $folder;
if (path_is_safe($target, GSDATAUPLOADPATH) && file_exists($target)) {
rmdir($target);
// delete thumbs folder
rmdir(GSTHUMBNAILPATH . $path . $folder);
redirect("upload.php?upd=del-success&id=" . $folder . "&path=" . $path);
}
}
示例5: array
$menus = array(array('上传记录', '?file=' . $file));
$id = isset($id) ? intval($id) : -1;
$id > -1 && $id < 10 or $id = -1;
if ($id == -1 && $action != 'part') {
$action = 'part';
}
if ($id > -1) {
$table = $DT_PRE . 'upload_' . $id;
}
switch ($action) {
case 'delete':
$itemid or msg('请选择记录');
$itemids = is_array($itemid) ? implode(',', $itemid) : $itemid;
$result = $db->query("SELECT fileurl FROM {$table} WHERE pid IN ({$itemids})");
while ($r = $db->fetch_array($result)) {
delete_upload($r['fileurl'], 0);
}
$db->query("DELETE FROM {$table} WHERE pid IN ({$itemids})");
dmsg('删除成功', $forward);
break;
case 'delete_record':
$itemid or msg('请选择记录');
$itemids = is_array($itemid) ? implode(',', $itemid) : $itemid;
$db->query("DELETE FROM {$table} WHERE pid IN ({$itemids})");
dmsg('删除成功', $forward);
break;
case 'part':
$lists = array();
for ($i = 0; $i < 10; $i++) {
$r = array();
$r['table'] = $DT_PRE . 'upload_' . $i;
示例6: delete
function delete($itemid)
{
if (is_array($itemid)) {
foreach ($itemid as $v) {
$this->delete($v, $all);
}
} else {
$this->itemid = $itemid;
$r = $this->get_one();
$userid = get_user($r['editor']);
if ($r['content']) {
delete_local($r['content'], $userid);
}
if ($r['thumb']) {
delete_upload($r['thumb'], $userid);
}
$this->db->query("DELETE FROM {$this->table} WHERE itemid={$itemid}");
$this->db->query("DELETE FROM {$this->table_order} WHERE itemid={$itemid}");
}
}
示例7: delete_file_content
delete_file_content($id);
generate_sitemap();
exec_action('page-delete');
redirect("cpages.php?upd=edit-success&id=" . $id . "&type=delete");
}
}
// are we deleting archives?
if (isset($_GET['zip'])) {
$zip = $_GET['zip'];
$status = delete_zip($zip);
redirect("archive.php?upd=del-" . $status . "&id=" . $zip);
}
// are we deleting uploads?
if (isset($_GET['file'])) {
$path = isset($_GET['path']) ? $_GET['path'] : "";
$file = $_GET['file'];
delete_upload($file, $path);
redirect("upload.php?upd=del-success&id=" . $file . "&path=" . $path);
}
// are we deleting a folder?
if (isset($_GET['folder'])) {
$path = isset($_GET['path']) ? $_GET['path'] : "";
$folder = $_GET['folder'];
$target = GSDATAUPLOADPATH . $path . $folder;
if (file_exists($target)) {
rmdir($target);
// delete thumbs folder
rmdir(GSTHUMBNAILPATH . $path . $folder);
redirect("upload.php?upd=del-success&id=" . $folder . "&path=" . $path);
}
}
示例8: page_upload
function page_upload($args)
{
// only handle the file if the frontend wants us to
if (empty($args['preferred_module']) || $args['preferred_module'] != 'page') {
return false;
}
// check if supported file
if (!in_array($args['mime'], array('image/jpeg', 'image/png', 'image/gif')) || $args['mime'] == '' && !in_array(filext($args['file']), array('jpg', 'jpeg', 'png', 'gif'))) {
return false;
}
// check if there is already a background-image and delete it
$obj = load_object(array('name' => $args['page'] . '.page'));
if (!$obj['#error']) {
$obj = $obj['#data'];
if (!empty($obj['page-background-file'])) {
delete_upload(array('pagename' => array_shift(expl('.', $args['page'])), 'file' => $obj['page-background-file'], 'max_cnt' => 1));
}
}
// set as background-image in page object
$obj = array();
$obj['name'] = $args['page'] . '.page';
$obj['page-background-file'] = $args['file'];
$obj['page-background-mime'] = $args['mime'];
// update page object
load_modules('glue');
$ret = update_object($obj);
if ($ret['#error']) {
log_msg('page_upload: error updating page object: ' . quot($ret['#data']));
return false;
} else {
// we don't actually render the object here, but signal the
// frontend that everything went okay
return true;
}
}
示例9: delete_iotd
/**
* Delete an IOTD.
*
* @param AUTO_LINK The ID of the IOTD to delete
*/
function delete_iotd($id)
{
$caption = $GLOBALS['SITE_DB']->query_value('iotd', 'caption', array('id' => $id));
$title = $GLOBALS['SITE_DB']->query_value('iotd', 'i_title', array('id' => $id));
log_it('DELETE_IOTD', strval($id), get_translated_text($caption));
delete_lang($caption);
delete_lang($title);
require_code('files2');
delete_upload('uploads/iotds', 'iotd', 'url', 'id', $id);
delete_upload('uploads/iotds_thumbs', 'iotd', 'thumb_url', 'id', $id);
// Delete from the database
$GLOBALS['SITE_DB']->query_delete('iotd', array('id' => $id), '', 1);
$GLOBALS['SITE_DB']->query_delete('rating', array('rating_for_type' => 'iotds', 'rating_for_id' => $id));
$GLOBALS['SITE_DB']->query_delete('trackbacks', array('trackback_for_type' => 'iotds', 'trackback_for_id' => $id));
decache('main_iotd');
}
示例10: delupload
function delupload($username, $userid)
{
if (!$userid || !$username) {
return;
}
$result = $this->db->query("SELECT fileurl FROM {$this->db->pre}upload_" . $userid % 10 . " WHERE username='{$username}'");
while ($r = $this->db->fetch_array($result)) {
delete_upload($r['fileurl'], $userid);
}
}
示例11: login_cookie_check
// Relative
$relative = '../';
// Include common.php
include 'inc/common.php';
login_cookie_check();
$nonce = $_GET['nonce'];
if (!check_nonce($nonce, "delete", "deletefile.php")) {
die("CSRF detected!");
}
// are we deleting pages?
if (isset($_GET['id'])) {
$id = $_GET['id'];
if ($id == 'index') {
header('Location: pages.php?upd=edit-err&type=You cannot delete your homepage');
} else {
delete_file($id);
header("Location: pages.php?upd=edit-success&id=" . $id . "&type=delete");
}
}
// are we deleting archives?
if (isset($_GET['zip'])) {
$zip = $_GET['zip'];
$status = delete_zip($zip);
header("Location: archive.php?upd=del-" . $status . "&id=" . $zip);
}
// are we deleting uploads?
if (isset($_GET['file'])) {
$file = $_GET['file'];
delete_upload($file);
header("Location: upload.php?upd=del-success&id=" . $file);
}
示例12: delete
function delete($itemid, $all = true)
{
global $MOD, $L;
if (is_array($itemid)) {
foreach ($itemid as $v) {
$this->delete($v);
}
} else {
$this->itemid = $itemid;
$r = $this->get_one();
$userid = get_user($r['username']);
if ($r['thumb']) {
delete_upload($r['thumb'], $userid);
}
$this->db->query("DELETE FROM {$this->table} WHERE itemid={$itemid}");
if ($r['username'] && $MOD['credit_del_credit']) {
credit_add($r['username'], -$MOD['credit_del_credit']);
credit_record($r['username'], -$MOD['credit_del_credit'], 'system', $L['honor_punish_reason'], 'ID:' . $this->itemid);
}
}
}
示例13: item_update
function item_update($post)
{
global $_userid;
$thumb = $post[0]['thumb'];
$this->item_add($post[0]);
unset($post[0]);
foreach ($post as $k => $v) {
if ($v['thumb']) {
$thumb .= $v['thumb'];
}
if (isset($v['delete'])) {
if ($v['thumb']) {
delete_upload($v['thumb'], $_userid);
}
$this->item_delete($k);
unset($post[$k]);
}
}
if ($thumb) {
clear_upload($thumb, $this->itemid);
}
$this->item_edit($post);
return true;
}
示例14: delete_upload
delete_upload($HOME['bannerf'], $_userid);
}
if ($HOME['banner1'] != $setting['banner1']) {
delete_upload($HOME['banner1'], $_userid);
}
if ($HOME['banner2'] != $setting['banner2']) {
delete_upload($HOME['banner2'], $_userid);
}
if ($HOME['banner3'] != $setting['banner3']) {
delete_upload($HOME['banner3'], $_userid);
}
if ($HOME['banner4'] != $setting['banner4']) {
delete_upload($HOME['banner4'], $_userid);
}
if ($HOME['banner5'] != $setting['banner5']) {
delete_upload($HOME['banner5'], $_userid);
}
clear_upload($setting['background'] . $setting['logo'] . $setting['video'] . $setting['banner'] . $setting['bannerf'] . $setting['banner1'] . $setting['banner2'] . $setting['banner3'] . $setting['banner4'] . $setting['banner5']);
$announce = $setting['announce'];
unset($setting['announce']);
$setting = dhtmlspecialchars($setting);
$setting['announce'] = dsafe($announce);
update_company_setting($_userid, $setting);
dmsg($L['home_msg_save'], 'home.php?tab=' . $tab);
}
} else {
$CS = cache_read('module-4.php');
$api_map = $CS['map'];
$api_stats = $CS['stats'];
$api_kf = $CS['kf'];
$menu_f = ',';
示例15: clear_upload
function clear_upload($content = '', $itemid = 0)
{
global $CFG, $DT, $db, $session, $_userid;
if (!is_object($session)) {
$session = new dsession();
}
if (!isset($_SESSION['uploads']) || !$_SESSION['uploads'] || !$content) {
return;
}
$update = array();
foreach ($_SESSION['uploads'] as $file) {
if (strpos($content, $file) === false) {
delete_upload($file, $_userid);
} else {
if ($DT['uploadlog'] && $itemid) {
$update[] = "'" . md5($file) . "'";
}
}
}
if ($update) {
$db->query("UPDATE {$db->pre}upload_" . $_userid % 10 . " SET itemid={$itemid} WHERE item IN (" . implode(',', $update) . ")");
}
$_SESSION['uploads'] = array();
}