Using PHP
Forum rules
Before creating a new support thread, please take a look at the board3 Portal FAQ and use the search!
Many questions have already been answered.
Before creating a new support thread, please take a look at the board3 Portal FAQ and use the search!
Many questions have already been answered.
Using PHP
Hello,
I am creating my own module
Therefor I followed the instructions from the knowledge base (https://github.com/board3/Board3-Portal ... rtal-2.1.x)
All is setup and working
But it seems I can't use php coding in the module.
Am I doing something wrong?
How can I use php when creating my own module?
Thank you
I am creating my own module
Therefor I followed the instructions from the knowledge base (https://github.com/board3/Board3-Portal ... rtal-2.1.x)
All is setup and working
But it seems I can't use php coding in the module.
Am I doing something wrong?
How can I use php when creating my own module?
Thank you
Re: Using PHP
Oh, almost 1k views but no one who can give me a little help?
I know I should use ***_side.php extension, but even that doesn't help me.
Maybe some have other ideas?
I know I should use ***_side.php extension, but even that doesn't help me.
Maybe some have other ideas?
Re: Using PHP
Thank you for the reply
In my main file I have the line
I have the file called "lammert_da_servermonitor_side.php" in the folder .\phpBB3\ext\lammert\daservermonitor\styles\Hexagon\template.
The code in the file:
In the block on the frontpage is displayed, so I think the file is in the correct location and the file is called into the block.
In my main file I have the line
Code: Select all
return '@lammert_daservermonitor/lammert_da_servermonitor_side.php';
The code in the file:
Code: Select all
{$LR_BLOCK_H_L}<!-- IF $S_BLOCK_ICON --><img src="{$IMAGE_SRC}" width="{$IMAGE_WIDTH}" height="{$IMAGE_HEIGHT}" alt="" /> <!-- ENDIF -->{$TITLE}{$LR_BLOCK_H_R}
<div style="text-align: center;">
<?php echo "Hello"; ?>
Hi
</div>
<br />
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}
Code: Select all
Hi
Re: Using PHP
I try to create some custom modules for our Wolfenstein:ET community.
Some info about the server, the map plying and players on server.
The code is ready and the info is in a file I made: Here
The info is from een opensource (ET Splatterladder
This needs to be in a module on our community site: Here
When this is done, I want to create a module with names of the admins, which needs to be editable by admins.
But have not worked on that one yet.
Some info about the server, the map plying and players on server.
The code is ready and the info is in a file I made: Here
The info is from een opensource (ET Splatterladder
This needs to be in a module on our community site: Here
When this is done, I want to create a module with names of the admins, which needs to be editable by admins.
But have not worked on that one yet.
Re: Using PHP
Thank you for your time and effort
To me it looks like the module can handle HTML, but not PHP.
Maybe someone can answer this?
If it is possible to use PHP in a module, then I wonder how it can be done.
Maybe someone knows this?
To me it feels like a rather simple question, but somehow it is not.
Maybe anyone knows why?
To me it looks like the module can handle HTML, but not PHP.
Maybe someone can answer this?
If it is possible to use PHP in a module, then I wonder how it can be done.
Maybe someone knows this?
To me it feels like a rather simple question, but somehow it is not.
Maybe anyone knows why?
Re: Using PHP
Seems no one knows how this module works.
Please close topic
Please close topic
Re: Using PHP
I also tried to use php and it gets commented out.
In the above example the line <?php echo "Hello"; ?> it gets commented and so it doesn't produce the "Hello" message, but only "Hi" that is printed with html code.
Did I miss something?
In the above example the line <?php echo "Hello"; ?> it gets commented and so it doesn't produce the "Hello" message, but only "Hi" that is printed with html code.
Did I miss something?
Last edited by dueller on 25. June 2020 22:34, edited 1 time in total.
Re: Using PHP
At last I figured it out.Lammerts wrote: ↑27. May 2020 18:06 Thank you for the reply
In my main file I have the lineI have the file called "lammert_da_servermonitor_side.php" in the folder .\phpBB3\ext\lammert\daservermonitor\styles\Hexagon\template.Code: Select all
return '@lammert_daservermonitor/lammert_da_servermonitor_side.php';
The code in the file:
In the block on the frontpageCode: Select all
{$LR_BLOCK_H_L}<!-- IF $S_BLOCK_ICON --><img src="{$IMAGE_SRC}" width="{$IMAGE_WIDTH}" height="{$IMAGE_HEIGHT}" alt="" /> <!-- ENDIF -->{$TITLE}{$LR_BLOCK_H_R} <div style="text-align: center;"> <?php echo "Hello"; ?> Hi </div> <br /> {$LR_BLOCK_F_L}{$LR_BLOCK_F_R}
is displayed, so I think the file is in the correct location and the file is called into the block.Code: Select all
Hi
In the above example you have to give your file the html extension, lammert_da_servermonitor_side.html (php extension does nothing more).
Then you can't use php in it BUT INSTEAD OF IT YOU MUST USE twig template engine.
So instead of <?php echo "Hello"; ?> (that gets commented out) you MUST USE the equivalent {{ "Hello" }}
Such a basic thing that no one ever mentioned, I found it by searching in the code of other modules...
Last edited by dueller on 26. June 2020 00:59, edited 1 time in total.