Using LANG with custom images

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
Andem
Registered User
Posts: 6
Joined: Sun Apr 27, 2003 6:05 pm

Using LANG with custom images

Post by Andem » Wed Jun 02, 2004 7:13 pm

This is not a typical problem, more of a request for a weird kind of help, so I've neglected to include a typical template.

Alright, running phpbb.. quite modified. I have a custom template that was created a while back, but never really translated a lot of the images to other languages. We have to do that now as we have multiple language forums.

What we have is a menu that is an image map, rather than text links to forum functions. I've done the menu image in other languages so what I tried to do in the template is a link to templates/cantek/images/{lang}/menuimg.gif. The {LANG} function returns a blank when processed and the forum page pops up. Am I doing this incorrectly? If so, can someone provide me with some tips as to getting this working with a php modification? Or is it possible to accomplish this with the forums?


Thanks a ton to anyone who can help me with that!

Regards,
Christopher

Andem
Registered User
Posts: 6
Joined: Sun Apr 27, 2003 6:05 pm

Post by Andem » Wed Jun 02, 2004 8:52 pm

By the way. I also tried $images['menuimg'] = "$current_template_images/{LANG}/actualmenu.gif"; with {MENUIMG}, but that doesnt seem to work either.

flogger12
Registered User
Posts: 14936
Joined: Tue Nov 25, 2003 2:13 am

Post by flogger12 » Wed Jun 02, 2004 9:16 pm

I don't believe you can use php variables in a link path. I don't know how to do what you want. but I don't think that is it.


robert

Andem
Registered User
Posts: 6
Joined: Sun Apr 27, 2003 6:05 pm

Post by Andem » Thu Jun 03, 2004 6:35 pm

Thank you for reading my post, flogger12. Do you know if there's a quick way in which I can accomplish this? It may involve IE editing certain php files... Hmm, I'm gonna play around -- maybe duplicate another image variable like "Edit" and modify it.. I'll let you guys know if I get anything with it.

Cheers!

User avatar
warmweer
Registered User
Posts: 2366
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Post by warmweer » Thu Jun 03, 2004 7:19 pm

Rather than editing the .tpl files themselves (or for that matter the .php files) I think you can easily solve your problem just by editing the .cfg file of each theme by including the language variable in the location of the image file. e.g.

Code: Select all

$images['icon_pm'] = "$current_template_images/{LANG}/icon_pm.gif";
My board's not broken, it just went peculiar

Andem
Registered User
Posts: 6
Joined: Sun Apr 27, 2003 6:05 pm

Post by Andem » Thu Jun 03, 2004 11:57 pm

Tried that.. and in overall_header.tpl, I included {NAVIGATION}, tried {NAVIGATION_IMG} <-- both of them were tried also in lowercase.

Code: Select all

$images['navigation'] = "$current_template_images/{LANG}/actualmenu.gif";
It doesnt print anything in the template.[/code]

User avatar
warmweer
Registered User
Posts: 2366
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Post by warmweer » Fri Jun 04, 2004 3:27 pm

{NAVIGATION} can only be used in overall_header.tpl after it has been declared (going off memory that should be in overall_header.php or page_header.php)

in the php-file find something like this

Code: Select all

$template->assign_vars(array(
and include

Code: Select all

'NAVIGATION' => $images['navigation'],
The next part is to define the previous part (and that is done in the .cgf-file for each template.)

Code: Select all

$images['navigation'] = "$current_template_images/{LANG}/actualmenu.gif";
So my guess is that you never declared {NAVIGATION} (or forgot to add it to the array). That would explain the "blank" value.
My board's not broken, it just went peculiar

Locked

Return to “2.0.x Support Forum”