From 90e79cd4fc291f553deefda71bd52f44a7ae1c8b Mon Sep 17 00:00:00 2001 From: gburton Date: Tue, 16 Feb 2021 10:50:50 +0000 Subject: [PATCH] Removal of Partner News dashboard module --- .../modules/dashboard/d_partner_news.php | 17 -- .../modules/dashboard/d_partner_news.php | 146 ------------------ install/phoenix.sql | 3 - 3 files changed, 166 deletions(-) delete mode 100644 admin/includes/languages/english/modules/dashboard/d_partner_news.php delete mode 100644 admin/includes/modules/dashboard/d_partner_news.php diff --git a/admin/includes/languages/english/modules/dashboard/d_partner_news.php b/admin/includes/languages/english/modules/dashboard/d_partner_news.php deleted file mode 100644 index 3f89658fa..000000000 --- a/admin/includes/languages/english/modules/dashboard/d_partner_news.php +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/admin/includes/modules/dashboard/d_partner_news.php b/admin/includes/modules/dashboard/d_partner_news.php deleted file mode 100644 index a0ef6668d..000000000 --- a/admin/includes/modules/dashboard/d_partner_news.php +++ /dev/null @@ -1,146 +0,0 @@ -enabled ) { - $this->content_width = (int)($this->base_constant('CONTENT_WIDTH') ?? 6); - } - - if ( !function_exists('json_decode') ) { - $this->description .= '

' . MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_ERROR_JSON_DECODE . '

'; - - $this->enabled = false; - } - } - - function getOutput() { - $result = $this->_getContent(); - - $output = ''; - - if (is_array($result) && !empty($result)) { - $output .= ''; - $output .= ''; - $output .= ''; - $output .= ''; - $output .= ''; - $output .= ''; - $output .= ''; - - foreach ($result as $p) { - $output .= ''; - $output .= ''; - $output .= ''; - } - - $output .= ''; - $output .= '
' . MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_TITLE . '
' . $p['title'] . ' (' . $p['category_title'] . ')
' . $p['status_update'] . '
'; - - $output .= '
'; - $output .= '' . tep_image('images/icon_phoenix.png', 'Phoenix') . ' '; - $output .= '' . MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_MORE_TITLE . ''; - $output .= '
'; - } - - return $output; - } - - function _getContent() { - $result = null; - - $filename = DIR_FS_CACHE . 'oscommerce_partners_news.cache'; - - if ( file_exists($filename) ) { - $difference = floor((time() - filemtime($filename)) / 60); - - if ( $difference < 60 ) { - $result = unserialize(file_get_contents($filename)); - } - } - - if ( !isset($result) ) { - if (function_exists('curl_init')) { - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, 'http://www.oscommerce.com/index.php?RPC&Website&Index&GetPartnerStatusUpdates'); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - $response = trim(curl_exec($ch)); - curl_close($ch); - - if (!empty($response)) { - $result = trim($response); - } - } else { - if ($fp = @fsockopen('www.oscommerce.com', 80, $errno, $errstr, 30)) { - $header = 'GET /index.php?RPC&Website&Index&GetPartnerStatusUpdates HTTP/1.0' . "\r\n" . - 'Host: www.oscommerce.com' . "\r\n" . - 'Connection: close' . "\r\n\r\n"; - - fwrite($fp, $header); - - $response = ''; - while (!feof($fp)) { - $response .= fgets($fp, 1024); - } - - fclose($fp); - - $response = explode("\r\n\r\n", $response); // split header and content - - if (isset($response[1]) && !empty($response[1])) { - $result = trim($response[1]); - } - } - } - - if ( !empty($result) ) { - $result = json_decode($result, true); - - if ( is_writable(DIR_FS_CACHE) ) { - file_put_contents($filename, serialize($result), LOCK_EX); - } - } - } - - return $result; - } - - protected function get_parameters() { - return [ - 'MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_STATUS' => [ - 'title' => 'Enable Partner News Module', - 'value' => 'True', - 'desc' => 'Do you want to show the latest osCommerce Partner News on the dashboard?', - 'set_func' => "tep_cfg_select_option(['True', 'False'], ", - ], - 'MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_CONTENT_WIDTH' => [ - 'title' => 'Content Width', - 'value' => '6', - 'desc' => 'What width container should the content be shown in? (12 = full width, 6 = half width).', - 'set_func' => "tep_cfg_select_option(['12', '11', '10', '9', '8', '7', '6', '5', '4', '3', '2', '1'], ", - ], - 'MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_SORT_ORDER' => [ - 'title' => 'Sort Order', - 'value' => '1100', - 'desc' => 'Sort order of display. Lowest is displayed first.', - ], - ]; - } - - } diff --git a/install/phoenix.sql b/install/phoenix.sql index b0a09be06..9ccee0c18 100644 --- a/install/phoenix.sql +++ b/install/phoenix.sql @@ -1454,9 +1454,6 @@ 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 ('Reviews to display', 'MODULE_ADMIN_DASHBOARD_REVIEWS_DISPLAY', '5', 'This number of Reviews will display, ordered by latest added.', '6', '2', now()); insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_ADMIN_DASHBOARD_REVIEWS_CONTENT_WIDTH', '6', 'What width container should the content be shown in? (12 = full width, 6 = half width).', '6', '1', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ADMIN_DASHBOARD_REVIEWS_SORT_ORDER', '800', 'Sort order of display. Lowest is displayed first.', '6', '0', now()); -insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Partner News Module', 'MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_STATUS', 'True', 'Do you want to show the latest osCommerce Partner News on the dashboard?', '6', '1', 'tep_cfg_select_option([\'True\', \'False\'], ', now()); -insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_CONTENT_WIDTH', '6', 'What width container should the content be shown in? (12 = full width, 6 = half width).', '6', '2', 'tep_cfg_select_option([\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'], ', now()); -insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ADMIN_DASHBOARD_PARTNER_NEWS_SORT_ORDER', '1100', 'Sort order of display. Lowest is displayed first.', '6', '3', now()); # Boxes INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Installed Modules', 'MODULE_BOXES_INSTALLED', 'bm_categories.php;bm_manufacturers.php;bm_whats_new.php;bm_order_history.php;bm_best_sellers.php;bm_reviews.php', 'List of box module filenames separated by a semi-colon. This is automatically updated. No need to edit.', '6', '0', now());