new entry in language_**.php

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
FabriceT
Posts: 7
Joined: Wed Jul 10, 2019 3:04 pm

new entry in language_**.php

Post by FabriceT » Wed Jul 10, 2019 3:19 pm

Hello
I want to write a presentation text in the index.tpl file of my template.
I add an entry in the file "language_en.php" like this.

$ PMF_LANG ["msgintro"] = 'Mon texte introductiont';

and I wrote this in the index.tpl file.
.. \ phpMyFAQ \ assets \ template \ MyTPL\ index.tpl

Code: Select all


<div class="col-md-8 pmf-maincontent">
			               {msgintro}
						   {writeContent}
						   
</div>
But that does not work.
What is missing ?
How to do ?
Thank you for your help .
Fabirce

Thorsten
Posts: 14781
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: new entry in language_**.php

Post by Thorsten » Thu Jul 11, 2019 8:00 am

phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

FabriceT
Posts: 7
Joined: Wed Jul 10, 2019 3:04 pm

Re: new entry in language_**.php

Post by FabriceT » Mon Jul 15, 2019 1:30 pm

Hello
Thank you for your reply
I followed the "tutorial" but the call was ..... index.php? action = intro
-> is empty.
can you help me ?
tank you
best regard

my information :

test.tpl = intro.tpl
test.pho = intro.php

/phpmyfaq/assets/template/Mytemplayte/intro.tpl
or
/phpmyfaq/assets/template/default/intro.tpl

intro.php = same code as the example

Code: Select all

$allowedVariables = [
    'add' => 1,
    'artikel' => 1,
    'ask' => 1,
    'attachment' => 1,
    'contact' => 1,
    'glossary' => 1,
    'help' => 1,
    'login' => 1,
    'mailsend2friend' => 1,
    'news' => 1,
    'open' => 1,
    'overview' => 1,
    'password' => 1,
    'register' => 1,
    'save' => 1,
    'savecomment' => 1,
    'savequestion' => 1,
    'savevoting' => 1,
    'search' => 1,
    'send2friend' => 1,
    'sendmail' => 1,
    'show' => 1,
    'sitemap' => 1,
    'thankyou' => 1,
    'translate' => 1,
    'ucp' => 1,
    'writecomment' => 1,
    'intro' => 1,
];

Thorsten
Posts: 14781
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: new entry in language_**.php

Post by Thorsten » Sat Jul 20, 2019 7:36 am

Hi,

please enable the DEBUG mode. Which version do you use?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

FabriceT
Posts: 7
Joined: Wed Jul 10, 2019 3:04 pm

Re: new entry in language_**.php

Post by FabriceT » Tue Aug 13, 2019 11:07 am

Hello,
sorry for the late answer ( I was on vacation;))
I had to look for to put in debug ;- )

here are the messages

( ! ) Fatal error: Uncaught Error: Call to undefined method PMF_Template::processTemplate() in D:\Data\phpmyfaq\test.php on line 2
( ! ) Error: Call to undefined method PMF_Template::processTemplate() in D:\Data\phpmyfaq\test.php on line 2


version : powered by phpMyFAQ 2.9.13

FabriceT
Posts: 7
Joined: Wed Jul 10, 2019 3:04 pm

Re: new entry in language_**.php

Post by FabriceT » Wed Aug 14, 2019 3:55 pm

for your information
the function of the example is not good
you have to use the "parse" function
this code works

---test.php----
<?php

$testTitle_1 = $PMF_LANG['Mymsg_1'];
$testContent_1 = $PMF_LANG['Mymsg_2'];
$testTitle_2 = $PMF_LANG['Mymsg_3'];
$testContent_2 = $PMF_LANG['Mymsg_4'];
$testTitle_3 = $PMF_LANG['Mymsg_5'];
$testContent_3 = $PMF_LANG['Mymsg_6'];




$tpl->parse ('writeContent', array(
'testTitle_1' => $testTitle_1,
'testContent_1' => $testContent_1,
'testTitle_2' => $testTitle_2,
'testContent_2' => $testContent_2,
'testTitle_3' => $testTitle_3,
'testContent_3' => $testContent_3
)
);

?>

merci pour votre aide
Fabrice

Thorsten
Posts: 14781
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: new entry in language_**.php

Post by Thorsten » Wed Aug 14, 2019 4:32 pm

Hi,

yes, sorry, I have to update our FAQ as the function names changed over the years...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

Post Reply