Jump to content
Latest News: (loading..)

vampirehunter

Members
  • Content count

    718
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by vampirehunter

  1. I have a problem, but can't work out whats causing it. I've edited the english.php file and defined define('DATE_FORMAT_SHORT', '%d/%m%/Y'); // this is used for strftime() define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime() define('DATE_FORMAT', 'd/m/Y'); // this is used for date() define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S'); define('JQUERY_DATEPICKER_I18N_CODE', ''); // leave empty for en_US; see http://jqueryui.com/demos/datepicker/#localization define('JQUERY_DATEPICKER_FORMAT', 'dd/mm/yy'); // see http://docs.jquery.com/UI/Datepicker/formatDate //// // Return date in raw format // $date should be in format mm/dd/yyyy // raw date is in format YYYYMMDD, or DDMMYYYY function tep_date_raw($date, $reverse = false) { if ($reverse) { return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4); } else { return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2); } } However, when i go to the create account page and select a date, its still showing the US date format of mm/dd/yy. Can anyone advise what else needs to be changed? I assumed that one change would do it, but its not working. i checked my html source and this is what it says <script>$('#dob').datepicker({dateFormat: 'dd/mm/yy',viewMode: 2});</script> <script>var nowTemp = new Date(); var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0); $('#dfrom').datepicker({dateFormat: 'dd/mm/yy',onRender: function(date) {return date.valueOf() > now.valueOf() ? 'disabled' : '';}}); </script> <script>$('#dto').datepicker({dateFormat: 'dd/mm/yy',onRender: function(date) {return date.valueOf() > now.valueOf() ? 'disabled' : '';}});</script> </body>
  2. Ok, using Gergley's and Kymation's existing code and modifying and refining it slightly. I have managed to make the following module which hopefully is useful for people here: If anyone wants to try it out and check for any issues, that would be great. Any ideas for tweaking the code are also welcome, but this is a working module. A bootstrap carousel for the Home Page (Index Page) Only which will display any banners created from the Banner Manager in Admin. I've tested this, just 3 Files to install and just install via Admin, Modules and under Content. Its titled "Carousel Banners For Home Page" to make it easy to find. You can also set the content width of the carousel container which I've added in as a configuration option. So here are the files to insert: 1.) Includes/modules/content/header/cm_carousel.php <?php /* $Id: banner_rotator.php v1.1.2 20110108 Kymation $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ class cm_carousel { var $code; var $group; var $title; var $description; var $sort_order; var $enabled = false; function cm_carousel() { $this->code = get_class($this); $this->group = basename(dirname(__FILE__)); $this->title = MODULE_FRONT_PAGE_BANNER_ROTATOR_TITLE; $this->description = MODULE_FRONT_PAGE_BANNER_ROTATOR_DESCRIPTION; if (defined('MODULE_FRONT_PAGE_BANNER_ROTATOR_STATUS')) { $this->sort_order = MODULE_FRONT_PAGE_BANNER_ROTATOR_SORT_ORDER; $this->enabled = (MODULE_FRONT_PAGE_BANNER_ROTATOR_STATUS == 'True'); } } function execute() { global $PHP_SELF, $oscTemplate, $cPath; $content_width = (int)MODULE_FRONT_PAGE_BANNER_ROTATOR_CONTENT_WIDTH; if ($PHP_SELF == 'index.php' && $cPath == '') { // Set the Javascript to go in the header $footer_scripts = '<script>' . '$(\'.carousel\').carousel({ interval: ' . ( int ) MODULE_FRONT_PAGE_BANNER_ROTATOR_FADE_TIME . '})' . "\n" .'</script>'; $oscTemplate->addBlock($footer_scripts, 'footer_scripts'); // Set the banner rotator code to display on the front page $banner_query_raw = " select banners_id, banners_url, banners_image, banners_html_text from " . TABLE_BANNERS . " where banners_group = '" . MODULE_FRONT_PAGE_BANNER_ROTATOR_GROUP . "' and status order by banners_id " . MODULE_FRONT_PAGE_BANNER_ROTATOR_BANNER_ORDER . " limit " . MODULE_FRONT_PAGE_BANNER_ROTATOR_MAX_DISPLAY; $banner_query = tep_db_query($banner_query_raw); if (tep_db_num_rows($banner_query) > 0) { $body_text = '<!-- Banner Rotator BOF -->' . "\n"; $body_text .= ' <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">' . "\n"; $indicators = '<!-- Indicators --> <ol class="carousel-indicators">'; $wrapper_slides = '<!-- Wrapper for slides -->' . "\n" . '<div class="carousel-inner">'; $background = $this->createImage(544, 172, 118, 115, 115); $counter = 0; while ($banner = tep_db_fetch_array($banner_query)) { $indicators .= ' <li data-target="#carousel-example-generic" data-slide-to="' . $counter . '"' . ($counter == 0 ? 'class="active"' : '') . '></li>'; $wrapper_slides .= ' <div class="item' . ($counter == 0 ? ' active' : '') . '">'; if ($banner['banners_url'] != '') { $wrapper_slides .= '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '">'; } //$wrapper_slides .= tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_html_text']); if ($banner['banners_image'] !== '') { //$wrapper_slides .= tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_html_text']); $wrapper_slides .= tep_image(DIR_WS_IMAGES . $banner['banners_image'], '', 544, 172); $wrapper_slides .= '<div class="carousel-caption"> </div>'; } else { //$wrapper_slides .= tep_image(DIR_WS_IMAGES . 'pixel_silver.gif', 'alt', 544, 172 ); $wrapper_slides .= '<img class="img-responsive" alt="544x172" src="' . $background . '" />'; $wrapper_slides .= '<div class="carousel-caption">' . $banner['banners_html_text'] . '</div>'; } if ($banner['banners_url'] != '') { $wrapper_slides .= '</a>'; } $wrapper_slides .= ' </div>' . "\n"; $counter++; } $indicators .= '</ol>'; // close indicator $wrapper_slides .= '</div>'; // wrapper close $controls = ' <!-- Controls --> <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> </a>'; // öszefuzés $body_text .= $indicators . $wrapper_slides . $controls; $body_text .= ' </div>' . "\n"; $body_text .= ' <div class="clearfix"></div>' . "\n"; $body_text .= '<!-- Banner Rotator EOF -->' . "\n"; $carousel = $body_text; $oscTemplate->addBlock($carousel, $this->group); } ob_start(); include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/carousel.php'); $template = ob_get_clean(); $oscTemplate->addContent($template, $this->group); } } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_FRONT_PAGE_BANNER_ROTATOR_STATUS'); } function install() { 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_FRONT_PAGE_BANNER_ROTATOR_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); 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 ('Content Width', 'MODULE_FRONT_PAGE_BANNER_ROTATOR_CONTENT_WIDTH', '12', 'What width container should the content be shown in?', '6', '1', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now())"); 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 Banner Rotator', 'MODULE_FRONT_PAGE_BANNER_ROTATOR_STATUS', 'True', 'Do you want to show the banner rotator?', '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, date_added) values ('Fade Time', 'MODULE_FRONT_PAGE_BANNER_ROTATOR_FADE_TIME', '500', 'The time it takes to fade from one banner to the next. 1000 = 1 second', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Hold Time', 'MODULE_FRONT_PAGE_BANNER_ROTATOR_HOLD_TIME', '4000', 'The time each banner is shown. 1000 = 1 second', '6', '0', now())"); 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 ('Banner Order', 'MODULE_FRONT_PAGE_BANNER_ROTATOR_BANNER_ORDER', 'desc', 'Order that the Banner Rotator uses to show the banners.', '6', '0', 'tep_cfg_select_option(array(\'asc\', \'desc\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Banner Rotator Group', 'MODULE_FRONT_PAGE_BANNER_ROTATOR_GROUP', 'rotator', 'Name of the banner group that the Banner Rotator uses to show the banners.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Banner Rotator Max Banners', 'MODULE_FRONT_PAGE_BANNER_ROTATOR_MAX_DISPLAY', '4', 'Maximum number of banners that the Banner Rotator will show', '6', '0', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array ( 'MODULE_FRONT_PAGE_BANNER_ROTATOR_CONTENT_WIDTH', 'MODULE_FRONT_PAGE_BANNER_ROTATOR_STATUS', 'MODULE_FRONT_PAGE_BANNER_ROTATOR_SORT_ORDER', 'MODULE_FRONT_PAGE_BANNER_ROTATOR_FADE_TIME', 'MODULE_FRONT_PAGE_BANNER_ROTATOR_HOLD_TIME', 'MODULE_FRONT_PAGE_BANNER_ROTATOR_BANNER_ORDER', 'MODULE_FRONT_PAGE_BANNER_ROTATOR_GROUP', 'MODULE_FRONT_PAGE_BANNER_ROTATOR_MAX_DISPLAY' ); } function createImage($width = 900, $height = 500, $red = 255, $green = 0, $blue = 0) { $im = imagecreatetruecolor($width, $height); // sets background to red $color = imagecolorallocate($im, (int)$red, (int)$green, (int)$blue); imagefill($im, 0, 0, $color); //header('Content-type: image/png'); ob_start(); imagepng($im); $contents = ob_get_contents(); ob_end_clean(); imagedestroy($im); $imgData = base64_encode($contents); $src = 'data: image/png;base64,'.$imgData; return $src; } } ?> 2.) Includes/modules/content/header/templates/carousel.php <div id="carousel" class="col-sm-<?php echo $content_width; ?>"> <?php echo $carousel; ?> </div> 3.) Includes/languages/english/modules/content/header/cm_carousel.php <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2014 osCommerce Released under the GNU General Public License */ define('MODULE_FRONT_PAGE_BANNER_ROTATOR_TITLE', 'Carousel Banners For Home Page'); define('MODULE_FRONT_PAGE_BANNER_ROTATOR_DESCRIPTION', 'Adds a carousel to Home Page with banner images set from Banner Manager.'); ?> The only thing needed is to style your carousel in your user.css file by specifying whichever minimum heights you want or using bootstrap media queries for various screens. I've checked the code, and its working. Feel free to improve and offer any tips on this. Screenshot attached of the admin options and carousel on home page. I just used the stock oscommerce logo as a banner in this one.
  3. vampirehunter

    Country-State Selector

    is this already added to the 2.3.4.1 ce frozen version?
  4. hi, do you have example of it in action how it looks? or the code what you did to get it in that way.
  5. hi thanks this looks great if this is used to redo the template of product info page. whats the best way to re introduce the PHP code bits back in? as there is a fair bit of php code that spits out some html and other fields on the page. ive always found this page tricky to edit and keep track of div tags
  6. vampirehunter

    Purchase without account for 2.3.4 and BS2334

    hi managed to find out the 2nd domain i made was a direct copy of the 1st site, and there are 2 fields in the database that required changing that still had the 1st sites email in it.
  7. vampirehunter

    Purchase without account for 2.3.4 and BS2334

    how do we edit this line here? NOTE: This email address has been submitted by a visitor to our online-shop. If you were not this visitor, please send a message to:************. Thank you for your purchase and have a nice day. for some reason, my confirmation order email is showing an incorrect email from a different domain, how is this edited? in admin all the correct emails have been set, but the order confirmation email shows my other domains email address.
  8. vampirehunter

    Purchase without account for 2.3.4 and BS2334

    hi. can anyone help the email address for store owner is not showing correctly in the confirmation order email? all the emails are correctly set in the admin also, i tried to find where this "Note: this email address has been submitted" line and cannot find it in any file? which file is it in? Date Ordered: Monday 04 June, 2018 NOTE: This email address has been submitted by a visitor to our online-shop. If you were not this visitor, please send a message to:************. Thank you for your purchase and have a nice day.
  9. vampirehunter

    KissIT Image Thumnailer

    can anyone advise whenever i upload an image, the product info page is failing to load fully i checked error log and it says this PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 12000 bytes) not sure why. i have 3 other sites running exact same code and same php 5.4 on server what could it be? the page loads fine when there are no images uploaded
  10. vampirehunter

    KissIT Image Thumnailer

    hi i have this kissit thumbnailer added to the default colorbox gallery is there a way to easily add it so it works with the slick gallery? or any other different gallery for that matter? thanks
  11. hi i was wondering if someone can advise. There is no guest checkout being used. Users have to sign up to purchase from the shop. I want to have an additional item or possibly attribute to only show up in the products listings when a specific other main item has been purchased. So for example, users can purchase the main item, but can only see the additional item after its been purchased and they are logged in. What is the simplest way to do it? So user logged in -> Can see Main Item Purchases Main Item. The additional item or alternatively items attributes then will show up in product listings whenever they are logged in.
  12. vampirehunter

    New Payflow requirement: TLS 1.2 & HTTP/1.1

    i ran the script and got this on my hosting PHP version: 5.4.45 curl version: 7.36.0 SSL version: OpenSSL/1.0.1e SSL version number: 0 OPENSSL_VERSION_NUMBER: 1000105f TLS test (default): TLS 1.2 TLS test (TLS_v1): TLS 1.2 TLS test (TLS_v1_2): TLS 1.2
  13. vampirehunter

    New Payflow requirement: TLS 1.2 & HTTP/1.1

    i have the paypal app installed on a edge/BS oscommerce im using paypal standard in the app I have configured my API using my paypal API username details and have a pdt token set. I dont have any information in the private key, public certificate or openssl fields in configure on the app. ive been able to accept payments. do i need to do anything in regards to this announcement?
  14. vampirehunter

    [CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

    whats the pros and cons of this addon vs the Ultimate SEO Urls for bootstrap version of oscommerce?
  15. vampirehunter

    PayPal App v5.000

    hi sorry if this sounds stupid, but if im using the Paypal App with my paypal api credentials. on the settings for paypal standard which im using ive set the PDT token but do i still require a public certificate, private key and openssl also?
  16. are these better suited to the Bootstrap versions than Gadlols SEO friendly url addon?
  17. vampirehunter

    AJAX Attribute Manager support

    Hi Does this plugin help to sort out the attributes easier than the default oscommerce? As in, you can sort attributes easily? and is it same as this one where you can add attributes when adding a new product for easier setup? https://apps.oscommerce.com/6E6Qw thanks
  18. vampirehunter

    PayPal App v5.010 for v2.3.4BS

    hi does encrypted payments have to be selected? i have set up api correctly but wondering if Encrypted payments should be selected to true?
  19. vampirehunter

    PayPal App v5.000

    hi i checked mine has no update button it just has button linking to the addon area would i need to manually add this addon myself?
  20. vampirehunter

    PayPal App v5.000

    can anyone advise. my paypal v4.039 i have currently can i just install the latest version of 5.010 drag and drop?
  21. vampirehunter

    PayPal App v5.010 for v2.3.4BS

    hi. my paypal app is currently 4.039 do i just install the latest version ontop of the existing one? or do i need to install each update first?
  22. vampirehunter

    PayPal App v5.000

    is it fairly easy to update the existing app to this newest version?
×