From 9e0fc083217a8026c649fd7ed51ab613d507641c Mon Sep 17 00:00:00 2001 From: gburton Date: Wed, 15 Jan 2020 09:51:23 +0000 Subject: [PATCH 01/24] Update Feeds --- admin/certified_addons.php | 3 ++- admin/includes/modules/dashboard/d_phoenix_addons.php | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/admin/certified_addons.php b/admin/certified_addons.php index 2bc2f1ab4..8d64f65e0 100644 --- a/admin/certified_addons.php +++ b/admin/certified_addons.php @@ -14,7 +14,8 @@ require('includes/template_top.php'); - $feed = simplexml_load_file('https://template.me.uk/addon_feed.xml'); $num = 0; + $feed = simplexml_load_file('http://feeds.feedburner.com/PhoenixAddons'); + $num = 0; ?>
diff --git a/admin/includes/modules/dashboard/d_phoenix_addons.php b/admin/includes/modules/dashboard/d_phoenix_addons.php index 216ad48bc..e67a70e86 100644 --- a/admin/includes/modules/dashboard/d_phoenix_addons.php +++ b/admin/includes/modules/dashboard/d_phoenix_addons.php @@ -30,7 +30,7 @@ function __construct() { } function getOutput() { - $feed = simplexml_load_file('https://template.me.uk/addon_feed.xml'); + $feed = simplexml_load_file('http://feeds.feedburner.com/PhoenixAddons'); $output = null; @@ -41,7 +41,7 @@ function getOutput() { $output .= '' . tep_image('images/icon_phoenix.png', 'Phoenix') . ' ' . MODULE_ADMIN_DASHBOARD_PHOENIX_ADDONS_TITLE . ''; $output .= '' . MODULE_ADMIN_DASHBOARD_PHOENIX_ADDONS_OWNER . ''; $output .= '' . MODULE_ADMIN_DASHBOARD_PHOENIX_ADDONS_RATING . ''; - $output .= ''. MODULE_ADMIN_DASHBOARD_PHOENIX_ADDONS_DATE . ''; + $output .= ''. MODULE_ADMIN_DASHBOARD_PHOENIX_ADDONS_DATE . ''; $output .= ''; $output .= ''; $output .= ''; @@ -52,7 +52,7 @@ function getOutput() { $output .= '' . $item->title . ''; $output .= '' . $item->owner . ''; $output .= '' . tep_draw_stars($item->rating) . ''; - $output .= '' . date("F j, Y", strtotime($item->pubDate)) . ''; + $output .= '' . date("F j, Y", strtotime($item->pubDate)) . ''; $output .= ''; } } From ad963805b31a1be04d95e5e3bc0f889a87e86dab Mon Sep 17 00:00:00 2001 From: gburton Date: Wed, 15 Jan 2020 09:52:50 +0000 Subject: [PATCH 02/24] CSS Targets --- .../english/modules/boxes/bm_shopping_cart.php | 5 ++++- .../modules/navbar_modules/nb_shopping_cart.php | 4 ++-- includes/modules/boxes/bm_shopping_cart.php | 2 +- .../modules/boxes/templates/tpl_bm_shopping_cart.php | 2 +- .../templates/tpl_nb_shopping_cart.php | 12 +++++++----- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/includes/languages/english/modules/boxes/bm_shopping_cart.php b/includes/languages/english/modules/boxes/bm_shopping_cart.php index ba0165353..775f884a1 100755 --- a/includes/languages/english/modules/boxes/bm_shopping_cart.php +++ b/includes/languages/english/modules/boxes/bm_shopping_cart.php @@ -5,13 +5,16 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2018 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ define('MODULE_BOXES_SHOPPING_CART_TITLE', 'Shopping Cart'); define('MODULE_BOXES_SHOPPING_CART_DESCRIPTION', 'Show shopping cart contents'); + define('MODULE_BOXES_SHOPPING_CART_BOX_TITLE', 'Shopping Cart'); define('MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY', '0 items'); + + define('MODULE_BOXES_SHOPPING_CART_BOX_CART_TOTAL', '%s'); \ No newline at end of file diff --git a/includes/languages/english/modules/navbar_modules/nb_shopping_cart.php b/includes/languages/english/modules/navbar_modules/nb_shopping_cart.php index f4bc85ab5..54aa1ff2f 100644 --- a/includes/languages/english/modules/navbar_modules/nb_shopping_cart.php +++ b/includes/languages/english/modules/navbar_modules/nb_shopping_cart.php @@ -17,9 +17,9 @@ define('MODULE_NAVBAR_SHOPPING_CART_TITLE', 'Shopping Cart'); define('MODULE_NAVBAR_SHOPPING_CART_DESCRIPTION', 'Show Shopping Cart in Navbar'); - define('MODULE_NAVBAR_SHOPPING_CART_CONTENTS', ' %1$s item(s) '); + define('MODULE_NAVBAR_SHOPPING_CART_CONTENTS', ' %1$s item(s) '); define('MODULE_NAVBAR_SHOPPING_CART_NO_CONTENTS', ' 0 items'); - define('MODULE_NAVBAR_SHOPPING_CART_HAS_CONTENTS', '%s item(s), %s'); + define('MODULE_NAVBAR_SHOPPING_CART_HAS_CONTENTS', '%s item(s), %s'); define('MODULE_NAVBAR_SHOPPING_CART_VIEW_CART', 'View Cart'); define('MODULE_NAVBAR_SHOPPING_CART_CHECKOUT', ' Checkout'); diff --git a/includes/modules/boxes/bm_shopping_cart.php b/includes/modules/boxes/bm_shopping_cart.php index f4da87a1a..b3037f62a 100644 --- a/includes/modules/boxes/bm_shopping_cart.php +++ b/includes/modules/boxes/bm_shopping_cart.php @@ -57,7 +57,7 @@ function execute() { $cart_contents_string .= '

' . MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY . '

'; } - $cart_totalised = $currencies->format($cart->show_total()); + $cart_totalised = sprintf(MODULE_BOXES_SHOPPING_CART_BOX_CART_TOTAL, $currencies->format($cart->show_total())); $tpl_data = ['group' => $this->group, 'file' => __FILE__]; include 'includes/modules/block_template.php'; diff --git a/includes/modules/boxes/templates/tpl_bm_shopping_cart.php b/includes/modules/boxes/templates/tpl_bm_shopping_cart.php index 9d50163dd..2dfec4d29 100644 --- a/includes/modules/boxes/templates/tpl_bm_shopping_cart.php +++ b/includes/modules/boxes/templates/tpl_bm_shopping_cart.php @@ -1,6 +1,6 @@
-
+
From 5a29956644f87656b7f307428076769b265eb0b9 Mon Sep 17 00:00:00 2001 From: gburton Date: Thu, 16 Jan 2020 14:35:45 +0000 Subject: [PATCH 04/24] Restyle for display --- includes/modules/boxes/bm_shopping_cart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/modules/boxes/bm_shopping_cart.php b/includes/modules/boxes/bm_shopping_cart.php index b3037f62a..ec170f723 100644 --- a/includes/modules/boxes/bm_shopping_cart.php +++ b/includes/modules/boxes/bm_shopping_cart.php @@ -54,7 +54,7 @@ function execute() { } } } else { - $cart_contents_string .= '

' . MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY . '

'; + $cart_contents_string .= '' . MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY . ''; } $cart_totalised = sprintf(MODULE_BOXES_SHOPPING_CART_BOX_CART_TOTAL, $currencies->format($cart->show_total())); From d0ef6bf00aed8253fa2c594996aae52c6045fc18 Mon Sep 17 00:00:00 2001 From: gburton Date: Thu, 16 Jan 2020 14:37:54 +0000 Subject: [PATCH 05/24] Check for fopen wrapper --- .../modules/security_check/fopen_wrapper.php | 15 ++++++++ .../modules/security_check/fopen_wrapper.php | 36 +++++++++++++++++++ install/templates/pages/index.php | 9 +++++ 3 files changed, 60 insertions(+) create mode 100644 admin/includes/languages/english/modules/security_check/fopen_wrapper.php create mode 100644 admin/includes/modules/security_check/fopen_wrapper.php diff --git a/admin/includes/languages/english/modules/security_check/fopen_wrapper.php b/admin/includes/languages/english/modules/security_check/fopen_wrapper.php new file mode 100644 index 000000000..466d799ef --- /dev/null +++ b/admin/includes/languages/english/modules/security_check/fopen_wrapper.php @@ -0,0 +1,15 @@ +This is a hosting setting and may be able to be performed via your hosting control panel - if not, ask your host.'); + diff --git a/admin/includes/modules/security_check/fopen_wrapper.php b/admin/includes/modules/security_check/fopen_wrapper.php new file mode 100644 index 000000000..3c597d62f --- /dev/null +++ b/admin/includes/modules/security_check/fopen_wrapper.php @@ -0,0 +1,36 @@ +title = MODULE_SECURITY_CHECK_FOPEN_WRAPPER_TITLE; + } + + function pass() { + if ((int)ini_get('allow_url_fopen') == 0) return false; + + return true; + } + + function getMessage() { + return MODULE_SECURITY_CHECK_FOPEN_WRAPPER_ERROR; + } + + } + \ No newline at end of file diff --git a/install/templates/pages/index.php b/install/templates/pages/index.php index 459235b13..19bf099ae 100755 --- a/install/templates/pages/index.php +++ b/install/templates/pages/index.php @@ -51,6 +51,10 @@ if (version_compare(PHP_VERSION, '7', '<')) { $warning_array['php_version'] = 'The version of PHP must be at least 7. The version here is ' . PHP_VERSION; } + + if ((int)ini_get('allow_url_fopen') == 0) { + $warning_array['allow_url_fopen'] = 'Fopen Wrappers must be turned on. This is a hosting setting which you or your host may be able to change by setting allow_url_fopen to "1" or "On" in php.ini'; + } if (!empty($configfile_array) || !empty($warning_array)) { ?> @@ -178,6 +182,11 @@ MySQL ' : ''); ?> + + allow_url_fopen + + ' : ''); ?> + Recommended Extensions From 3b9a66b8e109e26175cdff3e5ab658b63c65e06d Mon Sep 17 00:00:00 2001 From: gburton Date: Thu, 16 Jan 2020 22:41:45 +0000 Subject: [PATCH 06/24] Bootstrapped Page --- admin/includes/languages/english/invoice.php | 13 +- admin/invoice.php | 208 ++++++++----------- 2 files changed, 100 insertions(+), 121 deletions(-) diff --git a/admin/includes/languages/english/invoice.php b/admin/includes/languages/english/invoice.php index a1e625d0a..4cfd9a1d3 100755 --- a/admin/includes/languages/english/invoice.php +++ b/admin/includes/languages/english/invoice.php @@ -5,12 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2002 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ define('TABLE_HEADING_COMMENTS', 'Comments'); + +define('TABLE_HEADING_QTY', 'Qty'); define('TABLE_HEADING_PRODUCTS_MODEL', 'Model'); define('TABLE_HEADING_PRODUCTS', 'Products'); define('TABLE_HEADING_TAX', 'Tax'); @@ -22,9 +24,14 @@ define('ENTRY_SOLD_TO', 'SOLD TO:'); define('ENTRY_SHIP_TO', 'SHIP TO:'); -define('ENTRY_PAYMENT_METHOD', 'Payment Method:'); +define('ENTRY_PAYMENT_METHOD', 'Payment Method: %s'); define('ENTRY_SUB_TOTAL', 'Sub-Total:'); define('ENTRY_TAX', 'Tax:'); define('ENTRY_SHIPPING', 'Shipping:'); define('ENTRY_TOTAL', 'Total:'); -?> + +define('ENTRY_INVOICE_NUMBER', 'Invoice: %s'); +define('ENTRY_INVOICE_DATE', 'Date: %s'); + +define('INVOICE_THANK_YOU', '

Thank You!

'); + diff --git a/admin/invoice.php b/admin/invoice.php index 232813a91..9d99abc72 100755 --- a/admin/invoice.php +++ b/admin/invoice.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ @@ -16,131 +16,103 @@ $currencies = new currencies(); $oID = tep_db_prepare_input($_GET['oID']); - $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); + $orders_query = tep_db_query("select orders_id from orders where orders_id = '" . (int)$oID . "'"); include('includes/classes/order.php'); $order = new order($oID); + + require('includes/template_top.php'); ?> - -> - - -<?php echo TITLE; ?> - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
' . nl2br(STORE_ADDRESS) . '
' . STORE_PHONE; ?>
- - - - - - - -
- - - - - - - - - - - - - - - -
customer['format_id'], $order->billing, 1, '', '
'); ?>
customer['telephone']; ?>
customer['email_address'] . '">' . $order->customer['email_address'] . ''; ?>
- - - - - - -
delivery['format_id'], $order->delivery, 1, '', '
'); ?>
+ +
+
+
+ ' . STORE_NAME . ''; + echo '

' . nl2br(STORE_ADDRESS) . '

'; + echo '

' . STORE_PHONE . '

'; + ?> +
+
+ +
+ +
+
+
    +
  • +
  • customer['format_id'], $order->billing, 1, '', ', '); ?>
  • +
  • customer['telephone']; ?> customer['email_address']; ?>
  • +
