Previous Thread
Next Thread
Print Thread
Rating: 5
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Mod Name / Version Instant UBBCode boxes on PM v0.2
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 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!
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:
code:
<textarea cols="$TextCols" rows="$TextRows" class="formboxes" name="Message">$RawBody</textarea>



Should be changed into this:
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 it into this (note that the name attribute has changed):
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
50948-PM_instantubbcode-image.png (0 Bytes, 25 downloads)

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Instructions are very clear and worked wonderfully for me.

[:"red"]T H A N K _ Y O U ! ! ![/]

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
I'm glad to hear it!

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
Worked great for me too

Joined: Mar 2002
Posts: 305
Enthusiast
Enthusiast
Offline
Joined: Mar 2002
Posts: 305
Worked for me as well -- thank you!


[:"red"]Lisa[/]
Sponsored Links
Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
I take that back. I was having errors on replies to PMs which were saying that there was a field not filled in. Maybe it's conflicting with one of the other hacks I got installed... I'll play with it later after I set up a test board to screw up, lol

Joined: Mar 2002
Posts: 305
Enthusiast
Enthusiast
Offline
Joined: Mar 2002
Posts: 305
I got the same error, can't reply to PM's because I get the message "Not all fields filled in". I didn't notice it right away because I wasn't replying to myself.


[:"red"]Lisa[/]
Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
That's the error I got...

I think it might need the subject to be edited to send with no errors. I tried that and sometimes it went through, I think. It was acting pretty strange so I may be mistaken here.

Otherwise the hack worked great!

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Hmmmmmm....

been repling back and fourth to all sorts of members this evening. 42 Pms in the last couple of hours.

No problems to report.

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
This hack was also causing my index.php (IIP 4.3) to 'hang' and not display all the time. Hitting refresh button would display the page correctly. When I removed this hack, and only this hack, the hang issue cleared up. Don't ask me how these two are related, but this hack was definitly affecting the index.php somehow... Strange.

Sponsored Links
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
That doesn't sound good at all, I'll look into it when I get back home next week.

But I think reply works for me so it might be something I missed in the description.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I'm running IIP too and haven't noticed a problem.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
maybe you need to repair that table in your database. It might be corrupted and giving IIP a rough time trying to read the # of pm's


- Allen wavey
- What Drives You?
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3


looks good here, tho I'll need to update the pm templates to look like the posting pages now


- Allen wavey
- What Drives You?
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
That sounds great!

Is there any problems with replying after installing the hack?

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
[] I got the same error, can't reply to PM's because I get the message "Not all fields filled in".

Same here. The value of the body isn't taken over, i think

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
OK, I've checked and replies works for me, so either there is a mistake in the description or you might have missed something. Since some people doesn't seem to have the problem I'm guessing that some of you are missing something, probably becasue the description isn't clear.

First, have you changed the name of the textarea tag to Body in all of these files: sendmessage.tmpl, sendprivate.tmpl, mess_handler.tmpl, mess_reply.tmpl
I'm guessing that this is done, otherwise the boxes wouldn't work on those pages.

Secondly, have you followed step 4 and added the $Message = $Body; to all of the mentioned files?

If everything seems to be in order I need some more information. Is it only happening when replying? Does the error come up both when doing a preview and posting directly?

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
OK, since some people have had some trouble with replying I've tried to find out what the problem is and now I think I know what the problem is.

In Step 2 where you change the input tag you must only change the value of the name attribute, that is in red. This is because the value is different, in the mess_reply.tmpl the value should be 'value="$FormMessage"'.

Please let me know if this fixes the problem.

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Yes, missunderstood that part.
Thx, everything working now!

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
OK, I found out what was happening to me. I was leaving in a name="Message" in the textarea tag edits on a couple of the templates. I would suggest changing the directions to contain exact code for each of the four templates to avoid this. It is much easier to replace an entire line of code than edit. The four template did not have the name="Message" in the same spot, this is how it got left in.

Also, the .zip version of UBBT has the tag textareahtml, while the .gz has textarea tag. So I would suggest listing the code to change between those tags, so instructions would work on either version.

I hope this keeps others from having the same problems I did! LOL

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Well, the first version I had of the description (can be found in the corresponding thread in modifaction suggestion board) has a step for each row to be changed. I did the new version because many of the changes were almost the same and tried to use color to show what should be changed.

What do you others think, should the description be one step for each thing to change and having the complete new row or should it be as it is now with description of what should be changed at the same time in several different files? It doesn't matter to me, I have both versions of the description and can post either one. No matter which I'll keep I'll make it clearer so as to minimize any possible confusion.

Sounds strange that there is a difference in the templates between the zip and the gz version, I would call that a bug. =]

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
Maybe you can just stress to make sure there is only one 'name' in each tag? I was not paying attention and the old name got left, thus causing the problem.

Also, the difference might be due to slight differences in PHP from unix to win32? I dunno, but I tried to use the admin template editor to change the tags to the unix version, but they kept reverting back.. hmm...

Oh well, it works now that I figured out what I was doing wrong

Joined: Apr 2002
Posts: 30
User
User
Offline
Joined: Apr 2002
Posts: 30
I also added
code:
$instant_ubbcode = $html -> instant_ubbcode();

to the sendmessage.php right below
code:
// --------------------------------------------------------------
// Now if we are doing a preview of the post, we do this
if ($preview) {



That will allow them to still use ubbcode on the preview screen.

Thanks for this great hack!


Paul Fries
Systems Administrator
CWIE LLC
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Did I miss that? Thanks for the fix! I'll get it added to the code when I can reach my home computer again.


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
Ruben Rocha
Ruben Rocha
Lutz,FL,USA
Posts: 254
Joined: January 2000
Forum Statistics
Forums63
Topics37,575
Posts293,932
Members13,824
Most Online6,139
Sep 21st, 2024
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,835
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 1
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-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)