diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..d46d153 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,37 @@ +name: PHP Lint Workflow + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + # 1. Fetch code from the repository + - name: Checkout code + uses: actions/checkout@v3 + + # 2. Set up PHP + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + + # 3. Check PHP syntax in all files + - name: Lint PHP files + run: | + find . -name "*.php" -not -path "./vendor/*" -exec php -l {} \; + + # 4. (Optional) Install Composer dependencies - useful if you add dependencies in the future + # - name: Install dependencies + # run: composer install --no-progress --no-suggest + + # 5. (Optional) Run unit tests - for example, PHPUnit + # - name: Run tests + # run: vendor/bin/phpunit diff --git a/CHANGELOG.md b/CHANGELOG.md index c0ca0d3..21f10d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,20 +2,20 @@ All notable changes to this project will be documented in this file. +## v1.0.0 – First Release -## [Unreleased] -Right now project is finished, I am working on fixing all the bugs and secruity issues. +### New in v1.0.0 + +The project is ready for use but is still evolving. Work is ongoing to fix bugs and address security issues. ### Added --- +..... + ### Changed --- +..... + ### Fixed --- - -## [pre release] - 2024-10-30 -### Added -The only functionalities that are added right now are fix patches for media queries, secruity reasons bugs fixing. +..... diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cdeedf1..bd19f44 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,104 +1,31 @@ -# Contributing to PHP_CMS_for_blog +# Contributing to CorelyPHP + +First off, thank you for considering contributing to [CorelyPHP](https://github.com/Dominik-developer/CorelyPHP)! 🎉 Your help is greatly appreciated. -First off, thank you for considering contributing to [PHP_CMS_for_blog](https://github.com/Dominik-developer/PHP_CMS_for_blog)! 🎉 Your help is greatly appreciated. - ## If you've found a bug, please create an issue following these steps: -1. **Check for duplicates:** Search [existing issues](https://github.com/Dominik-developer/PHP_CMS_for_blog/issues) to ensure it hasn’t been reported. -2. **If it’s a new issue:** - - Open a new issue. - - Provide a detailed description of the bug. - - The version of the project you’re using. - - Steps to reproduce it. - - Expected vs. actual behavior. - - Screenshots or logs (if applicable/possible). - - Environment details (e.g., OS, browser). -3. **Remeber to follow** [Style Guides](https://github.com/Dominik-developer/PHP_CMS_for_blog/blob/main/STYLE_GUIDES.md) for this softwere. -## How to Suggest a Feature -1. **Search existing suggestions:** Ensure your idea isn’t already suggested in [existing issues](https://github.com/Dominik-developer/PHP_CMS_for_blog/issues). -2. **If it’s a new idea:** +1. **Check for duplicates:** Search [existing issues](https://github.com/Dominik-developer/CorelyPHP/issues) to ensure it hasn’t been reported. +2. **If it’s a new issue:** - Open a new issue. - - Add clear title and description. - - Explain why the feature is needed and what problem it solves. - - Describe how the feature might work or look. - - Potential implementation ideas. -3. **Remeber to follow** [Style Guides](https://github.com/Dominik-developer/PHP_CMS_for_blog/blob/main/STYLE_GUIDES.md) for this softwere. - - - -## Code of Conduct -Please read our [Code of Conduct](CODE_OF_CONDUCT.md) to understand the expectations for participation in this project. - - - - - - - - - - - - - - - - - +Please read our [Code of Conduct](CODE_OF_CONDUCT.md) to understand the expectations for participation in this project. diff --git a/README.md b/README.md index b0baa5b..efe7460 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,45 @@ -# PHP_CMS_for_blog +# **CorelyPHP – PHP CMS for Blogs** -This project is ready to deploy blog webiste with seprate admin panel to manage data. +**CorelyPHP** is a ready-to-deploy blogging platform with a separate admin panel for managing content. -It is written in PHP with MySQL on backend and HTML, CSS and JavaScript on frontend. +This project is built using: +- **Backend:** PHP with MySQL +- **Frontend:** HTML, CSS, JavaScript -All files all devided into 4 groups: +## **Project Structure** -* admin - with all admin side files -* docs - with documentation -* public - with all user side files -* rest - all md files and license - -This way of deviding files allows to not damage backend files while rebuilding fronend. -The only concern is implemetation of PHP functions and HTML code that is deliverd by functions. -But this may be easly fixed specialy that when rebuilding frontend you will want other data so queries may need some improvment or rebuild. +All files are divided into the following sections: -I am still working to make sure this project is 100% secure,, responisve, functional, elegant and the possibly the best I can make it. +- **`admin/`** – Contains all admin-side files +- **`docs/`** – Holds documentation +- **`public/`** – Contains user-facing files -Senior Dev probably will tell that few things could be build differnt or better, probably but all things I learned druring building this project will implemented in next one, plus I upgreade codebase all the time when I find easier or better way to write sometinng but I am limited by time. +This structured approach helps prevent backend modifications while rebuilding the frontend. The only challenge is the integration of PHP functions that generate HTML dynamically, but this can be adjusted when refining queries and templates. -## Current version: v1.0.0 +## **Development Status** -This version number means which version should be used. Release version sometimes may just have small patches that are not worth rebuilding to new V. But make sure you read what is changing so you know what is going on. +I am continuously improving **CorelyPHP** to make it: +✔ Secure +✔ Responsive +✔ Fully functional +✔ Elegant +✔ Efficient -## INFO +This project is a work in progress, and while some parts may be improved or rewritten in future updates, it is stable and ready for use. Contributions and feedback are always welcome! -Check SECRUITY.md and CHANGELOG.md for information about versions and other stuff. +A more experienced developer might suggest alternative or optimized approaches. However, every lesson I’ve learned during this project will be applied to future updates and projects. I also refine the codebase whenever I find better solutions, though time constraints may limit immediate improvements. + +## **Project Guidelines & Documentation** + +For more details on the project, check out the following files: + +- 📜 **[LICENSE](LICENSE)** – License terms and conditions +- 🛠 **[CONTRIBUTING.md](CONTRIBUTING.md)** – Guidelines for contributors +- 🚀 **[STYLE_GUIDES.md](STYLE_GUIDES.md)** – Code style and best practices +- 🔄 **[CHANGELOG.md](CHANGELOG.md)** – Version history and updates +- 🔐 **[SECURITY.md](SECURITY.md)** – Security policies and vulnerability reporting +- 🌍 **[CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)** – Community guidelines + +## **Current Version: v1.0.0** + +The versioning system ensures clarity on stable releases. Minor patches may not require immediate updates, but always check the **CHANGELOG.md** for details on new features and fixes. diff --git a/SECURITY.md b/SECURITY.md index ea78d1a..bb17c44 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,68 +1,53 @@ # Security Policy -‼️ Secruity sugestions should be treated as invalid not as vulnerability. +‼️ Security suggestions should be treated as invalid, not as vulnerabilities. -## Secruity Policy +## Security Policy -* Latest Releases: The newest release, currently version v1.0.0, is the only version receiving active security updates. We strongly recommend using the latest version whenever possible. +* **Latest Releases:** The newest release, currently version v1.0.0, is the only version receiving active security updates. We strongly recommend using the latest version whenever possible. -* Review Changelog for Updates: For minor updates or changes, please refer to the changelog to understand what has been updated or fixed. +* **Review Changelog for Updates:** For minor updates or changes, please refer to the changelog to understand what has been updated or fixed. -* No Backports: Security fixes are applied exclusively to the latest version. Older versions will not receive retroactive patches for vulnerabilities. +* **No Backports:** Security fixes are applied exclusively to the latest version. Older versions will not receive retroactive patches for vulnerabilities. -* Security Risks of Unsupported Versions: Using unsupported versions exposes you to known and unknown vulnerabilities, as they are no longer maintained or updated. +* **Security Risks of Unsupported Versions:** Using unsupported versions exposes you to known and unknown vulnerabilities, as they are no longer maintained or updated. -* Update Regularly: Keeping your software up to date is essential to ensure your system remains secure. +* **Update Regularly:** Keeping your software up to date is essential to ensure your system remains secure. ## Supported Versions - +* All safe and supported versions of our software are marked with a ✅. +* It is highly recommended to use only these versions, as they contain the latest security fixes and improvements. Older, unsupported versions should be avoided, as they may contain vulnerabilities that will not be addressed retroactively. +* New versions that do not introduce security changes will not affect the support status of previous versions. - -* All safe and supported versions of our software are marked with a ✅. -* New versions that do not introduce changes in terms of security do not affect the lack of support for previous versions. - - - -| Version | Supported | -| ------- | ------------------ | -| pre release | :negative_squared_cross_mark: | +| Version | Supported | +| ------------- | ------------------ | +| pre-release | :negative_squared_cross_mark: | | v0.1.0-beta | :white_check_mark: | -| v1.0.0 | :white_check_mark: | - - +| v1.0.0 | :white_check_mark: | ## Reporting a Vulnerability - - -‼️ Please report only one vulnerability ot once unless it is really connected. - -To report vulnerability: - -* create issue -* in title write 'Vulnerability' and which part it affects: admin/user/other and how serious it is -* tag me -* add 'Vulnerability' label / bug label or invalid label -* write description: - * short summary - * which part of the repository is affected - * in which version it happend - * how serious it is - * what type of vulnerability it is - * how did you find it/ how it happend -* if you know how to solve the issue please be welcome to propose the solution - * propose solution here in issue or by pull request - * if u decide to create pull request, add note here in pr that this pr fixes this specific issue described here -* publish aaaand done! -* I may comment on your issue so please turn on notifications because I will comment - Thank you for reporting issues and making the project more sefe. - Thankful main developer: Dominik-developer +‼️ Please report only one vulnerability at a time, unless it is genuinely connected to another issue. + +To report a vulnerability: + +* Create an issue. +* In the title, write "Vulnerability" and specify which part it affects (admin/user/other) and how serious it is. +* Tag me in the issue. +* Add the "Vulnerability" label, or a "Bug" label, or an "Invalid" label if it’s not valid. +* Write a detailed description: + * A short summary of the vulnerability. + * Which part of the repository is affected. + * In which version the vulnerability occurs. + * How serious the vulnerability is. + * What type of vulnerability it is (e.g., XSS, SQL injection, etc.). + * How you found the issue and how it happened. +* If you know how to fix the issue, feel free to propose a solution: + * Propose a solution in the issue or via a pull request. + * If submitting a pull request, please note in the PR description that it fixes this specific issue. +* Publish the issue and you’re done! +* I may comment on your issue, so please turn on notifications to stay updated. + +Thank you for reporting issues and helping make the project more secure! +— Main developer: Dominik-developer diff --git a/STYLE_GUIDES.md b/STYLE_GUIDES.md index 542e300..2f2ed83 100644 --- a/STYLE_GUIDES.md +++ b/STYLE_GUIDES.md @@ -1,9 +1,11 @@ -# Style Guides for PHP CMS for blog +# Style Guides for CorelyPHP -This document outlines the coding and formatting standards to be followed when contributing to [PHP_CMS_for_blog](https://github.com/Dominik-developer/PHP_CMS_for_blog). +This document outlines the coding and formatting standards to be followed when contributing to [CorelyPHP](https://github.com/Dominik-developer/CorelyPHP). This guideline is still in development and probaby will take a while before it will appears here because project is private now on GitHub. +If you nedd help create issue with label 'documentation' and tag Dominik-developer. + article ID.'; +} + +$conn->close(); + +header('Location: ../panel.php?window=edit-article'); +exit(); + diff --git a/admin/algo/edit.alg.php b/admin/algo/edit.alg.php new file mode 100644 index 0000000..76fdd24 --- /dev/null +++ b/admin/algo/edit.alg.php @@ -0,0 +1,197 @@ +close(); + exit(); + } + + // Check database connection + if ($conn->connect_errno != 0) { + $_SESSION['message'] = 'Connection to db fail'; + header('Location: ../panel.php?window=edit-article&id='.$article_id); + $conn->close(); + exit(); + } else { + + // Checking if article exists + $sql_select = "SELECT id, photo_path FROM articles WHERE id = ?"; + $stmt = $conn->prepare($sql_select); + $stmt->bind_param("i", $article_id); + $stmt->execute(); + $result = $stmt->get_result(); + + if ($result->num_rows > 0) { + + // Fetch existing photo path + $row = $result->fetch_assoc(); + $existing_photo = $row['photo_path']; + + // If a new photo is submitted + if(!empty($_FILES['new_photo']['name'])) { + + // Remove the old photo if a new one is being uploaded + #=========usuwanie=strego=zdjecia===== + + /** * + check in db what way i have path for photos saved and fix it in case it is the other way + */ + if (!empty($existing_photo) && file_exists('/Applications/XAMPP/xamppfiles/htdocs/server/panel_new/' . $existing_photo)) { + unlink('/Applications/XAMPP/xamppfiles/htdocs/server/panel_new/' . $existing_photo); + } + + // Check for upload errors + if ($_FILES["new_photo"]["error"] !== UPLOAD_ERR_OK) { + switch ($_FILES["new_photo"]["error"]) { + case UPLOAD_ERR_PARTIAL: + $_SESSION['message'] = 'File only partially uploaded.'; + header('Location: ../panel.php?window=edit-article&id='.$article_id); + exit(); + case UPLOAD_ERR_NO_FILE: + $_SESSION['message'] = 'No file was uploaded.'; + header('Location: ../panel.php?window=edit-article&id='.$article_id); + exit(); + case UPLOAD_ERR_EXTENSION: + $_SESSION['message'] = 'File upload stopped by a PHP extension.'; + header('Location: ../panel.php?window=edit-article&id='.$article_id); + exit(); + case UPLOAD_ERR_FORM_SIZE: + $_SESSION['message'] = 'File exceeds MAX_FILE_SIZE in the HTML form.'; + header('Location: ../panel.php?window=edit-article&id='.$article_id); + exit(); + case UPLOAD_ERR_INI_SIZE: + $_SESSION['message'] = 'File exceeds upload_max_filesize in php.ini .'; + header('Location: ../panel.php?window=edit-article&id='.$article_id); + exit(); + case UPLOAD_ERR_NO_TMP_DIR: + $_SESSION['message'] = 'Temporary folder not found.'; + header('Location: ../panel.php?window=edit-article&id='.$article_id); + exit(); + case UPLOAD_ERR_CANT_WRITE: + $_SESSION['message'] = 'Failed to write file.'; + header('Location: ../panel.php?window=edit-article&id='.$article_id); + exit(); + default: + $_SESSION['message'] = 'Unknown upload error.'; + header('Location: ../panel.php?window=edit-article&id='.$article_id); + exit(); + } + } + + // Check photo size + if ($_FILES["new_photo"]["size"] > 1048576) { + $_SESSION['message'] = 'File too large (max 1MB).'; + header('Location: ../panel.php?window=edit-article&id='.$article_id); + $conn->close(); + exit(); + } + + // Generate a new filename for the photo + $pathinfo = pathinfo($_FILES["new_photo"]["name"]); + $base = preg_replace("/[^\w-]/", "_", $pathinfo["filename"]); + $filename = $base . "." . $pathinfo["extension"]; + $destination = "/Applications/XAMPP/xamppfiles/htdocs/server/panel_new/articles_photos/" . $filename; + + // Add a numeric suffix if file exists + $i = 1; + while (file_exists($destination)) { + $filename = $base . "($i)." . $pathinfo["extension"]; + $destination = "/Applications/XAMPP/xamppfiles/htdocs/server/panel_new/articles_photos/" . $filename; + $i++; + } + + if (!move_uploaded_file($_FILES["new_photo"]["tmp_name"], $destination)) { + $_SESSION['message'] = "Can't move uploaded file."; + header('Location: ../panel.php?window=edit-article&id='.$article_id); + $conn->close(); + exit(); + } + + // Update photo path in database + $NEW_photo_path = 'articles_photos/'.$filename; + $sql_update = "UPDATE articles SET title = ?, text = ?, photo_path = ? WHERE id = ?"; + $stmt_update = $conn->prepare($sql_update); + $stmt_update->bind_param('sssi', $NEW_title, $NEW_text, $NEW_photo_path , $article_id); + + } else { + // If no new photo is uploaded + $sql_update = "UPDATE articles SET title = ?, text = ? WHERE id = ?"; + $stmt_update = $conn->prepare($sql_update); + $stmt_update->bind_param("ssi", $NEW_title, $NEW_text, $article_id); + } + + if ($stmt_update->execute()) { + $_SESSION['message'] = 'Article was successfully updated.'; + header('Location: ../panel.php?window=edit-article'); + $stmt_update->close(); + $conn->close(); + exit(); + } else { + $_SESSION['message'] = 'Error during updating article.'; + header('Location: ../panel.php?window=edit-article&id='.$article_id); + $stmt_update->close(); + $conn->close(); + exit(); + } + + } else { + $_SESSION['message'] = 'Article with id: '.$article_id.' does not exist'; + header('Location: ../panel.php?window=edit-article&id=0'); + $stmt->close(); + $conn->close(); + exit(); + } + } + + } else { + $_SESSION['message'] = 'POST table doesn\'t have all data'; + header('Location: panel.php?window=edit-article&id='.$article_id); + $conn->close(); + exit(); + } + +} catch (mysqli_sql_exception $e) { + $_SESSION['message'] = 'Database connection error: ' . $e->getMessage(); + header('Location: ../panel.php?window=edit-article&id=0'); + $conn->close(); + exit(); + +} finally { + + if (isset($conn) && $conn instanceof mysqli) { + $conn->close(); + } +} diff --git a/admin/new.alg.php b/admin/algo/new.alg.php similarity index 72% rename from admin/new.alg.php rename to admin/algo/new.alg.php index 4f192fd..62a4cb0 100644 --- a/admin/new.alg.php +++ b/admin/algo/new.alg.php @@ -4,11 +4,11 @@ if(!isset ($_SESSION['adminLoged'])) { - header('Location: panel.login.php'); + header('Location: ../panel.login.php'); exit(); } -require_once 'panel.connect.php'; +require '../panel.connect.php'; $conn = @new mysqli($host, $db_user, $db_password, $db_name); @@ -18,140 +18,127 @@ if(empty($_POST['title']) || empty($_FILES['textUpload']['name']) || empty($_FILES['photoUpload']['name'])) { $_SESSION['message'] = 'Error, POST table empty.'; - header('Location: panel.php'); + header('Location: ../panel.php?window=add-article'); exit(); } else { - echo '1 '; if ($_FILES["photoUpload"]["error"] !== UPLOAD_ERR_OK) { switch ($_FILES["photoUpload"]["error"]) { case UPLOAD_ERR_PARTIAL: $_SESSION['message'] = 'File only partially uploaded.'; - header('Location: panel.php'); + header('Location: ../panel.php?window=add-article'); exit(); case UPLOAD_ERR_NO_FILE: $_SESSION['message'] = 'No file was uploaded.'; - header('Location: panel.php'); + header('Location: ../panel.php?window=add-article'); exit(); case UPLOAD_ERR_EXTENSION: $_SESSION['message'] = 'File upload stopped by a PHP extension.'; - header('Location: panel.php'); + header('Location: ../panel.php?window=add-article'); exit(); case UPLOAD_ERR_FORM_SIZE: $_SESSION['message'] = 'File exceeds MAX_FILE_SIZE in the HTML form.'; - header('Location: panel.php'); + header('Location: ../panel.php?window=add-article'); exit(); case UPLOAD_ERR_INI_SIZE: $_SESSION['message'] = 'File exceeds upload_max_filesize in php.ini .'; - header('Location: panel.php'); + header('Location: ../panel.php?window=add-article'); exit(); case UPLOAD_ERR_NO_TMP_DIR: $_SESSION['message'] = 'Temporary folder not found.'; - header('Location: panel.php'); + header('Location: ../panel.php?window=add-article'); exit(); case UPLOAD_ERR_CANT_WRITE: $_SESSION['message'] = 'Failed to write file.'; - header('Location: panel.php'); + header('Location: ../panel.php?window=add-article'); exit(); default: $_SESSION['message'] = 'Unknown upload error.'; - header('Location: panel.php'); + header('Location: ../panel.php?window=add-article'); exit(); } } if ($_FILES["photoUpload"]["size"] > 1048576) { $_SESSION['message'] = 'File too large (max 1MB).'; - header('Location: panel.php'); + header('Location: ../panel.php?window=add-article'); exit(); } - echo '2 '; - $title = mysqli_real_escape_string($conn, $_POST['title']); $textUpload = file_get_contents($_FILES['textUpload']['tmp_name']); $photo = $_FILES['photoUpload']; - echo '3 '; - if ($conn->connect_errno != 0) { $_SESSION['message'] = 'db connection fail.'; - header('Location: panel.php'); + header('Location: ../panel.php?window=add-article'); #echo "Error: " . $conn->connect_error; #throw new Exception(mysqli_connect_errno()); } else { $sql = "SELECT * FROM articles WHERE title = '$title'"; - echo '4 '; + if($result = $conn->query($sql)) { $num = $result->num_rows; - echo '5 '; + if($num != 0) { $_SESSION['message'] = 'Article with this title already exist.'; - header('Location: panel.php'); + header('Location: ../panel.php?window=add-article'); } else { - echo '6 '; + $pathinfo = pathinfo($_FILES["photoUpload"]["name"]); $base = $pathinfo["filename"]; $base = preg_replace("/[^\w-]/", "_", $base); - echo '7 '; + $filename = $base . "." . $pathinfo["extension"]; - $destination = "/Applications/XAMPP/xamppfiles/htdocs/serwer/panel/articles_photos/" . $filename; - echo '8 '; + $destination = "/Applications/XAMPP/xamppfiles/htdocs/server/panel_new/articles_photos/" . $filename; + // Add a numeric suffix if the file already exists $i = 1; while (file_exists($destination)) { - echo '9 '; + $filename = $base . "($i)." . $pathinfo["extension"]; - $destination = "/Applications/XAMPP/xamppfiles/htdocs/serwer/panel/articles_photos/" . $filename; + + $destination = "/Applications/XAMPP/xamppfiles/htdocs/server/panel_new/articles_photos/".$filename; $i++; } - echo '10 '; + if ( ! move_uploaded_file($_FILES["photoUpload"]["tmp_name"], $destination)) { echo $destination. '
'; $_SESSION['message'] = "Can't move uploaded file."; - header('Location: panel.php'); + header('Location: ../panel.php?window=add-article'); } - echo '11 '; - //echo $destination; $target_file = 'articles_photos/'.$filename; - // inserting data into db $sql_insert = $sql_insert = "INSERT INTO articles (title, text, photo_path) VALUES (?, ?, ?)"; $stmt_insert = $conn->prepare($sql_insert); $stmt_insert->bind_param('sss', $title, $textUpload, $target_file); - echo '12 '; if ($stmt_insert->execute()) { - echo '13.1 '; + $_SESSION['message'] = 'Article was succesfully addes to db.'; - header('Location: panel.php'); + header('Location: ../panel.php?window=add-article'); } else { $_SESSION['message'] = 'Error during adding data to db.'; - header('Location: panel.php'); - #echo "Błąd podczas dodawania artykułu: " . $conn->error; - echo '13.2 '; + header('Location: ../panel.php?window=add-article'); } - echo '14 '; $stmt_insert->close(); - #$_SESSION['message'] = 'File uploaded successfully.'; - #header('Location: panel.php'); } } else { $_SESSION['message'] = 'Error occur during checking title.'; - header('Location: panel.php'); + header('Location: ../panel.php?window=add-article'); #throw new Exception($conn->error); } $conn->close(); diff --git a/admin/password.alg.php b/admin/algo/password.alg.php similarity index 50% rename from admin/password.alg.php rename to admin/algo/password.alg.php index dd6966d..d12d93d 100644 --- a/admin/password.alg.php +++ b/admin/algo/password.alg.php @@ -1,17 +1,15 @@ -connect_errno!=0) { $_SESSION['message'] = 'connection to db fail'; #echo 'Error: '.$conn->connect_error; - header('Location:panle.php'); + header('Location: ../panel.php?window=settings'); exit(); }else{ + + $ID = $_SESSION['id']; - $sql = "SELECT `login`, `password` FROM `admin` WHERE id=1 "; + $sql = "SELECT `password` FROM `admin` WHERE id = '$ID' "; if($result = @$conn->query(sprintf($sql))) { - $num = $result->num_rows; if($num >0) { - $row = $result->fetch_assoc(); - - if($_POST['oldPass'] == $row['password']) { + + if (password_verify($_POST['oldPass'], $row['password'])) { $new_password = $_POST['newPass']; + $password_hash = password_hash($new_password, PASSWORD_DEFAULT); - //DB update - $sql_update = "UPDATE `admin` SET `password` = '$new_password' WHERE id=1 "; + $sql = "UPDATE `admin` SET `password` = ? WHERE `id` = ?"; + $stmt = $conn->prepare($sql); - if ($conn->query($sql_update) === TRUE) { - + if (!$stmt) { + die("Error during prepearing statement: " . $conn->error); + } + + $stmt->bind_param("si", $password_hash, $ID); + + if ($stmt->execute()) { $_SESSION['message'] = 'Password changed successfully.'; - header('Location: panel.php'); + header('Location: ../panel.php?window=settings'); + echo $_SERVER['message']; } else { - $_SESSION['message'] = 'Error: something went wrong during updating password'; - #echo $conn->error; - header('Location: panel.phps'); + $_SESSION['message'] = 'Error: something went wrong during updating password.
'; //$stmt->error; + echo $_SERVER['message']; } - + + $stmt->close(); + $conn->close(); + } else { $_SESSION['message'] = 'Old password is wrong'; - header('Location:panel.php'); + header('Location: ../panel.php?window=settings'); } } else { $_SESSION['message'] = 'more rows found than needed'; - header('Location: panel.phps'); + header('Location: ../panel.php?window=settings'); } } $conn->close(); exit(); } } else { - $_SESSION['message'] = 'new password different than one writen again'; - header('Location:panel.php'); + $_SESSION['message'] = 'new password different than one written again '; + header('Location: ../panel.php?window=settings'); exit(); } } else { $_SESSION['message'] = 'POST table doesnt have all data'; - header('Location:panel.php'); + header('Location: panel.php?window=settings'); exit(); -} - +} \ No newline at end of file diff --git a/admin/algo/service_status.alg.php b/admin/algo/service_status.alg.php new file mode 100644 index 0000000..1ee5a77 --- /dev/null +++ b/admin/algo/service_status.alg.php @@ -0,0 +1,103 @@ +connect_errno!=0) { + $_SESSION['message'] = 'connection do db fail'; + header('Location: ../panel.php?window=service-break'); + exit(); +} + +if (isset($_POST['toggle'])) { + + $setting_id = $_POST['setting_id']; + + $stmt = $conn->prepare("UPDATE `service` SET `service_status` = `service_status` XOR 1 WHERE `id` = ?"); + if ($stmt) { + $stmt->bind_param('i', $setting_id); + + if ($stmt->execute()) { + if ($stmt->affected_rows > 0) { + $_SESSION['message'] = 'Service status value changed successfully.'; + } else { + $_SESSION['message'] = 'Error during updating: row ID error.'; + } + } else { + $_SESSION['message'] = 'Something went wrong during updating status.'; + } + $stmt->close(); + } else { + $_SESSION['message'] = 'Failed to prepare the SQL statement.'; + } + +} else { + $_SESSION['message'] = 'Something went wrong, try again.'; + header('Location: ../panel.php?window=service-break'); + exit(); +} + + + + + + + +/* + + + + $setting_id = $_POST['setting_id']; + + $sql = "SELECT `service_status` FROM `service` WHERE id=1 "; + + if($result = @$conn->query(sprintf($sql))) + { + + $num = $result->num_rows; + + if($num >0) + { + + $row = $result->fetch_assoc(); + + //Value change + $new_value = $row["service_status"] ? 0 : 1; + + //DB update + $sql_update = "UPDATE `service` SET service_status = $new_value WHERE id = $setting_id"; + + if ($conn->query($sql_update) === TRUE) { + + $_SESSION['message'] = 'Service status value changed successfully'; + header('Location: ../panel.php?window=service-break'); + } else { + $_SESSION['message'] = 'Error: something went wrong during updating status'; + #echo $conn->error; + header('Location: ../panel.php?window=service-break'); + } + + } else{ + $_SESSION['message'] = 'more rows found than needed'; + header('Location: ../panel.php?window=service-break'); + } + } + $conn->close(); + exit(); + } else { + $_SESSION['message'] = 'something went wrong, try again'; + header('Location: ../panel.php?window=service-break'); + exit(); + } + + diff --git a/admin/all_articles.alg.php b/admin/all_articles.alg.php index 8c3c582..3f741b2 100644 --- a/admin/all_articles.alg.php +++ b/admin/all_articles.alg.php @@ -9,50 +9,64 @@ function all() { -//additional files -require 'panel.connect.php'; - - //$conn = @new mysqli($host, $db_user, $db_password, $db_name); - - #error_reporting(E_ALL); - #ini_set('display_errors', 1); - -$conn = @new mysqli($host, $db_user, $db_password, $db_name); - -if ($conn->connect_errno) { - $_SESSION['message'] = 'connection to db fail'; - #echo "Error: " . $conn->connect_error; - header('Location:panel.php'); - exit(); -} else { - // Zaktualizowane zapytanie, które pobiera dodatkowe informacje - $sql = "SELECT * FROM articles"; - $result = $conn->query($sql); - - if ($result->num_rows > 0) { - echo ''; - echo ''; - echo ''; - // Pętla po wynikach - while ($row = $result->fetch_assoc()) { - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; // Skrócona treść - echo ''; - echo ''; - echo ''; - } - echo ''; - echo '
IDTitleDate of PublishedContentImage PathView
' . $row['ID'] . '' . $row['title'] . '' . $row['date_of_publish'] . '' . substr($row['text'], 0, 50) . '...' . $row['photo_path'] . 'Link
'; + //additional files + require 'panel.connect.php'; + + $conn = @new mysqli($host, $db_user, $db_password, $db_name); + + if ($conn->connect_errno) { + $_SESSION['message'] = 'connection to db fail'; + #echo "Error: " . $conn->connect_error; + header('Location: panel.php?window=all-articles'); + exit(); } else { - $_SESSION['message'] = 'no data found'; - header('Location:panel.php'); + $sql = "SELECT * FROM articles"; + $result = $conn->query($sql); - } + if ($result->num_rows > 0) { + echo ''; + echo ''; + echo ''; - $conn->close(); -} + while ($row = $result->fetch_assoc()) { + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + echo ''; + echo '
IDTitleDate of PublishedContentImage PathViewEdit
' . $row['ID'] . '' . $row['title'] . '' . $row['date_of_publish'] . '' . substr($row['text'], 0, 50) . '...' . $row['photo_path'] . 'ViewEdit
'; + } else { + echo ''; + echo ''; + echo ''; + + $info = 'No data'; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + echo ''; + echo '
IDTitleDate of PublishedContentImage PathViewEdit
' . $info . '' . $info . '' . $info . '' . $info . '' . $info . '' . $info . '' . $info . '
'; + + $_SESSION['message'] = 'No data found. Database empty.'; + } + + $conn->close(); + } } +?> + diff --git a/admin/data_loading.alg.php b/admin/data_loading.alg.php new file mode 100644 index 0000000..7a6504d --- /dev/null +++ b/admin/data_loading.alg.php @@ -0,0 +1,39 @@ +connect_errno) { + $_SESSION['message'] = 'connection to db fail'; + header('Location: panel.php?window=edit-article'); + exit(); + } else { + $sql = "SELECT * FROM articles WHERE id = $articleID"; + $result = $conn->query($sql); + + if ($result->num_rows > 0) { + $row = $result->fetch_assoc(); + $conn->close(); + return $row; + + } else { + $_SESSION['message'] = 'No data found. Database empty.'; + $conn->close(); + return null; + } + } +} + + + + + diff --git a/admin/functions.php b/admin/functions.php deleted file mode 100644 index 8db997f..0000000 --- a/admin/functions.php +++ /dev/null @@ -1,188 +0,0 @@ - -
- - -
-
-
-

- -
-
-
-
- -
- - -
-
-
-

New article

-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-
- -
-
- -
-
-
- - -
-
-
- -
-
-
-
-
-
- -
- - -
-
-
-

All articles

-
- -
-
-
-
-
- -
- - -
-
-
-

Change status of service break

-
- -
- - -
-
-
- -
-
-
-
-
-
- -
- - -
-
-
-

Change Password

-
-
- -
-
-
- -
-
-
- -
-
-
- - -
-
-
- -
-
-
-
-
-
- { - menuBtn.addEventListener("click", () => { - navBar.classList.toggle("open") - }) - }) - - optionBtns.forEach(optBtn => { - optBtn.addEventListener("click", () => { - navBar.classList.remove("open") - }) - }) - - overlay.addEventListener("click", () => { - navBar.classList.remove("open"); - }) -}); - -document.addEventListener("DOMContentLoaded", function() { - - // Funkcja do obsługi kliknięcia w przycisk - function handleButtonClick(sectionId) { - // Pobierz wszystkie sekcje - const sections = document.querySelectorAll('.section'); - - // Ukryj wszystkie sekcje - sections.forEach(section => section.classList.remove('visible')); - - // Pokaż wybraną sekcję - document.getElementById(sectionId).classList.add('visible'); - - } - - // Dodaj event listenery do przycisków - document.getElementById("allBtn").addEventListener('click', function() { - handleButtonClick('allSection'); - }); - document.getElementById("section1Btn").addEventListener('click', function() { - handleButtonClick('section1'); - }); - document.getElementById("section2Btn").addEventListener('click', function() { - handleButtonClick('section2'); - }); - document.getElementById("section3Btn").addEventListener('click', function() { - handleButtonClick('section3'); - }); - document.getElementById("section4Btn").addEventListener('click', function() { - handleButtonClick('section4'); - }); - -}); - -/* -document.addEventListener("DOMContentLoaded", function() { - const smallMenuBtn = document.querySelectorAll(""), - - smallMenuBtns.forEach(smallMenuBtn => { - smallMenuBtn.addEventListener("click", () => { - .classList.toggle("visible") - }) - }) - -}) - -*/ - -/*mesage handler*/ -document.addEventListener("DOMContentLoaded", function() { - - // Zamknij popout po kliknięciu w X - document.getElementById('close-btn')?.addEventListener('click', function() { - document.getElementById('overlay').classList.add('hidden'); - }); - - // Zamknij popout po kliknięciu poza nim - document.getElementById('overlay')?.addEventListener('click', function(event) { - if (event.target.id === 'overlay') { - document.getElementById('overlay').classList.add('hidden'); - } - }); -}); \ No newline at end of file diff --git a/admin/index.php b/admin/index.php new file mode 100644 index 0000000..8d81737 --- /dev/null +++ b/admin/index.php @@ -0,0 +1,4 @@ +connect_errno!=0) +{ + echo "Error: ".$conn->connect_error; +} else { + + $login = $_POST['login']; + $password = $_POST['password']; + + $password_hash = password_hash($password, PASSWORD_DEFAULT); + + echo 'hash:'.$password_hash; + + $login = htmlentities($login, ENT_QUOTES, "UTF-8"); + + if($result = @$conn->query(sprintf("SELECT * FROM admin WHERE login='%s' ", mysqli_real_escape_string($conn, $login)))) + { + $num_adm = $result->num_rows; + + if($num_adm >0) + { + $row = $result->fetch_assoc(); + + if (password_verify($password, $row['password'])) { + + $_SESSION['adminLoged'] = true; + + $_SESSION['id'] = $row['id']; + $_SESSION['login'] = $row['login']; + $_SESSION['password'] = $row['password']; + + unset($_SESSION['loginError']); + $result->free_result(); + + header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0'); + header('Cache-Control: post-check=0, pre-check=0', false); // For HTTP/1.0 compatibility + header('Pragma: no-cache'); // For HTTP/1.0 compatibility + + //Set the Expires header to ensure that the page is considered expired + header('Expires: Wed, 11 Jan 1984 05:00:00 GMT'); + + header('Location: panel.php'); + + } else { + $_SESSION['loginError'] = 'Error! Login or password wrong.'; + header('Location: panel.login.php'); + } + + }else{ + $_SESSION['loginError'] = 'Error! Login or password wrong.'; + header('Location: panel.login.php'); + } + } + + $conn->close(); +} + +exit(); diff --git a/admin/panel.login.css b/admin/panel.login.css index ca72540..64e72ad 100644 --- a/admin/panel.login.css +++ b/admin/panel.login.css @@ -1,8 +1,6 @@ body{ - /*background-color: lightslategray;*/ background-color: #fff; - /*background-color: #e3f2fd;*/ height: 100%; margin: 0; padding: 0; @@ -18,11 +16,9 @@ main{ } #loginBox{ - width: 340px; /*380px*/ - height: 290px; /*280px*/ - border-radius: 5px; /* 8px*/ - /*background-color: lightgrey;*/ - /*background-color: #fff;*/ + width: 320px; + height: 290px; + border-radius: 5px; position: absolute; top: 45%; left: 50%; @@ -44,28 +40,25 @@ main{ } input[type="text"], input[type="password"] { - width: 200px; /*180px*/ + width: 200px; padding: 10px; margin: 5px 0; box-sizing: border-box; - border-radius: 5px; /*8px*/ + border-radius: 5px; border: none; font-size: 13px; border: 1px solid #333; } input[type="submit"] { - width: 200px; /*180px*/ + width: 200px; padding: 10px; margin: 10px 0; - /*background-color: #4CAF50;/* - /*background-color: red;*/ background-color: #4070f4;; - color: white; - /*color: #333;*/ + color: #fff; border: none; cursor: pointer; - border-radius: 5px; /*8px*/ - font-size: 14px; + border-radius: 5px; + font-size: 16px; } footer{ @@ -73,12 +66,11 @@ footer{ bottom: 0; width: 100%; height: 30px; - background-color: #f1f1f1; text-align: center; line-height: 30px; - background-color: lightgray; + background-color: #4070f4; + color: #fff; font-size: 22px; - } @@ -149,7 +141,7 @@ footer{ } } -@media (max-width: 260px) OR (max-height: 460px){ +@media (max-width: 300px) OR (max-height: 460px){ main{ display: none; } diff --git a/admin/panel.login.php b/admin/panel.login.php index 7dcfb99..a3afd39 100644 --- a/admin/panel.login.php +++ b/admin/panel.login.php @@ -3,21 +3,26 @@ session_start(); - -if((isset($_SESSION['adminLoged'])) && ($_SESSION['aminLoged'] == true)) +if((isset($_SESSION['adminLoged'])) && ($_SESSION['adminLoged'] == true)) // think over { - //unset($_SESSION['adminLoged']); header('Location: panel.php'); exit(); - - //jesli nie chcemy by zosrtały wykonane następne instrukcje w skrypcie php - //znajdujące sie poniej instrukcji header naley uzyć exit(); - //nastąpi natychmiastowe przekierowanie - // nie kończymy imprzy, wychodzimy po angielsku - + // nie kończymy imprezy, wychodzimy po angielsku } +// cache control +header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +// for dev +define('ENV_DEV', false); +if(ENV_DEV == true){ + $_SESSION['adminLoged'] = true; + header('Location: panel.php'); + exit(); +} ?> @@ -38,7 +43,7 @@
-
+
diff --git a/admin/panel.logout.alg.php b/admin/panel.logout.alg.php index 04f5e10..75017ea 100644 --- a/admin/panel.logout.alg.php +++ b/admin/panel.logout.alg.php @@ -2,6 +2,8 @@ session_start(); + $_SESSION['adminLoged'] = false; // i make sure it has value different from true + session_unset(); //session_destroy(); header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0'); @@ -9,5 +11,5 @@ header('Pragma: no-cache'); header('Expires: Wed, 11 Jan 1984 05:00:00 GMT'); - header('Location:panel.login.php');//panel.logout.out.php + header('Location:panel.login.php'); //panel.logout.out.php exit(); diff --git a/admin/panel.php b/admin/panel.php index 9c02241..dcbbe15 100644 --- a/admin/panel.php +++ b/admin/panel.php @@ -3,25 +3,26 @@ 1800)) { - // Sesja wygasła - usuń dane sesji - session_unset(); // Usuń wszystkie zmienne sesji - session_destroy(); // Zniszcz sesję + // Session expired - delete session data + session_unset(); // Delete all session variables + session_destroy(); // Destroy session } -$_SESSION['LAST_ACTIVITY'] = time(); // Aktualizacja czasu ostatniej aktywności +$_SESSION['LAST_ACTIVITY'] = time(); // Last Activity Time Update //additional files require_once 'panel.connect.php'; -include_once 'functions.php'; +include 'window_functions.php'; ?> @@ -45,8 +46,8 @@ - - + + @@ -76,11 +77,10 @@ -
-
- -
+ }else{ // if new widows added, there must be added new if statements added as well + + if($_GET["window"] == "all-articles"){ -
- -
-
- -
+ + + }elseif($_GET["window"] == "edit-article"){ + + editArticle(); + + }elseif($_GET["window"] == "service-break"){ -
- -
- + }elseif($_GET["window"] == "settings"){ -
- -
- + + }else{ + + error(); + + } + } + ?>
@@ -214,7 +223,7 @@ ?> - + \ No newline at end of file diff --git a/admin/panel_login.alg.php b/admin/panel_login.alg.php deleted file mode 100644 index e6be4b1..0000000 --- a/admin/panel_login.alg.php +++ /dev/null @@ -1,69 +0,0 @@ -connect_errno!=0) -{ - echo "Error: ".$conn->connect_error; -} -else -{ - $login = $_POST['login']; - $password = $_POST['password']; - - $login = htmlentities($login, ENT_QUOTES, "UTF-8"); - $password = htmlentities($password, ENT_QUOTES, "UTF-8"); - - if($result = @$conn->query(sprintf("SELECT * FROM admin WHERE login='%s' AND password='%s' ", - mysqli_real_escape_string($conn, $login), - mysqli_real_escape_string($conn, $password) ))) - { - $num_adm = $result->num_rows; - - if($num_adm >0) - { - - $_SESSION['adminLoged'] = true; //zalogowany = true - - $row = $result->fetch_assoc(); - - $_SESSION['id'] = $row['id']; - $_SESSION['login'] = $row['login']; - $_SESSION['password'] = $row['password']; - - - unset($_SESSION['loginError']); - $result->free_result(); - - header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0'); - header('Cache-Control: post-check=0, pre-check=0', false); // Dla zgodności z HTTP/1.0 - header('Pragma: no-cache'); // Dla zgodności z HTTP/1.0 - - // Ustawienie nagłówka Expires, aby upewnić się, że strona jest uznawana za przeterminowaną - header('Expires: Wed, 11 Jan 1984 05:00:00 GMT'); - - header('Location: panel.php'); - - }else{ - - $_SESSION['loginError'] = 'Error! Login or password wrong.'; - header('Location: panel.login.php'); - } - } - - $conn->close(); -} - - -exit(); diff --git a/admin/service_status.alg.php b/admin/service_status.alg.php deleted file mode 100644 index a698443..0000000 --- a/admin/service_status.alg.php +++ /dev/null @@ -1,69 +0,0 @@ -connect_errno!=0) { - $_SESSION['message'] = 'connection do db fail'; - #echo "Error: ".$conn->connect_error; - header('Location: panel.php'); - exit(); - }else{ - - $sql = "SELECT `service_status` FROM `service` WHERE id=1 "; - - if($result = @$conn->query(sprintf($sql))) - { - - $num = $result->num_rows; - - if($num >0) - { - - $row = $result->fetch_assoc(); - - //Value change - $new_value = $row["service_status"] ? 0 : 1; - - //DB update - $sql_update = "UPDATE `service` SET service_status = $new_value WHERE id = $setting_id"; - - if ($conn->query($sql_update) === TRUE) { - - $_SESSION['message'] = 'Service status value changed successfully'; - header('Location: panel.php'); - }else{ - $_SESSION['message'] = 'Error: something went wrong during updating status'; - #echo $conn->error; - header('Location: panel.php'); - } - - }else{ - $_SESSION['message'] = 'more rows found than needed'; - header('Location: panel.php'); - } - } - $conn->close(); - exit(); - } -}else{ - $_SESSION['message'] = 'something went wrong, try again'; - header('Location: panel.php'); - exit(); -} - - diff --git a/admin/test.new.php b/admin/test.new.php deleted file mode 100644 index 8b9657c..0000000 --- a/admin/test.new.php +++ /dev/null @@ -1,3 +0,0 @@ - + +
+
+

Dashboard

+
+ +
+
+
+ + + +
+
+

All articles

+
+
+ +
+
+
+
+ + + +
+
+

Add article

+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ + +
+
+
+ +
+ +
+
+
+ + 0) { + + require_once 'data_loading.alg.php'; + + $articleData = edit_dataLoading($_GET['id']); + + if ($articleData === null) { + + echo "

No article data found.

"; + } else { + + ?> +
+
+

Edit article

+
+
+ + + +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+ +
+
+ <?php echo $articleData['title']; ?> photo +
+ +
+
+ +
+
+ +
+
+
+
+
+ +
+ + +
+
+ +
+
+ +
+
+
+ +
+ + +
+
+ +
+
+
+
+
+
+
+ +
+
+

Choose article to edit

+
+
+ +
+
+
+
+ + +
+
+

Service Break

+
+
+ +
+ + +
+
+
+ +
+
+
+
+
+ + + +
+
+

Settings

+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+
+ + +
+
+
+ +
+
+
+
+
+ + + +
+
+

Something went wrong

+
+ Something went wrong, please reload the page with the link below + Reload +
+
+
+ + Error page + + + + + +
diff --git a/public/functions.php b/public/functions.php index ad5e44e..7965339 100644 --- a/public/functions.php +++ b/public/functions.php @@ -47,9 +47,12 @@ function all_articles(){ '. $row['title'] . '
- ' . substr($row['text'], 0, 50) . '... + + photo from article + +
- + ' . substr($row['text'], 0, 50) . '...
diff --git a/public/main.css b/public/main.css index f9399ba..41b3424 100644 --- a/public/main.css +++ b/public/main.css @@ -8,30 +8,30 @@ body { } header { - background-color: #f0f0f0; /* jasne tło dla trybu jasnego */ + background-color: #f0f0f0; color: #121212; padding: 10px; text-align: center; - position: relative; /* Zwrócone do poprzedniego */ + position: relative; } nav { - background-color: #e6e6e6; /* jasne tło dla trybu jasnego */ + background-color: #e6e6e6; padding: 10px; text-align: center; top: 0; - position: sticky; /* Zwrócone sticky na nawigacji */ + position: sticky; z-index: 11; } nav a { - color: #6A1B9A; /* Fioletowy kolor linków */ + color: #6A1B9A; text-decoration: none; margin: 0 10px; } nav a:hover { - color: #03DAC6; /* Miętowy kolor na hover */ + color: #03DAC6; } main { @@ -53,7 +53,7 @@ footer { display: flex; justify-content: center; align-items: center; - background-color: #f0f0f0; /* jasne tło dla trybu jasnego */ + background-color: #f0f0f0; color: #121212; } @@ -90,7 +90,7 @@ div.articleTitle { border-bottom: 1px solid #E0E0E0; margin-bottom: 10px; padding: 10px; - background-color: #6A1B9A; /* Fioletowy */ + background-color: #6A1B9A; color: #fff; border-top-right-radius: 8px; border-top-left-radius: 8px; @@ -125,11 +125,11 @@ img { } nav a { - color: #BB86FC; /* Fioletowy kolor dla trybu ciemnego */ + color: #BB86FC; } nav a:hover { - color: #03DAC6; /* Miętowy kolor na hover */ + color: #03DAC6; } article.wrapper { @@ -139,8 +139,13 @@ img { } div.articleTitle { - background-color: #BB86FC; /* Fioletowy dla trybu ciemnego */ + background-color: #BB86FC; color: #121212; } + + article footer#date_of_pub { + background-color: #1F1B24; + color: #fff; + } } diff --git a/public/service.html b/public/service.html index 6665d34..502fbd8 100644 --- a/public/service.html +++ b/public/service.html @@ -4,37 +4,39 @@ Service page + + + + + + + + + + + + + +

Service page

-

Prowadzone są teraz prace serwisowe!
Za utrudnienia przepraszamy.

+

We are currently undergoing maintenance!
We apologize for the inconvenience.


- Prosimy spróbować póniej: Link: Blog main page + Please try again later: Link: Blog main page
\ No newline at end of file diff --git a/public/single.css b/public/single.css index a587046..9f414e6 100644 --- a/public/single.css +++ b/public/single.css @@ -21,12 +21,9 @@ article { } article header{ - /*background-color: #fff; - color: #121212;*/ height: 50px; font-size: 40px; border-radius: 8px; - /*border-bottom: solid 1px #121212;*/ text-align: center; /*max-width: 1000px;*/ margin: 0; @@ -45,7 +42,7 @@ article img{ border-radius: 8px !important; } -/* +/* /i may add this later/ article img:hover { z-index: 10; transform: scale(1.5); @@ -73,22 +70,7 @@ article footer{ text-align: left; align-items: normal; padding-left: 20px; - max-height: 60px; + max-height: 40px; box-sizing: border-box; margin-top: 5px; - } - - -/* dark/light mode*/ -/*@media (prefers-color-scheme: dark) { - body { - background-color: #121212; - color: #fff; - } - - .gallery-item{ - background-color: #fff; - border: #fff; - } -}*/