mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-14 12:08:01 +00:00
Added the ability to create a master code that can delete any image from the server (only for server hosters)
This commit is contained in:
@@ -6,6 +6,7 @@ PictShare is an multi lingual, open source image hosting service with a simple r
|
|||||||
|
|
||||||
UPDATES
|
UPDATES
|
||||||
========
|
========
|
||||||
|
- Nov. 06: Master delete code. One code to delete them all
|
||||||
- Nov. 01: [Restricted uploads and option-use](#restriction-settings)
|
- Nov. 01: [Restricted uploads and option-use](#restriction-settings)
|
||||||
- Oct. 30: [Rotations and filters](#smart-query-system)
|
- Oct. 30: [Rotations and filters](#smart-query-system)
|
||||||
|
|
||||||
@@ -24,6 +25,7 @@ If you're a blogger like myself, you can use it as storage for your images so th
|
|||||||
- Smart [resize, filter and rotation](#smart-query-system) features
|
- Smart [resize, filter and rotation](#smart-query-system) features
|
||||||
- Duplicates don't take up space. If the exact same images is uploaded twice, the second upload will link to the first
|
- Duplicates don't take up space. If the exact same images is uploaded twice, the second upload will link to the first
|
||||||
- You can control who can upload images or use filters/resizes by defining an [upload-code](#restriction-settings)
|
- You can control who can upload images or use filters/resizes by defining an [upload-code](#restriction-settings)
|
||||||
|
- You can set a code in your ```/inc/config.inc.php``` (MASTER_DELETE_CODE) that, if appended to any URL of an Image, will delete the image and all cached versions of it from the server
|
||||||
|
|
||||||
## Smart query system
|
## Smart query system
|
||||||
PictShare images can be changed after upload just by modifying the URL. It works like this:
|
PictShare images can be changed after upload just by modifying the URL. It works like this:
|
||||||
@@ -162,6 +164,7 @@ server {
|
|||||||
|
|
||||||
## Upgrading
|
## Upgrading
|
||||||
- Just re-download the [PictShare zip](https://github.com/chrisiaut/pictshare/archive/master.zip) file and extract and overwrite existing pictshare files. Uploads and config won't be affected.
|
- Just re-download the [PictShare zip](https://github.com/chrisiaut/pictshare/archive/master.zip) file and extract and overwrite existing pictshare files. Uploads and config won't be affected.
|
||||||
|
- Check if your ```/inc/config.inc.php``` file has all settings required by the ```/inc/example.config.inc.php``` since new options might get added in new versions
|
||||||
|
|
||||||
Or use these commands:
|
Or use these commands:
|
||||||
|
|
||||||
@@ -178,6 +181,7 @@ rm -rf temp
|
|||||||
- Plugin to upload images with ShareX: https://github.com/ShareX/CustomUploaders/blob/master/pictshare.net.json
|
- Plugin to upload images with ShareX: https://github.com/ShareX/CustomUploaders/blob/master/pictshare.net.json
|
||||||
|
|
||||||
## Coming soon
|
## Coming soon
|
||||||
|
- Delete codes for every uploaded image so users can delete images if no longer needed
|
||||||
- Albums
|
- Albums
|
||||||
- Traffic analysis tool for server admins
|
- Traffic analysis tool for server admins
|
||||||
|
|
||||||
|
|||||||
BIN
css/imgs/deleted.jpg
Normal file
BIN
css/imgs/deleted.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
@@ -1,5 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
//If set, can be added to any image URL to delete the image and all versions of the image
|
||||||
|
//Must be longer than 10 characters
|
||||||
|
//Usage example:
|
||||||
|
// image: https://pictshare.net/b260e36b60.jpg
|
||||||
|
// to delete it, access https://pictshare.net/delete_YOURMASTERDELETECODE/b260e36b60.jpg
|
||||||
|
// Will render one last time, if refreshed won't be on the server anymore
|
||||||
|
define('MASTER_DELETE_CODE', false);
|
||||||
|
|
||||||
//If set, upload form will only be shown on that location
|
//If set, upload form will only be shown on that location
|
||||||
//eg: define('UPLOAD_FORM_LOCATION', 'secret/upload'); then the upload form will only be visible
|
//eg: define('UPLOAD_FORM_LOCATION', 'secret/upload'); then the upload form will only be visible
|
||||||
//from http://your.domain/secret/upload
|
//from http://your.domain/secret/upload
|
||||||
|
|||||||
@@ -57,11 +57,42 @@ class PictshareModel extends Model
|
|||||||
}
|
}
|
||||||
else if($el=='forcesize')
|
else if($el=='forcesize')
|
||||||
$data['forcesize'] = true;
|
$data['forcesize'] = true;
|
||||||
|
else if(strlen(MASTER_DELETE_CODE)>10 && $el=='delete_'.MASTER_DELETE_CODE)
|
||||||
|
$data['delete'] = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($data['delete'] && $data['hash'])
|
||||||
|
{
|
||||||
|
$this->deleteImage($data['hash']);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deleteImage($hash)
|
||||||
|
{
|
||||||
|
$base_path = ROOT.DS.'upload'.DS.$hash.DS;
|
||||||
|
if(!is_dir($base_path)) return false;
|
||||||
|
if ($handle = opendir($base_path))
|
||||||
|
{
|
||||||
|
while (false !== ($entry = readdir($handle)))
|
||||||
|
{
|
||||||
|
if ($entry != "." && $entry != "..")
|
||||||
|
{
|
||||||
|
unlink($base_path.$entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
rmdir($base_path);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
function isLegacyThumbnail($val)
|
function isLegacyThumbnail($val)
|
||||||
{
|
{
|
||||||
if(strpos($val,'_'))
|
if(strpos($val,'_'))
|
||||||
|
|||||||
Reference in New Issue
Block a user