1
trspice
Can a file include tag be used in a language file define?
  • 2007/4/15 4:43

  • trspice

  • Not too shy to talk

  • Posts: 193

  • Since: 2007/3/24


I have quite a bit of text that I want to be read from a language file. I am really just replacing the text of an existing definition.

I wanted to place the text in an external html file and use and include tag <{include file='thefile.html'}> to call it. Can this be done? If so how? I tried a few methods but all failed.
There's nothing but science....
The Reggae Album

2
Catzwolf
Re: Can a file include tag be used in a language file define?
  • 2007/4/15 5:29

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


try this:

<{include file="$xoops_url/thefile.html"}>

Catz

3
skenow
Re: Can a file include tag be used in a language file define?
  • 2007/4/15 13:10

  • skenow

  • Home away from home

  • Posts: 993

  • Since: 2004/11/17


What is the filetype of the language file you are using? If you are using a php file, your include statement would be
Quote:
include 'path/file.html';


The <{include file="path/file.html"}> would be for use in an html file.

4
trspice
Re: Can a file include tag be used in a language file define?
  • 2007/4/16 17:34

  • trspice

  • Not too shy to talk

  • Posts: 193

  • Since: 2007/3/24


Thanks for the suggestions. Both still print the code on the page instead of the text from the file. Here is exactly what I am doing

I am using Userpages module and want to add significant amount of text to language/main.php line 38
define("_USERPAGE_EMPTY_PAGE","Disclaimer and rules");
There's nothing but science....
The Reggae Album

5
Dave_L
Re: Can a file include tag be used in a language file define?
  • 2007/4/16 18:26

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


I don't think you can embed an "include" within a "define" value, unless there's a tricky way of doing it with "eval".

You could either (1) add the text in main.php:

define("_USERPAGE_EMPTY_PAGE","
text
more text
and more text
");

or (2) put it in a separate file other.php:


define
("_USERPAGE_EMPTY_PAGE","
text
more text
and more text
...
"
);

?>


and change main.php:

#define("_USERPAGE_EMPTY_PAGE","Disclaimer and rules");
include('other.php');

6
Catzwolf
Re: Can a file include tag be used in a language file define?
  • 2007/4/16 18:34

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Actually there is an easier way of doing this.

Do as dave says, and include your define files and use this smarty tag instead:
like

define('_MY_DEFINE', 'My Text');

and in the html file:

<{$smarty.const._MY_DEFINE}>

Catz

7
trspice
Re: Can a file include tag be used in a language file define?
  • 2007/4/16 23:26

  • trspice

  • Not too shy to talk

  • Posts: 193

  • Since: 2007/3/24


Many thanks :)
There's nothing but science....
The Reggae Album

Login

Who's Online

319 user(s) are online (240 user(s) are browsing Support Forums)


Members: 0


Guests: 319


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