+
+
+
    +
  • +
  • delivery['format_id'], $order->delivery, 1, '', ', '); ?>
  • +
+
+
+
    +
  • +
  • info['date_purchased'])); ?>
  • +
  • info['payment_method']); ?>
  • +
+
+
+ +
+ - - - -
info['payment_method']; ?>
- - - - - - - - + + + + + + + + -products); $i < $n; $i++) { - echo ' ' . "\n" . - ' ' . "\n" . - ' + products); $i < $n; $i++) { + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; } - echo ' ' . "\n" . - ' ' . "\n"; - echo ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n"; - echo ' ' . "\n"; - } -?> - - - -
' . $order->products[$i]['qty'] . ' x' . $order->products[$i]['name']; - - if (isset($order->products[$i]['attributes']) && (($k = sizeof($order->products[$i]['attributes'])) > 0)) { - for ($j = 0; $j < $k; $j++) { - echo '
  - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value']; - if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')'; - echo ''; - } + +
' . $order->products[$i]['qty'] . '' . $order->products[$i]['name']; + if (isset($order->products[$i]['attributes']) && (($k = sizeof($order->products[$i]['attributes'])) > 0)) { + for ($j = 0; $j < $k; $j++) { + echo '
- ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value']; + if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')'; + echo ''; + } + } + echo '
' . $order->products[$i]['model'] . '' . tep_display_tax_value($order->products[$i]['tax']) . '%' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true), true, $order->info['currency'], $order->info['currency_value']) . '' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '
' . $order->products[$i]['model'] . '' . tep_display_tax_value($order->products[$i]['tax']) . '%' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true), true, $order->info['currency'], $order->info['currency_value']) . '' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '
-totals); $i < $n; $i++) { - echo ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n"; - } -?> -
' . $order->totals[$i]['title'] . '' . $order->totals[$i]['text'] . '
- + for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) { + echo ''; + echo '' . $order->totals[$i]['title'] . ''; + echo '' . $order->totals[$i]['text'] . ''; + echo ''; + } + ?> + + + +
+ +
-
- + + From f0638904f8b07228650cdd86c41e611fd99aed6d Mon Sep 17 00:00:00 2001 From: gburton Date: Thu, 16 Jan 2020 22:57:51 +0000 Subject: [PATCH 07/24] Hook call in favour of hard code. --- admin/includes/languages/english/invoice.php | 3 --- admin/invoice.php | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/admin/includes/languages/english/invoice.php b/admin/includes/languages/english/invoice.php index 4cfd9a1d3..e2f473842 100755 --- a/admin/includes/languages/english/invoice.php +++ b/admin/includes/languages/english/invoice.php @@ -32,6 +32,3 @@ define('ENTRY_INVOICE_NUMBER', 'Invoice: %s'); define('ENTRY_INVOICE_DATE', 'Date: %s'); - -define('INVOICE_THANK_YOU', '

Thank You!

'); - diff --git a/admin/invoice.php b/admin/invoice.php index 9d99abc72..21fa485d8 100755 --- a/admin/invoice.php +++ b/admin/invoice.php @@ -106,9 +106,9 @@ -
- -
+ call('invoice', 'extraComments'); + ?> From f086087d11aa3deabeb31e4b3892fcb9d948dc2c Mon Sep 17 00:00:00 2001 From: gburton Date: Fri, 17 Jan 2020 10:44:12 +0000 Subject: [PATCH 08/24] Bootstrapped Page --- .../languages/english/packingslip.php | 9 +- admin/packingslip.php | 162 ++++++++---------- 2 files changed, 75 insertions(+), 96 deletions(-) diff --git a/admin/includes/languages/english/packingslip.php b/admin/includes/languages/english/packingslip.php index c6c7d2e75..785cd11b5 100755 --- a/admin/includes/languages/english/packingslip.php +++ b/admin/includes/languages/english/packingslip.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2002 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ @@ -13,8 +13,11 @@ define('TABLE_HEADING_COMMENTS', 'Comments'); define('TABLE_HEADING_PRODUCTS_MODEL', 'Model'); define('TABLE_HEADING_PRODUCTS', 'Products'); +define('TABLE_HEADING_QTY', 'Qty'); define('ENTRY_SOLD_TO', 'SOLD TO:'); define('ENTRY_SHIP_TO', 'SHIP TO:'); -define('ENTRY_PAYMENT_METHOD', 'Payment Method:'); -?> +define('ENTRY_PAYMENT_METHOD', 'Payment Method: %s'); + +define('ENTRY_INVOICE_NUMBER', 'Invoice: %s'); +define('ENTRY_INVOICE_DATE', 'Date: %s'); diff --git a/admin/packingslip.php b/admin/packingslip.php index 167b58e05..6ed3f98d0 100755 --- a/admin/packingslip.php +++ b/admin/packingslip.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2014 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ @@ -16,106 +16,82 @@ $currencies = new currencies(); $oID = tep_db_prepare_input($_GET['oID']); - $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); + $orders_query = tep_db_query("select orders_id from orders where orders_id = '" . (int)$oID . "'"); include('includes/classes/order.php'); $order = new order($oID); + + require('includes/template_top.php'); ?> - -> - - -<?php echo TITLE; ?> - - - - - - - - - - - - - - - - - - - - - - ' . "\n" . - ' ' . "\n" . - ' ' . "\n"; - } -?> -
- - - - -
' . nl2br(STORE_ADDRESS) . '
' . STORE_PHONE; ?>
- - - - - - - -
- - - - - - - - - - - - - - - -
customer['format_id'], $order->billing, 1, '', '
'); ?>
customer['telephone']; ?>
customer['email_address'] . '">' . $order->customer['email_address'] . ''; ?>
- - - - - - -
delivery['format_id'], $order->delivery, 1, '', '
'); ?>
+ +
+
+
+ ' . STORE_NAME . ''; + echo '

' . nl2br(STORE_ADDRESS) . '

'; + echo '

' . STORE_PHONE . '

'; + ?> +
+
+ +
+ +
+
+
    +
  • +
  • customer['format_id'], $order->billing, 1, '', '
    '); ?>
  • +
  • customer['telephone']; ?> customer['email_address']; ?>
  • +
+
+
+
    +
  • +
  • delivery['format_id'], $order->delivery, 1, '', '
    '); ?>
  • +
+
+
+
    +
  • +
  • info['date_purchased'])); ?>
  • +
  • info['payment_method']); ?>
  • +
+
+
+ +
+ - - - -
info['payment_method']; ?>
- - - + + + -products); $i<$n; $i++) { - echo ' ' . "\n" . - ' ' . "\n" . - ' + products); $i < $n; $i++) { + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; } + ?> + +
' . $order->products[$i]['qty'] . ' x' . $order->products[$i]['name']; - - if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) { - for ($j=0, $k=sizeof($order->products[$i]['attributes']); $j<$k; $j++) { - echo '
  - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value']; - echo ''; - } + +
' . $order->products[$i]['qty'] . '' . $order->products[$i]['name']; + if (isset($order->products[$i]['attributes']) && (($k = sizeof($order->products[$i]['attributes'])) > 0)) { + for ($j=0, $k=sizeof($order->products[$i]['attributes']); $j<$k; $j++) { + echo '
- ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . ''; + } + } + echo '
' . $order->products[$i]['model'] . '
+ + call('packingslip', 'extraComments'); + ?> - echo '
' . $order->products[$i]['model'] . '
- - - -
+ From 4fb688b278f8a55bd790fcbfc9e53ec798e35704 Mon Sep 17 00:00:00 2001 From: gburton Date: Fri, 17 Jan 2020 10:45:07 +0000 Subject: [PATCH 09/24] Remove pages from the usual admin layout This is subject to change in the future. --- admin/includes/template_top.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/admin/includes/template_top.php b/admin/includes/template_top.php index 82643e0b4..f7f66c2be 100755 --- a/admin/includes/template_top.php +++ b/admin/includes/template_top.php @@ -49,9 +49,13 @@ call('siteWide', 'injectLeftColumn'); + if (!in_array($PHP_SELF, $bad_pages)) { + require('includes/header.php'); + + echo $OSCOM_Hooks->call('siteWide', 'injectLeftColumn'); + } } ?> From 93f7e45e4c5927dcb17054c6e0284bc5fd5ddabb Mon Sep 17 00:00:00 2001 From: gburton Date: Fri, 17 Jan 2020 10:49:45 +0000 Subject: [PATCH 10/24] Remove Languages These languages are not being maintained at Github --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index c0501ee47..804375488 100644 --- a/README.md +++ b/README.md @@ -72,8 +72,6 @@ Language | URL | Credit & Thanks ------------ | ------------- | ------------- German | https://github.com/cupidare/OsCommerce-CE-Phoenix-German-language-Deutsches-Sprachpaket | @cupidare Spanish | https://github.com/raiwa/OSCOM-CE-Phoenix-Spanish-language-idioma-espanol | @raiwa -Russian | https://github.com/Agrosheriff/CE-Phoenix-1.0.0.4_RU | @Fredi -Dutch | https://github.com/Denkster/OSCOM-CE-Phoenix_Dutch_language_Nederlandse_taal | @Denkster ### Image Credits From ef7850717582fd6f37655d878ddc704f7700e48e Mon Sep 17 00:00:00 2001 From: gburton Date: Tue, 21 Jan 2020 18:03:26 +0000 Subject: [PATCH 11/24] Add remarks, remove date from dashboard --- admin/certified_addons.php | 4 +++- admin/includes/languages/english/certified_addons.php | 1 + .../english/modules/dashboard/d_phoenix_addons.php | 3 +-- admin/includes/modules/dashboard/d_phoenix_addons.php | 6 ++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/admin/certified_addons.php b/admin/certified_addons.php index 8d64f65e0..5bcfbae62 100644 --- a/admin/certified_addons.php +++ b/admin/certified_addons.php @@ -32,6 +32,7 @@ + @@ -45,7 +46,8 @@ echo '' . $item->title . ''; echo '' . $item->owner . ''; echo '' . tep_draw_stars($item->rating) . ''; - echo '' . date("F j, Y", strtotime($item->pubDate)) . ''; + echo '' . $item->remarks ?? ' ' . ''; + echo '' . date("j M Y", strtotime($item->pubDate)) . ''; echo ''; } ?> diff --git a/admin/includes/languages/english/certified_addons.php b/admin/includes/languages/english/certified_addons.php index a62d06936..cc6156652 100644 --- a/admin/includes/languages/english/certified_addons.php +++ b/admin/includes/languages/english/certified_addons.php @@ -15,6 +15,7 @@ define('TABLE_CERTIFIED_ADDONS_TITLE', 'Addon'); define('TABLE_CERTIFIED_ADDONS_OWNER', 'Created By'); define('TABLE_CERTIFIED_ADDONS_RATING', 'Rating'); +define('TABLE_CERTIFIED_ADDONS_REMARKS', 'Remarks'); define('TABLE_CERTIFIED_ADDONS_DATE', 'Release Date'); define('TEXT_CERTIFIED_ADDONS', '

All Addons listed here have been certified by a Phoenix Core Team member.


If you would like to have your addon certified and added to this list please contact @burt on the osCommerce forum.

'); diff --git a/admin/includes/languages/english/modules/dashboard/d_phoenix_addons.php b/admin/includes/languages/english/modules/dashboard/d_phoenix_addons.php index 19ca2447e..821a11cf7 100644 --- a/admin/includes/languages/english/modules/dashboard/d_phoenix_addons.php +++ b/admin/includes/languages/english/modules/dashboard/d_phoenix_addons.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2019 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ @@ -15,7 +15,6 @@ define('MODULE_ADMIN_DASHBOARD_PHOENIX_ADDONS_OWNER', 'By'); define('MODULE_ADMIN_DASHBOARD_PHOENIX_ADDONS_RATING', 'Rating'); -define('MODULE_ADMIN_DASHBOARD_PHOENIX_ADDONS_DATE', 'Date'); define('MODULE_ADMIN_DASHBOARD_PHOENIX_JOIN_CLUB', 'Join the Club'); define('MODULE_ADMIN_DASHBOARD_PHOENIX_VIEW_ALL', 'View full list of Certified Addons'); diff --git a/admin/includes/modules/dashboard/d_phoenix_addons.php b/admin/includes/modules/dashboard/d_phoenix_addons.php index e67a70e86..3b5de2de5 100644 --- a/admin/includes/modules/dashboard/d_phoenix_addons.php +++ b/admin/includes/modules/dashboard/d_phoenix_addons.php @@ -40,8 +40,7 @@ function getOutput() { $output .= ''; $output .= '' . tep_image('images/icon_phoenix.png', 'Phoenix') . ' ' . MODULE_ADMIN_DASHBOARD_PHOENIX_ADDONS_TITLE . ''; $output .= '' . MODULE_ADMIN_DASHBOARD_PHOENIX_ADDONS_OWNER . ''; - $output .= '' . MODULE_ADMIN_DASHBOARD_PHOENIX_ADDONS_RATING . ''; - $output .= ''. MODULE_ADMIN_DASHBOARD_PHOENIX_ADDONS_DATE . ''; + $output .= '' . MODULE_ADMIN_DASHBOARD_PHOENIX_ADDONS_RATING . ''; $output .= ''; $output .= ''; $output .= ''; @@ -51,8 +50,7 @@ function getOutput() { $output .= ''; $output .= '' . $item->title . ''; $output .= '' . $item->owner . ''; - $output .= '' . tep_draw_stars($item->rating) . ''; - $output .= '' . date("F j, Y", strtotime($item->pubDate)) . ''; + $output .= '' . tep_draw_stars($item->rating) . ''; $output .= ''; } } From 74ca02e4f026783f54ffd4cb8c53c07400563420 Mon Sep 17 00:00:00 2001 From: gburton Date: Tue, 21 Jan 2020 18:15:19 +0000 Subject: [PATCH 12/24] Add Hook Points --- admin/countries.php | 10 ++++++++++ admin/specials.php | 10 ++++++++++ admin/testimonials.php | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/admin/countries.php b/admin/countries.php index a4ff02058..8beea3317 100755 --- a/admin/countries.php +++ b/admin/countries.php @@ -13,6 +13,8 @@ require('includes/application_top.php'); $action = $_GET['action'] ?? ''; + + $OSCOM_Hooks->call('countries', 'countriesPreAction'); if (tep_not_null($action)) { switch ($action) { @@ -23,6 +25,8 @@ $address_format_id = tep_db_prepare_input($_POST['address_format_id']); tep_db_query("insert into countries (countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id) values ('" . tep_db_input($countries_name) . "', '" . tep_db_input($countries_iso_code_2) . "', '" . tep_db_input($countries_iso_code_3) . "', '" . (int)$address_format_id . "')"); + + $OSCOM_Hooks->call('countries', 'countriesActionInsert'); tep_redirect(tep_href_link('countries.php')); break; @@ -34,6 +38,8 @@ $address_format_id = tep_db_prepare_input($_POST['address_format_id']); tep_db_query("update countries set countries_name = '" . tep_db_input($countries_name) . "', countries_iso_code_2 = '" . tep_db_input($countries_iso_code_2) . "', countries_iso_code_3 = '" . tep_db_input($countries_iso_code_3) . "', address_format_id = '" . (int)$address_format_id . "' where countries_id = '" . (int)$countries_id . "'"); + + $OSCOM_Hooks->call('countries', 'countriesActionSave'); tep_redirect(tep_href_link('countries.php', 'page=' . $_GET['page'] . '&cID=' . $countries_id)); break; @@ -41,11 +47,15 @@ $countries_id = tep_db_prepare_input($_GET['cID']); tep_db_query("delete from countries where countries_id = '" . (int)$countries_id . "'"); + + $OSCOM_Hooks->call('countries', 'countriesActionDelete'); tep_redirect(tep_href_link('countries.php', 'page=' . $_GET['page'])); break; } } + + $OSCOM_Hooks->call('countries', 'countriesPostAction'); require('includes/template_top.php'); ?> diff --git a/admin/specials.php b/admin/specials.php index 4b0e541f9..d9ef97979 100755 --- a/admin/specials.php +++ b/admin/specials.php @@ -16,6 +16,8 @@ $currencies = new currencies(); $action = $_GET['action'] ?? ''; + + $OSCOM_Hooks->call('specials', 'specialsPreAction'); if (tep_not_null($action)) { switch ($action) { @@ -44,6 +46,8 @@ } tep_db_query("insert into specials (products_id, specials_new_products_price, specials_date_added, expires_date, status) values ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), " . (tep_not_null($expires_date) ? "'" . tep_db_input($expires_date) . "'" : 'null') . ", '1')"); + + $OSCOM_Hooks->call('specials', 'specialsActionInsert'); tep_redirect(tep_href_link('specials.php', 'page=' . $_GET['page'])); break; @@ -61,6 +65,8 @@ } tep_db_query("update specials set specials_new_products_price = '" . tep_db_input($specials_price) . "', specials_last_modified = now(), expires_date = " . (tep_not_null($expires_date) ? "'" . tep_db_input($expires_date) . "'" : 'null') . " where specials_id = '" . (int)$specials_id . "'"); + + $OSCOM_Hooks->call('specials', 'specialsActionUpdate'); tep_redirect(tep_href_link('specials.php', 'page=' . $_GET['page'] . '&sID=' . $specials_id)); break; @@ -68,11 +74,15 @@ $specials_id = tep_db_prepare_input($_GET['sID']); tep_db_query("delete from specials where specials_id = '" . (int)$specials_id . "'"); + + $OSCOM_Hooks->call('specials', 'specialsActionDelete'); tep_redirect(tep_href_link('specials.php', 'page=' . $_GET['page'])); break; } } + + $OSCOM_Hooks->call('specials', 'specialsPostAction'); require('includes/template_top.php'); ?> diff --git a/admin/testimonials.php b/admin/testimonials.php index caf043847..126f0237b 100644 --- a/admin/testimonials.php +++ b/admin/testimonials.php @@ -13,6 +13,8 @@ require('includes/application_top.php'); $action = $_GET['action'] ?? ''; + + $OSCOM_Hooks->call('testimonials', 'testimonialsPreAction'); if (tep_not_null($action)) { switch ($action) { @@ -35,6 +37,8 @@ tep_db_query("update testimonials set customers_id = '" . (int)$customers_id . "', customers_name = '" . tep_db_input($customers_name) . "', testimonials_status = '" . tep_db_input($testimonials_status) . "', last_modified = now() where testimonials_id = '" . (int)$testimonials_id . "'"); tep_db_query("update testimonials_description set testimonials_text = '" . tep_db_input($testimonials_text) . "' where testimonials_id = '" . (int)$testimonials_id . "'"); + $OSCOM_Hooks->call('testimonials', 'testimonialsActionUpdate'); + tep_redirect(tep_href_link('testimonials.php', 'page=' . $_GET['page'] . '&tID=' . $testimonials_id)); break; case 'deleteconfirm': @@ -42,6 +46,8 @@ tep_db_query("delete from testimonials where testimonials_id = '" . (int)$testimonials_id . "'"); tep_db_query("delete from testimonials_description where testimonials_id = '" . (int)$testimonials_id . "'"); + + $OSCOM_Hooks->call('testimonials', 'testimonialsActionDelete'); tep_redirect(tep_href_link('testimonials.php', 'page=' . $_GET['page'])); break; @@ -54,11 +60,15 @@ tep_db_query("insert into testimonials (customers_id, customers_name, date_added, testimonials_status) values ('" . $customers_id . "', '" . tep_db_input($customers_name) . "', now(), 1)"); $insert_id = tep_db_insert_id(); tep_db_query("insert into testimonials_description (testimonials_id, languages_id, testimonials_text) values ('" . (int)$insert_id . "', '" . (int)$languages_id . "', '" . tep_db_input($testimonial) . "')"); + + $OSCOM_Hooks->call('testimonials', 'testimonialsActionSave'); tep_redirect(tep_href_link('testimonials.php', tep_get_all_get_params(array('action')))); break; } } + + $OSCOM_Hooks->call('testimonials', 'testimonialsPostAction'); require('includes/template_top.php'); ?> From 8843c732a05b64c04d85496e38fd8353919cb32b Mon Sep 17 00:00:00 2001 From: ecartz Date: Wed, 22 Jan 2020 06:56:49 -0500 Subject: [PATCH 13/24] Default image If there is a default image configured and the image source is not a valid file, replace the image source with the default image. Add configuration for the default image. Default to blank so it doesn't do anything. --- includes/functions/html_output.php | 8 +++++--- install/oscommerce.sql | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/functions/html_output.php b/includes/functions/html_output.php index 849410ebe..ff22a5fac 100755 --- a/includes/functions/html_output.php +++ b/includes/functions/html_output.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2018 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ @@ -74,7 +74,9 @@ function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $ad //// // The HTML image wrapper function function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '', $responsive = true, $bootstrap_css = '') { - if ( (empty($src) || ($src == 'images/')) && (IMAGE_REQUIRED == 'false') ) { + if (defined('DEFAULT_IMAGE') && tep_not_null(DEFAULT_IMAGE) && (!file_exists(DIR_FS_CATALOG . $src) || !is_file(DIR_FS_CATALOG . $src))) { + $src = DEFAULT_IMAGE; + } elseif ( (empty($src) || ($src == 'images/')) && (IMAGE_REQUIRED == 'false') ) { return false; } @@ -412,4 +414,4 @@ function tep_draw_stars($rating = 0) { return '' . $stars . ''; } - \ No newline at end of file + diff --git a/install/oscommerce.sql b/install/oscommerce.sql index a1fc3f69e..81fdc29ae 100755 --- a/install/oscommerce.sql +++ b/install/oscommerce.sql @@ -3,7 +3,7 @@ # osCommerce, Open Source E-Commerce Solutions # http://www.oscommerce.com # -# Copyright (c) 2019 osCommerce +# Copyright (c) 2020 osCommerce # # Released under the GNU General Public License # @@ -686,6 +686,7 @@ INSERT INTO configuration (configuration_title, configuration_key, configuration INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Heading Image Height', 'HEADING_IMAGE_HEIGHT', '40', 'The pixel height of heading images', '4', '4', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Calculate Image Size', 'CONFIG_CALCULATE_IMAGE_SIZE', 'true', 'Calculate the size of images?', '4', '7', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Image Required', 'IMAGE_REQUIRED', 'true', 'Enable to display broken images. Good for development.', '4', '8', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now()); +INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Default Image', 'DEFAULT_IMAGE', '', 'The default image to show if the image is not a valid file. Leave blank not to show a default.', '4', '5', NOW()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Gender', 'ACCOUNT_GENDER', 'true', 'Display gender in the customers account', '5', '1', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Date of Birth', 'ACCOUNT_DOB', 'true', 'Display date of birth in the customers account', '5', '2', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now()); From adaf7128ef251142c970d29351331664caa5ea69 Mon Sep 17 00:00:00 2001 From: gburton Date: Wed, 22 Jan 2020 12:43:39 +0000 Subject: [PATCH 14/24] Show extra data about Hooks --- .../languages/english/modules_hooks.php | 8 +++++++- admin/modules_hooks.php | 20 +++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/admin/includes/languages/english/modules_hooks.php b/admin/includes/languages/english/modules_hooks.php index 78d770a52..8fd1e5bbb 100644 --- a/admin/includes/languages/english/modules_hooks.php +++ b/admin/includes/languages/english/modules_hooks.php @@ -5,11 +5,17 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2016 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ define('HEADING_TITLE', 'Hooks'); +define('TABLE_HEADING_LOCATION', '%s'); +define('TABLE_HEADING_GROUP', 'Group'); +define('TABLE_HEADING_FILE', 'File'); +define('TABLE_HEADING_METHOD', 'Method'); +define('TABLE_HEADING_VERSION', 'Version'); + define('TEXT_HOOKS_DIRECTORY', 'Hooks Directory:'); diff --git a/admin/modules_hooks.php b/admin/modules_hooks.php index 577a4f8bf..14fc0bdf1 100644 --- a/admin/modules_hooks.php +++ b/admin/modules_hooks.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2016 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ @@ -28,7 +28,15 @@ ?> - + + + + + + + + + @@ -50,11 +58,15 @@ $obj = new $class(); foreach ( get_class_methods($obj) as $method ) { + $obj_vars = get_class_vars(get_class($obj)); + if ( substr($method, 0, 7) == 'listen_' ) { ?> - - + + + + Date: Wed, 22 Jan 2020 21:24:25 +0000 Subject: [PATCH 15/24] Update Readme add certified developer --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 804375488..9585e8584 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,11 @@ https://template.me.uk/phoenix/index.php | https://template.me.uk/supporters/ind Name | URL | Services Offered ------------ | ------------- | ------------- Rainer | https://www.oscaddons.com/index.php/en | Providing all kinds of support for CE Phoenix online stores. You will find Add-Ons which add functionality and features to your store. Completely free Add-Ons and a selection of commercial Add-Ons at very affordable prices exclusive to my website. On the other hand you can count on installation and programming services at very competitive prices. Visit my website and feel free to contact me - English, Deutsch and Español. +John | https://sewebsites.net/ | Custom jobs, big or small, including adapting existing addons to CE Phoenix. Integration of stock systems and new payment methods. Addons both free and great value, soon to be added to the site. ### Support the Project -If you or your employer is commercially dependent on Phoenix (or a previous incarnation), please help to sponsor continual forward movement in the code-base. Phoenix needs you as much as you need Phoenix! I am hopeful that all shopowners, developers, consultants and businesses will support the Project ... allowing two professional developers to work on the code on an ad-hoc basis. - -A Supporter's subscription includes access to the current season of Supporters code as seen at the Supporters Demo shop; https://template.me.uk/supporters/index.php +If you or your employer is commercially dependent on Phoenix (or a previous incarnation), please help to sponsor continual forward movement in the code-base. Phoenix needs you as much as you need Phoenix! I am hopeful that all shopowners, developers, consultants and businesses will support the Project ... allowing two professional developers to work on the code on an ad-hoc basis. A Supporters subscription includes access to the current season of Supporters code as seen at the Supporters Demo shop; https://template.me.uk/supporters/index.php ### Join the Phoenix Club From be1bfc89986072db36f3dccec61bdfd24da82f26 Mon Sep 17 00:00:00 2001 From: ecartz Date: Thu, 23 Jan 2020 01:55:17 -0500 Subject: [PATCH 16/24] Email needs urlencode An email can contain symbols that have special meaning in URLs, like plus signs. --- password_reset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/password_reset.php b/password_reset.php index cb976bc46..c76dee814 100644 --- a/password_reset.php +++ b/password_reset.php @@ -95,7 +95,7 @@ } ?> - +
From ccb26c89ef094c9297110b73d6752eea45357056 Mon Sep 17 00:00:00 2001 From: Mark Fleeson Date: Fri, 24 Jan 2020 13:22:35 +0000 Subject: [PATCH 17/24] Update oscommerce.sql (cherry picked from commit 138f499fdb42ab1b555da10eb9dbd527f7943839) --- install/oscommerce.sql | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/install/oscommerce.sql b/install/oscommerce.sql index 81fdc29ae..266f5fe26 100755 --- a/install/oscommerce.sql +++ b/install/oscommerce.sql @@ -66,7 +66,7 @@ CREATE TABLE administrators ( DROP TABLE IF EXISTS categories; CREATE TABLE categories ( categories_id int NOT NULL auto_increment, - categories_image varchar(64), + categories_image varchar(255), parent_id int DEFAULT '0' NOT NULL, sort_order int(3), date_added datetime, @@ -79,11 +79,11 @@ DROP TABLE IF EXISTS categories_description; CREATE TABLE categories_description ( categories_id int DEFAULT '0' NOT NULL, language_id int DEFAULT '1' NOT NULL, - categories_name varchar(32) NOT NULL, + categories_name varchar(255) NOT NULL, categories_description TEXT NULL, categories_seo_description TEXT NULL, - categories_seo_keywords VARCHAR(128) NULL, - categories_seo_title VARCHAR(128) NULL, + categories_seo_keywords VARCHAR(255) NULL, + categories_seo_title VARCHAR(255) NULL, PRIMARY KEY (categories_id, language_id), KEY idx_categories_name (categories_name) ) CHARACTER SET utf8 COLLATE utf8_unicode_ci; @@ -223,8 +223,8 @@ CREATE TABLE languages ( DROP TABLE IF EXISTS manufacturers; CREATE TABLE manufacturers ( manufacturers_id int NOT NULL auto_increment, - manufacturers_name varchar(32) NOT NULL, - manufacturers_image varchar(64), + manufacturers_name varchar(255) NOT NULL, + manufacturers_image varchar(255), date_added datetime NULL, last_modified datetime NULL, PRIMARY KEY (manufacturers_id), @@ -240,8 +240,8 @@ CREATE TABLE manufacturers_info ( date_last_click datetime NULL, manufacturers_description TEXT NULL, manufacturers_seo_description TEXT NULL, - manufacturers_seo_keywords VARCHAR(128) NULL, - manufacturers_seo_title VARCHAR(128) NULL, + manufacturers_seo_keywords VARCHAR(255) NULL, + manufacturers_seo_title VARCHAR(255) NULL, PRIMARY KEY (manufacturers_id, languages_id) ) CHARACTER SET utf8 COLLATE utf8_unicode_ci; @@ -311,8 +311,8 @@ CREATE TABLE orders_products ( orders_products_id int NOT NULL auto_increment, orders_id int NOT NULL, products_id int NOT NULL, - products_model varchar(64), - products_name varchar(64) NOT NULL, + products_model varchar(255), + products_name varchar(255) NOT NULL, products_price decimal(15,4) NOT NULL, final_price decimal(15,4) NOT NULL, products_tax decimal(7,4) NOT NULL, @@ -350,8 +350,8 @@ CREATE TABLE orders_products_attributes ( orders_products_attributes_id int NOT NULL auto_increment, orders_id int NOT NULL, orders_products_id int NOT NULL, - products_options varchar(32) NOT NULL, - products_options_values varchar(32) NOT NULL, + products_options varchar(255) NOT NULL, + products_options_values varchar(255) NOT NULL, options_values_price decimal(15,4) NOT NULL, price_prefix char(1) NOT NULL, PRIMARY KEY (orders_products_attributes_id), @@ -387,8 +387,8 @@ DROP TABLE IF EXISTS products; CREATE TABLE products ( products_id int NOT NULL auto_increment, products_quantity int(4) NOT NULL, - products_model varchar(64), - products_image varchar(64), + products_model varchar(255), + products_image varchar(255), products_price decimal(15,4) NOT NULL, products_date_added datetime NOT NULL, products_last_modified datetime, @@ -429,13 +429,13 @@ DROP TABLE IF EXISTS products_description; CREATE TABLE products_description ( products_id int NOT NULL auto_increment, language_id int NOT NULL default '1', - products_name varchar(64) NOT NULL default '', + products_name varchar(255) NOT NULL default '', products_description text, products_url varchar(255) default NULL, products_viewed int(5) default '0', products_seo_description text NULL, - products_seo_keywords varchar(128) NULL, - products_seo_title varchar(128) NULL, + products_seo_keywords varchar(255) NULL, + products_seo_title varchar(255) NULL, PRIMARY KEY (products_id,language_id), KEY products_name (products_name) ) CHARACTER SET utf8 COLLATE utf8_unicode_ci; @@ -444,7 +444,7 @@ DROP TABLE IF EXISTS products_images; CREATE TABLE products_images ( id int NOT NULL auto_increment, products_id int NOT NULL, - image varchar(64), + image varchar(255), htmlcontent text, sort_order int NOT NULL, PRIMARY KEY (id), @@ -463,7 +463,7 @@ DROP TABLE IF EXISTS products_options; CREATE TABLE products_options ( products_options_id int NOT NULL default '0', language_id int NOT NULL default '1', - products_options_name varchar(32) NOT NULL default '', + products_options_name varchar(255) NOT NULL default '', PRIMARY KEY (products_options_id,language_id) ) CHARACTER SET utf8 COLLATE utf8_unicode_ci; @@ -471,7 +471,7 @@ DROP TABLE IF EXISTS products_options_values; CREATE TABLE products_options_values ( products_options_values_id int NOT NULL default '0', language_id int NOT NULL default '1', - products_options_values_name varchar(64) NOT NULL default '', + products_options_values_name varchar(255) NOT NULL default '', PRIMARY KEY (products_options_values_id,language_id) ) CHARACTER SET utf8 COLLATE utf8_unicode_ci; From a6214efdf43122eb3b4c5bfd64aee4dc0bb3228b Mon Sep 17 00:00:00 2001 From: ecartz Date: Sun, 26 Jan 2020 09:59:04 -0500 Subject: [PATCH 18/24] Selectable address labels Make the addresses labels for their associated radio buttons so that clicking the address selects the radio input. https://github.com/gburton/CE-Phoenix/issues/893 --- checkout_payment_address.php | 2 +- checkout_shipping_address.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/checkout_payment_address.php b/checkout_payment_address.php index faebfe617..cc6237a02 100644 --- a/checkout_payment_address.php +++ b/checkout_payment_address.php @@ -222,7 +222,7 @@ $format_id = tep_get_address_format_id($addresses['country_id']); ?> - +
diff --git a/checkout_shipping_address.php b/checkout_shipping_address.php index 6024956f4..6e6c6be10 100644 --- a/checkout_shipping_address.php +++ b/checkout_shipping_address.php @@ -234,7 +234,7 @@ $format_id = tep_get_address_format_id($addresses['country_id']); ?> - +
From c5d5cf5049f0181d28dc1f51d02fcecefd00e856 Mon Sep 17 00:00:00 2001 From: gburton Date: Sun, 26 Jan 2020 22:52:32 +0000 Subject: [PATCH 19/24] Txt update --- includes/languages/english/modules/header_tags/ht_canonical.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/languages/english/modules/header_tags/ht_canonical.php b/includes/languages/english/modules/header_tags/ht_canonical.php index bdf9b23c2..3da69245a 100644 --- a/includes/languages/english/modules/header_tags/ht_canonical.php +++ b/includes/languages/english/modules/header_tags/ht_canonical.php @@ -11,5 +11,5 @@ */ define('MODULE_HEADER_TAGS_CANONICAL_TITLE', 'Canonical Links'); - define('MODULE_HEADER_TAGS_CANONICAL_DESCRIPTION', 'Add canonical links to category/product pages.
Please note that hreflang attributes are not supported in this module which will affect you if you have more than one language in your shop.

You should seek the advice of a good SEO advisor (eg Jack_mcs in the main osCommerce forum).
'); + define('MODULE_HEADER_TAGS_CANONICAL_DESCRIPTION', 'Add canonical links to category/product pages.
Please note that hreflang attributes are not supported in this module which will affect you if you have more than one language in your shop.

You should seek the advice of a good developer or ask in the Phoenix Club.
'); \ No newline at end of file From 4890fb6355f04cff8585ab7c0b750f759924588a Mon Sep 17 00:00:00 2001 From: ecartz Date: Mon, 27 Jan 2020 01:38:30 -0500 Subject: [PATCH 20/24] Deprecate tep_class_exists() Deprecate the tep_class_exists function, which is now just a wrapper for class_exists. Will allow the function to be deleted in some future version. --- admin/action_recorder.php | 2 +- admin/includes/modules/dashboard/d_security_checks.php | 4 ++-- admin/modules.php | 2 +- admin/modules_content.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/admin/action_recorder.php b/admin/action_recorder.php index 27359c2c4..53b0655fd 100755 --- a/admin/action_recorder.php +++ b/admin/action_recorder.php @@ -36,7 +36,7 @@ include(DIR_FS_CATALOG_MODULES . 'action_recorder/' . $file); $class = substr($file, 0, strrpos($file, '.')); - if (tep_class_exists($class)) { + if (class_exists($class)) { ${$class} = new $class; } } diff --git a/admin/includes/modules/dashboard/d_security_checks.php b/admin/includes/modules/dashboard/d_security_checks.php index 49ce39f7c..fec6c736e 100755 --- a/admin/includes/modules/dashboard/d_security_checks.php +++ b/admin/includes/modules/dashboard/d_security_checks.php @@ -55,7 +55,7 @@ function getOutput() { include(DIR_FS_ADMIN . 'includes/modules/security_check/' . $secmodule); $secclass = 'securityCheck_' . substr($secmodule, 0, strrpos($secmodule, '.')); - if (tep_class_exists($secclass)) { + if (class_exists($secclass)) { $secCheck = new $secclass; if ( !$secCheck->pass() ) { @@ -123,4 +123,4 @@ function keys() { return array('MODULE_ADMIN_DASHBOARD_SECURITY_CHECKS_STATUS', 'MODULE_ADMIN_DASHBOARD_SECURITY_CHECKS_CONTENT_WIDTH', 'MODULE_ADMIN_DASHBOARD_SECURITY_CHECKS_SORT_ORDER'); } } - \ No newline at end of file + diff --git a/admin/modules.php b/admin/modules.php index 21a9b73b5..44ae34207 100755 --- a/admin/modules.php +++ b/admin/modules.php @@ -148,7 +148,7 @@ include($module_directory . $file); $class = substr($file, 0, strrpos($file, '.')); - if (tep_class_exists($class)) { + if (class_exists($class)) { $module = new $class; if ($module->check() > 0) { if (($module->sort_order > 0) && !isset($installed_modules[$module->sort_order])) { diff --git a/admin/modules_content.php b/admin/modules_content.php index 3173696bd..7ce26d89c 100755 --- a/admin/modules_content.php +++ b/admin/modules_content.php @@ -32,7 +32,7 @@ if (substr($file, strrpos($file, '.')) == $file_extension) { $class = substr($file, 0, strrpos($file, '.')); - if (!tep_class_exists($class)) { + if (!class_exists($class)) { if ( file_exists(DIR_FS_CATALOG_LANGUAGES . $language . '/modules/content/' . $group . '/' . $file) ) { include(DIR_FS_CATALOG_LANGUAGES . $language . '/modules/content/' . $group . '/' . $file); } @@ -40,7 +40,7 @@ include(DIR_FS_CATALOG_MODULES . 'content/' . $group . '/' . $file); } - if (tep_class_exists($class)) { + if (class_exists($class)) { $module = new $class(); if (in_array($group . '/' . $class, $modules_installed)) { From eafcf49f3968bcaec6925159e08691a381e0604b Mon Sep 17 00:00:00 2001 From: gburton Date: Tue, 28 Jan 2020 13:45:05 +0000 Subject: [PATCH 21/24] Bootstrapped Page Required changes to two modules --- .../modules/newsletters/newsletter.php | 3 +- .../newsletters/product_notification.php | 3 +- .../languages/english/newsletters.php | 14 +- .../modules/newsletters/newsletter.php | 52 ++- .../newsletters/product_notification.php | 100 ++--- admin/newsletters.php | 341 +++++++++--------- 6 files changed, 260 insertions(+), 253 deletions(-) diff --git a/admin/includes/languages/english/modules/newsletters/newsletter.php b/admin/includes/languages/english/modules/newsletters/newsletter.php index 62a1d2995..375176f3d 100755 --- a/admin/includes/languages/english/modules/newsletters/newsletter.php +++ b/admin/includes/languages/english/modules/newsletters/newsletter.php @@ -5,10 +5,9 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2002 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ define('TEXT_COUNT_CUSTOMERS', 'Customers receiving newsletter: %s'); -?> \ No newline at end of file diff --git a/admin/includes/languages/english/modules/newsletters/product_notification.php b/admin/includes/languages/english/modules/newsletters/product_notification.php index 29ce42318..84faa90e3 100755 --- a/admin/includes/languages/english/modules/newsletters/product_notification.php +++ b/admin/includes/languages/english/modules/newsletters/product_notification.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2002 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ @@ -21,4 +21,3 @@ define('BUTTON_UNSELECT', '<<<'); define('BUTTON_SUBMIT', 'Submit'); define('BUTTON_CANCEL', 'Cancel'); -?> \ No newline at end of file diff --git a/admin/includes/languages/english/newsletters.php b/admin/includes/languages/english/newsletters.php index 4328d8d63..df648d69a 100755 --- a/admin/includes/languages/english/newsletters.php +++ b/admin/includes/languages/english/newsletters.php @@ -5,16 +5,17 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2002 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ define('HEADING_TITLE', 'Newsletter Manager'); -define('TABLE_HEADING_NEWSLETTERS', 'Newsletters'); +define('TABLE_HEADING_NEWSLETTERS', 'Name'); +define('TABLE_HEADING_DATE_ADDED', 'Date Added'); define('TABLE_HEADING_SIZE', 'Size'); -define('TABLE_HEADING_MODULE', 'Module'); +define('TABLE_HEADING_MODULE', 'Type'); define('TABLE_HEADING_SENT', 'Sent'); define('TABLE_HEADING_STATUS', 'Status'); define('TABLE_HEADING_ACTION', 'Action'); @@ -23,8 +24,8 @@ define('TEXT_NEWSLETTER_TITLE', 'Newsletter Title:'); define('TEXT_NEWSLETTER_CONTENT', 'Content:'); -define('TEXT_NEWSLETTER_DATE_ADDED', 'Date Added:'); -define('TEXT_NEWSLETTER_DATE_SENT', 'Date Sent:'); +define('TEXT_NEWSLETTER_DATE_ADDED', 'Date Added: %s'); +define('TEXT_NEWSLETTER_DATE_SENT', 'Date Sent: %s'); define('TEXT_INFO_DELETE_INTRO', 'Are you sure you want to delete this newsletter?'); @@ -38,3 +39,6 @@ define('ERROR_SEND_UNLOCKED_NEWSLETTER', 'Error: Please lock the newsletter before sending it.'); define('ERROR_NEWSLETTER_MODULE_NOT_EXISTS', 'Error: Module does not exist'); + +define('TEXT_TITLE', 'Title:'); +define('TEXT_CONTENT', 'Content:'); diff --git a/admin/includes/modules/newsletters/newsletter.php b/admin/includes/modules/newsletters/newsletter.php index dfee4a4ab..d6ebe6599 100755 --- a/admin/includes/modules/newsletters/newsletter.php +++ b/admin/includes/modules/newsletters/newsletter.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2002 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ @@ -24,38 +24,32 @@ function choose_audience() { } function confirm() { - $mail_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'"); + $mail_query = tep_db_query("select count(*) as count from customers where customers_newsletter = '1'"); $mail = tep_db_fetch_array($mail_query); - - $confirm_string = '' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - '
' . sprintf(TEXT_COUNT_CUSTOMERS, $mail['count']) . '
' . tep_draw_separator('pixel_trans.gif', '1', '10') . '
' . $this->title . '
' . tep_draw_separator('pixel_trans.gif', '1', '10') . '
' . nl2br($this->content) . '
' . tep_draw_separator('pixel_trans.gif', '1', '10') . '
' . tep_draw_button(IMAGE_SEND, 'mail-closed', tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'] . '&action=confirm_send'), 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'])) . '
'; + + $confirm_string = null; + + $confirm_string .= ''; + $confirm_string .= ''; + $confirm_string .= ''; + $confirm_string .= ''; + $confirm_string .= ''; + $confirm_string .= ''; + $confirm_string .= ''; + $confirm_string .= ''; + $confirm_string .= ''; + $confirm_string .= '
' . TEXT_TITLE . '' . $this->title . '
' . TEXT_CONTENT . '' . $this->content . '
'; + + $confirm_string .= '
'; + $confirm_string .= tep_draw_bootstrap_button(IMAGE_SEND, 'fas fa-paper-plane', tep_href_link('newsletters.php', 'page=' . (int)$_GET['page'] . '&nID=' . (int)$_GET['nID'] . '&action=confirm_send'), 'primary', null, 'btn-success btn-block btn-lg xxx text-white'); + $confirm_string .= tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-angle-left', tep_href_link('newsletters.php', 'page=' . (int)$_GET['page'] . '&nID=' . (int)$_GET['nID']), null, null, 'btn-light mt-2'); + $confirm_string .= '
'; return $confirm_string; } function send($newsletter_id) { - $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'"); + $mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from customers where customers_newsletter = '1'"); $mimemessage = new email(); @@ -73,7 +67,7 @@ function send($newsletter_id) { } $newsletter_id = tep_db_prepare_input($newsletter_id); - tep_db_query("update " . TABLE_NEWSLETTERS . " set date_sent = now(), status = '1' where newsletters_id = '" . tep_db_input($newsletter_id) . "'"); + tep_db_query("update newsletters set date_sent = now(), status = '1' where newsletters_id = '" . tep_db_input($newsletter_id) . "'"); } } -?> + \ No newline at end of file diff --git a/admin/includes/modules/newsletters/product_notification.php b/admin/includes/modules/newsletters/product_notification.php index ba49c42e4..f0efb05a8 100755 --- a/admin/includes/modules/newsletters/product_notification.php +++ b/admin/includes/modules/newsletters/product_notification.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2002 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ @@ -23,13 +23,13 @@ function choose_audience() { global $languages_id; $products_array = array(); - $products_query = tep_db_query("select pd.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.language_id = '" . $languages_id . "' and pd.products_id = p.products_id and p.products_status = '1' order by pd.products_name"); + $products_query = tep_db_query("select pd.products_id, pd.products_name from products p, products_description pd where pd.language_id = '" . $languages_id . "' and pd.products_id = p.products_id and p.products_status = '1' order by pd.products_name"); while ($products = tep_db_fetch_array($products_query)) { $products_array[] = array('id' => $products['products_id'], 'text' => $products['products_name']); } -$choose_audience_string = ''; - $global_button = tep_draw_button(BUTTON_GLOBAL, 'circle-triangle-n', tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'] . '&action=confirm&global=true'), 'primary'); - - $cancel_button = tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'])); - - $choose_audience_string .= '
' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - '
' . TEXT_PRODUCTS . '
' . tep_draw_pull_down_menu('products', $products_array, '', 'size="20" style="width: 20em;" multiple') . '
 
' . $global_button . '







' . tep_draw_button(IMAGE_SEND, 'mail-closed', null, 'primary') . '

' . $cancel_button . '
' . TEXT_SELECTED_PRODUCTS . '
' . tep_draw_pull_down_menu('chosen[]', array(), '', 'size="20" style="width: 20em;" multiple') . '
'; + $choose_audience_string .= '
'; + $choose_audience_string .= '
'; + $choose_audience_string .= '
'; + $choose_audience_string .= '
' . TEXT_PRODUCTS . '
'; + $choose_audience_string .= tep_draw_pull_down_menu('products', $products_array, '', 'class="custom-select" size="20" multiple'); + $choose_audience_string .= '
'; + $choose_audience_string .= '
'; + $choose_audience_string .= tep_draw_bootstrap_button(BUTTON_GLOBAL, 'fas fa-globe', tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'] . '&action=confirm&global=true'), 'primary', null, 'btn-info xxx text-white'); + $choose_audience_string .= '

