15 years on The Web
miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Specific miniBB Support Forums / Specific /   

Default (pre-defined) text in the new message area

Author Slavva
#1 | Posted: 18 Aug 2013 23:27 
First off, thanks for the scripts, Paul and the gang, great job.
I am far from being a programmer, still could use some guidance in the matter of setting some pre-defined text in the new message area. Instead of being just blank I want the new post/reply field to contain a number of lines, something like:

1. Gist:
2. Symbols:

etc. Is it an easy thing to do, or does it require extensive modification? Thank you very much.

Author tom322
Active Member
#2 | Posted: 19 Aug 2013 05:17 
Not sure what exactly you want to achieve, but you may use placeholder to put some text in text area, like:

<textarea placeholder="Gist:" />

Author Slavva
#3 | Posted: 19 Aug 2013 10:41 
Thanks, Tom. I am making a kind of a message board with each message having the same layout, so to say. The messages are announcements. Placeholder sounds like a solution, but where exactly should I put it? I am after the very field I am using right now, the "Your Reply" field.

Author Paul
Lead Developer
#4 | Posted: 19 Aug 2013 11:35 
Here it is: How to find where to edit this and that.

Look up for 'textarea' in miniBB folder, most likely you will find the only one template holding message area, it is main_post_form.html.

Providing placeholder would be truly nice idea for your approach. There is a way to put straight "physical" text in the message area, but it should be handled on the coding level, because this template is also used in the other places - private messaging, editing message. Having some pre-defined text in it is impossible for these places.

Author Slavva
#5 | Posted: 19 Aug 2013 12:47 
Thanks, Paul. I am not going to allow private messaging or editing per se. Although "coding level" sounds too complicated to me, I could give it a try if you point out the files I need to work with.

Author Paul
Lead Developer
#6 | Posted: 19 Aug 2013 18:01 
In bb_plugins.php you just should pre-define some variable, holding your default text. For example:

$defaultMessageText='Default Message Text';

then paste {$defaultMessageText} in between
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.

Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Check out the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB