The Arcive of vBulletin Modifications Site. |
|
Details »»
|
|||||||||||||||||||||||||
OK, I wrote this hack seeing as my users were nagging about it and I could not find one here (if there is one, I apologise - please give me the URL).
This works exactly like post preview: How to install: Open private.php 1) First we need to move "newmessage" after "dosend". Highlight the entire section between: Code:
// ############################### start new message ############################### Code:
// ############################### start send message ############################### Cut this entire section (a total of 83 lines in 2.2.1) and paste it right above: Code:
// ############################### start do stuff (move, etc) ############################### a) Find: Code:
$savecopy=iif($savecopy=="yes",1,0); Code:
// preview hack
$pmreceipt=iif($pmreceipt=="yes",1,0);
// preview hack
Code:
if ($pmquota>0 and $touserinfo[usergroupid] != 6 and $bbuserinfo[usergroupid] != 6) {
Code:
// preview hack
if ($preview) {
$previewpost=1;
$previewmessage=bbcodeparse($message,0,$allowsmilie);
if ($signature) {
$post['signature'] = bbcodeparse($bbuserinfo['signature'],0,$allowsmilie);
eval("\$post[signature] = \"".gettemplate("postbit_signature")."\";");
$previewmessage.=$post['signature'];
}
eval("\$postpreview=\"".gettemplate("priv_sendpreview")."\";");
$parseurlchecked=iif($parseurl,"checked","");
$pmreceiptchecked=iif($pmreceipt,"checked","");
$savecopychecked=iif($savecopy,"checked","");
$signaturechecked=iif($signature,"checked","");
$previewchecked=0;
$title = htmlspecialchars($title);
$privatemessageid = $prevmessageid;
$forward;
$subject = $title;
$privmessage = $message;
$action="newmessage";
} else {
// preview hack
Code:
} #end dosend Code:
} // preview hack
Code:
//show new message form Code:
// 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
Code:
if ($bbuserinfo[userid]!=0 and !$previewpost and $bbuserinfo[signature]!="") {
$signaturechecked="CHECKED";
}
Code:
// preview hack
if (!isset($parseurl)) {
$parseurlchecked="CHECKED";
}
if (!isset($savecopy)) {
$savecopychecked="CHECKED";
}
if (!isset($pmreceipt)) {
$pmreceiptchecked="CHECKED";
}
// preview hack
Code:
// /enhanced
eval("dooutput(\"".gettemplate("priv_sendprivmsg")."\");");
Code:
// preview hack
if (!isset($privmessage)) {
$privmessage = $message[message];
}
// preview hack
g) Find: Code:
// enhanced $receipt=iif($pmreceipt=="yes",1,0); // /enhanced Code:
// enhanced $receipt=iif($pmreceipt,1,0); // /enhanced Save private.php and upload to server. In the Administration control panel -> Templates 1) ADD template priv_sendpreview and insert to it: Code:
<br>
<table cellpadding="0" cellspacing="0" border="0" bgcolor="#555576" width="100%" align="center"><tr><td>
<table cellpadding="4" cellspacing="1" border="0" width="100%">
<tr>
<td bgcolor="#8080A6"><smallfont color="#EEEEFF"><b>Message Preview:</b></smallfont></td>
</tr>
<tr>
<td bgcolor="#F1F1F1"><normalfont>$previewmessage</normalfont></td>
</tr>
</table>
</td></tr></table>
2) Open template priv_sendprivmsg a) place $postpreview where you want the message preview to appear (normally would be under $cpnav). b) Find: Code:
<textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="3">$message[message]</textarea> Code:
<textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="3"> $privmessage</textarea> Code:
<input type="checkbox" name="parseurl" value="yes" checked> Code:
<input type="checkbox" name="parseurl" value="yes" $parseurlchecked> Code:
<input type="checkbox" name="savecopy" value="yes" checked> Code:
<input type="checkbox" name="savecopy" value="yes" $savecopychecked> Code:
<input type="submit" class="bginput" name="submit" value="Send Message" accesskey="s" tabindex="4"> Code:
<input type="submit" class="bginput" name="submit" value="Send Message" accesskey="s" tabindex="4">
<input type="submit" class="bginput" name="preview" value="Preview Message" accesskey="p" tabindex="4">
3) Open template priv_requestreceipt Find: Code:
<input type="checkbox" name="pmreceipt" value="yes" checked> Code:
<input type="checkbox" name="pmreceipt" value="yes" $pmreceiptchecked> Comments and additions welcome. Cheers, Bira Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
Sorry, forgot to attack the instructions in a txt file as well (the same instructions as posted above).
|
|
#3
|
||||
|
||||
|
bira, in the attached text file, you left a [/code] in.
![]() It's in this part: PHP Code:
|
|
#4
|
||||
|
||||
fixed, thanks |
|
#5
|
||||
|
||||
|
Not that I think anyone managed to install this hack so fast, but just in case - I made the following change to the above hack installation instructions:
In the private.php: Quote:
|
|
#6
|
||||
|
||||
|
[QUOTE]Originally posted by bira
Not that I think anyone managed to install this hack so fast, but just in case... |
|
#7
|
||||
|
||||
|
Thanks
|
|
#8
|
||||
|
||||
|
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.
I've had a bug on my BB after installing this hack, so if anyone who installed this hack experiences the same problem, here's the fix: Problem: even if you select the option to "request read receipt", the PM doesn't appear in the message tracking page. Fix: in private.php find: Code:
// enhanced $receipt=iif($pmreceipt=="yes",1,0); // /enhanced Code:
// enhanced $receipt=iif($pmreceipt,1,0); // /enhanced |
|
#9
|
||||
|
||||
|
After reading your message, I tested, and found I had the same problem. Your fix works fine. But I have to wonder, since it looks like this isn't part of your hack code, but rather part of the original code...does this fix have any other side effects?
|
|
#10
|
||||
|
||||
|
JJR512 it shouldn't.
There is no difference as far as the private.php script goes between $pmreceipt=="yes" and just $pmreceipt not NULL. For some reason, the preview hack alters the "yes". But it's still either NULL (empty) or not (has value). So, the original code does: Code:
if ($pmreceipt=="yes") {
return 1;
} else {
return 0;
}
Code:
if ($pmrecepit) { //does $pmreceipt have a value?
return 1;
} else {
return 0;
}
![]() Cheers, Bira |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|