Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: [Solved]: anycontent.php and other languages...  (Read 3482 times)

0 Members and 1 Guest are viewing this topic.

LFox

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
[Solved]: anycontent.php and other languages...
« on: April 17, 2008, 11:25:56 pm »

How to add anycontent.php text to russian.php and english.php? I need to show anycontent.php on different languages, when user choose their language, anycontent.php will translate)
« Last Edit: April 23, 2008, 01:31:30 pm by Joachim Müller »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: anycontent.php and other languages...
« Reply #1 on: April 18, 2008, 08:12:51 am »

Code: [Select]
switch($USER['lang']){
case "russian":
echo "russian";
break;
case "serbian":
echo "serbian";
break;
default:
echo "default... eg. english";
} // switch

LFox

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: anycontent.php and other languages...
« Reply #2 on: April 18, 2008, 12:48:25 pm »

thanks!) and can you say where in the anycontent I must put it?
And how add text from anycontent to russian.php etc.?
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: anycontent.php and other languages...
« Reply #3 on: April 18, 2008, 01:52:41 pm »

you d'ont have to put text in the lang file, in stramm's code, you have to replace "russian" for exemple with the russian text you will show...
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

LFox

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: anycontent.php and other languages...
« Reply #4 on: April 18, 2008, 03:13:11 pm »

ooh, I don't understood then)))
If so, That's GREAT!!! Thank you once again Stramm!!!
And thank you François for explaining!)
Logged

LFox

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: anycontent.php and other languages...
« Reply #5 on: April 18, 2008, 03:28:41 pm »

amm... I have some problems with it...

When I put this code to anycontent with simple texts, example:

Code: [Select]
switch($USER['lang']){
case "russian":
echo "simple text on russian...";
break;
case "serbian":
echo "serbian";
break;
default:
echo "default... eg. english";
} // switch

it works well. But when I put there table, it get me an error, example:

Code: [Select]
switch($USER['lang']){
case "russian":
echo "<div align="center">
<table border="1" width="500" id="table2" bordercolorlight="#ffffff">
 <tr>
<td width="100">
<p><ul>
<li><a href="http://www.example.com">Title 1</a></li>
<li><a href="http://www.example.com">Title 2</a></li>
<li><a href="http://www.example.com">Title 3</a></li>
</ul></p></td></tr>
</table></div>";
break;
case "serbian":
echo "serbian";
break;
default:
echo "default... eg. english";
} // switch

Is it means that I can't put there any tables, only text, or I do something wrong?
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: anycontent.php and other languages...
« Reply #6 on: April 18, 2008, 03:34:25 pm »

read more about the php echo function here
http://php.net/manual/en/function.echo.php

probably most useful for you would be
Code: [Select]
echo <<<EOT
here comes the text you want to output. It can be table definition or whatever
<table>
<tr>
<td>
more yadda here
</td>
</tr>
</table>
EOT;

LFox

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
Re: anycontent.php and other languages...
« Reply #7 on: April 23, 2008, 11:41:05 am »

Thank you very much!!! Work's great!)
Logged
Pages: [1]   Go Up
 

Page created in 0.036 seconds with 19 queries.