https://www.icyphoenix.com/viewtopic.php?f=35&t=3879
-----------------------------------
dllrsoft
Sun 16 Mar, 2008 21:19

How To Add Php Code In A Block?
-----------------------------------
Hi!!

I want to introduce php code in a block (HTML based), how can I do it?

Thanks for replies!!

Greets!!


-----------------------------------
moreteavicar
Sun 16 Mar, 2008 23:41

Re: How To Add Php Code In A Block?
-----------------------------------
The best (and currently only) way to use php in a block is to actually create your own block. Study the existing blocks to get an idea of how they work - for example you may need to access existing system variables - you do this by using "global", e.g. global db; for using phpBB derived SQL functions. You need to follow the same file naming conventions (blocks_imp_yourblock.php) and create also template block (yourblock_block.tpl). You must make sure you define your code within a function of same name as block, e.g. function imp_yourblock_block_func()... Its not too hard ;)


-----------------------------------
dllrsoft
Mon 17 Mar, 2008 02:51

Re: How To Add Php Code In A Block?
-----------------------------------
[b]moreteavicar[/b] thanks!!

I'm going to prove it.

I'll be back... :wink: 

Edit: Perfect!!! It's run OK!! Very thanks [b]moreteavicar[/b]!!

Greets!!


-----------------------------------
moreteavicar
Mon 17 Mar, 2008 17:01

Re: How To Add Php Code In A Block?
-----------------------------------
Great... before long you'll be starting to make new blocks for Icy Phoenix too ;)


