// preview hack
if (!$pagetext) {
// parse message for html if previewing
$message = htmlspecialchars($message); // Without this, a </textarea> in the message breaks the form on preview
}
// preview hack
e) Find:
Code:
if ($bbuserinfo[userid]!=0 and !$previewpost and $bbuserinfo[signature]!="") {
$signaturechecked="CHECKED";
}
Right under it insert:
Code:
// preview hack
if (!isset($parseurl)) {
$parseurlchecked="CHECKED";
}
if (!isset($savecopy)) {
$savecopychecked="CHECKED";
}
if (!isset($pmreceipt)) {
$pmreceiptchecked="CHECKED";
}
// preview hack
BTW, I just noticed that the name of this hack doesn't really suit what it does..."Preview Sent Private Message"...you haven't really sent the message yet, when you preview it.
If you haven't installed the hack, ignore this message -- the installation instructions in the first thread and the downloadable attachment txt file have been modified.
ok, found - and corrected - another bug.
Problem: if you are replying to a PM or forwarding it, the icon in the folder for that PM does not change from a regular "read PM" to a "replied to PM" or a "forwarded PM".
The reason is that if you preview a message, the values for "privatemessageid" and "forward" -- hidden fields in the form -- are not stored.
For this, we have to redclare them in the 'preview' part of the hack.
If you already installed this hack, find in private.php:
These determine the behaviour of your icons in the PM folder:
if $privatemessageid has a value, then it means you are now replying to or forwarding a message. If it doesn't have a value, it means you are writing a new message.
if $privatemessageid has a value and $forward=1, it means you are forwarding a message and not replying.
These then determine which icon will be displayed in your inbox next to that message.
Now, when you click on "Reply" for a message, these values are filled.
When you hit "Preview", these values are lost.
So we need to "reinstate" them.
That's what these two lines are for:
Code:
$privatemessageid = $prevmessageid;
$forward;
From what you are telling me, I can only assume you have high error reporting set in php.ini.
For the vast majority of the people, that error won't show up because they are not in development environment with high error reporting, and functionality is not tampered.
However, if you want to be "holier than the pope" so to speak, do this instead:
PHP Code:
if ($prevmessageid) {
$privatemessageid = $prevmessageid;
}
$forward = iif($forward,1,0);
I think this should work. Try it out and let me know
OKay.. I have installed this as well and come across another pecularity.
If you look in private.php in the "New Message" section there is this line:
PHP Code:
if (isset($privatemessageid)) {
Well what this does is start a check to make sure the previous message actually exists. On my version and installation of PHP even though it was set to '0' this was returning true. I had to change the line to the following to prevent a "Invalid Message Error".
PHP Code:
if (isset($privatemessageid) and $privatemessageid!=0) {
With that it works great. I recommend that if the error doesn't occur then use Bira's original code. If it does then make this modification.