miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Master Class miniBB Support Forums / Master Class /  
 

Building a custom message form

 
Author Anonymous
Guest
#1 | Posted: 21 Sep 2006 02:28 
I want to replace the new topic form with a custom form that has several input fields other than just the $postText. I want those fields to be output in the post where $postText is now. Any ideas on how to get started on this?

Author Paul
Lead Developer 
#2 | Posted: 21 Sep 2006 07:14 
Try to look at templates/main_post_form.html variable. Probably, this is the file you need to edit and add your new fields. Don't forget that you also need to parse these fields on input; use handlers in bb_plugins.php.

Author Anonymous
Guest
#3 | Posted: 22 Sep 2006 21:03 
Thanks. But I want this to be a custom form that is different from the main_post_form. So in other words, one form for new topics and the current one for replies. Unfortunately it appears that main_post_form serves both functions now. Any thoughts on how to change this or if anyone else has tried something similar?

Author Anonymous
Guest
#4 | Posted: 22 Sep 2006 21:10 
Scratch that last post - I figured out how to do it using the 1st page & separate topic form addon. But I am having trouble parsing the new form elements when they come in - how do I do that?

Author Paul
Lead Developer 
#5 | Posted: 24 Sep 2006 03:19 
What do you mean exactly by "having trouble"?

Author Anonymous
Guest
#6 | Posted: 24 Sep 2006 20:50 
Sorry, let me re-phrase: I am able to have a custom form with an additional field called "var1". I am able to display the "var1" field on the form and manipulate the code so that the value in the form gets inserted into a new column in the _posts table. But I am having trouble getting that new "var1" column to display in the post itself. Guessing I have somehow use the db_simpleSelect function?

Author Paul
Lead Developer 
#7 | Posted: 25 Sep 2006 03:31 
Take a look at some of our addons (Avatars, for example), and you will notice here is a function called parseMessage(). You can use this function for parsing addional message results.

Alternatively, if you want to destroy the core, edit bb_func_vthread.php file and paste additional fields in DB request. Assign them to variables like any others, and paste them as variables into main_posts_cell.html template. This will display fields in the thread listing.

Master Class miniBB Support Forums / Master Class /
 Building a custom message form
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