TinyPortal

Development => International => Topic started by: techbot on March 06, 2007, 08:44:45 PM

Title: How can I use php in the center block?
Post by: techbot on March 06, 2007, 08:44:45 PM
I'm no php guru so I'm lost.  I have a simple script for random images located on my server.  I want to add a center block where this can be called and display the images on my TP center.

How can I do this?
Title: Re: How can I use php in the center block?
Post by: G6Cad on March 06, 2007, 08:50:22 PM
http://www.tinyportal.net/index.php?topic=6309
Title: Re: How can I use php in the center block?
Post by: techbot on March 06, 2007, 08:52:07 PM
Sorry, I wasn't too clear on that...I know how to create the block...I have that in place. It's just not calling the php script.  I'm not good with php at all, so maybe I'm doing something wrong.  Do I create the block as a php block, a script block?  What php command do I use to call that file and display it?
Title: Re: How can I use php in the center block?
Post by: IchBin on March 06, 2007, 09:13:18 PM
Depends on how your php script is created. Is it already in a file?

Then simply adding this to a phpbox block will call it in:
include('path/to/file.php');

If not, you can just paste the php code into a phpbox. Don't forget if you do this you need to leave out the beginning <?php and ending ?> tag or it will not work.