Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon] Banner Box for 2.3


kymation

Recommended Posts

I just tested this on a stock osCommerce install (Version 2.3.3) and it does the same thing you reported. I don't believe this bug has been fixed in any of the never versions. As a quick patch, find this code in includes/functions/banner.php:

 

  $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';

 

and replace with:

 

  if( $banner['banners_url'] != '' ) {
         $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';
  }

 

You'll also have to add banners_url, to the beginning of the two SQL strings above that.

 

Regards

Jim

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

Link to comment
Share on other sites

I've made the change, but I am not sure what the last instructions mean.

 

I just tested this on a stock osCommerce install (Version 2.3.3) and it does the same thing you reported. I don't believe this bug has been fixed in any of the never versions. As a quick patch, find this code in includes/functions/banner.php:

 

 $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';

 

and replace with:

 

 if( $banner['banners_url'] != '' ) {
$banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';
 }

 

You'll also have to add banners_url, to the beginning of the two SQL strings above that.

 

Regards

Jim

 

I'm sorry, but I do not know what that means. Could you please be a bit more specific? I have no training and don't know what the SQL string is.

 

At this point, the box heading is showing, but the photo is not. I'm thinking it is probably because I have not done the last part of your instructions.

 

Thank you,

Jewell

Link to comment
Share on other sites

The above change will not stop anything from working, so if it's not working you've done something wrong. Go back to your backup and try again.

 

