1
ipwgc
I need to display an image in a block in different language
  • 2009/11/19 22:58

  • ipwgc

  • Quite a regular

  • Posts: 216

  • Since: 2005/8/13


Hi, I have made a module, and I need to display an image in a block in different language.
Ejemple:
1) /MYMODULE/language/english/img/register1.gif
2) /MYMODULE/language/spanish/img/register2.gif

QUESTION: How can I display this images in a block?
which is the code to use in the link?

Thank for your support
David

2
ghia
Re: I need to display an image in a block in different language
  • 2009/11/20 0:09

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Do you have a PHP or HTML block?
Did you try a URL as XOOPS_URL.'/modules/MYMODULE/language/english/img/register1.gif'

3
ipwgc
Re: I need to display an image in a block in different language
  • 2009/11/20 2:37

  • ipwgc

  • Quite a regular

  • Posts: 216

  • Since: 2005/8/13


Hi ghia,
For you to understand I need a specific code to insert on the module, see examples below
My question is how I can do the same on my module?
They have this code <{$msg_lang_name}> to call the image from the language folder,

THIS CODE IS in the index.php from the xfguestbook line 219
$xoopsTpl->assign('msg_lang_name', $xoopsConfig['language']);

QUESTION: How I can do the same on my module and blocks?

Regards,
David

-------------
SEE Below is a real working example from the xfguestbook module $modversion['version'] = '2.40a'; $modversion['author'] = "the Cat";

EXAMPLE IN ENGLISH

<br />
<a href="index.php"><img src='<{$xoops_url}>/modules/xfguestbook/language/<{$msg_lang_name}>/images/logo.gif' alt=' Guestbook' border='0' />
<br />
--------------------------
EXAMPLE IN SPANISH

<br />
<a href="index.php"><img src='<{$xoops_url}>/modules/xfguestbook/language/<{$msg_lang_name}>/images/logo.gif' alt=' Guestbook' border='0' />
<br />

4
ghia
Re: I need to display an image in a block in different language
  • 2009/11/20 9:10

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


I don't know what you are asking.
You have outlined all elements that are needed to implement it in your module.
In yourblock.php
$xoopsTpl->assign('mymod_lang_name'$xoopsConfig['language']);

In yourblocktemplate.html
<img src='<{$xoops_url}>/modules/MYMODULE/language/<{$mymod_lang_name}>/img/register1.gif' alt=' ' />

5
ipwgc
Re: I need to display an image in a block in different language
  • 2009/11/21 1:07

  • ipwgc

  • Quite a regular

  • Posts: 216

  • Since: 2005/8/13


Hi, ghia
Is working only on the index.php
I add the below code in /MYMODULE/index.php
$xoopsTpl->assign('msg_lang_name', $xoopsConfig['language']);

and I add the below code in /template/index.html
(IS WORKING, OK)
<img src="<{$xoops_url}>/modules/MYMODULE/language/<{$mymod_lang_name}>/images/register.gif

NOW, MY PROBLEM IS IN THE HTML BLOCKS.
Which is the code for this 2 files?
1. /template/blocks/blocks_page.html
2. /MYMODULE/blocks/page.php

THIS CODE IS NOT WORKING ON THE BLOCKS
$xoopsTpl->assign('msg_lang_name', $xoopsConfig['language']);

Regards,
David Yanez

6
ghia
Re: I need to display an image in a block in different language
  • 2009/11/21 2:16

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Right!
For blocks, you need to use the block variable.
$block['mymod_lang_name'] = $xoopsConfig['language'];

and
<{$block.mymod_lang_name}>

7
ipwgc
Re: I need to display an image in a block in different language
  • 2009/11/21 3:19

  • ipwgc

  • Quite a regular

  • Posts: 216

  • Since: 2005/8/13


THANK YOU GHIA
NOW IS WORKING, PERFECT,

In the index.php and in the blocks.

I will show you the module next week.
Name of the module "SocialNet 2010"

Now is possible to add images in English and Spanish, and other languages to.
Regards, and again thank you for your support.
David Yanez

Login

Who's Online

301 user(s) are online (202 user(s) are browsing Support Forums)


Members: 0


Guests: 301


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits