Can't use php in entries, please help

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
ivorusev
Posts: 2
Joined: Sat Mar 14, 2009 1:16 am

Can't use php in entries, please help

Post 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!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

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

Post 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
# 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/
ivorusev
Posts: 2
Joined: Sat Mar 14, 2009 1:16 am

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

Post 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 :)
Post Reply