Page 1 of 1

Can't use php in entries, please help

Posted: Sat Mar 14, 2009 1:23 am
by ivorusev
Hi there,
I've been using s9y for quite a long time and I find it really great, but since now I've never needed to use some php code in entries/posts/articles. The thing is that I want to embed a widget of my own that is a piece of a php code, so therefore I need to be able at least to require it the normal way right? Like : <?php require('http://mydoma.in/php/code/path.php'); ?>

So far by reading through several topics here I happened to know that instead I should use the so called "smarty" code with syntax like {php_include .... }, and disable the security in the theme I am using - both actions done, but still no output of my widget form is shown in the entry. Please advice how it should be done. Thanks in advance!

Re: Can't use php in entries, please help

Posted: Sat Mar 14, 2009 11:34 am
by garvinhicking
Hi!

We do not allow PHP code in entries due to the security nature and implications of that.

The closest thing you can get is using the "Smarty Markup" plugin, and then disabling the smarty security in your template's config.inc.php with

Code: Select all

<?php
$serendipity['smarty']->security = false;
and then you can use {php}...{/php} in your entries.

If you write you've done that, how exactly did you to it? Did you configure the smarty markup plugin to be enabled for blog entries?

Regards,
Garvin

Re: Can't use php in entries, please help

Posted: Sun Mar 15, 2009 12:08 am
by ivorusev
No, actually did not know about that Smarty Markup plugin. Will now get it and try with it. The only info I found about putting php code in s9y was a topic in this forum about embedding php in the template so I improvised hoping the same will work with entries :)