Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Mod Name / Version: PM Quote Original Message 1.3

Description: Gives the user the option to quote the original message when replying to a PM. There is a checkbox to include the quote. Works similar to the way email works - helps to not get confused in alot of back and fourth PMs. Verified that this works with 6.3.

Working Under: UBB.Threads 6.2-6.3-6.4

Mod Status: Beta

Any pre-requisites: none

Author(s): JoshPet

Date: 06/11/03

Credits: maze and dimopoulos for suggesting it

Files Altered: mess_handler.php, mess_reply.php, mess_handler.tmpl, mess_reply.tmpl

New Files: none

Database Altered: none

Info/Instructions: <img src="/forum/images/graemlins/smile.gif" alt="" />

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.


Attachments
84084-PMQuoteOrigMsg1.3.txt (0 Bytes, 160 downloads)

Last edited by JoshPet; 01/04/2004 1:32 PM.
Sponsored Links
Joined: Jun 2002
Posts: 670
Code Monkey
Code Monkey
Offline
Joined: Jun 2002
Posts: 670
I can't get this to work for me. I get this error when I click on "Reply to this message." This is the error I get:

Parse error: parse error, unexpected $ in /home/laondal/public_html/foros/templates/default/mess_handler.tmpl on line 75

The weird thing is there are only 74 lines in the entire file. I've attached the mess_handler.tmpl file.
Attachments
91871-mess_handler.tmpl (0 Bytes, 36 downloads)

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Opened in UltraEdit and I actually see 75 lines, but line 75 is blank, which is after the ?>

Otherwise compared the code to my install and it's exactly the same. Could try double checking and deleting that line.

Joined: Aug 2003
Posts: 160
ST Offline
Junior Member
Junior Member
Offline
Joined: Aug 2003
Posts: 160
Is there a way to add the name of the sender in the quote area?

Like the post quote name mod, so it syas something like
Quote: ST said...
and then the content

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Probably you'd have to rework things a bit.... when you are replying you're replying to a user number. Probably have to add a query somewhere to insert the name in to the quote stuff into the scripts.

Sponsored Links
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Hey Josh, does this one work under Threads 6.4?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yes, we are using it here, no problems.

Joined: Nov 2003
Posts: 482
Enthusiast
Enthusiast
Offline
Joined: Nov 2003
Posts: 482
[]ST said:
Is there a way to add the name of the sender in the quote area?

Like the post quote name mod, so it syas something like
Quote: ST said...
and then the content
[/]

Yes. It's really simple. (oops, forgot to mention it's mess_reply.php)

[:"red"]Find:[/]
Code
 <br />// Grab the username of who we are sending this to <br />	$query = " <br />		SELECT U_Username <br />		FROM	 {$config['tbprefix']}Users <br />		WHERE  U_Number='$Sendto' <br />	"; <br />	$sth = $dbh -> do_query($query); <br />	list($Sendtoname) = $dbh -> fetch_array($sth); <br />


[:"red"]and move it above: [/]

Code
 <br />// #################################################################### <br />// preview_mess - Preview reply to this message <br />// #################################################################### <br />


This will pull the query out of the preview, so it's shared by code outside that block (namely, where you want to know the username )

[:"red"]Then find (JoshPet's mod): [/]
Code
 <br />$Message .= "\n\n<blockquote><font class=\"small\">{$ubbt_lang['IN_REPLY']}:</font><hr /><br />"; <br />


[:"red"]and replace with:[/]
Code
 <br />$Message .= "\n\n<blockquote><font class=\"small\">$Sendtoname sent:</font><hr /><br />"; <br />


Note: this works fine on 6.4, btw.

Joined: Jun 2000
Posts: 190
Enthusiast
Enthusiast
Joined: Jun 2000
Posts: 190
Josh,

Thanks for this great little hack. However, we would prefer to have the quote appear at the top of the reply rather than below the reply. Can this be done?

Edit: One other thing.... as it is now, the "Quote original PM" is checked by default. Can this be changed so it is NOT checked by default?

Jeff

Last edited by Pilgrim; 04/29/2004 6:31 PM.

Artificial Intelligence is no match for natural stupidity!
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Make it not checked by default:
Look at the instructions:
Code
<br /><!--Quote original message hack by JoshPet --><br /><input type="checkbox" name="QuoteOrig" value="1" checked="checked" class="formboxes" /><br />I want to Quote the Original Message in my Reply<br /><br /><br /><br /><br />


change to:
Code
<br /><!--Quote original message hack by JoshPet --><br /><input type="checkbox" name="QuoteOrig" value="1" class="formboxes" /><br />I want to Quote the Original Message in my Reply<br /><br /><br /><br /><br />


Original Message on top:

Change:
Code
	   if ($QuoteOrig) {<br />	      $Message .= "\n\n<blockquote><font class=\"small\">{$ubbt_lang['IN_REPLY']}:</font><hr /><br />";<br />	      $Message .= $OrigMessage;<br />	      $Message .= "<br /><br /><hr /></blockquote>";<br />	   } 


to

Code
	   if ($QuoteOrig) {<br />	      $Message = "\n\n<blockquote><font class=\"small\">{$ubbt_lang['IN_REPLY']}:</font><hr /><br /> . $OrigMessage . "<br /><br /><hr /></blockquote>" . $Message";<br />	     <br />	   } 

Sponsored Links
Joined: Jun 2000
Posts: 190
Enthusiast
Enthusiast
Joined: Jun 2000
Posts: 190
Astaran,

Thanks for the help. The first part which unchecks the box by default works fine. But the second modification to put the "quote" at the top of the reply returns a parse error. Are you sure your coding is 100% correct? Not knowing myself, I have to rely upon your expertise.

This is what my section looks like before replacing it with your mod:

Code
if ($QuoteOrig) {<br />	      $Message .= "\n\n<blockquote><font class=\"small\">$Sendtoname sent:</font><hr /><br />";<br />	      $Message .= $OrigMessage;<br />	      $Message .= "<br /><br /><hr /></blockquote>";<br />	   }


Jeff


Artificial Intelligence is no match for natural stupidity!
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Try this instead:

Code
<br />   if ($QuoteOrig) {<br />	      $Message = "\n\n<blockquote><font class=\"small\">{$ubbt_lang['IN_REPLY']}:</font><hr /><br />" . $OrigMessage . "<br /><br /><hr /></blockquote>" . $Message;<br />	     <br />	   } <br />

Joined: Jun 2000
Posts: 190
Enthusiast
Enthusiast
Joined: Jun 2000
Posts: 190
Thanks.... this one works perfectly!! []http://www.the-highway.com/Smileys/boing.gif[/]


Artificial Intelligence is no match for natural stupidity!

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
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
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)