diff --git a/assets/images/templates/Blog Tactics.jpg b/assets/images/templates/Blog Tactics.jpg new file mode 100644 index 0000000..cb8bc1c Binary files /dev/null and b/assets/images/templates/Blog Tactics.jpg differ diff --git a/assets/images/templates/Comprehensive SEO.png b/assets/images/templates/Comprehensive SEO.png new file mode 100644 index 0000000..5aa35d6 Binary files /dev/null and b/assets/images/templates/Comprehensive SEO.png differ diff --git a/assets/images/templates/gemini-image-2_Generate_a_dynamic_eBook_cover_for_“Blog_Promotion_Tactics_for_Digital_Markete-0.jpg b/assets/images/templates/gemini-image-2_Generate_a_dynamic_eBook_cover_for_“Blog_Promotion_Tactics_for_Digital_Markete-0.jpg new file mode 100644 index 0000000..cb8bc1c Binary files /dev/null and b/assets/images/templates/gemini-image-2_Generate_a_dynamic_eBook_cover_for_“Blog_Promotion_Tactics_for_Digital_Markete-0.jpg differ diff --git a/editor_13d84da0257b8680.php b/editor_13d84da0257b8680.php index 30cdd71..d848dc3 100644 --- a/editor_13d84da0257b8680.php +++ b/editor_13d84da0257b8680.php @@ -191,7 +191,7 @@ $projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';

Customize Your Page

- ← Back to Home +
@@ -212,10 +212,20 @@ $projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
+
+ + +
+
+
+ + +
+
-
This will replace the default button in the preview.
+
This will replace the default button in the preview. If you use this, uncheck "Show Call to Action Button" above.
diff --git a/login.php b/login.php new file mode 100644 index 0000000..938bf5c --- /dev/null +++ b/login.php @@ -0,0 +1,66 @@ + + + + + + + Login - Admin + + + + +
+

Admin Login

