kgtee 67 Posted July 7, 2019 (edited) I have this Jssor Slide module installed in my OSC Frozen for a couple of months now. It has been displaying the banners very well. Just a few days back, I realized that some banners which were due to expire on June 30 are still being displayed. I checked with the Banner Manager, the expiry dates for these banners are still set correctly. Somehow, the banners continue to be displayed. Has anyone encountered this situation? What is the solution? Thank you in advance! Additional note: I have a second look at the banner manager. It appears only those banners with Displays/Clicks Counts = 0/0 are not expired automatically. Why 0/0? Edited July 7, 2019 by kgtee Share this post Link to post Share on other sites
kgtee 67 Posted July 7, 2019 21 minutes ago, kgtee said: I have this Jssor Slide module installed in my OSC Frozen for a couple of months now. It has been displaying the banners very well. Just a few days back, I realized that some banners which were due to expire on June 30 are still being displayed. I checked with the Banner Manager, the expiry dates for these banners are still set correctly. Somehow, the banners continue to be displayed. Has anyone encountered this situation? What is the solution? Thank you in advance! Additional note: I have a second look at the banner manager. It appears only those banners with Displays/Clicks Counts = 0/0 are not expired automatically. Why 0/0? Just discovered with phpmyadmin, these problematic slides are not recorded in the banners_history database. ?? Share this post Link to post Share on other sites
kgtee 67 Posted July 7, 2019 (edited) It seems JSlider module has no association with banner.php and has totally ignored the displays and clicks update functions in there. Edited July 7, 2019 by kgtee Share this post Link to post Share on other sites
kgtee 67 Posted July 7, 2019 (edited) 5 hours ago, kgtee said: Just discovered with phpmyadmin, these problematic slides are not recorded in the banners_history database. ?? I added the record for new slides and this solves the expiry problem. I edited catalog/admin.banner_manager.php: Quote if ($action == 'insert') { $insert_sql_data = array('date_added' => 'now()', 'status' => '1'); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); tep_db_perform(TABLE_BANNERS, $sql_data_array); $banners_id = tep_db_insert_id(); // add history record for new banner $sql_data_array_h = array('banners_id' => $banners_id, 'banners_shown' => 0, 'banners_clicked' => 0, 'banners_history_date' => 'now()'); tep_db_perform(TABLE_BANNERS_HISTORY, $sql_data_array_h); // end add history record I also added the one line in the template tpl_cm_i_jssor.php: Quote if (($cnt = tep_db_num_rows($banner_query)) > 0) { while ($banner = tep_db_fetch_array($banner_query)) { if (tep_not_null($banner['banners_html_text'])) { $imgArray[] = $banner['banners_html_text']; } else { $imgArray[] = tep_image('images/' . $banner['banners_image'], $banner['banners_html_text'], '','','u="image"'); } if (tep_not_null($banner['banners_url'])) { $urlArray[] = tep_href_link($banner['banners_url']); } else { $urlArray[] = '#'; } // added by KGT tep_update_banner_display_count($banner['banners_id']);// end by KGT Now, my display counts are ticking. 😂 Edited July 7, 2019 by kgtee 1 Jack_mcs reacted to this Share this post Link to post Share on other sites
kgtee 67 Posted July 13, 2019 I believe I have installed this Jssor Slider module in OSC Phoenix successfully. The HTML page source suggests the code is running normally. However I am not seeing any slides nor the navigation bullets and arrows being shown. The slides seem to be covered by an opaque layer on top. What may be the cause? Share this post Link to post Share on other sites
Jack_mcs 1,020 Posted July 13, 2019 I haven't tried it in Phoenix but my guess is that it is because the main javascript include is loaded in the footer in Phoenix, where it was loaded in the header in BS3. That means the javascript in this addon doesn't have the defines it needs. Support Links: Need Help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC version (the community-supported responsive version) here. How to Upgrade to the latest version Recommended SEO Addons Share this post Link to post Share on other sites
kgtee 67 Posted July 13, 2019 2 hours ago, Jack_mcs said: I haven't tried it in Phoenix but my guess is that it is because the main javascript include is loaded in the footer in Phoenix, where it was loaded in the header in BS3. That means the javascript in this addon doesn't have the defines it needs. @Jack_mcs Many thanks! You are right indeed. I moved the following 3 lines from template_bottom.php to template_top.php: Quote echo $OSCOM_Hooks->call('siteWide', 'injectAfterFooter'); echo $OSCOM_Hooks->call('siteWide', 'injectSiteEnd'); echo $oscTemplate->getBlocks('footer_scripts'); The Jssor Slider now works beautifully. I now wonder whether moving these lines will have any other impact on the site design or not? Kind of worried. 😨 Share this post Link to post Share on other sites
Jack_mcs 1,020 Posted July 13, 2019 It shouldn't cause a problem with other code, that I can think of. But it is not the correct change since it will break should you ever update the core files. See my Message Box addon for the code change to allow it to work without changing the core files. 1 kgtee reacted to this Support Links: Need Help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC version (the community-supported responsive version) here. How to Upgrade to the latest version Recommended SEO Addons Share this post Link to post Share on other sites
♥raiwa 1,419 Posted July 13, 2019 6 hours ago, Jack_mcs said: I haven't tried it in Phoenix but my guess is that it is because the main javascript include is loaded in the footer in Phoenix, where it was loaded in the header in BS3. That means the javascript in this addon doesn't have the defines it needs. I do not know the details of this addon, but if you Inject the scripts into "footer_scripts" it should work without core changes: $oscTemplate->addBlock($variable_ containing_the_script . PHP_EOL, 'footer_scripts'); See example in ht_grid_list_view.php About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
Jack_mcs 1,020 Posted July 14, 2019 18 hours ago, raiwa said: I do not know the details of this addon, but if you Inject the scripts into "footer_scripts" it should work without core changes: Thanks for mentioning this. The way I did it was place my javascript within code to wait for the script to load. It's in the module so there's not any changes to the core files. window.addEventListener('DOMContentLoaded', function() { //script goes here }); 1 kgtee reacted to this Support Links: Need Help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC version (the community-supported responsive version) here. How to Upgrade to the latest version Recommended SEO Addons Share this post Link to post Share on other sites
♥raiwa 1,419 Posted July 14, 2019 23 hours ago, kgtee said: @Jack_mcs Many thanks! You are right indeed. I moved the following 3 lines from template_bottom.php to template_top.php: Sorry for probably messing up. I referred to this message. 1 kgtee reacted to this About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
kgtee 67 Posted July 28, 2019 (edited) I have been trying to figure out how to get the banner click count working. I just found the solution. In the template file tpl_cm_i_jssor.php: Quote // Find this line and disable it // $urlArray[] = tep_href_link($banner['banners_url']); // Replace it with the one below $urlArray[] = tep_href_link('redirect.php', 'action=banner&goto=' . $banner['banners_id']); Now, the URL click counts are ticking too. 😄😂😊 Edited July 28, 2019 by kgtee 1 Jack_mcs reacted to this Share this post Link to post Share on other sites
♥Dan Cole 546 Posted October 25, 2019 Jack or anyone else reading this for that matter. I'm looking to add this to a new Phoenix install and was wondering if the package/add-on has been updated recently. Reading the thread it looks like there are several changes that should be incorporated. Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here. Share this post Link to post Share on other sites
Jack_mcs 1,020 Posted October 25, 2019 I have a new version here that I plan on releasing but the current version will work as long as the following changes are made. In the includes/modules/content/header/templates/cm_header_jssor.php and the includes/modules/content/index/templates/tpl_cm_i_jssor.php files (or just the one you want to use), find jQuery(document).ready(function ($) { and add this above it window.addEventListener('DOMContentLoaded', function() { //wait for jquery to load Then farther down, find }); </script> and change it to }); }); </script> It should work fine then but please let me know if it doesn't. Support Links: Need Help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC version (the community-supported responsive version) here. How to Upgrade to the latest version Recommended SEO Addons Share this post Link to post Share on other sites
♥Dan Cole 546 Posted October 25, 2019 Thanks Jack...I thought there were several changes based on the feedback in this thread but perhaps they were for some specific/unique setups. I'll download it and give it a go. Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here. Share this post Link to post Share on other sites
♥Dan Cole 546 Posted October 25, 2019 Early days but it seems to work just fine Jack. Dan Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here. Share this post Link to post Share on other sites
Jack_mcs 1,020 Posted November 16, 2020 A new version has been uploaded with these changes: Added code to delay javascript to make it compatible with Phoenix. Changed code to be compatible with the new advert system (Phoenix only). Changed code to allow text to be shown on the banners. Moved the jssor images to the correct location to match the code. 2 1 valquiria23, Smoky Barnable and Fredi reacted to this Support Links: Need Help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC version (the community-supported responsive version) here. How to Upgrade to the latest version Recommended SEO Addons Share this post Link to post Share on other sites
Fredi 98 Posted November 18, 2020 Thank You Jack! Installed the module on a test site, everything works SUPER!👍👌 1 Jack_mcs reacted to this Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.Best regards, Fredi Share this post Link to post Share on other sites