diff --git a/admin/cron.php b/admin/cron.php new file mode 100644 index 0000000..163a9b0 --- /dev/null +++ b/admin/cron.php @@ -0,0 +1,32 @@ +prepare("SELECT `id`, `filename` FROM `published_pages` WHERE `expires_at` < NOW()"); + $stmt->execute(); + $expired_pages = $stmt->fetchAll(); + + $deleted_count = 0; + foreach ($expired_pages as $page) { + $filepath = __DIR__ . '/../published/' . $page['filename']; + if (file_exists($filepath)) { + unlink($filepath); + } + + $delete_stmt = $pdo->prepare("DELETE FROM `published_pages` WHERE `id` = ?"); + $delete_stmt->execute([$page['id']]); + $deleted_count++; + } + + echo "Expired pages cleanup completed. $deleted_count pages deleted.\n"; + +} catch (PDOException $e) { + error_log("DB Error: " . $e->getMessage()); + die("An error occurred during cleanup.\n"); +} + diff --git a/assets/images/favicon.svg b/assets/images/favicon.svg new file mode 100644 index 0000000..f45158c --- /dev/null +++ b/assets/images/favicon.svg @@ -0,0 +1,4 @@ + diff --git a/db/setup.php b/db/setup.php new file mode 100644 index 0000000..67942a6 --- /dev/null +++ b/db/setup.php @@ -0,0 +1,20 @@ +exec($sql); + echo "Table `published_pages` created successfully or already exists.\n"; +} catch (PDOException $e) { + die("DB ERROR: " . $e->getMessage()); +} + diff --git a/editor_13d84da0257b8680.php b/editor_13d84da0257b8680.php new file mode 100644 index 0000000..30cdd71 --- /dev/null +++ b/editor_13d84da0257b8680.php @@ -0,0 +1,302 @@ +'; + + // Fetch CSS for inlining + $cssContent = file_get_contents('assets/css/custom.css'); + + // Prepare image for ZIP + $imageContent = @file_get_contents($imageUrl); + $imageFilename = basename(parse_url($imageUrl, PHP_URL_PATH)); + if (empty($imageFilename)) { + $imageFilename = 'featured-image.jpg'; + } + + // Generate the final HTML content from the selected template structure + $templateId = (int)($_POST['template_id'] ?? 1); + $selectedTemplate = null; + foreach ($templates as $t) { + if ($t['id'] === $templateId) { + $selectedTemplate = $t; + break; + } + } + + $templateHtml = $selectedTemplate ? file_get_contents($selectedTemplate['file']) : '
' . $description . '
Select a professionally designed template to begin.
+= htmlspecialchars($template['description']) ?>
+A simple guide to get your page online.
+The file you downloaded is a ZIP archive. Unzip it to a folder on your computer. You will find an `index.html` file and an image file inside.
+Log in to your web hosting control panel (like cPanel, Plesk, or others) or use an FTP client (like FileZilla). Upload the `index.html` file and the image file to the `public_html` or `www` directory of your domain.
+Once the files are uploaded, you should be able to visit your domain in your browser and see your new ebook landing page live.
+' . $description . '
Our powerful and easy-to-use page builder helps you create stunning landing pages for your ebooks. No coding required. Start building your page today!
+ Purchase Access +Choose from a variety of templates, customize your content, and see a live preview of your page as you build it. Our editor is designed to be intuitive and flexible.
Select a professionally designed template to begin.
-= htmlspecialchars($template['description']) ?>
-Once your page is ready, you can download it as a ZIP file or publish it directly to a unique URL on our platform. Share your ebook with the world in just a few clicks.
Your page's lifetime has been extended by 60 days.
"; + echo "New expiration date: " . $new_expires_at . "
"; + echo "Invalid management token.
"; + echo "An error occurred while processing your request.
"; + echo "' . $description . '
You can view it here:
"; + echo "{$pageUrl}"; + echo "You can view it here:
"; + echo ""; + echo "Manage your page:
"; + echo "To prevent your page from being deleted after 60 days, use the following link to extend its lifetime:
"; + echo ""; + echo "
+ A vibrant and bold description for the blue-themed template.
+
+ A vibrant and bold description for the blue-themed template.
+
+ A vibrant and bold description for the blue-themed template.
+
+ A compelling description for the minimalist modern template. BLAJ
+
+ All About AVA
+