Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multiple languages News scroller?


Recommended Posts

Hi all,

I am using the contribution: News Scroller Box - NO JAVA/HTML Version and are quite happy with it.

 

My problem is that my shop: www.tokyotoys.biz is multilingual and I would like to have the news only in selected language.

At the moment there is only 1 news.html page located in the Catalog folder.

 

Contrib is :http://www.oscommerce.com/community/contributions,389/category,all/search,news+scroller

 

As I am not so very good at php I humbly reach out my hand for some support at this forum.

 

The main problem is shown below where the HTML page that will scroll in the infobox is stated as "./news.html";

I have tried to look at the other infoboxes for clues on how to do it, but I have not figred it out yet.

 

Anyone with a helping hand?

 

*/

?>

<!-- scroller //-->

<tr>

<td>

<?php

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' => BOX_HEADING_LINKS

);

new infoBoxHeading($info_box_contents, false, false);

 

$info_box_contents = array();

$filename = "./news.html";

$fd = fopen ($filename, "r");

$contents = fread ($fd, filesize ($filename));

fclose ($fd);

$info_box_contents[] = array('align' => 'left',

'text' => '<center><marquee direction="up" height="160" scrollAmount="2" onMouseover="scrollAmount=0" onMouseout="scrollAmount=2">'.$contents.'</marquee></center>'

 

);

new infoBox($info_box_contents);

?>

</td>

</tr>

<!-- links_eof //-->

 

 

Best regards

Crazypilot

Link to comment
Share on other sites

ok, the easiest way to do that is going to creat a differetn html file for each language, and put it in the appropriate language directory.

 

The in the script you've pasted above on this line....

 

$contents = fread ($fd, filesize ($filename));

 

You've going to want to change the $filename variable to point at the appropriate directory

 

$contents = fread ($fd, filesize (DIR_WS_HTTP_CATALOG . DIR_WS_LANGUAGES. $filename));

 

I think that should work

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

opps I forgot the $language variable.

 

$contents = fread ($fd, filesize (DIR_WS_HTTP_CATALOG . DIR_WS_LANGUAGES. $language . '/' . $filename));

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

opps I forgot the $language variable.

 

$contents = fread ($fd, filesize (DIR_WS_HTTP_CATALOG . DIR_WS_LANGUAGES. $language . '/' . $filename));

 

 

Really super support!!

Thank you Chris for superfast answer.

 

I thought somtething like that would be applicable, but was to unsure about the code.

 

I will try it out and reply to this string if it works.

 

By the way, anyone with a solution for a similar problem.

 

When using a multilingual shop the Newsletter that can be used with Osc is only in one language.

 

Is there a way to sort customers to english_newsletter/ swedish_newsletter/french_newsletter/german_newsletter?

 

Regards

Crazypilot

Link to comment
Share on other sites

For all that is interested of a language specified News scroller, I got it finally to work.

Thanks Chris for the script above, however I had to "try and a lot of error" it before I got it to work.

Note, my Catalog is in the Root so I deleted DIR_WS_CATALOG and finally got below script to work like a charm.

Regards Cp

 

*/

?>

<!-- scroller //-->

<tr>

<td>

<?php

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' => BOX_HEADING_LINKS

);

new infoBoxHeading($info_box_contents, false, false);

 

$info_box_contents = array();

$filename = DIR_WS_LANGUAGES. $language . '/' . "news.html";

$fd = fopen ($filename, "r");

$contents = fread ($fd, filesize ($filename));

 

fclose ($fd);

$info_box_contents[] = array('align' => 'left',

'text' => '<center><marquee direction="up" height="160" scrollAmount="2" onMouseover="scrollAmount=0" onMouseout="scrollAmount=2">'.$contents.'</marquee></center>'

 

);

new infoBox($info_box_contents);

?>

</td>

</tr>

<!-- links_eof //-->

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.
Note: Your post will require moderator approval before it will be visible.

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