Page 1 of 1
How do I (embed my own php code)
Posted: Mon Jul 12, 2004 2:58 pm
by stephanb
Code: Select all
<?
$today = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
$filingdate = mktime(0, 0, 0, 6, 15, 2004 );
$start= (int)date("z", $filingdate);
$now = (int)date("z", $today);
$days = $now - $start;
echo "Day <b>$days</b>";
?>
I want to embed the above php code somewhere on the weblog page, but I cannot seem to find a nice way to accomplish this. It is basically a general question regarding embedded php code.
Any idea ?
/Stephan
Re: How do I (embed my own php code)
Posted: Mon Jul 12, 2004 3:33 pm
by garvinhicking
Hi Stephan!
A proper place would be your templates/bla/layout.php file. Or depending on your embed method, if you use output-buffer redirection (as described in the docs) inside your $serendipity['indexFile'].
Regards,
Garvin.
Posted: Sat Jul 31, 2004 12:47 am
by robintw
Hi
I have tried to follow these instructions, but cannot find my /templates/bla/layout.php file. The folder bla doesn't seem to exist and I have looked inside my template (blue) folder and layout.php doesn't seem to exist.
I have another bit of php code I would like to insert on the index page (a counter). Is this the right way of doing it??
Robin
Posted: Sat Jul 31, 2004 1:00 am
by tomsommer
copy layout.php from the "default" folder into your own template folder
Posted: Sat Jul 31, 2004 10:49 am
by robintw
Thanks, I've got the layout.php file now...
Where in that file should I put my php bit to set up my counter??
I would like the display for the counter to appear at the bottom if possible or if not then on the left hand side.
Thanks in advance
Robin