'; + $choose_audience_string .= ''; + $choose_audience_string .= '

'; + $choose_audience_string .= ''; + $choose_audience_string .= '
'; + $choose_audience_string .= '
'; + $choose_audience_string .= '
' . TEXT_SELECTED_PRODUCTS . '
'; + $choose_audience_string .= tep_draw_pull_down_menu('chosen[]', array(), '', 'class="custom-select" size="20" multiple'); + $choose_audience_string .= '
'; + $choose_audience_string .= '
'; + + $choose_audience_string .= tep_draw_bootstrap_button(IMAGE_SEND, 'fas fa-paper-plane', null, 'primary', null, 'btn-success btn-lg btn-block xxx text-white'); + $choose_audience_string .= tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-angle-left', tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $_GET['nID']), null, null, 'btn-light mt-2'); + $choose_audience_string .= '
'; return $choose_audience_string; } @@ -92,12 +103,12 @@ function confirm() { $audience = array(); if (isset($_GET['global']) && ($_GET['global'] == 'true')) { - $products_query = tep_db_query("select distinct customers_id from " . TABLE_PRODUCTS_NOTIFICATIONS); + $products_query = tep_db_query("select distinct customers_id from products_notifications"); while ($products = tep_db_fetch_array($products_query)) { $audience[$products['customers_id']] = '1'; } - $customers_query = tep_db_query("select customers_info_id from " . TABLE_CUSTOMERS_INFO . " where global_product_notifications = '1'"); + $customers_query = tep_db_query("select customers_info_id from customers_info where global_product_notifications = '1'"); while ($customers = tep_db_fetch_array($customers_query)) { $audience[$customers['customers_info_id']] = '1'; } @@ -106,38 +117,30 @@ function confirm() { $ids = implode(',', $chosen); - $products_query = tep_db_query("select distinct customers_id from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id in (" . $ids . ")"); + $products_query = tep_db_query("select distinct customers_id from products_notifications where products_id in (" . $ids . ")"); while ($products = tep_db_fetch_array($products_query)) { $audience[$products['customers_id']] = '1'; } - $customers_query = tep_db_query("select customers_info_id from " . TABLE_CUSTOMERS_INFO . " where global_product_notifications = '1'"); + $customers_query = tep_db_query("select customers_info_id from customers_info where global_product_notifications = '1'"); while ($customers = tep_db_fetch_array($customers_query)) { $audience[$customers['customers_info_id']] = '1'; } } - $confirm_string = '' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . tep_draw_form('confirm', 'newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'] . '&action=confirm_send') . "\n" . - ' ' . "\n" . - ' ' . "\n" . - '
' . sprintf(TEXT_COUNT_CUSTOMERS, sizeof($audience)) . '
' . tep_draw_separator('pixel_trans.gif', '1', '10') . '
' . $this->title . '
' . tep_draw_separator('pixel_trans.gif', '1', '10') . '
' . nl2br($this->content) . '
' . tep_draw_separator('pixel_trans.gif', '1', '10') . '
'; + $confirm_string = '
' . sprintf(TEXT_COUNT_CUSTOMERS, sizeof($audience)) . '
'; + + $confirm_string .= ''; + $confirm_string .= ''; + $confirm_string .= ''; + $confirm_string .= ''; + $confirm_string .= ''; + $confirm_string .= ''; + $confirm_string .= ''; + $confirm_string .= ''; + $confirm_string .= ''; + $confirm_string .= '
' . TEXT_TITLE . '' . $this->title . '
' . TEXT_CONTENT . '' . $this->content . '
'; + if (sizeof($audience) > 0) { if (isset($_GET['global']) && ($_GET['global'] == 'true')) { $confirm_string .= tep_draw_hidden_field('global', 'true'); @@ -146,11 +149,10 @@ function confirm() { $confirm_string .= tep_draw_hidden_field('chosen[]', $chosen[$i]); } } - $confirm_string .= tep_draw_button(IMAGE_SEND, 'mail-closed', null, 'primary'); + $confirm_string .= tep_draw_bootstrap_button(IMAGE_SEND, 'fas fa-paper-plane', null, 'primary', null, 'btn-success btn-block btn-lg'); } - $confirm_string .= tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'] . '&action=send')) . '
'; + + $confirm_string .= tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-angle-left', tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'] . '&action=send'), 'primary', null, 'btn-light mt-2'); return $confirm_string; } @@ -159,14 +161,14 @@ function send($newsletter_id) { $audience = array(); if (isset($_POST['global']) && ($_POST['global'] == 'true')) { - $products_query = tep_db_query("select distinct pn.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where c.customers_id = pn.customers_id"); + $products_query = tep_db_query("select distinct pn.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from customers c, products_notifications pn where c.customers_id = pn.customers_id"); while ($products = tep_db_fetch_array($products_query)) { $audience[$products['customers_id']] = array('firstname' => $products['customers_firstname'], 'lastname' => $products['customers_lastname'], 'email_address' => $products['customers_email_address']); } - $customers_query = tep_db_query("select c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_INFO . " ci where c.customers_id = ci.customers_info_id and ci.global_product_notifications = '1'"); + $customers_query = tep_db_query("select c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from customers c, customers_info ci where c.customers_id = ci.customers_info_id and ci.global_product_notifications = '1'"); while ($customers = tep_db_fetch_array($customers_query)) { $audience[$customers['customers_id']] = array('firstname' => $customers['customers_firstname'], 'lastname' => $customers['customers_lastname'], @@ -177,14 +179,14 @@ function send($newsletter_id) { $ids = implode(',', $chosen); - $products_query = tep_db_query("select distinct pn.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where c.customers_id = pn.customers_id and pn.products_id in (" . $ids . ")"); + $products_query = tep_db_query("select distinct pn.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from customers c, products_notifications pn where c.customers_id = pn.customers_id and pn.products_id in (" . $ids . ")"); while ($products = tep_db_fetch_array($products_query)) { $audience[$products['customers_id']] = array('firstname' => $products['customers_firstname'], 'lastname' => $products['customers_lastname'], 'email_address' => $products['customers_email_address']); } - $customers_query = tep_db_query("select c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_INFO . " ci where c.customers_id = ci.customers_info_id and ci.global_product_notifications = '1'"); + $customers_query = tep_db_query("select c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address from customers c, customers_info ci where c.customers_id = ci.customers_info_id and ci.global_product_notifications = '1'"); while ($customers = tep_db_fetch_array($customers_query)) { $audience[$customers['customers_id']] = array('firstname' => $customers['customers_firstname'], 'lastname' => $customers['customers_lastname'], @@ -209,7 +211,7 @@ function send($newsletter_id) { } $newsletter_id = tep_db_prepare_input($newsletter_id); - tep_db_query("update " . TABLE_NEWSLETTERS . " set date_sent = now(), status = '1' where newsletters_id = '" . tep_db_input($newsletter_id) . "'"); + tep_db_query("update newsletters set date_sent = now(), status = '1' where newsletters_id = '" . tep_db_input($newsletter_id) . "'"); } } -?> + \ No newline at end of file diff --git a/admin/newsletters.php b/admin/newsletters.php index 32ce7c56e..0708ad6c5 100755 --- a/admin/newsletters.php +++ b/admin/newsletters.php @@ -5,14 +5,14 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2010 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); - $action = (isset($_GET['action']) ? $_GET['action'] : ''); + $action = $_GET['action'] ?? ''; if (tep_not_null($action)) { switch ($action) { @@ -21,7 +21,7 @@ $newsletter_id = tep_db_prepare_input($_GET['nID']); $status = (($action == 'lock') ? '1' : '0'); - tep_db_query("update " . TABLE_NEWSLETTERS . " set locked = '" . $status . "' where newsletters_id = '" . (int)$newsletter_id . "'"); + tep_db_query("update newsletters set locked = '" . $status . "' where newsletters_id = '" . (int)$newsletter_id . "'"); tep_redirect(tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $_GET['nID'])); break; @@ -60,10 +60,10 @@ $sql_data_array['status'] = '0'; $sql_data_array['locked'] = '0'; - tep_db_perform(TABLE_NEWSLETTERS, $sql_data_array); + tep_db_perform('newsletters', $sql_data_array); $newsletter_id = tep_db_insert_id(); } elseif ($action == 'update') { - tep_db_perform(TABLE_NEWSLETTERS, $sql_data_array, 'update', "newsletters_id = '" . (int)$newsletter_id . "'"); + tep_db_perform('newsletters', $sql_data_array, 'update', "newsletters_id = '" . (int)$newsletter_id . "'"); } tep_redirect(tep_href_link('newsletters.php', (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'nID=' . $newsletter_id)); @@ -74,7 +74,7 @@ case 'deleteconfirm': $newsletter_id = tep_db_prepare_input($_GET['nID']); - tep_db_query("delete from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$newsletter_id . "'"); + tep_db_query("delete from newsletters where newsletters_id = '" . (int)$newsletter_id . "'"); tep_redirect(tep_href_link('newsletters.php', 'page=' . $_GET['page'])); break; @@ -84,7 +84,7 @@ case 'confirm_send': $newsletter_id = tep_db_prepare_input($_GET['nID']); - $check_query = tep_db_query("select locked from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$newsletter_id . "'"); + $check_query = tep_db_query("select locked from newsletters where newsletters_id = '" . (int)$newsletter_id . "'"); $check = tep_db_fetch_array($check_query); if ($check['locked'] < 1) { @@ -106,16 +106,20 @@ require('includes/template_top.php'); ?> - - - - - +
+

+
+ '; + echo tep_draw_bootstrap_button(IMAGE_NEW_NEWSLETTER, 'fas fa-newspaper', tep_href_link('newsletters.php', 'action=new'), null, null, 'btn-danger xxx text-white'); + echo ''; + } + ?> + + + objectInfo($newsletter); @@ -155,65 +159,71 @@ for ($i=0, $n=sizeof($directory_array); $i<$n; $i++) { $modules_array[] = array('id' => substr($directory_array[$i], 0, strrpos($directory_array[$i], '.')), 'text' => substr($directory_array[$i], 0, strrpos($directory_array[$i], '.'))); } -?> - - - - - - - - - - - - - + +
+ +
+ module, 'id="Module" class="form-control" required aria-required="true"'); ?> +
+
+ +
+ +
+ title, 'class="form-control" id="Title" required aria-required="true"'); ?> +
+
+ +
+ +
+ content, 'class="form-control" id="Content" required aria-required="true"'); ?> +
+
+ +
+ +
+ + + + - - - + ?> + +
- - - - -
- - - - - - - - - - - - - - - - - - -
module); ?>
title, '', true); ?>
content); ?>
- - - -
- + + - + + +
content); ?>title; ?>
content); ?>
+ +
+ +
+ module . substr($PHP_SELF, strrpos($PHP_SELF, '.'))); $module_name = $nInfo->module; $module = new $module_name($nInfo->title, $nInfo->content); -?> - - show_choose_audience) { echo $module->choose_audience(); } else { echo $module->confirm(); } ?> - -show_choose_audience) { + echo $module->choose_audience(); + } + else { + echo $module->confirm(); + } } elseif ($action == 'confirm') { $nID = tep_db_prepare_input($_GET['nID']); - $newsletter_query = tep_db_query("select title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'"); + $newsletter_query = tep_db_query("select title, content, module from newsletters where newsletters_id = '" . (int)$nID . "'"); $newsletter = tep_db_fetch_array($newsletter_query); $nInfo = new objectInfo($newsletter); @@ -239,15 +251,12 @@ include('includes/modules/newsletters/' . $nInfo->module . substr($PHP_SELF, strrpos($PHP_SELF, '.'))); $module_name = $nInfo->module; $module = new $module_name($nInfo->title, $nInfo->content); -?> - - confirm(); ?> - -confirm(); } elseif ($action == 'confirm_send') { $nID = tep_db_prepare_input($_GET['nID']); - $newsletter_query = tep_db_query("select newsletters_id, title, content, module from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'"); + $newsletter_query = tep_db_query("select newsletters_id, title, content, module from newsletters where newsletters_id = '" . (int)$nID . "'"); $newsletter = tep_db_fetch_array($newsletter_query); $nInfo = new objectInfo($newsletter); @@ -257,129 +266,129 @@ $module_name = $nInfo->module; $module = new $module_name($nInfo->title, $nInfo->content); ?> - - - - - - -
- - + + +
+
+ + send($nInfo->newsletters_id); -?> - - - - - - - - - - - - + ?> + +
+ + +
+
+ +
+ +
+ - - - - +
+
+
+
- - - - - - - - -newsletters_id) ) { - echo ' ' . "\n"; - } else { - echo ' ' . "\n"; - } -?> - - - - - - - - - - - -
 
