From 390a6e9f4f0d98d1bf7bf9bf0b79b2f165c10af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CVeLiTi=E2=80=9D?= <“info@veliti.nl”> Date: Thu, 30 Jan 2025 13:43:02 +0100 Subject: [PATCH] Initial rewiring --- admin/language.php | 8 +++---- {font => custom/css/font}/.DS_Store | Bin {font => custom/css/font}/GOODDOGP.TXT | 0 {font => custom/css/font}/GOODDP__.TTF | Bin {font => custom/css/font}/Gerb-Bold.ttf | Bin {font => custom/css/font}/Gerb.ttf | Bin .../font}/Montserrat-VariableFont_wght.ttf | Bin custom/customfunctions.php | 20 +++++++++--------- custom/email/order-details-template.php | 2 +- custom/email/order-invoice-template.php | 2 +- custom/email/order-notification-template.php | 2 +- custom/settings/config.php | 4 ++-- functions.php | 18 ++++++++-------- index.php | 20 +++++++++--------- 14 files changed, 38 insertions(+), 38 deletions(-) rename {font => custom/css/font}/.DS_Store (100%) rename {font => custom/css/font}/GOODDOGP.TXT (100%) rename {font => custom/css/font}/GOODDP__.TTF (100%) rename {font => custom/css/font}/Gerb-Bold.ttf (100%) rename {font => custom/css/font}/Gerb.ttf (100%) rename {font => custom/css/font}/Montserrat-VariableFont_wght.ttf (100%) diff --git a/admin/language.php b/admin/language.php index 9a3cdae..f1b06f7 100644 --- a/admin/language.php +++ b/admin/language.php @@ -3,15 +3,15 @@ defined('admin') or exit; // Capture post data if (isset($_POST['language_US'], $_POST['language_NL'])) { // Save templates - file_put_contents('../custom/translations_US.php', $_POST['language_US']); - file_put_contents('../custom/translations_NL.php', $_POST['language_NL']); + file_put_contents('../custom/translations/translations_US.php', $_POST['language_US']); + file_put_contents('../custom/translations/translations_NL.php', $_POST['language_NL']); header('Location: index.php?page=language&success_msg=1'); exit; } // Read language_US template PHP file -$contents = file_get_contents('../custom/translations_US.php'); +$contents = file_get_contents('../custom/translations/translations_US.php'); // Read language template PHP file -$contents2 = file_get_contents('../custom/translations_NL.php'); +$contents2 = file_get_contents('../custom/translations/translations_NL.php'); // Handle success messages if (isset($_GET['success_msg'])) { if ($_GET['success_msg'] == 1) { diff --git a/font/.DS_Store b/custom/css/font/.DS_Store similarity index 100% rename from font/.DS_Store rename to custom/css/font/.DS_Store diff --git a/font/GOODDOGP.TXT b/custom/css/font/GOODDOGP.TXT similarity index 100% rename from font/GOODDOGP.TXT rename to custom/css/font/GOODDOGP.TXT diff --git a/font/GOODDP__.TTF b/custom/css/font/GOODDP__.TTF similarity index 100% rename from font/GOODDP__.TTF rename to custom/css/font/GOODDP__.TTF diff --git a/font/Gerb-Bold.ttf b/custom/css/font/Gerb-Bold.ttf similarity index 100% rename from font/Gerb-Bold.ttf rename to custom/css/font/Gerb-Bold.ttf diff --git a/font/Gerb.ttf b/custom/css/font/Gerb.ttf similarity index 100% rename from font/Gerb.ttf rename to custom/css/font/Gerb.ttf diff --git a/font/Montserrat-VariableFont_wght.ttf b/custom/css/font/Montserrat-VariableFont_wght.ttf similarity index 100% rename from font/Montserrat-VariableFont_wght.ttf rename to custom/css/font/Montserrat-VariableFont_wght.ttf diff --git a/custom/customfunctions.php b/custom/customfunctions.php index 328a612..d5f81ba 100644 --- a/custom/customfunctions.php +++ b/custom/customfunctions.php @@ -17,7 +17,7 @@ function get_countries() { // Template Header default including MENU function template_header($title, $head = '') { - include 'translations_'.strtoupper(language_code).'.php'; + include './custom/translations/translations_'.strtoupper(language_code).'.php'; // Get the amount of items in the shopping cart, this will be displayed in the header. $num_items_in_cart = isset($_SESSION['cart']) ? array_sum(array_column($_SESSION['cart'], 'quantity')) : 0; @@ -62,8 +62,8 @@ if (veliti_analytics){ $site_title - $title - - + + $veliti_analytics $head @@ -110,7 +110,7 @@ if (veliti_analytics){ // Template Header (related to MENU function) function template_header_top($title, $head = '') { - include 'translations_'.strtoupper(language_code).'.php'; + include './custom/translations/'.strtoupper(language_code).'.php'; // Get the amount of items in the shopping cart, this will be displayed in the header. $num_items_in_cart = isset($_SESSION['cart']) ? array_sum(array_column($_SESSION['cart'], 'quantity')) : 0; $home_link = url('index.php'); @@ -156,8 +156,8 @@ function template_header_top($title, $head = '') { $site_title - $title - - + + $veliti_analytics $head @@ -171,7 +171,7 @@ function template_header_top($title, $head = '') { } // Template Menu function template_menu(){ - include 'translations_'.strtoupper(language_code).'.php'; + include './custom/translations/translations_'.strtoupper(language_code).'.php'; // Get the amount of items in the shopping cart, this will be displayed in the header. $num_items_in_cart = isset($_SESSION['cart']) ? array_sum(array_column($_SESSION['cart'], 'quantity')) : 0; $home_link = url('index.php'); @@ -225,7 +225,7 @@ function template_menu(){ // Template footer function template_footer() { - include 'translations_'.strtoupper(language_code).'.php'; + include './custom/translations/translations_'.strtoupper(language_code).'.php'; $base_url = base_url; $rewrite_url = rewrite_url ? 'true' : 'false'; $year = date('Y'); @@ -291,7 +291,7 @@ function template_footer() { //++++++++++++++++++++++++++++++++++++++++++++++++++++ //Template header order email function template_order_email_header() { - include 'translations_'.strtoupper(language_code).'.php'; + include './custom/translations/translations_'.strtoupper(language_code).'.php'; $home_link = url('index.php'); $myaccount_link = url('index.php?page=myaccount'); @@ -501,7 +501,7 @@ EOT; } // Template order footer function template_order_email_footer() { -include 'translations_'.strtoupper(language_code).'.php'; +include './custom/translations/translations_'.strtoupper(language_code).'.php'; $home_link = url('index.php'); $products_link = url(link_to_collection); $about_link = url('index.php?page=about'); diff --git a/custom/email/order-details-template.php b/custom/email/order-details-template.php index 1026f54..6f8ce93 100644 --- a/custom/email/order-details-template.php +++ b/custom/email/order-details-template.php @@ -1,7 +1,7 @@ - +
diff --git a/custom/email/order-invoice-template.php b/custom/email/order-invoice-template.php index e02276e..6930a79 100644 --- a/custom/email/order-invoice-template.php +++ b/custom/email/order-invoice-template.php @@ -3,7 +3,7 @@ //(defined(security_key) or defined('admin')) or exit; ?> - +
diff --git a/custom/email/order-notification-template.php b/custom/email/order-notification-template.php index 990cb5c..c75e1c0 100644 --- a/custom/email/order-notification-template.php +++ b/custom/email/order-notification-template.php @@ -1,7 +1,7 @@ - +
diff --git a/custom/settings/config.php b/custom/settings/config.php index 8d3aeef..a6d2c33 100644 --- a/custom/settings/config.php +++ b/custom/settings/config.php @@ -16,7 +16,7 @@ define('age_verification_enabled',false); //Enable VeLiTi-analytics define('veliti_analytics',false); // Default logtraffic -define('log_usage',true); +define('log_usage',false); /* Banners */ // Show offer at home page define('show_offer_home_page',true); @@ -155,7 +155,7 @@ define('db_user','morvalwatches');//morvalwatches_prod // Database password define('db_pass','4~gv71bM6'); // Database name -define('db_name','advanced_shoppingcart'); //morvalwatches +define('db_name','shoppingcart_advanced'); //morvalwatches /* Payment options */ //Pay on Delivery diff --git a/functions.php b/functions.php index af82123..66d8561 100644 --- a/functions.php +++ b/functions.php @@ -134,7 +134,7 @@ function populate_categories($categories, $selected = 0, $parent_id = 0, $n = 0) // Send order details email function function send_order_details_email($email, $products, $first_name, $last_name, $address_street, $address_city, $address_state, $address_zip, $address_country, $subtotal, $discounttotal,$shippingtotal,$taxtotal,$total, $order_id) { - include './custom/translations_'.strtoupper(language_code).'.php'; + include './custom/translations/translations_'.strtoupper(language_code).'.php'; // Send payment notification to webmaster $address_name = htmlspecialchars($first_name ?? '', ENT_QUOTES).' '.htmlspecialchars($last_name ?? '', ENT_QUOTES); if (email_notifications) { @@ -159,7 +159,7 @@ function send_order_details_email($email, $products, $first_name, $last_name, $a //Send email to administrator for out of stock notification // only for registered users function send_product_notification_email($email,$product_details){ - include './custom/translations_'.strtoupper(language_code).'.php'; + include './custom/translations/translations_'.strtoupper(language_code).'.php'; $subject = $subject_out_of_stock.' - '.$product_details; $headers = 'From: ' . mail_from . "\r\n" . 'Reply-To: ' . $email . "\r\n" . 'Return-Path: ' . mail_from . "\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-Type: text/html; charset=UTF-8' . "\r\n"; @@ -315,7 +315,7 @@ function format_bytes($bytes) { function getAccessoiries($pdo, $categoryID){ - include './custom/translations_'.strtoupper(language_code).'.php'; + include './custom/translations/translations_'.strtoupper(language_code).'.php'; $stmt = $pdo->prepare('SELECT p.*, (SELECT m.full_path FROM products_media pm JOIN media m ON m.id = pm.media_id WHERE pm.product_id = p.id ORDER BY pm.position ASC LIMIT 1) AS img FROM products p JOIN products_categories pc ON pc.category_id = :category_id AND pc.product_id = p.id JOIN categories c ON c.id = pc.category_id WHERE p.status = 1'); $stmt->bindValue(':category_id', $categoryID, PDO::PARAM_INT); @@ -364,7 +364,7 @@ function getAccessoiries($pdo, $categoryID){ function getSamples($pdo, $categoryID){ - include './custom/translations_'.strtoupper(language_code).'.php'; + include './custom/translations/translations_'.strtoupper(language_code).'.php'; $stmt = $pdo->prepare('SELECT p.*, (SELECT m.full_path FROM products_media pm JOIN media m ON m.id = pm.media_id WHERE pm.product_id = p.id ORDER BY pm.position ASC LIMIT 1) AS img FROM products p JOIN products_categories pc ON pc.category_id = :category_id AND pc.product_id = p.id JOIN categories c ON c.id = pc.category_id WHERE p.status = 1'); $stmt->bindValue(':category_id', $categoryID, PDO::PARAM_INT); @@ -550,7 +550,7 @@ function generateInvoice($pdo, $orderID){ function freeShipment($price, $type){ - include './custom/translations_'.strtoupper(language_code).'.php'; + include './custom/translations/translations_'.strtoupper(language_code).'.php'; //Free delivery indicator $delivery_status = ($price >= free_shipment_price) ? $free_delivery : $non_free_delivery.currency_code.free_shipment_price.',-'; @@ -564,7 +564,7 @@ function freeShipment($price, $type){ function consent() { - include './custom/translations_'.strtoupper(language_code).'.php'; + include './custom/translations/translations_'.strtoupper(language_code).'.php'; $age_consent = '