Adding a line of PHP-code

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Davy
Regular
Posts: 109
Joined: Fri Oct 13, 2006 2:06 pm
Location: The Netherlands

Adding a line of PHP-code

Post by Davy »

Hello!

I want to add a line of PHP-code at the bottom of the "index.php"-file in the "templates/default"-folder.
That line will be an include-function, so: include("filename.ext");
But... How to do this in a template?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Adding a line of PHP-code

Post by garvinhicking »

Hi Davy!

Usually one uses Plugins toinsert stuff at places, but if you really need includes at that place, create a config.inc.php in your template folder:

Code: Select all

<?php
$serendipity['smarty']->security = false
Then you can use {include_php} in your smartytemplates.Have a look at smarty.php.net for documentation on that function!

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Davy
Regular
Posts: 109
Joined: Fri Oct 13, 2006 2:06 pm
Location: The Netherlands

Re: Adding a line of PHP-code

Post by Davy »

Thanks! I found the first step: include_php, but I was missing the second one: how to turn off the security...

So thanks for your help!
Post Reply