' . tep_image('images/icons/preview.gif', ICON_PREVIEW) . ' ' . $newsletters['title']; ?> 0) { echo tep_image('images/icons/locked.gif', ICON_LOCKED); } else { echo tep_image('images/icons/unlocked.gif', ICON_UNLOCKED); } ?>newsletters_id) ) { echo tep_image('images/icon_arrow_right.gif', ''); } else { echo '' . tep_image('images/icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> 
- - - - - - - -
display_count($newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_NEWSLETTERS); ?>display_links($newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>
+ + + + + + + + + + + + + newsletters_id) ) { + echo ''; + } else { + echo ''; + } + ?> + + + + + + + + + + +
'; } else { echo ''; } ?> 0) { echo ''; } else { echo ''; } ?>newsletters_id) ) { echo ''; } else { echo ''; } ?>
+
+ +
+
display_count($newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_NEWSLETTERS); ?>
+
display_links($newsletters_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?>
+
+ +
+ '' . $nInfo->title . ''); + $heading[] = array('text' => $nInfo->title); - $contents = array('form' => tep_draw_form('newsletters', 'newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $nInfo->newsletters_id . '&action=deleteconfirm')); + $contents = array('form' => tep_draw_form('newsletters', 'newsletters.php', 'page=' . (int)$_GET['page'] . '&nID=' . (int)$nInfo->newsletters_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO); - $contents[] = array('text' => '
' . $nInfo->title . ''); - $contents[] = array('align' => 'center', 'text' => '
' . tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $_GET['nID']))); + $contents[] = array('text' => '' . $nInfo->title . ''); + $contents[] = array('class' => 'text-center', 'text' => tep_draw_button(IMAGE_DELETE, 'trash', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link('newsletters.php', 'page=' . (int)$_GET['page'] . '&nID=' . (int)$_GET['nID']))); break; default: if (isset($nInfo) && is_object($nInfo)) { - $heading[] = array('text' => '' . $nInfo->title . ''); + $heading[] = array('text' => $nInfo->title); if ($nInfo->locked > 0) { - $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $nInfo->newsletters_id . '&action=new')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $nInfo->newsletters_id . '&action=delete')) . tep_draw_button(IMAGE_PREVIEW, 'document', tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview')) . tep_draw_button(IMAGE_SEND, 'mail-closed', tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $nInfo->newsletters_id . '&action=send')) . tep_draw_button(IMAGE_UNLOCK, 'unlocked', tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $nInfo->newsletters_id . '&action=unlock'))); + $contents[] = array('class' => 'text-center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link('newsletters.php', 'page=' . (int)$_GET['page'] . '&nID=' . (int)$nInfo->newsletters_id . '&action=new')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link('newsletters.php', 'page=' . (int)$_GET['page'] . '&nID=' . (int)$nInfo->newsletters_id . '&action=delete')) . tep_draw_button(IMAGE_PREVIEW, 'document', tep_href_link('newsletters.php', 'page=' . (int)$_GET['page'] . '&nID=' . (int)$nInfo->newsletters_id . '&action=preview')) . tep_draw_button(IMAGE_SEND, 'mail-closed', tep_href_link('newsletters.php', 'page=' . (int)$_GET['page'] . '&nID=' . (int)$nInfo->newsletters_id . '&action=send')) . tep_draw_button(IMAGE_UNLOCK, 'unlocked', tep_href_link('newsletters.php', 'page=' . (int)$_GET['page'] . '&nID=' . (int)$nInfo->newsletters_id . '&action=unlock'))); } else { - $contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_PREVIEW, 'document', tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $nInfo->newsletters_id . '&action=preview')) . tep_draw_button(IMAGE_LOCK, 'locked', tep_href_link('newsletters.php', 'page=' . $_GET['page'] . '&nID=' . $nInfo->newsletters_id . '&action=lock'))); + $contents[] = array('class' => 'text-center', 'text' => tep_draw_button(IMAGE_PREVIEW, 'document', tep_href_link('newsletters.php', 'page=' . (int)$_GET['page'] . '&nID=' . (int)$nInfo->newsletters_id . '&action=preview')) . tep_draw_button(IMAGE_LOCK, 'locked', tep_href_link('newsletters.php', 'page=' . (int)$_GET['page'] . '&nID=' . (int)$nInfo->newsletters_id . '&action=lock'))); } - $contents[] = array('text' => '
' . TEXT_NEWSLETTER_DATE_ADDED . ' ' . tep_date_short($nInfo->date_added)); - if ($nInfo->status == '1') $contents[] = array('text' => TEXT_NEWSLETTER_DATE_SENT . ' ' . tep_date_short($nInfo->date_sent)); + $contents[] = array('text' => sprintf(TEXT_NEWSLETTER_DATE_ADDED, tep_date_short($nInfo->date_added))); + if ($nInfo->status == '1') $contents[] = array('text' => sprintf(TEXT_NEWSLETTER_DATE_SENT, tep_date_short($nInfo->date_sent))); } break; } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { - echo ' ' . "\n"; - - $box = new box; - echo $box->infoBox($heading, $contents); - - echo ' ' . "\n"; + echo '
'; + $box = new box; + echo $box->infoBox($heading, $contents); + echo '
'; } ?> - - - + +
+ - - From 7f486c14a3d8b2e25ba56b1454f1e680a77262a2 Mon Sep 17 00:00:00 2001 From: gburton Date: Tue, 28 Jan 2020 14:58:20 +0000 Subject: [PATCH 22/24] Remove deprecated and unused functions Update malformed HTML --- includes/functions/general.php | 207 +---------------------------- includes/functions/html_output.php | 43 +----- 2 files changed, 4 insertions(+), 246 deletions(-) diff --git a/includes/functions/general.php b/includes/functions/general.php index 04787e605..702a721ee 100755 --- a/includes/functions/general.php +++ b/includes/functions/general.php @@ -5,7 +5,7 @@ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com - Copyright (c) 2018 osCommerce + Copyright (c) 2020 osCommerce Released under the GNU General Public License */ @@ -22,13 +22,6 @@ function tep_get_version() { return $v; } -//// -// Stop from parsing any further PHP code -// v2.3.3.1 now closes the session through a registered shutdown function - function tep_exit() { - exit; - } - //// // Redirect to another page or site function tep_redirect($url) { @@ -48,7 +41,7 @@ function tep_redirect($url) { header('Location: ' . $url); - tep_exit(); + exit; } //// @@ -143,28 +136,6 @@ function tep_check_stock($products_id, $products_quantity) { return $out_of_stock; } -//// -// Break a word in a string if it is longer than a specified length ($len) - function tep_break_string($string, $len, $break_char = '-') { - $l = 0; - $output = ''; - for ($i=0, $n=strlen($string); $i<$n; $i++) { - $char = substr($string, $i, 1); - if ($char != ' ') { - $l++; - } else { - $l = 0; - } - if ($l > $len) { - $l = 1; - $output .= $break_char; - } - $output .= $char; - } - - return $output; - } - //// // Return all HTTP GET variables, except those passed as a parameter function tep_get_all_get_params($exclude_array = '') { @@ -255,12 +226,6 @@ function tep_get_path($current_category_id = '') { return 'cPath=' . $cPath_new; } -//// -// Returns the clients browser - function tep_browser_detect($component) { - return stristr($_SERVER['HTTP_USER_AGENT'], $component); - } - //// // Alias function to tep_get_countries() function tep_get_country_name($country_id) { @@ -390,43 +355,6 @@ function tep_calculate_tax($price, $tax) { return $price * $tax / 100; } -//// -// Return the number of products in a category -// TABLES: products, products_to_categories, categories - function tep_count_products_in_category($category_id, $include_inactive = false) { - $products_count = 0; - if ($include_inactive == true) { - $products_query = tep_db_query("select count(*) as total from products p, products_to_categories p2c where p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$category_id . "'"); - } else { - $products_query = tep_db_query("select count(*) as total from products p, products_to_categories p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '" . (int)$category_id . "'"); - } - $products = tep_db_fetch_array($products_query); - $products_count += $products['total']; - - $child_categories_query = tep_db_query("select categories_id from categories where parent_id = '" . (int)$category_id . "'"); - if (tep_db_num_rows($child_categories_query)) { - while ($child_categories = tep_db_fetch_array($child_categories_query)) { - $products_count += tep_count_products_in_category($child_categories['categories_id'], $include_inactive); - } - } - - return $products_count; - } - -//// -// Return true if the category has subcategories -// TABLES: categories - function tep_has_category_subcategories($category_id) { - $child_category_query = tep_db_query("select count(*) as count from categories where parent_id = '" . (int)$category_id . "'"); - $child_category = tep_db_fetch_array($child_category_query); - - if ($child_category['count'] > 0) { - return true; - } else { - return false; - } - } - //// // Returns the address_format_id for the given country // TABLES: countries; @@ -527,12 +455,6 @@ function tep_address_label($customers_id, $address_id = 1, $html = false, $boln return tep_address_format($format_id, $address, $html, $boln, $eoln); } - function tep_row_number_format($number) { - if ( ($number < 10) && (substr($number, 0, 1) != '0') ) $number = '0' . $number; - - return $number; - } - function tep_get_categories($categories_array = '', $parent_id = '0', $indent = '') { global $languages_id; @@ -762,123 +684,6 @@ function tep_parse_search_string($search_str = '', &$objects) { } } -//// -// Check date - function tep_checkdate($date_to_check, $format_string, &$date_array) { - $separator_idx = -1; - - $separators = array('-', ' ', '/', '.'); - $month_abbr = array('jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'); - $no_of_days = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); - - $format_string = strtolower($format_string); - - if (strlen($date_to_check) != strlen($format_string)) { - return false; - } - - $size = sizeof($separators); - for ($i=0; $i<$size; $i++) { - $pos_separator = strpos($date_to_check, $separators[$i]); - if ($pos_separator != false) { - $date_separator_idx = $i; - break; - } - } - - for ($i=0; $i<$size; $i++) { - $pos_separator = strpos($format_string, $separators[$i]); - if ($pos_separator != false) { - $format_separator_idx = $i; - break; - } - } - - if ($date_separator_idx != $format_separator_idx) { - return false; - } - - if ($date_separator_idx != -1) { - $format_string_array = explode( $separators[$date_separator_idx], $format_string ); - if (sizeof($format_string_array) != 3) { - return false; - } - - $date_to_check_array = explode( $separators[$date_separator_idx], $date_to_check ); - if (sizeof($date_to_check_array) != 3) { - return false; - } - - $size = sizeof($format_string_array); - for ($i=0; $i<$size; $i++) { - if ($format_string_array[$i] == 'mm' || $format_string_array[$i] == 'mmm') $month = $date_to_check_array[$i]; - if ($format_string_array[$i] == 'dd') $day = $date_to_check_array[$i]; - if ( ($format_string_array[$i] == 'yyyy') || ($format_string_array[$i] == 'aaaa') ) $year = $date_to_check_array[$i]; - } - } else { - if (strlen($format_string) == 8 || strlen($format_string) == 9) { - $pos_month = strpos($format_string, 'mmm'); - if ($pos_month != false) { - $month = substr( $date_to_check, $pos_month, 3 ); - $size = sizeof($month_abbr); - for ($i=0; $i<$size; $i++) { - if ($month == $month_abbr[$i]) { - $month = $i; - break; - } - } - } else { - $month = substr($date_to_check, strpos($format_string, 'mm'), 2); - } - } else { - return false; - } - - $day = substr($date_to_check, strpos($format_string, 'dd'), 2); - $year = substr($date_to_check, strpos($format_string, 'yyyy'), 4); - } - - if (strlen($year) != 4) { - return false; - } - - if (!settype($year, 'integer') || !settype($month, 'integer') || !settype($day, 'integer')) { - return false; - } - - if ($month > 12 || $month < 1) { - return false; - } - - if ($day < 1) { - return false; - } - - if (tep_is_leap_year($year)) { - $no_of_days[1] = 29; - } - - if ($day > $no_of_days[$month - 1]) { - return false; - } - - $date_array = array($year, $month, $day); - - return true; - } - -//// -// Check if year is a leap year - function tep_is_leap_year($year) { - if ($year % 100 == 0) { - if ($year % 400 == 0) return true; - } else { - if (($year % 4) == 0) return true; - } - - return false; - } - //// // Return table heading with sorting capabilities function tep_create_sort_heading($sortby, $colnum, $heading) { @@ -1048,14 +853,6 @@ function tep_has_product_attributes($products_id) { } } -//// -// Get the number of times a word/character is present in a string - function tep_word_count($string, $needle) { - $temp_array = preg_split('/' . $needle . '/', $string); - - return sizeof($temp_array); - } - function tep_count_modules($modules = '') { $count = 0; diff --git a/includes/functions/html_output.php b/includes/functions/html_output.php index ff22a5fac..728e0f235 100755 --- a/includes/functions/html_output.php +++ b/includes/functions/html_output.php @@ -18,7 +18,7 @@ function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $ad $page = tep_output_string($page); if (!tep_not_null($page)) { - die('

Error!

Unable to determine the page link!

'); + die('
Error!

Unable to determine the page link!

'); } if ($connection == 'NONSSL') { @@ -30,7 +30,7 @@ function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $ad $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; } } else { - die('

Error!

Unable to determine connection method on a link!

Known methods: NONSSL SSL


'); + die('
Error!

Unable to determine connection method on a link!

Known methods: NONSSL SSL

'); } if (tep_not_null($parameters)) { @@ -126,37 +126,6 @@ function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '', return $image; } -//// -// The HTML form submit button wrapper function -// Outputs a button in the selected language - function tep_image_submit($image, $alt = '', $parameters = '') { - global $language; - - $image_submit = ' Date: Tue, 28 Jan 2020 14:59:05 -0500 Subject: [PATCH 23/24] Remove misleading comment The database was modified to remove the 255 character limit. The new limit is something like 65,535. --- includes/modules/shipping/zones.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/includes/modules/shipping/zones.php b/includes/modules/shipping/zones.php index 0026d0387..dc4787588 100755 --- a/includes/modules/shipping/zones.php +++ b/includes/modules/shipping/zones.php @@ -89,9 +89,6 @@ difficult to design precise shipping tables. If you want to, you can hack the shipping.php file to get rid of the rounding. - Lastly, there is a limit of 255 characters on each of the Zone - Shipping Tables and Zone Countries. - */ class zones { From 45b84a44547c2b8c0893ed3e5162c212251f7039 Mon Sep 17 00:00:00 2001 From: gburton Date: Tue, 28 Jan 2020 22:09:59 +0000 Subject: [PATCH 24/24] 1.0.4.4 --- includes/version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/version.php b/includes/version.php index 3e6e23cc7..252f81943 100755 --- a/includes/version.php +++ b/includes/version.php @@ -1 +1 @@ -1.0.4.3 \ No newline at end of file +1.0.4.4 \ No newline at end of file