Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by bira bira is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 11-25-2001 Last Update: Never Installs: 31
 
No support by the author.

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 ###############################
Until (but not including):

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) ###############################
2) Now we need to insert the following code:

a) Find:

Code:
    $savecopy=iif($savecopy=="yes",1,0);
Right under it insert:

Code:

    // preview hack
    $pmreceipt=iif($pmreceipt=="yes",1,0);
    // preview hack
    
b) Find:

Code:
    if ($pmquota>0 and $touserinfo[usergroupid] != 6 and $bbuserinfo[usergroupid] != 6) {
Right above it insert:

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
    
c) Find:

Code:
    } #end dosend
Right above it insert:

Code:

    } // preview hack
    
d) Find:

Code:
    //show new message form
Right under it insert:

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
    
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
    
f) Find:

Code:
    // /enhanced
    eval("dooutput(\"".gettemplate("priv_sendprivmsg")."\");");
Right above it insert:

Code:

    // preview hack
    if (!isset($privmessage)) {
        $privmessage = $message[message];
    }
    // preview hack
    

g) Find:

Code:
    // enhanced
   $receipt=iif($pmreceipt=="yes",1,0);
   // /enhanced
And replace it with (the code to remove is marked in red):

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>
    
(you may edit this to your liking).

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>
And replace it with (change marked in red):

Code:
    <textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="3"> $privmessage</textarea>
c) Find:

Code:
    <input type="checkbox" name="parseurl" value="yes" checked>
And replace it with (change marked in red):

Code:
    <input type="checkbox" name="parseurl" value="yes" $parseurlchecked>
d) Find:

Code:
    <input type="checkbox" name="savecopy" value="yes" checked>
And replace it with (change marked in red):

Code:
    <input type="checkbox" name="savecopy" value="yes" $savecopychecked>
e) Find:

Code:
    <input type="submit" class="bginput" name="submit" value="Send Message" accesskey="s" tabindex="4">
And replace it with (change marked in red):

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>
And replace it with (change marked in red):

Code:
    <input type="checkbox" name="pmreceipt" value="yes" $pmreceiptchecked>
That's it!

Comments and additions welcome.

Cheers,

Bira

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 12-10-2001, 04:13 AM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks wluke, good to know
Reply With Quote
  #23  
Old 12-10-2001, 05:16 AM
FWC's Avatar
FWC FWC is offline
 
Join Date: Oct 2001
Location: Ontario, CA
Posts: 821
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]Originally posted by bira
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

Cheers,

Bira
Reply With Quote
  #24  
Old 12-12-2001, 04:18 AM
LuBi LuBi is offline
 
Join Date: Oct 2001
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok I press preview, and the page refreshes with nothing but a new blank priv message...

help!?
Reply With Quote
  #25  
Old 12-12-2001, 11:31 AM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LuBi, follow the instructions again and see what you missed out or did wrong
Reply With Quote
  #26  
Old 12-12-2001, 03:53 PM
LuBi LuBi is offline
 
Join Date: Oct 2001
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

From what I can see I have installed everything correctly, my only problem was that copy and paste part but the problem was no with what I did but that it was interesting anyhow.. now my only worry is when I pree preview it's more like a refresh button and the page comes back blank, exactly what happened before so nothing has changed. I have this hack installed with the jscript hack similar to what firefly runs on here.. but for some reason my preview doesn't work...
Reply With Quote
  #27  
Old 12-13-2001, 03:30 PM
LuBi LuBi is offline
 
Join Date: Oct 2001
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<<help>>
Reply With Quote
  #28  
Old 12-13-2001, 03:40 PM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LuBi, I honestly don't know how to help you.

If you installed the hack exactly as the instructions say then you shouldn't have any problem.

Your problem, from what you are describing, is that the action 'preview' is either not present in private.php, or misconfigured. If the page simply refreshes, it means it doesn't know what to "do" with 'preview'. That means you installed the hack wrongly.
Reply With Quote
  #29  
Old 12-13-2001, 03:53 PM
LuBi LuBi is offline
 
Join Date: Oct 2001
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok well that was funny I missed $postpreview 5 times. Now my problem wil be getting this hack to work with the javascript hack. I think I just need to change this $privmessage for $message[message] and I'll be so fresh so clean. THANKS!

*Edit - Works now with the javascript hack, my mistake $privmessage had an extra e i.e. $privmessagee Thanks Again!
Reply With Quote
  #30  
Old 12-24-2001, 12:50 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried installing twice. and this is what I get printed on screen above my headers

(part of my VB title) Private Messaging - Send Message

then I get the screen to send PM

and underneath it printed on the screen

HTTP/1.1 200 OK Date: Mon, 24 Dec 2001 04:29:14 GMT Server: Apache/1.3.19 (Unix) PHP/4.0.5 mod_ssl/2.8.2 OpenSSL/0.9.6 X-Powered-By: PHP/4.0.5 Content-Length: 5331 Keep-Alive: timeout=15, max=97 Connection: Keep-Alive Content-Type: text/html

and then the vbulletin error message no private message specified...

???
Reply With Quote
  #31  
Old 12-24-2001, 01:14 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Stupid me instead of cutting and pasting I did a copy and paste... However I cannot preview. I still am getting the no message specified error....

I applied wluke's fix

if (isset($privatemessageid) and $privatemessageid!=0) {

and it is working now.

Thanks for the hack Bira.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:34 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05100 seconds
  • Memory Usage 2,333KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (28)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete