Page 1 of 1

PHP output in block. How?

Posted: 13. October 2010 19:00
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?

Re: PHP output in block. How?

Posted: 13. October 2010 22:40
by Marc

Re: PHP output in block. How?

Posted: 18. July 2011 14:07
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