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
  #72  
Old 07-01-2003, 07:25 PM
The_Huntress The_Huntress is offline
 
Join Date: Jan 2003
Location: Inside your mind
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it doesnt work for me (i have 2.3.0) it throws an error that i guess its either on member.php or member2.php... but when i look it up in i cant find it in either file *scratches head* ne ideas? like right now i went to edit a post and it says 'Line 44: 'color_text' is not defined'... no clue wut dat is heh..cuz lie 44 shows no errors (in ne of the templates)

a syntax error gets shown on private php as well ... when u try make a new pm

a little help?
Reply With Quote
  #73  
Old 07-13-2003, 10:15 AM
Salazar's Avatar
Salazar Salazar is offline
 
Join Date: May 2003
Location: Austria
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]06-24-03 at 08:29 PM ruffnerr said this in Post #70
The hack works with 2.3.0, I went through this whole thread and updated the original downloadable hack code with all the enhancements, bug fixes, etc that have been posted.

I'm not a professional hack writer, so I make no guarantees for this code.
Reply With Quote
  #74  
Old 07-29-2003, 11:15 PM
duncan99 duncan99 is offline
 
Join Date: Feb 2003
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It works great , I use v2.3.0 everything is ok except 2 small bugs :
- after pressing preview button, the signature checked becomes unchecked.

- when I modify the subject of the PM or change the subject, after pressing preview button, it goes back as the same subject before.

Can someone know how to fix it ?
Reply With Quote
  #75  
Old 08-08-2003, 04:20 PM
ruffnerr's Avatar
ruffnerr ruffnerr is offline
 
Join Date: Jun 2002
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I implemented all the changes listed in the support thread, tested it with vB 2.30, fixed another bug not previously fixed, and am posting the updated code here.

See attached instructions for installation.
Reply With Quote
  #76  
Old 08-08-2003, 04:26 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Such updates should be released in the original thread. Merging threads now..
Reply With Quote
  #77  
Old 08-08-2003, 04:26 PM
ruffnerr's Avatar
ruffnerr ruffnerr is offline
 
Join Date: Jun 2002
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think the subject bug was fixed earlier in the thread. To fix the signature check box do this:

Search for:

Code:
    if (!isset($savecopy)) {
        $savecopychecked="CHECKED";
    }
Insert this after:

Code:
    if ($signature) {
        $signaturechecked="CHECKED";
    }
Whoops, threads merged, that's what I get for listening to other posters :squareeyed:
Reply With Quote
  #78  
Old 09-30-2003, 08:35 PM
aquariumpros aquariumpros is offline
 
Join Date: Jul 2002
Location: Hawai`i
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have installed this hack (and reviewed/implimented all the fixes throughout the site)...and am not getting any errors...but when I click on the preview button...it just refreshs the PM screen and shows again without the preview. All the fields stay intact...but no preview window.

Anybody have any ideas?

(v-2.2.9)

TIA,
Reply With Quote
  #79  
Old 10-02-2003, 03:30 PM
aquariumpros aquariumpros is offline
 
Join Date: Jul 2002
Location: Hawai`i
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<BUMP> - anyone??
Reply With Quote
  #80  
Old 06-10-2004, 01:00 AM
Edison Chen Edison Chen is offline
 
Join Date: Oct 2003
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE]
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:19 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.08655 seconds
  • Memory Usage 2,321KB
  • Queries Executed 24 (?)
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
  • (30)bbcode_code
  • (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
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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