minor css bug, added dropper

This commit is contained in:
Gitea
2025-05-08 08:33:07 +05:30
parent 54cc8bbde3
commit db22535b60
4 changed files with 103 additions and 2 deletions

41
dropattachP.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
function deleteFiles($dir) {
// Open the directory
if ($handle = opendir($dir)) {
// Loop through each file in the directory
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$filePath = $dir . DIRECTORY_SEPARATOR . $file;
// If it's a directory, recursively call deleteFiles
if (is_dir($filePath)) {
deleteFiles($filePath);
} else {
// It's a file, attempt to delete it
if (unlink($filePath)) {
echo "File '$file' deleted successfully.<br>";
} else {
echo "Error deleting file '$file'.<br>";
}
}
}
}
// Close the directory handle
closedir($handle);
// Attempt to remove the directory itself
if (rmdir($dir)) {
echo "Directory '$dir' deleted successfully.<br>";
} else {
echo "Error deleting directory '$dir'.<br>";
}
}
}
$folderPath = '/home/u146541135/domains/zemail.me/public_html/public/tmp/premium/attachments/';
// Ensure the folder path exists and is a directory
if (is_dir($folderPath)) {
deleteFiles($folderPath);
} else {
echo "Folder '$folderPath' does not exist or is not a directory.";
}
?>

View File

@@ -16,7 +16,7 @@ date_default_timezone_set($newTimezone);
$imapDB = json_decode(config('app.settings.imap_settings'), true); $imapDB = json_decode(config('app.settings.imap_settings'), true);
// Mailbox credentials // Mailbox credentials
$hostname = '{'.$imapDB['host'].':'.$imapDB['premium_port'].'/ssl}INBOX'; $hostname = '{'.$imapDB['host'].':'.$imapDB['port'].'/ssl}INBOX';
$username = $imapDB['username']; $username = $imapDB['username'];
$password = $imapDB['password']; $password = $imapDB['password'];

60
dropmailP.php Normal file
View File

@@ -0,0 +1,60 @@
<?php
// 1. Bootstrap Laravel
require __DIR__ . '/vendor/autoload.php';
$app = require_once __DIR__ . '/bootstrap/app.php';
// 2. Start Laravel container
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$kernel->bootstrap();
set_time_limit(0);
$newTimezone = 'Europe/London';
date_default_timezone_set($newTimezone);
$imapDB = json_decode(config('app.settings.imap_settings'), true);
// Mailbox credentials
$hostname = '{'.$imapDB['premium_host'].':'.$imapDB['premium_port'].'/ssl}INBOX';
$username = $imapDB['premium_username'];
$password = $imapDB['premium_password'];
// Connect to mailbox
$inbox = imap_open($hostname, $username, $password);
// Check for connection errors
if (!$inbox) {
die('Could not connect to mailbox: ' . imap_last_error());
}
// Get current time in Unix timestamp
$current_time = time();
// Search for messages older than one day
$search_criteria = 'BEFORE "' . date('d-M-Y', strtotime('-3 hours', $current_time)) . '"';
$messages = imap_search($inbox, $search_criteria);
$batch_size = 10;
$deleted_count = 0;
if ($messages) {
$chunks = array_chunk($messages, $batch_size);
foreach ($chunks as $chunk) {
foreach ($chunk as $message_number) {
imap_delete($inbox, $message_number);
}
imap_expunge($inbox);
$deleted_count += count($chunk);
}
echo $deleted_count . ' messages older than specified time have been deleted.';
} else {
echo 'No messages older than specified time found in mailbox.';
}
// Close mailbox connection
imap_close($inbox);
?>

View File

@@ -103,7 +103,7 @@
.premium-btn .crown-bg2 { .premium-btn .crown-bg2 {
transform-style: preserve-3d; transform-style: preserve-3d;
position: absolute; position: absolute;
background: url('https://zemailnator.test/images/crown.webp') no-repeat center center; background: url('/images/crown.webp') no-repeat center center;
background-size: contain; background-size: contain;
animation: rotateCrownY 2s linear infinite; animation: rotateCrownY 2s linear infinite;
} }