Hi,
I though it would be cool if one could put the mailform page on another page. May-be one would like to put some personalised text on top to the mailform...
Something like
{{{PLUGIN:mailform();}}}
or simply
{{{mailform();}}}
would be cool. Is there such a possibility? I know there are different plugins available, but as the code is already part of cmsimple, why dublicate if you don't need anything fancy.
svasti
Adding mailform on a page?
Re: Adding mailform on a page?
Indeed that's a reasonable thought. Unfortunately the mailform is written in a sequential programming style, so reusing the mailform is probably not easy. You might try something like the following:svasti wrote:I know there are different plugins available, but as the code is already part of cmsimple, why dublicate if you don't need anything fancy.
Code: Select all
function mailform()
{
global $pth, ...; // several variables required for the mailform
include $pth['file']['mailform'];
return $o;
}
For CMSimple_XH 1.6 I have rewritten cmsimple/mailform.php to cmsimple/classes/Mailform.php (see the 1.6 branch). The chances to reuse this class are probably better, even if the class was not written for reuse (actually I have just encapsulated the existing code in a class, and divided it to a couple of methods). Something like the following might suffice:
Code: Select all
function mailform()
{
include 'path-to-Mailform.php';
$mailform = new XH_Mailform();
return $mailform->process();
}
Christoph M. Becker – Plugins for CMSimple_XH
Re: Adding mailform on a page?
Hi Christoph,
may be on could put something like this into some future version.
svasti
may be on could put something like this into some future version.
svasti
Re: Adding mailform on a page?
The first step to having it in a future version, is to put it on the roadmap. I've put it on the roadmap for CMSimple_XH 1.6. It should not take long to implement it, even if my suggestions from above are not sufficient, as some modifications of Mailform.php are necessary.svasti wrote:may be on could put something like this into some future version.
Christoph M. Becker – Plugins for CMSimple_XH
Re: Adding mailform on a page?
I have added XH_mailform() (r830). Just call it on a page:
Code: Select all
{{{XH_mailform();}}}
Christoph M. Becker – Plugins for CMSimple_XH