kgtee 77 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 77 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 77 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 77 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 77 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,112 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: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Need Help? See this thread and provide the information requested. How to Upgrade to the latest version Recommended SEO Addons Share this post Link to post Share on other sites
kgtee 77 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,112 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: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Need Help? See this thread and provide the information requested. How to Upgrade to the latest version Recommended SEO Addons Share this post Link to post Share on other sites
♥raiwa 1,472 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,112 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: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Need Help? See this thread and provide the information requested. How to Upgrade to the latest version Recommended SEO Addons Share this post Link to post Share on other sites
♥raiwa 1,472 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 77 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 547 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,112 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: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Need Help? See this thread and provide the information requested. How to Upgrade to the latest version Recommended SEO Addons Share this post Link to post Share on other sites
♥Dan Cole 547 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 547 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,112 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. 3 1 domiosc, Fredi, valquiria23 and 1 other reacted to this Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Need Help? See this thread and provide the information requested. How to Upgrade to the latest version Recommended SEO Addons Share this post Link to post Share on other sites
Fredi 104 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
Owl Sauron 9 Posted May 17, 2021 On 11/16/2020 at 7:01 PM, Jack_mcs said: 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. Are you going to update this module to the new Phoenix versions? Installed it on Phoenix 1.0.8.0 with PHP 7.0 and got a odd "bug": each banner is displayed 3 times before going to the next one. Any idea how to fix this? Share this post Link to post Share on other sites
Jack_mcs 1,112 Posted May 18, 2021 Probably. As for showing three times. I can't imagine what would cause that.The only thing I can guess at is if you have both the header and index modules installed since they are not made to run at the same time. If you only have one installed, remove it and try the other one to see if that makes a difference. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Need Help? See this thread and provide the information requested. How to Upgrade to the latest version Recommended SEO Addons Share this post Link to post Share on other sites
Owl Sauron 9 Posted May 18, 2021 7 hours ago, Jack_mcs said: Probably. As for showing three times. I can't imagine what would cause that.The only thing I can guess at is if you have both the header and index modules installed since they are not made to run at the same time. If you only have one installed, remove it and try the other one to see if that makes a difference. only used the header. already tried that. Index does the same, one installed at a time. Share this post Link to post Share on other sites
Jack_mcs 1,112 Posted May 18, 2021 Then it must be due to compatibility with the version of your shop since the problem doesn't exist in others. I'll check that before uploading a new version. 1 Owl Sauron reacted to this Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Need Help? See this thread and provide the information requested. How to Upgrade to the latest version Recommended SEO Addons Share this post Link to post Share on other sites
Owl Sauron 9 Posted May 20, 2021 Ok... had a few mins free and took a look at it and found the problem. Its with the number of installed languages you have on the shop. It will show the HTML Text for each language for the same slide generating (slide * languages) slides. Since i wont use any HTML Text on the banner i simply did a "quick fix" for the header module as: Edit file "tpl_cm_header_jssor.php" replacing from line 5 to 16 the following code: " $banner_query = tep_db_query("select a.advert_id, a.advert_url, a.advert_image, ai.advert_html_text from advert a left join advert_info ai using(advert_id) where advert_group = '" . MODULE_CONTENT_HEADER_JSSOR_SLIDER_GROUP . "' and status = 1"); if (($cnt = tep_db_num_rows($banner_query)) > 0) { while ($banner = tep_db_fetch_array($banner_query)) { if (tep_not_null($banner['advert_image'])) { $imgArray[] = tep_image('images/' . $banner['advert_image'], $banner['advert_html_text'], '','','u="image"'); $txtArray[] = $banner['advert_html_text']; } else { $imgArray[] = $banner['advert_html_text']; } " with: " $banner_query = tep_db_query("select advert_id, advert_url, advert_image from advert where advert_group = '" . MODULE_CONTENT_HEADER_JSSOR_SLIDER_GROUP . "' and status = 1"); if (($cnt = tep_db_num_rows($banner_query)) > 0) { while ($banner = tep_db_fetch_array($banner_query)) { if (tep_not_null($banner['advert_image'])) { $imgArray[] = tep_image('images/' . $banner['advert_image'], '', '','','u="image"'); } " its just an headsup so you dont waste time looking for the bug and can fix the problem when you update the module but might be handy for someone else in the meanwhile. Tested on Phoenix 1.0.8.0 PHP 7.0 1 Jack_mcs reacted to this Share this post Link to post Share on other sites
Owl Sauron 9 Posted May 20, 2021 Actually... please ignore my last fix. Its even easier and you can make use of the HTML Text feature: Edit file "tpl_cm_header_jssor.php" and replace: " $banner_query = tep_db_query("select a.advert_id, a.advert_url, a.advert_image, ai.advert_html_text from advert a left join advert_info ai using(advert_id) where advert_group = '" . MODULE_CONTENT_HEADER_JSSOR_SLIDER_GROUP . "' and status = 1"); " with: " $banner_query = tep_db_query("select a.advert_id, a.advert_url, a.advert_image, ai.advert_html_text, ai.languages_id from advert a left join advert_info ai using(advert_id) where advert_group = '" . MODULE_CONTENT_HEADER_JSSOR_SLIDER_GROUP . "' and status = '1' AND ai.languages_id = " . (int)$_SESSION['languages_id'] . " "); " and the file "tpl_cm_i_jssor.php" replace with: " $banner_query = tep_db_query("select a.advert_id, a.advert_url, a.advert_image, ai.advert_html_text, ai.languages_id from advert a left join advert_info ai using(advert_id) where advert_group = '" . MODULE_CONTENT_INDEX_JSSOR_SLIDER_GROUP . "' and status = '1' AND ai.languages_id = " . (int)$_SESSION['languages_id'] . " "); " Share this post Link to post Share on other sites