How To Add Php Code In A Block? »  Show posts from    to     

Icy Phoenix


Old Support Topics - How To Add Php Code In A Block?



dllrsoft [ Sun 16 Mar, 2008 21:19 ]
Post subject: 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 ]
Post subject: 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 ]
Post subject: Re: How To Add Php Code In A Block?
moreteavicar thanks!!

I'm going to prove it.

I'll be back...

Edit: Perfect!!! It's run OK!! Very thanks moreteavicar!!

Greets!!


moreteavicar [ Mon 17 Mar, 2008 17:01 ]
Post subject: Re: How To Add Php Code In A Block?
Great... before long you'll be starting to make new blocks for Icy Phoenix too




Powered by Icy Phoenix