Find this code (There is more on the line after that, I just don't want to type it all)

 

    $banner = tep_random_select("select banners_id, banners_title,

 

and change to

 

    $banner = tep_random_select("select banners_id, banners_title, banners_url,

 

then find this code

 

    $banner_query = tep_db_query("select banners_id, banners_title,

 

and change to

 

    $banner_query = tep_db_query("select banners_id, banners_title,banners_url,

 

Regards

Jim

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

Link to comment
Share on other sites

Hi, Jim:

 

I've done as suggested; starting over again with a fresh includes/functions/banner.php file. That reverted the file back to previous setup ... the photo showed up centered in the box on my website and when I clicked on it a new blank page was created.

 

I followed your instructions above to make changes to the banner.php file. And when I was done I had the same issue as before. The banner box heading is there, but the photo does not show up. If I go into Admin account and change the settings on the banner box with rotator, setting Rotate Banners to 'True', the picture shows up again but it is forced to the left instead of being centered.

 

At this point I have restored the banner.php file to its original state. My page looks right ... but when the picture is clicked on, it takes me to a blank page with this url: http://www.jewellsembroidery.com/shop/redirect.php?action=banner&goto=7

 

Question: When I go to my website and right click on the image it gives me the same url as above. Does that mean it has been programmed to do that? Is there any way to know where that code is located and just go in and change it?

 

Thank you again for your help. I truly appreciate it.

Jewell

Edited by jeu4328
Link to comment
Share on other sites

Yes, I made a mistake in my code. I told you to replace with thie:

 

         if( $banner['banners_url'] != '' ) {
                 $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';
         }

 

and that should have been:

 

         if( $banner['banners_url'] != '' ) {
                 $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';
         } else {
                 $banner_string = tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) ;
         }

 

Sorry about the error.

 

Regards

Jim

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

Link to comment
Share on other sites

Hi, Jim:

 

No problem at all. :P

 

The new code works perfectly with a static photo.

 

To test it, I changed the setting to 'rotate', and it still pulls the images to the left.

 

Thank you so much for the updated code. I love the new banner box! :lol:

 

Have a fantastic weekend!

Jewell

Edited by jeu4328
Link to comment
Share on other sites

Hello:

 

At one point tonight I worked on the 'Extras' that were attached to the Rotating Banner I installed earlier this week ... the header/footer banner add-on. However, I have removed the files because I read that the header/footer portion of the add-on should have been added before the right/left column rotating banner. :-

 

Weird things are now happening in the footer area of my eStore. At the bottom I normally have an image that says "The perfect gift is only minutes away!". Right above that I have a small graphic giving credit to Clipartoon.com for artwork used in digitizing some of my designs. Before I worked on my site tonight, both images were at the bottom of my website ... neither of them had borders.

 

After adding the module files, the outlines came back ... and only one of the images is showing up at a time. Each of the two images seems to show up every one or two times the site is refreshed. I've removed the changes, but my footer is still not right. Something must be 'set' somewhere that is telling the footer to change randomly each time the site is refreshed. This is not what I would like to have happen. I prefer to have both of the images at the bottom of the page ... without a border on either of them.

 

Would you know which file might need to be updated to make this correction (remove borders and have both images showing at same time)? And what code would be needed to correct the problem?

 

Thank you very much,

Jewell

Link to comment
Share on other sites

My guess is that you have replaced the footer with a copy of the stock footer, and yours had previously been changed. You need to restore the includes/footer.php with your backup of the version that worked the way you want it to, or make the changes to that file again. I have no idea what changes you had made so can't be more specific.

 

Regards

Jim

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

Link to comment
Share on other sites

Hello:

 

I have replaced the includes/footer.php with older saved version and there is still a border around the footer.

Is there any way to change that in the css stylesheet? I have my images set to have borders. Is there any code I can add to my stylesheet that will remove the border on the footer without removing it from the other images?

 

Thank you,

Jewell

Link to comment
Share on other sites

Yes, you need to add some CSS to remove the borders from the footer. You will probably need to add a class to the div enclosing your footer banners, then style that in your stylesheet. Your footer has been modified so I can't be more specific than that.

 

This is getting off-topic, so if you have more questions that are not related to this addon, please ask those in the general support forum.

 

Regards

Jim

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

Link to comment
Share on other sites

I had already added the following code to my css stylesheet. When I initially added this code, it removed the border around the footer. The code is still in place in my stylesheet.

 

Before this issue, I had been working on installing the Specials Image Overlay Module. I removed it because I was having issues with receiving error messages when trying to install the module and I noticed before removing it that the border around the footer image was back.

#storeLogo img, div.grid_24 > a > img {

border: none;

}

Link to comment
Share on other sites

  • 2 weeks later...

Hi, Jim:

 

I'd like to remove the border from around the image in the banner box.

I've tried making that change in the css stylesheet, but I'm not sure what to type. Nothing I've tried has worked.

 

Could you please tell me if that is where I need to go to make the change, and what code I need to enter?

 

Thank you,

Jewell

Link to comment
Share on other sites

The border is part of the theme, so you would have to override that in your stylesheet. Use Firebug in Firefox to see the CSS being applied to the border. You then need to write your CSS to replace that with your background color.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 2 months later...

Hi,

How can I make banners to rotate with different images whitout stops? Did I missed something in banner manager? In admin I switched on rotate banners to true and define max. banners in rotation and other features. How can I point banner manager to the images? Static banner (only one image) works just fine.

Thanks for the answer.

Regards,

Matjaz

Link to comment
Share on other sites

The banners will rotate if you have multiple banners uploaded and assigned to the proper group. Check in the Banner Manager that you have assigned your banners to the group you chose for this addon.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 3 weeks later...

Hi

 

I have just installed this addon and notice that when I go to admin>banner manager>new I get this

 

Im sure I haven't altered any files. Can someone tell me what I need to do to fix it.

 

I have read through this forum but don't see an answer.

 

Many thanks

post-276414-0-70765700-1392349896_thumb.jpg

Edited by grandpaj
Link to comment
Share on other sites

That's a bug. The language define is missing. Thanks for the bug report; I'll fix that in the next release.

 

In the meantime, add this line to your admin/includes/languages/english/banner_manager.php:

 

 define( 'TEXT_BANNERS_LANGUAGE', 'Language:' );

 

Regards

Jim

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

Link to comment
Share on other sites

That's a bug. The language define is missing. Thanks for the bug report; I'll fix that in the next release.

 

In the meantime, add this line to your admin/includes/languages/english/banner_manager.php:

 

define( 'TEXT_BANNERS_LANGUAGE', 'Language:' );

 

Regards

Jim

 

Many thanks.

 

Kind regards

 

Grandpa

Link to comment
Share on other sites

  • 8 months later...

Hi, Klymation,

 

I have installed the banner_box and it is working fine.  Could you point me in the direction that would allow me to have a banner for each box.  It appears that currently the application provide adding rotating banner to one defined box. 

 

Anyt help would be appreciated.  Thanks.

 

Ken.

Link to comment
Share on other sites

  • 1 month later...

Hi, I have the banner box in the left column and there is a margin on the top and on the left.

 

How would I amend this so there is no margin/padding?

 

Many thanks for the great contribution :)

Link to comment
Share on other sites

The banner box has the same margins as all of your boxes. If you want to do something specific to just this box, add an id to this box by changing line 40 of the bm_banner_rotator.php file to:

        $module_contents = '<div class="ui-widget infoBoxContainer" id="banner_box">' . PHP_EOL;

Then you can add some CSS to change the margin:

#banner_box {
  margin: 0;
}

Or whatever CSS you want to apply to the box.

 

Regards

Jim

Edited by kymation

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...