Permalink
Browse files

Removing threads fix

Fixes #14
  • Loading branch information...
Halamix2 committed Jul 24, 2017
1 parent 8b00a8f commit 8d75ba0d1147ad0e2db61f2d495d442eb702a1c0
Showing with 9 additions and 6 deletions.
  1. +2 −2 classes/Upload.php
  2. +7 −4 delete.php
View
@@ -28,7 +28,7 @@ function __construct($dir, $maxSize, $uploadLoc)
$this->initialized = false;
$this->uploadLoc = $uploadLoc;
// Initialize the TextDb object
$this->tdb($dir . '/', 'main.tdb');
parent::__construct($dir . '/', 'main.tdb');
// Check if the upload mod has been installed
if (!file_exists($dir . '/main_uploads.ta'))
@@ -156,4 +156,4 @@ public function notInitialized()
return true;
}
}
}
View
@@ -28,14 +28,17 @@
foreach($p_ids as $p_id) {
$pRec = $post_tdb->get('posts', $p_id);
$upload_ids = explode(",",$pRec[0]['upload_id']);
$upload_ids = [];
if($pRec[0]['upload_id']!="") {
$upload_ids = explode(",",$pRec[0]['upload_id']);
}
$upload = new Upload(DB_DIR, $_CONFIG["fileupload_size"],$_CONFIG["fileupload_location"]);
foreach ($upload_ids as $upload_id)
$upload->deleteFile($upload_id);
$upload->deleteFile($upload_id);
if (!isset($subtract_user_post_count[$pRec[0]['user_id']])) {
$subtract_user_post_count[$pRec[0]['user_id']] = 1;
}

0 comments on commit 8d75ba0

Please sign in to comment.