aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/admin/upgrade.php2
-rw-r--r--actions/delete.php21
2 files changed, 13 insertions, 10 deletions
diff --git a/actions/admin/upgrade.php b/actions/admin/upgrade.php
index 9c4aef1cf..334e9588e 100644
--- a/actions/admin/upgrade.php
+++ b/actions/admin/upgrade.php
@@ -11,6 +11,8 @@ if ($version <= $local_version) {
forward($_SERVER['HTTP_REFERER']);
}
+set_time_limit(0);
+
$base_dir = $CONFIG->pluginspath . 'tidypics/upgrades';
// taken from engine/lib/version.php
diff --git a/actions/delete.php b/actions/delete.php
index c1e0ed59e..9b8c6ac6f 100644
--- a/actions/delete.php
+++ b/actions/delete.php
@@ -53,7 +53,7 @@ $image_repo_size_md = get_metadata_byname($owner_guid, "image_repo_size");
$image_repo_size = (int)$image_repo_size_md->value;
//loop through all images and delete them
-foreach($images as $im) {
+foreach ($images as $im) {
$thumbnail = $im->thumbnail;
$smallthumb = $im->smallthumb;
$largethumb = $im->largethumb;
@@ -76,16 +76,17 @@ foreach($images as $im) {
$delfile->setFilename($largethumb);
$delfile->delete();
}
- if ($im) { //delete actual image file
- $delfile = new ElggFile($im->getGUID());
- $delfile->owner_guid = $im->getOwner();
- //$delfile->setFilename($im->originalfilename);
- $image_repo_size -= $delfile->size();
+ if ($im) {
+ $image_repo_size -= $im->size();
- if (!$delfile->delete()) {
- if ($subtype=='image') register_error(elgg_echo("tidypics:deletefailed")); //unable to delete object
+ if (!$im->delete()) {
+ if ($subtype=='image') {
+ register_error(elgg_echo("tidypics:deletefailed")); //unable to delete object
+ }
} else {
- if ($subtype=='image') system_message(elgg_echo("tidypics:deleted")); //successfully deleted object
+ if ($subtype=='image') {
+ system_message(elgg_echo("tidypics:deleted")); //successfully deleted object
+ }
}
} //end delete actual image file
} //end looping through each image to delete it
@@ -107,7 +108,7 @@ if ($subtype == 'album') {
rmdir($albumdir);
}
- //delete object from database
+ //delete album object from database
if (!$entity->delete()) {
register_error(elgg_echo("tidypics:deletefailed")); //unable to delete object
} else {