Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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 1
Edit 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 2
In 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 3
Open 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 4
Now 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;


Attachments
51967-PM_instantubbcode-1_0.zip (0 Bytes, 12 downloads)

Last edited by canvey; 12/27/2002 4:35 PM.
Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)