Jump to content

mattjt83

♥Ambassador
  • Content count

    557
  • Joined

  • Last visited

  • Days Won

    24

mattjt83 last won the day on August 19 2017

mattjt83 had the most liked content!

About mattjt83

  • Birthday 12/21/1983

Profile Information

  • Real Name
    Matt T
  • Gender
    Male
  • Location
    USA
  • Interests
    Most anything related to computers, websites, and cooking

Recent Profile Visitors

52,921 profile views
  1. mattjt83

    addthis

    I had a quick look at that addon and there isn't anything in it that allows you to customize the image shown. You may be able to grab some custom code from the addthis website but I'm not sure since I don't use it.
  2. mattjt83

    addthis

    If you can post the code for the addon and also which addon you are referring to someone can probably give you a little better guidance as to what needs to be changed.
  3. mattjt83

    Please Review my Website - comments are welcome

    OK, you've done all the hard work of getting the products loaded and the site features implemented. Good job on that My issues are: 1. The site looks very generic. A professional looking template would make a HUGE difference. What it will come down to is that people are scared to shop on non-professional looking sites. If you are only selling items to well established customers your site would probably be fine but otherwise it would be a wise investment to get a proper template setup. Some very simple style adjustments could present your hard work in a much better way. 2. The images do look pixelated (stretched). I'm not sure if you can help this if the images are coming from the manufacturer that way.
  4. The stray </form> tag could cause unforeseen issues and invalidates the html. Not relevant though since you updated the module to a header_tag. I can appreciate what you are doing and I think it's great you're giving back to the community. I have edited your header_tag module so that it is coded according to the proper standards and hopefully doesn't cause issues for users. <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2018 osCommerce Released under the GNU General Public License V1.0 JcM Adaptive Images 16-7-2018 Adaptive Images by Matt Wilcox is licensed under a Creative Commons Attribution 3.0 Unported License. This addon uses the code by MattWilcox/Adaptive-Images from GitHub It is used as supplied and all credit is with original author. All this add-on does is allow you to install in as a module you can turn on and off. */ class ht_jcm_adaptive_images { var $code = 'ht_jcm_adaptive_images'; var $group = 'header_tags'; var $title; var $description; var $sort_order; var $enabled = false; function __construct() { $this->title = MODULE_HEADER_TAGS_JCM_ADAPTIVE_IMAGES_TITLE; $this->description = MODULE_HEADER_TAGS_JCM_ADAPTIVE_IMAGES_DESCRIPTION; if ( defined('MODULE_HEADER_TAGS_JCM_ADAPTIVE_IMAGES_STATUS') ) { $this->sort_order = MODULE_HEADER_TAGS_JCM_ADAPTIVE_IMAGES_SORT_ORDER; $this->enabled = (MODULE_HEADER_TAGS_JCM_ADAPTIVE_IMAGES_STATUS == 'True'); } } function execute() { global $oscTemplate; $output = <<<EOD <script>document.cookie='resolution='+Math.max(screen.width,screen.height)+'; path=/';</script> EOD; $oscTemplate->addBlock($output, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_HEADER_TAGS_JCM_ADAPTIVE_IMAGES_STATUS'); } function install() { tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable JcM Adaptive Images Module', 'MODULE_HEADER_TAGS_JCM_ADAPTIVE_IMAGES_STATUS', 'True', 'Do you want to allow images script to be added to the page header?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Adaptive Images for OcS', 'MODULE_HEADER_TAGS_JCM_ADAPTIVE_IMAGES_DESCRIPTION_STATUS', 'True', 'adaptive images', '6', '0', 'tep_cfg_select_option(array(\'True\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_HEADER_TAGS_JCM_ADAPTIVE_IMAGES_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); } function remove() { tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_HEADER_TAGS_JCM_ADAPTIVE_IMAGES_STATUS', 'MODULE_HEADER_TAGS_JCM_ADAPTIVE_IMAGES_DESCRIPTION_STATUS', 'MODULE_HEADER_TAGS_JCM_ADAPTIVE_IMAGES_SORT_ORDER'); } } ?>
  5. I looked at the code again and I'm not seeing an opening <form> tag. Also there is zero need for a <form></form> to be used with this snippet or a <div></div>. A header tag would make a lot more sense in this circumstance and would also get the script into the <head> like the author suggests.
  6. @JcMagpie You have a stray </form> in your template file. Also, just a couple thoughts... 1. This probably could/should be a header_tag module rather than a content module since it just inserts a single line of javascript. No use in sticking it inside a <div> and also he recommends it being in the <head> section preferably before any other scripts. 2. I think any file that is using the code from Matt Wilcox should give him credit.
  7. mattjt83

    Speeding up your website load times.

    Also it would need different people browsing the site with different devices. If only people with desktops viewed the site maybe the script didn't need to be triggered etc... Try viewing the site on a mobile device and maybe the cache will start to fill up.
  8. @burt Looks like this thread should be frozen: https://forums.oscommerce.com/topic/413005-last-active-oscommerce-team-member/ ????
  9. I think what is happening is the string of installed modules needs to be updated to not include the module you deleted. If you uninstall a module through the admin it updates the configuration table for you but not you may need to do it manually. Login to phpmyadmin and find the configuration table. Search for the rows containing the module keys and delete them. You will also need to update the key that contains the installed modules string. For instance the order totals modules is MODULE_ORDER_TOTAL_INSTALLED and the data in mine is: ot_subtotal.php;ot_discount_coupon.php;ot_redemptions.php;ot_cs_discount.php;ot_shipping.php;ot_rush_order.php;ot_total.php;ot_cs_cash_tendered.php;ot_tax.php. You would need to delete the offending module from that list. I'm not sure what the module is so it might not be in the order total area. It could be in the payment modules etc.... OR maybe just put the files back in place and uninstall it properly from your admin.
  10. OK cool. Glad it's working for you
  11. Just so I'm clear, you tried my code or just reverted to the old code?
  12. Maybe this? I haven't tested it but it should work I think <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2014 osCommerce Released under the GNU General Public License */ class ht_grid_list_view { var $code = 'ht_grid_list_view'; var $group = 'footer_scripts'; var $title; var $description; var $sort_order; var $enabled = false; function __construct() { $this->title = MODULE_HEADER_TAGS_GRID_LIST_VIEW_TITLE; $this->description = MODULE_HEADER_TAGS_GRID_LIST_VIEW_DESCRIPTION; if ( defined('MODULE_HEADER_TAGS_GRID_LIST_VIEW_STATUS') ) { $this->sort_order = MODULE_HEADER_TAGS_GRID_LIST_VIEW_SORT_ORDER; $this->enabled = (MODULE_HEADER_TAGS_GRID_LIST_VIEW_STATUS == 'True'); } } function execute() { global $PHP_SELF, $oscTemplate; if (tep_not_null(MODULE_HEADER_TAGS_GRID_LIST_VIEW_PAGES)) { $pages_array = array(); foreach (explode(';', MODULE_HEADER_TAGS_GRID_LIST_VIEW_PAGES) as $page) { $page = trim($page); if (!empty($page)) { $pages_array[] = $page; } } if (in_array(basename($PHP_SELF), $pages_array)) { $grid_list_js = <<<EOD <script> $(function() { if (window.localStorage) { let cc = localStorage['list_grid']; if (cc == 'list') { $('#products .item').removeClass('grid-group-item').addClass('list-group-item'); } else { $('#products .item').removeClass('list-group-item').addClass('grid-group-item'); } $('#list').click(function(event){ event.preventDefault(); $('#products .item').addClass('list-group-item').removeClass('grid-group-item'); localStorage['list_grid'] = 'list'; }); $('#grid').click(function(event){ event.preventDefault(); $('#products .item').removeClass('list-group-item').addClass('grid-group-item'); localStorage['list_grid'] = 'grid'; }); }else{ //cookie fallback $('head').append('<script src="ext/jquery/cookie.js"><\/script>'); try { let cc = $.cookie('list_grid'); if (cc == 'list') { $('#products .item').removeClass('grid-group-item').addClass('list-group-item'); }else{ $('#products .item').removeClass('list-group-item').addClass('grid-group-item'); } $('#list').click(function(event){ event.preventDefault(); $('#products .item').addClass('list-group-item').removeClass('grid-group-item'); $.cookie('list_grid', 'list'); }); $('#grid').click(function(event){ event.preventDefault(); $('#products .item').removeClass('list-group-item').addClass('grid-group-item'); $.cookie('list_grid', 'grid'); }); }catch(error){ console.log(error); } } }); </script> EOD; $oscTemplate->addBlock($grid_list_js . PHP_EOL, $this->group); } } } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_HEADER_TAGS_GRID_LIST_VIEW_STATUS'); } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Grid List javascript', 'MODULE_HEADER_TAGS_GRID_LIST_VIEW_STATUS', 'True', 'Do you want to enable the Grid/List Javascript module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Pages', 'MODULE_HEADER_TAGS_GRID_LIST_VIEW_PAGES', '" . implode(';', $this->get_default_pages()) . "', 'The pages to add the Grid List JS Scripts to.', '6', '4', 'ht_grid_list_view_show_pages', 'ht_grid_list_view_edit_pages(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_HEADER_TAGS_GRID_LIST_VIEW_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '5', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_HEADER_TAGS_GRID_LIST_VIEW_STATUS', 'MODULE_HEADER_TAGS_GRID_LIST_VIEW_PAGES', 'MODULE_HEADER_TAGS_GRID_LIST_VIEW_SORT_ORDER'); } function get_default_pages() { return array('advanced_search_result.php', 'index.php', 'products_new.php', 'specials.php'); } } function ht_grid_list_view_show_pages($text) { return nl2br(implode("\n", explode(';', $text))); } function ht_grid_list_view_edit_pages($values, $key) { global $PHP_SELF; $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.')); $files_array = array(); if ($dir = @dir(DIR_FS_CATALOG)) { while ($file = $dir->read()) { if (!is_dir(DIR_FS_CATALOG . $file)) { if (substr($file, strrpos($file, '.')) == $file_extension) { $files_array[] = $file; } } } sort($files_array); $dir->close(); } $values_array = explode(';', $values); $output = ''; foreach ($files_array as $file) { $output .= tep_draw_checkbox_field('ht_grid_list_view_file[]', $file, in_array($file, $values_array)) . '&nbsp;' . tep_output_string($file) . '<br />'; } if (!empty($output)) { $output = '<br />' . substr($output, 0, -6); } $output .= tep_draw_hidden_field('configuration[' . $key . ']', '', 'id="htrn_files"'); $output .= '<script> function htrn_update_cfg_value() { var htrn_selected_files = \'\'; if ($(\'input[name="ht_grid_list_view_file[]"]\').length > 0) { $(\'input[name="ht_grid_list_view_file[]"]:checked\').each(function() { htrn_selected_files += $(this).attr(\'value\') + \';\'; }); if (htrn_selected_files.length > 0) { htrn_selected_files = htrn_selected_files.substring(0, htrn_selected_files.length - 1); } } $(\'#htrn_files\').val(htrn_selected_files); } $(function() { htrn_update_cfg_value(); if ($(\'input[name="ht_grid_list_view_file[]"]\').length > 0) { $(\'input[name="ht_grid_list_view_file[]"]\').change(function() { htrn_update_cfg_value(); }); } }); </script>'; return $output; }
  13. Also found this https://developer.mozilla.org/en-US/docs/Web/API/Storage/LocalStorage which could be used as a cookie patch for users who can't/don't use localStorage in their browser. if (!window.localStorage) { Object.defineProperty(window, "localStorage", new (function () { var aKeys = [], oStorage = {}; Object.defineProperty(oStorage, "getItem", { value: function (sKey) { return sKey ? this[sKey] : null; }, writable: false, configurable: false, enumerable: false }); Object.defineProperty(oStorage, "key", { value: function (nKeyId) { return aKeys[nKeyId]; }, writable: false, configurable: false, enumerable: false }); Object.defineProperty(oStorage, "setItem", { value: function (sKey, sValue) { if(!sKey) { return; } document.cookie = escape(sKey) + "=" + escape(sValue) + "; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"; }, writable: false, configurable: false, enumerable: false }); Object.defineProperty(oStorage, "length", { get: function () { return aKeys.length; }, configurable: false, enumerable: false }); Object.defineProperty(oStorage, "removeItem", { value: function (sKey) { if(!sKey) { return; } document.cookie = escape(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"; }, writable: false, configurable: false, enumerable: false }); Object.defineProperty(oStorage, "clear", { value: function () { if(!aKeys.length) { return; } for (var sKey in aKeys) { document.cookie = escape(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"; } }, writable: false, configurable: false, enumerable: false }); this.get = function () { var iThisIndx; for (var sKey in oStorage) { iThisIndx = aKeys.indexOf(sKey); if (iThisIndx === -1) { oStorage.setItem(sKey, oStorage[sKey]); } else { aKeys.splice(iThisIndx, 1); } delete oStorage[sKey]; } for (aKeys; aKeys.length > 0; aKeys.splice(0, 1)) { oStorage.removeItem(aKeys[0]); } for (var aCouple, iKey, nIdx = 0, aCouples = document.cookie.split(/\s*;\s*/); nIdx < aCouples.length; nIdx++) { aCouple = aCouples[nIdx].split(/\s*=\s*/); if (aCouple.length > 1) { oStorage[iKey = unescape(aCouple[0])] = unescape(aCouple[1]); aKeys.push(iKey); } } return oStorage; }; this.configurable = false; this.enumerable = true; })()); }
  14. @burt Because everyone doesn't use localstorage you might want to check if it's enabled first and use the old code as a backup if it's not. if (window.localStorage) { // use localStorage script }else{ //fallback to cookies here }
  15. mattjt83

    [Contribution] Customer Support Portal

    @GLWalker That would be awesome. If you need some incentive just PM me the details :)
×