Quote:
Originally Posted by HappyDJ
I still can't figure this out - how to use etc! It would be excellent if some sort of idiots guide was made to make a form or whatever!
Any takers?
|
happy, while no EXPERT myself the form hack consists of three things wrapped up into one neat XML plugin - two templates and php processing code. 1)An input template(named 'form'), 2)an output template(named answers) and 3)the php processing code itself which is hooked to 'newthread_start'. The 2 templates, once installed, can be found in the vb 'Style Manager' and edited from within the admin cp (like everything else) rather than constantly reinstalling/overwriting the plugin itself (which I did initially).
The first thing I did however, to make life easier on myself, was to rename (thru search replace) all the variable references in the script itself to simplier, more generic names like 'question1', 'answer1' and $answer1 (the php references). I assume you know HTML form processing right??
Step2 (prior to loading the XML) is deciding where the output 'answers' is to go and those options are embedded in the php code itself. In my case I chose 'reply to thread' leaving the reply to 'new thread' option '0' otherwise you'll get a double post.
Having muddled thru all of that I designed my own 'custom' input 'form' (using the same 'answer' variables) and noticed 1 thing - I did not have to change the 'formname' (or modify the XML plugin)
IF you manually assign the new template (in my case named 'testform') the same title $formtitle="form" as the hookcode will still execute!! In other words the only real reason I see to install a second XML is if the php processing code needs changing. Of course if ya need new / different php processing code (which you need to design) then the XML plugin and the 'formtitle' needs to change too but if Abe's processing code is good (and all ya need) you can manually force the issue AT RUNTIME . . .
Make Sense??
I am using this in conjunction with Logician's 'Webtemplates' and it works very well posting user input data into a thread of my designation . . . .
Eh, Questions??
Rabbit