+ +
+ + +
+ + +
+
+ + +
+ + +
+ + diff --git a/publish.php b/publish.php index f86e1f3..7fb78cc 100644 --- a/publish.php +++ b/publish.php @@ -12,7 +12,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST[' $description = htmlspecialchars($_POST['description'] ?? 'A compelling description...'); $imageUrl = filter_var($_POST['imageUrl'] ?? '', FILTER_VALIDATE_URL) ?: 'https://images.pexels.com/photos/1907785/pexels-photo-1907785.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1'; $ctaText = htmlspecialchars($_POST['ctaText'] ?? 'Download Now'); - $checkoutHtml = $_POST['checkoutHtml'] ?? ''; + $ctaUrl = filter_var($_POST['ctaUrl'] ?? '', FILTER_VALIDATE_URL); + $showCtaButton = isset($_POST['showCtaButton']); + $checkoutHtml = $_POST['checkoutHtml'] ?? ''; // Fetch CSS for inlining $cssContent = file_get_contents('assets/css/custom.css'); @@ -35,7 +37,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST[' $templateHtml = $selectedTemplate ? file_get_contents($selectedTemplate['file']) : '
Ebook Cover

' . $title . '

' . $description . '

' . $checkoutHtml . '
'; $templateDom = new DOMDocument(); - @$templateDom->loadHTML($templateHtml, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); + // Wrap the template HTML in a single root element to ensure proper parsing + @$templateDom->loadHTML('
' . $templateHtml . '
', LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); + + // Remove the back button before publishing + $backButton = $templateDom->getElementById('back-to-templates-btn'); + if ($backButton) { + $backButton->parentNode->removeChild($backButton); + } $imgTag = $templateDom->getElementById('previewImage'); if ($imgTag) $imgTag->setAttribute('src', $imageUrl); @@ -51,16 +60,33 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST[' while ($ctaContainer->hasChildNodes()) { $ctaContainer->removeChild($ctaContainer->firstChild); } + if (!empty(trim($checkoutHtml))) { $fragment = $templateDom->createDocumentFragment(); + // Append HTML, suppressing errors for potentially malformed user input @$fragment->appendXML($checkoutHtml); $ctaContainer->appendChild($fragment); + } elseif ($showCtaButton && $ctaUrl) { + $link = $templateDom->createElement('a', $ctaText); + $link->setAttribute('href', $ctaUrl); + $link->setAttribute('class', 'btn btn-primary btn-lg'); + $link->setAttribute('role', 'button'); + $ctaContainer->appendChild($link); } else { - $ctaContainer->nodeValue = $ctaText; // Fallback to simple text if no HTML + // If no checkout HTML and button is disabled or no URL, remove the container + if ($ctaContainer->parentNode) { + $ctaContainer->parentNode->removeChild($ctaContainer); + } } } - $finalPreviewHtml = $templateDom->saveHTML(); + // Extract the inner HTML of the temporary div + $body = $templateDom->getElementsByTagName('div')->item(0); + $finalPreviewHtml = ''; + foreach ($body->childNodes as $child) { + $finalPreviewHtml .= $templateDom->saveHTML($child); + } + $htmlContent = << diff --git a/published/692d23de03ac9.html b/published/692d23de03ac9.html new file mode 100644 index 0000000..a9f5ff4 --- /dev/null +++ b/published/692d23de03ac9.html @@ -0,0 +1,169 @@ + + + + + + Minimalist Modern Title + + + + +
+
+ +
+
+ + + \ No newline at end of file diff --git a/published/692d24e8855ed.html b/published/692d24e8855ed.html new file mode 100644 index 0000000..8706c22 --- /dev/null +++ b/published/692d24e8855ed.html @@ -0,0 +1,160 @@ + + + + + + Classic Serif Title + + + + +
+
+
+ + +
+
+
+ + + \ No newline at end of file diff --git a/published/692d24f296fa8.html b/published/692d24f296fa8.html new file mode 100644 index 0000000..8706c22 --- /dev/null +++ b/published/692d24f296fa8.html @@ -0,0 +1,160 @@ + + + + + + Classic Serif Title + + + + +
+
+
+ + +
+
+
+ + + \ No newline at end of file diff --git a/published/692d250158e39.html b/published/692d250158e39.html new file mode 100644 index 0000000..f8d7131 --- /dev/null +++ b/published/692d250158e39.html @@ -0,0 +1,160 @@ + + + + + + Bold & Blue Title + + + + +
+
+
+ + +
+
+
+ + + \ No newline at end of file diff --git a/published/692d253d3ec60.html b/published/692d253d3ec60.html new file mode 100644 index 0000000..871b961 --- /dev/null +++ b/published/692d253d3ec60.html @@ -0,0 +1,170 @@ + + + + + + Bold & Blue Title + + + + +
+
+
+
+
+
+ Ebook Cover +
+
+

Bold & Blue Title

+

A vibrant and bold description for the blue-themed template.

+
Get It Now!
+
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/published/692d258062ed1.html b/published/692d258062ed1.html new file mode 100644 index 0000000..f511637 --- /dev/null +++ b/published/692d258062ed1.html @@ -0,0 +1,169 @@ + + + + + + Minimalist Modern Title + + + + +
+
+
+ +
+
+ Ebook Cover +
+
+

Minimalist Modern Title

+

A compelling description for the minimalist modern template.

+
Download Now
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/published/692d267c6166b.html b/published/692d267c6166b.html new file mode 100644 index 0000000..ccd2863 --- /dev/null +++ b/published/692d267c6166b.html @@ -0,0 +1,169 @@ + + + + + + Minimalist Modern Title + + + + +
+
+
+ +
+
+ Ebook Cover +
+
+

Minimalist Modern Title

+

A compelling description for the minimalist modern template.

+ +
+
+
+
+
+ + + \ No newline at end of file diff --git a/templates/template-1.html b/templates/template-1.html index f9f6067..6b2eeac 100644 --- a/templates/template-1.html +++ b/templates/template-1.html @@ -1,12 +1,13 @@ -
-
- Ebook Cover -
-
-

Minimalist Modern Title

-

A compelling description for the minimalist modern template.

-
- -
-
+Back to Templates +
+
+ Ebook Cover +
+
+

Minimalist Modern Title

+

A compelling description for the minimalist modern template.

+
+ +
+
\ No newline at end of file diff --git a/templates/template-2.html b/templates/template-2.html index 06155ee..3c7098d 100644 --- a/templates/template-2.html +++ b/templates/template-2.html @@ -1,12 +1,13 @@ -
-
- Ebook Cover -
-
-

Bold & Blue Title

-

A vibrant and bold description for the blue-themed template.

-
- -
-
+Back to Templates +
+
+ Ebook Cover +
+
+

Bold & Blue Title

+

A vibrant and bold description for the blue-themed template.

+
+ +
+
\ No newline at end of file diff --git a/templates/template-3.html b/templates/template-3.html index 30d48a3..12316a5 100644 --- a/templates/template-3.html +++ b/templates/template-3.html @@ -1,10 +1,11 @@ -
-
- Ebook Cover -

Classic Serif Title

-

An elegant and classic description, perfect for a timeless serif-style ebook.

-
- -
-
+Back to Templates +
+
+ Ebook Cover +

Classic Serif Title

+

An elegant and classic description, perfect for a timeless serif-style ebook.

+
+ +
+
\ No newline at end of file