1
kerkyra
xoopsTpl and blocks
  • 2008/6/19 11:17

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


hi i'm creating a custom block and trying to assign some language constants to the template i'm using. When i see the first page of the module! it works ok, but when i see the userinfo page for example only the constant names are shown. Any ideas??
whttp://www.guidemap.gr - Beta is out...

2
trabis
Re: xoopsTpl and blocks
  • 2008/6/19 12:55

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Xoops auto-include language/.../main.php for the current module. If you want to use a main.php of another block you have to include that file in your block.

3
kerkyra
Re: xoopsTpl and blocks
  • 2008/6/19 13:06

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


i'm using this code but only works if i'm in a modules page! when i see something outside the module it wont work!

Quote:
if ( file_exists(XOOPS_ROOT_PATH."/modules/modulename/language/".$xoopsConfig['language']."/main.php") ) {
include "../language/".$xoopsConfig['language']."/main.php";
} else {
include XOOPS_ROOT_PATH."/modules/modulename/language/english/main.php";
}


i suspect it cant identify the $xoopsConfig['language'] line because its a block although i have used global $xoopsConfig
whttp://www.guidemap.gr - Beta is out...

4
trabis
Re: xoopsTpl and blocks
  • 2008/6/19 17:52

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


include "../language/".$xoopsConfig['language']."/main.php";

This line is the problem. Use:

include_once (XOOPS_ROOT_PATH."/modules/modulename/language/".$xoopsConfig['language']."/main.php");

5
kerkyra
Re: xoopsTpl and blocks
  • 2008/6/20 10:21

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


you are the man! :) I should have seen this!!!!!!!
whttp://www.guidemap.gr - Beta is out...

Login

Who's Online

398 user(s) are online (258 user(s) are browsing Support Forums)


Members: 0


Guests: 398


more...

Donat-O-Meter

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

Latest GitHub Commits