is possible include php in a post?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
lebyrus
Posts: 3
Joined: Fri Oct 01, 2004 12:11 pm

is possible include php in a post?

Post by lebyrus »

i am trying it, but i don't have success... :(

i've been looking a solution, but i don't find it. is it possible?
romulus
Regular
Posts: 49
Joined: Fri Sep 24, 2004 4:31 pm
Contact:

Post by romulus »

no that is and shout not be possible. From a security point of view you don't want to have this ;)

What do you want to do exactly? I think you need to write a plugin. I'm working right now on a static page plugin, maybe that would be a help for you?
lebyrus
Posts: 3
Joined: Fri Oct 01, 2004 12:11 pm

Post by lebyrus »

i have a php function to color php code from an external (php) file:

<?php
include("get_sourcecode.php");
echo get_sourcecode("my-example.php");
?>

first line can be added in layout, but i need the echo line
romulus
Regular
Posts: 49
Joined: Fri Sep 24, 2004 4:31 pm
Contact:

Post by romulus »

Basically you want to display php code in your post with syntax highlighting, right?

I think that a plugin is the *ideal* solution for this. There are quite a few text formatting you can look into, to inherit you own plugin from. I have done the same with 2 smaller ones for my site.

My first idea to this would be to automatically add some css classes to php functions and the like with your plugin and to add the classes and colors in your style.css.
Sounds not too hard to implement, but still I'm no s9y developer ;)
lebyrus
Posts: 3
Joined: Fri Oct 01, 2004 12:11 pm

Post by lebyrus »

Basically you want to display php code in your post with syntax highlighting, right?
yes
I think that a plugin is the *ideal* solution for this.
me too :wink:
Sounds not too hard to implement, but still I'm no s9y developer
like me. I think that it would be something easy, but I wanted something quickly.

I'll study it, and, if i have time, maybe, I'll try it

Thanks :)
Post Reply