Jump to content
kymation

[Addon] Banner Box for 2.3

Recommended Posts

Hi,

 

I am still getting this error

 

TEP ERROR! (tep_display_banner(static, 1) -> Banner with ID '1' not found, or status inactive

 

 

I Set the banner group to hfc_module for the header banner. How can i go abt this?

Share this post


Link to post
Share on other sites

You need to have at least one banner set up in the hfc_module banner group. Use the Banner Manager in your admin to add a banner.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi,

 

I already did add the banner and its showing me this message....I even uninstalled n installed the module again but still the error message is on...

Share this post


Link to post
Share on other sites

The error message says that you banner does not exist, or you have it set to inactive in the Banner Manager.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Yes. Find this code in the module file:

 

 global $language, $oscTemplate;

if ($banner = tep_banner_exists('dynamic', 'hfc_module')) {

 

and change it to this:

 

 global $language, $oscTemplate, $current_category_id, $PHP_SELF;

if ($banner = tep_banner_exists('dynamic', 'hfc_module') && $PHP_SELF == 'index.php' && $current_category_id == 0 ) {

 

Regards

Jim

 

Hi, I found the error. I changed the code to this, and its not showing the error msg i stated. But when i use the original code, it works fine..

Share this post


Link to post
Share on other sites

That change restricts the module to run only on the front page. It doesn't fix any known bugs.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi, I have tried much. but i still get that error msg. I want it to display on the index page only. So i changed the codes as u said in  the hfc_banner.php

it works fine when i dont change the codes to display in the index page. 

Share this post


Link to post
Share on other sites

Hi Jim, 

 

I have a problem installing the module. 

I have read your manual and followed the step like the manual said. 

 

When I try to install the module in my admin panel, the module is not visible. 

Does this problem occurred before or do you have a solution? 

 

Dear regards, 

 

Ben 

Share this post


Link to post
Share on other sites

@@shafa1827  You've made a mistake in the placement of that new code. Check again that you have it in the correct location. If it still doesn't work, post the error meccage that youare getting and the cod that you have chaged, including a few lines before and after so I can see where it is.

 

@@benwijns  The most likely cause is that you ave uploaded one or more files to the wrong location. Check the file locations in the instructions against yours.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Thank you for this contribution.  It works great until I set Rotate Banners to "True".  For some reason the banners don't show up nor the navigation controls.  The only thing that displays is a small 5 pixel dark square where the banners should be.  Seems to be independent of browsers. 

Share this post


Link to post
Share on other sites

Check that you have the Banners Box Goup Name in the module set to the same group as your banners in your Banner Manager.

 

Regards

Jim

Edited by kymation

See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

The names are matching.  I even changed them to a new name for the group just to double check and still no luck. 

 

I uninstalled and reinstalled the module and still no luck. 

 

It almost feels like a javascript problem I'm having because everything works fine until I change Banner Rotate to "True". 

 

Also When I check my bm_banner_rotator.php file the variable var $enabled = True is not being changed from "false" to "true" when I change the value in the admin panel.  I changed it to "True" manually, but that didn't change anything.  

Share this post


Link to post
Share on other sites

Check that the files in your /ext/jquery/bannerRotator/ directory are there and not corrupted. That's the JavaScript that manages the rotator.

 

The values in the file will never change; those are just the default values. The actual values are stored in the database. If you changed it manually, check that you changed it to True and not true. It's a text variable and we don't check for case.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I've been looking it over for a few hours.  Everything looks good.   I tried playing around with where the javascript ready function was being called in bm_banner_rotator and got the first banner to load, but still could not get banner rotation.  Probably dumb luck.  Would it be possible for me to see the html source for a webpage using the rotator function? 

 

Also, if one of my banners was bad (eg. bad id number, bad code) would that stop the other banners from displaying in the rotation? 

Share this post


Link to post
Share on other sites

I don't have this set up on a test site. I'll try to do that later if I have the time.

 

I've never tried a banner rotator with a bad banner file. Check that all of your banners will display by calling them individually in the module or directly in your browser. A bad banner ID should only affect the bad banner and not the others.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

well, I checked my source code and all of my banners display properly on a blank html page ie. the banner array loaded by the bm_banner_rotator.php module is good.  The only thing left now that I can think of are the arguments that are being passed to the javascript function.  I think that for some reason empty arguments are being passed to the javascript function.  This would explain why the banner controls display, but no images display when I set rotation to true. 

 

Actually could the problem be that I am using jquery for another function on my page?  The banner rotation function depends on jquery right?  Is it ok or possible to use jquery for multiple functions at the same time?  

Share this post


Link to post
Share on other sites

It's OK to use jQuery on multiple functions on a page. Stock osCommerce uses jQuery to generate the page theme, buttons, etc.

 

Possibly the version of jQuery you are using is incompatible. I haven't seen this problem before, so I can only suggest some of the things I've seen before that cause problems with the banner rotator in various ways.

 

Try using Firebug in Firefox to inspect the banner box. That will tell you if the banner calls are malformed or missing the images.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Thank you so much.  Firebug was exactly what I needed.  It took me about 10 hours, but it gave me a much better understanding of what was going on.  Awesome tool.  Combined with stackoverflow.com and jsfiddle I was able to nail the problem down to javascript...jquery to be exact.  I had a template installed that was using an outdated jquery, maybe even a custom one.  Not only that, but your banner and one of my previously installed sliders were colliding due to how and when the functions were being called.  I didn't figure any of this out until I was halfway into replacing the Beacon 9 jquery banner rotator with the Unslider jquery slider inside of your BannerRotator install. 

 

Long story short, I tweaked a few settings for the new jquery script, updated my jquery files, moved the javascript ready function from the default location in your bannerRotator.php file (I was having problems with a line in bm_banner_Rotator.php where the argument passed to the javascript function is a class) into the header as pure javascript and now everything is working ok. 

 

Thanks again for your quick responses.  I appreciate all of your help.  I learned a lot.    

Share this post


Link to post
Share on other sites

Glad to hear you got it working. Software conflicts are always a pain; JavaScript double so.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi, I installed the latest version of Banner Box, but when I want to install the module in the admin panel, this error appears:

Fatal error: Cannot redeclare class bm_banner_rotator in C:\xampp\htdocs\oscommerce234\catalog\includes\modules\boxes\bm_banner_rotator.php on line 15

 

What is it that I have to do to make it work? Thank you very much.

Share this post


Link to post
Share on other sites

There are two possibilities:

1. you put one of the files in the wrong place. Try uploading the files again.

2. You have another banner rotator somewhere else on the page. They conflict, and the second one throws an error.

 

Regrds

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

There are two possibilities:

1. you put one of the files in the wrong place. Try uploading the files again.

2. You have another banner rotator somewhere else on the page. They conflict, and the second one throws an error.

 

Regrds

Jim

 Dear Jim, I apologize but I am a very beginner. I changed the class name in catalog/includes/modules\boxes\bm_banner_rotator.php from class bm_banner_rotator to class bm_banner_rotator1. In the Admin it works fine. I installed the module and uploaded 2 banners. But on the side they do not appear. I guess I have to change something else. Maybe you could give me a clue? Thank you very much.

Share this post


Link to post
Share on other sites

Working on OSc 2.3.4, I installed your addon. Everything is working so far.

 

Question:

 

I don't want to rotate any banners. How do I have to change the code if I just want to have the english banner on the english version of the shop, the german on the german, and so on. Right now they are picked randomly - therefore I don't know for what the languages which I set in the banner-manager are good for?

 

Thank's for any reply.

stefan

Share this post


Link to post
Share on other sites

osCommerce 2.3.4 doesn't have any language controls in the Banner Manager. It's single language only. If that's something you've added, of course it is not compatible with the stock Banner Rotator. You'll need to make changes to the code to do that.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×