Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

[CONTRIBUTION] Banner Multi language MOD


Recommended Posts



I'd like to ask you a question about the contribution Banner Multi language MOD.

I installed it successfully, but I get a little problem.

I installed the banner for my 3 languages, French dutch and English.

But the banner doesn't always match the right language. And if I refresh the page a few times, the language of the banner switches to another language alone.

So I get french with dutch, then english with english then with french.


Could you help me with that please?

My site is http://www.lejoaillier.be

Thank you.

Link to comment
Share on other sites

  • 3 months later...

I'm having the same problem. I have two languages, spanish and english. I installed it as well, banners show up, but sometimes they match the right language and sometimes they don't. I saw an amendment was made to the contribution to allow "languages from TABLE LANGUAGES", but aside from updating coding, no other information was written, so I have no idea if this (TABLE LANGUAGES) is the problem that I'm having. Can anyone please explain? Or if you've figured it out, can you please help?

Link to comment
Share on other sites

  • 2 months later...

@@belilan, @@yohan_kib, were you ever able to find a solution?


I've tried to sort it out, but to no avail. My only conclusion is that this is a mod for a banner rotator add-on out there and the original contributor just forgot to mention? I assumed MOD was for module, but it would make sense if it's a modification of another add-on, like the jQuery Banner Rotator contribution.


Either way, would be super helpful if someone can shed some light. (Fingers crossed @@OSC-Sevilla sees this!)


For the record, I've uninstalled and reinstalled this as-is 3 times so far, even with the language from tables update submitted by @@mpps. No luck at all.




Edited by Chachita
Link to comment
Share on other sites

  • 2 months later...

The same thing is happening for me. I think I know what the issue is but I don't know how to fix it. I am trying to use '2.3.1 - Banner Language Mod.zip' on osC 2.3.3 by OSC-Sevilla. Additionally I am using nivo Slider. Since the admin/banner_manager.php is not the same version that's in use with 2.3.3 I hand copied all the language related entries into my file rather than replacing it. Then for each admin/includes/language/xxx/banner_manager.php I added the new defines.


And this was the database mod that was used:

ALTER TABLE `banners` ADD `language_id` INT( 11 ) NOT NULL DEFAULT '1' AFTER `banners_id` ;


What I did after was make a directory in the images/adds directory in my install, for each of my languages. I then copied the images to be used in my banners for each language into the appropriate directory that I created. Then in the banner manager I created banner elements for all the languages and added them to the same banner group. The mod does allow you to set the language when you are doing this and the table language key values are updated correctly in the banners table. The admin area seems to completely work with regards to this.


And here is where I see the issue. The banners load with all the images regardless of the language definition. So I think that the key is modifying the includes/functions/banner.php so that it loads the banner elements based on the fact that languages in use match the language id of the banner element whenever the banner is refreshed.

Link to comment
Share on other sites

@@mrembedded, if i follow you correctly, you placed the banner images for each language within the root/includes/[language] directory for each language? right now, i have them all set up in the same folder in root/images/banners, but would make sense to put in each language folder. i'll give that try and see if it changes anything.


if not, then i agree, it must be the includes/functions/banner.php file that needs tweaking. i too am using the nivo slider, and i've tried dissecting the code with my own limited knowledge of php, but no luck. although, i also wonder if its the actual backend set-up for the banners. could it be the banner group assigned? maybe if each language had its own group? i dont understand how banner groups work, so i havent attempted that yet. have to admit, im a bit scared to.

Link to comment
Share on other sites

I have a folder in images called adds, catalog/images/adds/ and in that folder i added a folder for each language, catalog/image/adds/english for example. I put the related images in each language folder. You could do it the way that you suggested.


I am not a coder at all but have been playing with the includes/functions/banner.php and in my version (not stock 2.3.3 but included with a template that was purchased, file says 2003) and the code in this block:


// Display a banner from the specified group or banner id ($identifier)


seems to be the most important. I have 6 images, 3 in each language folder and the banner loads all 6 images related to the banner group regardless of language. I tried to change the database queries 'where' clause to add language_id=1 (my main language) into the string with the hope of the code only pulling and displaying the images for one language. The way the code works, it has multiple validations and will still pull the 6 images (when it should pull 3). The banner will display with 6 items but when it switches to the actual images of 3 of them you will get no image displayed and a TEP error about being disabled or not found because the result of the query mod gives correctly gives 3 elements. So that's a step in the right direction. My thinking was that if I could get the code to display the correct amount of images with a fixed language_id value in the database queries, I could then replace that fixed value with the user selected language variable value once I figured out how. I don't understand why it still tries to display the full 6 images. I must not be fiddling with the correct block of code that gets the initial images associated with the banner group. There is a 'select count(*)' query that seems to be used to grab the banners that are part of the banners group and limiting this to grab only the 3 images still has the effect of trying to display 6.


I think at minimum that whole block needs to be rewritten for it to work the way we want it to with the language mod. It would be nice to have access to a database map and flowchart of osC to better understand the logic independently of the code.

Link to comment
Share on other sites

@@mrembedded, i'm soooo not going to pretend i understand anything you just said! lol. i tried before to ask in the forums if the creator of this mod could at least clarify which add-on it is a mod for, but no luck. my suspicion is that this is not built for the nivo slider. hopefully someone with a greater understanding of this could help us out!

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.

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...