[MOD] Delete upload after chosen amount of days
Posted: Sun Feb 27, 2011 1:59 pm
This will delete the uploaded file after a x amount of days even if the file has been downloaded. It overrides the default deleting system.
Effected Files
upload.php
admin.php
Okay, open ./upload.php and try to locate this line:
This is the part where PHP writes to the database.
Now you'll have to add the $time variable again at the end of the file.
Example:
Now the first $time variable is assigned to the last time the file was downloaded, and now we'll assign the last $time variable as being the time it was originally first uploaded.
Now we want to modify the deleting script located in ./admin.php
Find:
Replace with:
Modification wrote by PeterS
memberlist.php?mode=viewprofile&u=54
Effected Files
upload.php
admin.php
Okay, open ./upload.php and try to locate this line:
- Code: Select all
fwrite($filelist, $rand2 ."|". basename($_FILES['upfile']['name']) ."|". $passkey ."|". $userip ."|". $time."|0|".$description."|".$passwerd."|".$cat."|".$_POST['pprotect']."|\n");
This is the part where PHP writes to the database.
Now you'll have to add the $time variable again at the end of the file.
Example:
- Code: Select all
fwrite($filelist, $rand2 ."|". basename($_FILES['upfile']['name']) ."|". $passkey ."|". $userip ."|". $time."|0|".$description."|".$passwerd."|".$cat."|".$_POST['pprotect'] ."|". $time."|\n");
Now the first $time variable is assigned to the last time the file was downloaded, and now we'll assign the last $time variable as being the time it was originally first uploaded.
Now we want to modify the deleting script located in ./admin.php
Find:
- Code: Select all
if ($filedata[4] < $deleteseconds) {
Replace with:
- Code: Select all
if ($filedata[9] < $deleteseconds) {
Modification wrote by PeterS
memberlist.php?mode=viewprofile&u=54