Mod Name / Version Instant UBBCode boxes on PM v1.0
Description This is a hack that adds the Instant UBBCode boxes to the PM pages.
Working under UBB.threads 6.0.1
Any pre-requisites None
Author(s) Gardener
Credits JoshPet who came up with the idea
Demo See attached screenshot
Files Altered sendmessage.tmpl, sendprivate.tmpl, mess_handler.tmpl, mess_reply.tmpl, sendprivate.php, mess_handler.php, mess_reply.php, sendmessage.php
Database Altered No
New Files None
Any other info Please report any problems you might have and I'll try to fix them as soon as possible. I haven't given this much testing yet, but it seems to work for me.
Step 1Edit the following template files: sendmessage.tmpl, sendprivate.tmpl, mess_handler.tmpl, mess_reply.tmpl
First you will have to change the form tag in all these files. It is slightly different in some of the files, but that doesn't matter, there should only be one in each file. It will look something like this (and is at line 18 in most of them):
code:
<form method="post" action="{$config['phpurl']}/sendmessage.php">
Add the part in red below to the form.
Make sure that the action attribute stays the same as before and that you remove the old name attribute!code:
<form[:"red"] name="replier"[/] method="post" action="{$config['phpurl']}/sendmessage.php">
After that you will have to update the Textarea tag in all of the files. Find the tag that looks like this, again, there should only be one textarea tag in each file. If you have downloaded the zip-version of UBB.threads, the textarea tags might be called textareahtml instead. The two lines below are actually on one line in the files.
code:
<textarea cols="$TextCols" rows="$TextRows" class="formboxes"
name="Message">$RawBody</textarea>
Change the parts in red below.
Please make sure that the old name attribute is removed!code:
<textarea cols="$TextCols" rows="$TextRows" class="formboxes"[:"red"]
wrap="soft" name="Body" onkeyup="storeCaret(this);"
onclick="storeCaret(this);"[/]>$RawBody</textarea>
$instant_ubbcode
Please note that the name attribute is changed, and that you won't have to insert the wrap="soft" in all files since it is already in some. It is also vitally important that the $instant_ubbcode is inserted after the textarea, otherwise the boxes won't show up.
Step 2In the files sendmessage.tmpl and mess_reply.tmpl you will also have to change the input tag looking like this:
code:
<input type="hidden" name="Message" value="$FormBody" />
And change the red parts below.
Note that the name attribute has changed, so the old one has to be removed. Also, since the value attribute is different, make sure you don't change that.code:
<input type="hidden"[:"red"] name="Body"[/] value="$FormBody" />
Step 3Open up the files sendprivate.php, mess_handler.php and mess_reply.php and do the following:
Find the line that looks something like this (it is the only one in each file that has the "send_header" part):
code:
$html -> send_header("{$ubbt_lang['PRIV_HEAD']} $User",$Cat,0,$user);
And add this line before it:
code:
$instant_ubbcode = $html -> instant_ubbcode();
Step 4Now open mess_reply.php and sendmessage.php and do the following in both files:
Find this line near the beginning:
code:
$RawBody = $Message;
And change it into this:
code:
$RawBody = $Body;
$Message = $Body;