PHP output in block. How?

Post Reply

Topic author
Enemy17
Active Member
Posts: 1
Joined: 13. October 2010 18:52

PHP output in block. How?

Post by Enemy17 »

Hi there,
I'm currently trying to add a block with php in it.
To quote the Knowledge Base:
If you need to execute PHP code for your new block, there is an easy way to do this. Adding PHP Code to the block file will not do anything at all. Open portal/block/additional_blocks.php and add your PHP right in front of this:
Well fine. But now I want to get information from php and display it, like the count of registered accounts in my gameserver database. echo "test"; doesn't output anything in my block.
I can't figure out how to do this. Can anyone tell me please?
User avatar

Marc
Dev
Posts: 2504
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München
Contact:

Re: PHP output in block. How?

Post by Marc »


miowa
Active Member
Posts: 9
Joined: 12. April 2011 23:04

Re: PHP output in block. How?

Post by miowa »

Hi there!

I'll try to keep this thread in english, so everone could help me.
Just installed Portal 2.0.0.b1 on phpbb 3.0.9. Absolutely fresh installation today!

I wanted an own block for (testings) displaying some iframe (youtube -.-") and it works after disabling BBCODE in the editor for it.
Ok.
No i've tried to add some php code like this one:

Code: Select all

<? echo "yaddayadda"; ?>
or this one:

Code: Select all

<? include 'chat/index.php'; ?>
php5 is present and already allowed in phpbb acp. So it should be displayed, but it doesn't works. Unfortunely.

I tried to follow the above code from Marc, but i don't understand it. :oops:

Yes, i know that i can do it if i edit the own block. Ok, true.
But i thought it's now possible in the acp/mods ???
Tried this one, too:

Code: Select all

<!-- PHP --> (my code) <-- ENDPHP -->
Not working.

Please, can anyone tell me, if php (echo/include) can however add in my own block (acp) or have i still to edit the phpfiles and upload them via ftp?
Thank you very much!

Greetings, miowa
Post Reply

Return to “Modifications Support”