📁 Folder Navigator
Position:
Root
/
apphome
/
content
/
socialmedia
Create
Folders
📁 chats
Rename
Copy
Delete
📁 contentuploads
Rename
Copy
Delete
📁 studio
Rename
Copy
Delete
Files
📄 .htaccess
📄 .user.ini
📄 auto_purge.php
📄 clean_xml.php
📄 contentplus.xml
📄 error_log
📄 index.php
📄 index2.php
📄 mychats.php
📄 post_content.php
📄 purge_chat.php
📄 purge_post.php
📄 space.php
📄 stats.json
📝 File Editor
Editing:
auto_purge.php
<?php /** * Standalone Social Media Content Asset Purger * Scans your shared contentuploads folder and deletes files that are past their expiration timestamp. */ function runStandaloneFolderCheck() { // Correct relative path from your post.php script down to your upload folder $uploadDir = "contentuploads/"; // Safety check: Exit if the folder path can't be resolved if (!is_dir($uploadDir)) { return false; } $allFiles = scandir($uploadDir); $currentTime = time(); $safetyThreshold = 86400; // 24 hours in seconds foreach ($allFiles as $file) { if ($file === '.' || $file === '..') { continue; } $parts = explode('_', $file, 2); if (count($parts) > 1 && is_numeric($parts[0])) { $fileTimestamp = (int)$parts[0]; // Using the exact same math as your post purger: $fileAge = $currentTime - $fileTimestamp; if ($fileAge >= $safetyThreshold) { $fullPath = $uploadDir . $file; if (is_file($fullPath)) { @unlink($fullPath); } } } } // Run the folder sweep instantly when this file is included runStandaloneFolderCheck(); ?>
💾 Save Changes