[Plugin] PD_Scripting

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

[Plugin] PD_Scripting

Post by Holger » Wed Mar 10, 2010 10:32 pm

Hi folks,

I've created a little new plugin called "pd_scripting" to use together with CMSimple_XH.

This plugin is doing, as it's name says, managing plugin-calls and scriptings together with
pagedata.php - the database of CMSimple_XH.
So it's not necessary to write #CMSimple ...# code to your content to include a plugin or another function anymore.

Goals:
  • The script can include plugins to a CMSimple-page by itself, without adding a script-call or anything else to content.htm.
    Just add the plugin-calls to the fields in the new tab above your editor.
  • Multiple plugins per page are possible (the amount is limited hardcoded up to 5 script-calls per page).
  • Optional user-defined "placeholders" within the content can be replaced with the plugin- or script-output.
  • Plugin-tab can be hidden from the user by config.
  • Pages with plugins can be hidden from toc together with page_params plugin.
Download updated version 2.0

WBR
Holger

jerry
Posts: 177
Joined: Fri Jul 25, 2008 8:54 pm
Location: Denmark
Contact:

Re: [Plugin] PD_Scripting

Post by jerry » Thu Mar 11, 2010 7:51 pm

Hi Holger

It must be the most missing plugin in CMSimple. Actualy I did plan to code something like this later this year but now it's not necessary anymore, it's already done :D. It works smothly and is easy to use, exactly the way I have planned to do it. So thx for the great work.

I did succesfully tested PD_scripting with following plugins: Newsletter (subscribe page), Form Mailer, Variable Content, Flip for Gallery andCarousel for Gallery.

Danish language file can be downloaded her: http://cmsimple.jakobsfeld.com/download ... ipt_da.zip until it will be included in plugin distribution package.
jerry
jerry/simplesolutions

manu
Posts: 1086
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: [Plugin] PD_Scripting

Post by manu » Wed Mar 17, 2010 9:47 am

another quantum leap!
Thanks Holger!
manu

manu
Posts: 1086
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: [Plugin] PD_Scripting

Post by manu » Wed Mar 17, 2010 10:38 am

Nevertheless something for the wishlist:
As I use CMSimple scripting not only for outputting something but also alter values like the "submenu" title like here, it would be nice if simple assignments like

Code: Select all

 #CMSimple $tx['submenu']['heading']="tour overview";#
would be excluded from outputting.
But thanks anyway
manu

CMSimple-Styles.com
Posts: 342
Joined: Thu Jun 26, 2008 8:19 pm
Location: Germany
Contact:

Re: [Plugin] PD_Scripting

Post by CMSimple-Styles.com » Tue Mar 30, 2010 11:27 pm

Hello Holger,
do you mind if i add this plugin to CMSimple SE?

manu
Posts: 1086
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: [Plugin] PD_Scripting

Post by manu » Wed Mar 31, 2010 6:14 am

manu wrote:Nevertheless something for the wishlist:
As I use CMSimple scripting not only for outputting something but also alter values like the "submenu" title like here, it would be nice if simple assignments like

Code: Select all

 #CMSimple $tx['submenu']['heading']="tour overview";#
would be excluded from outputting.
But thanks anyway
manu
a possible solution could be:

Code: Select all

<?php
// class user functions
class uf {
	function varAssignValue(&$var,$val) {
		$var = $val;
		return;
	}
}
$uf = new uf();
?>
Inside pd_scripting use

Code: Select all

$uf->varAssignValue($tx['submenu']['heading'],"tour overview")
to get the expected result.
manu

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: [Plugin] PD_Scripting

Post by Holger » Wed Mar 31, 2010 10:10 pm

Hi guys, thanks for all your replys!
jerry wrote:Danish language file can be downloaded her:
Thank you jerry, I'll include it in the next version.
manu wrote:
manu wrote:Nevertheless something for the wishlist:
As I use CMSimple scripting not only for outputting something but also alter values like the "submenu" title like here, it would be nice if simple assignments like

Code: Select all

 #CMSimple $tx['submenu']['heading']="tour overview";#
would be excluded from outputting.
But thanks anyway
manu
a possible solution could be:

Code: Select all

<?php
// class user functions
class uf {
	function varAssignValue(&$var,$val) {
		$var = $val;
		return;
	}
}
$uf = new uf();
?>
Inside pd_scripting use

Code: Select all

$uf->varAssignValue($tx['submenu']['heading'],"tour overview")
to get the expected result.
manu
Hi manu, thanks for your suggestion.

The plugin was thought to deal with $output. But you're right, it's nice to include a way to change some variables at runtime since it is possible to do this with the classic CMSimple scripting.
But IMO there's no need for a special function or method. I think we can append the code / content of the field in the pagedata without any manipulation to $c[$pd_s].
The only thing to do is to decide if the given script contains a function or only variables.
So If we find the first character of $pd_current['hi_pd_scripting_code'.$i] as a "$", we can assume that we have not to deal with a plugin/function, isn't it :?:
If so, we only have to append the code to $c[$pd_s] and the syntax below is enough inside pd_scripting tab:

Code: Select all

$tx['submenu']['heading']="tour overview"; $tx['foo']['bar']="Blah"; $cf['setting']['blah']="true";
I've made some little tests and it seems to work.

So I will make an update of the plugin with this feature in the next two or three days.
CMSimple-Styles.com wrote:Hello Holger,
do you mind if i add this plugin to CMSimple SE?
Hi Jens, no problem, including it is fine with me (im Gegenteil, es ist mir sogar eine Ehre!).
But you should wait those two or three days until I can provide the update. We have a long weekend and it seems to be not a problem for me to find the time doing it.

Holger

manu
Posts: 1086
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: [Plugin] PD_Scripting

Post by manu » Thu Apr 01, 2010 12:45 pm

sounds perfect. thx a lot!
manu

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: [Plugin] PD_Scripting

Post by Holger » Sat Apr 03, 2010 3:03 pm

I've finished the new version, changing variables on the fly is now possible too.
Beside this, a german help-file and german / danish languages are included.

Download the new version 2.0 with the updated link in my first post here.

Holger

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: [Plugin] PD_Scripting

Post by Holger » Sun Apr 04, 2010 12:35 pm

The package contains now sk language and help.
Thanks to Tata :D !

Holger

Post Reply