Tutorial for plugin ?
54 posts by 11 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: November 30, 2011 (RSS)
By Djulia - February 3, 2010
I would like to create a simple function that I would like to activate or deactivate in the section plugins ?
There would be a tutorial to explain how to create (to activate) a plugin?
Thanks for the feedback!
Djulia
Re: [Djulia] Tutorial for plugin ?
By Dave - February 4, 2010
I can write something up. Do you just want to automatically load your plugin or do you want to use one of the plugin hooks? Or, put another way, what do you want your plugin to do?
For the most part you can just create a php file in the /plugins/ folder with this header:
<?php
function yourfunction() {
...
}
?>
Once you do that you'll be able to see it and "activate" it in the plugins menu. Once activated it will be loaded by admin.php and any of your viewer pages.
The "Requires at least" line refers to CMSB versions. You can't activate a plugin unless you have at least that version.
Hope that helps! Let me know any additional details you need.
interactivetools.com
Re: [Dave] Tutorial for plugin ?
By Djulia - February 4, 2010
I wrote my plugin!
But, I did not really understand the use of addFilter.
That seems to be an important parameter.
It is the insertion point ?
Thanks to risk you in the explanations!
Djulia
Below my plugin, it will be perhaps useful for other users!
He alerts by email the admin if a user connects himself.
Re: [Djulia] Tutorial for plugin ?
By Dave - February 4, 2010
Looks good. I added this semicolon to make it work for me:
. "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}\n";
addFilter() and addAction() are almost the same but addFilter() must always return something. It's used to modify a value (such as the footer text), where-as addAction() just runs some code.
Let me know if you have any other questions about how everything works! :)
interactivetools.com
Re: [Djulia] Tutorial for plugin ?
By Dave - February 6, 2010
interactivetools.com
Re: [Dave] Tutorial for plugin ?
By Djulia - February 11, 2010 - edited: February 11, 2010
That functions perfectly with version 2.03.
Djulia
Re: [Djulia] Tutorial for plugin ?
By Dave - February 15, 2010
interactivetools.com
Re: [Dave] Tutorial for plugin ?
By Djulia - April 2, 2010
The post of Terry motivated me to improve a plugin that I had written.
It sends an email notification when a record is added or modified ...
CMSB impresses me each day by its flexibility!
But, I still block with the use of css.
Djulia
Re: [Djulia] Tutorial for plugin ?
By flamerz - April 2, 2010
good job.
Re: [Djulia] Tutorial for plugin ?
By hvbuilder - April 10, 2010
I upgraded to version 2.03 and installed your plugin, but I do not receive an email when a record is added or changed. Is there something else I need to do?
Thanks,
James