execute php code in html nugget ?
execute php code in html nugget ?
hi,
how can php be executed in a html-nugget ?
i'm trying to echo a "simple text" as a test
<?php echo "simple text"; ?>
echo "simple text";
{php}echo "simple text";{/php}
neither one does the trick...
tia,
p.
how can php be executed in a html-nugget ?
i'm trying to echo a "simple text" as a test
<?php echo "simple text"; ?>
echo "simple text";
{php}echo "simple text";{/php}
neither one does the trick...
tia,
p.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: execute php code in html nugget ?
Hi!
PHP-Code cannot be executed there as it would impose a huge security risk. You should build your own plugins, or use the "Include PHP script / External Code" sidebar nugget, where you can specify an external PHP script.
Or you search this forum for the php nugget. But it is not recommended.
The other option is to install the smartymarkup plugin, then you can use thise {php} markup in your nugget. But only if you also disable the smarty security setting in include/functions_smarty.inc.php or your templates config.inc.php via $serendipity['smarty']->security = false;
Best regards,
Garvin
PHP-Code cannot be executed there as it would impose a huge security risk. You should build your own plugins, or use the "Include PHP script / External Code" sidebar nugget, where you can specify an external PHP script.
Or you search this forum for the php nugget. But it is not recommended.
The other option is to install the smartymarkup plugin, then you can use thise {php} markup in your nugget. But only if you also disable the smarty security setting in include/functions_smarty.inc.php or your templates config.inc.php via $serendipity['smarty']->security = false;
Best 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/
# 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/
Re: execute php code in html nugget ?
garvinhicking wrote:Hi!
or use the "Include PHP script / External Code" sidebar nugget, where you can specify an external PHP script.
thanks Garvin but where do i find that script... i dont find it on the s9y site, and i dont find it on sourceforge...
p.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: execute php code in html nugget ?
Hi!
Regards,
Garvin
You can find it here on the forums. I can'T say much more, because I really don't advocate its use.thanks Garvin but where do i find that script... i dont find it on the s9y site, and i dont find it on sourceforge...
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/
# 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/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Yeah, but that's quite easy. Just upload your PHP script and include it.
Regards,
Garvin
Yeah, but that's quite easy. Just upload your PHP script and include it.
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/
# 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/
-
mgroeninger
- Regular
- Posts: 546
- Joined: Mon Dec 20, 2004 11:57 pm
- Contact:
Matthew (Feeling generous?)
ok, i know eval is supposed to be avoided...
so i'm willing to give it a go at writing my own SIMPLE plugin..
lets take the code mentioned in the post above and lets say i just want to do a echo can i then change this code :
into this :
... i guess not, because it isnt working...
any thaughts or pointers ?[/quote]
so i'm willing to give it a go at writing my own SIMPLE plugin..
lets take the code mentioned in the post above and lets say i just want to do a echo can i then change this code :
Code: Select all
function generate_content(&$title, $output = true)
{
$title = $this->get_config('title', $title);
if ($output) eval($this->get_config('content'));
} Code: Select all
function generate_content(&$title, $output = true)
{
$title = $this->get_config('title', $title);
echo "this is a test";
}
... i guess not, because it isnt working...
any thaughts or pointers ?[/quote]
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Yes, you can. What is not working? How does your full plugin look like? You did install the plugin through the interface, right? Without installing a plugin, nothing will happen?
Regards,
Garvin
Yes, you can. What is not working? How does your full plugin look like? You did install the plugin through the interface, right? Without installing a plugin, nothing will happen?
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/
# 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/
i just took the file mgroeninger linked me to, and changed 1 line as I posted...garvinhicking wrote:Hi!
Yes, you can. What is not working? How does your full plugin look like? You did install the plugin through the interface, right? Without installing a plugin, nothing will happen?
Regards,
Garvin
in fact all i want is to be able to include my own log.php file... so i can count visitors...
i'm sure someone (smarter then me) must have done this before ?
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
So you installed the plugin and have it in your plugin configuration panel as a sidebar item? And on your frontpage, it does not display anything? Try to put a "return true;" inside the generate_content() method?
Please paste your full current plugin file, then I can tell you what's wrong. You are definitely on the right path, it must be a minor issue.
Best regards,
Garvin
So you installed the plugin and have it in your plugin configuration panel as a sidebar item? And on your frontpage, it does not display anything? Try to put a "return true;" inside the generate_content() method?
Please paste your full current plugin file, then I can tell you what's wrong. You are definitely on the right path, it must be a minor issue.
Best 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/
# 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/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Okay, I'm sorry. Luck will come to those who wait.
Best regards,
Garvin
Okay, I'm sorry. Luck will come to those who wait.
Best 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/
# 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/