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 Mas*Mind Mas*Mind is offline
Developer Last Online: Sep 2003 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 02-22-2001 Last Update: Never Installs: 24
 
No support by the author.

This is what the hack does: It let's you preview a message when you're editing it, you can only preview when you're posting or replying the way it is now:

It works on my testserver, but I've not tested on a 'live' forum, but it seems to be working allright...

Instructions

1 Backup your editpost.php file!!! and open the original one...

Then:

after:

PHP Code:
if (!isset($action) or $action=="") {
  
$action="editpost";

insert:

PHP Code:
if($preview AND $action="updatepost")
    
$action "editpost"
after:

PHP Code:
if ($action=="editpost") {

  
// draw nav bar
  
$navbar=makenavbar($threadinfo[threadid],"thread",1); 
insert:

PHP Code:
  if($preview)
  { 
$parseurl=iif($parseurl=="yes",1,0);
      
$email=iif($email=="yes",1,0);
      
$allowsmilie=iif($disablesmilies=="yes",0,1);
      
$signature=iif($signature=="yes",1,0);
    
    
$previewmessage=$message;
    
    if (
$parseurl) {
      
$previewmessage $postinfo[message]=parseurl($previewmessage);
      }
    
    
$previewpost=1;
    
$previewmessage=bbcodeparse($previewmessage,$foruminfo[forumid],$allowsmilie);
    
$postinfo[message]=$message;    

    if (
$signature) {
      
$previewmessage.=bbcodeparse("\n__________________\n$bbuserinfo[signature]",0,$allowsmilies);
    }

    eval(
"\$postpreview=\"".gettemplate("editpost_postpreview")."\";");

    
$parseurlchecked=iif($parseurl,"checked","");
    
$postinfo[allowsmilie] = $allowsmilie;
    
$postinfo[showsignature] = $signature;
    
$postinfo[iconid] = $iconid;
    
$postinfo[title] = $title;
    
$previewchecked=0;
  }
  else{
       
$postinfo[message]=htmlspecialchars($postinfo[pagetext]);
    
$parseurlchecked="CHECKED";
  } 
Replace:

PHP Code:
 $postinfo[message]=htmlspecialchars($postinfo[pagetext]); 
with:

PHP Code:
//$postinfo[message]=htmlspecialchars($postinfo[pagetext]); 
replace:

PHP Code:
   if ($checkid=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE userid='$userinfo[userid]' AND threadid=$threadinfo[threadid]")) {
    
$emailchecked="CHECKED";
  } else {
    
$emailchecked="";
  } 
with:

PHP Code:
   if(!$preview)
      
$email=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE userid=$userinfo[userid] AND threadid=$threadinfo[threadid]");
  
$emailchecked=iif($email,"CHECKED",""); 
Make a new template called 'editpost_postpreview' with the following content:

Code:
 <table width=100% border=0 cellspacing=1 cellpadding=4>
<TR bgcolor="#6c6081">
<TD valign=middle><smallfont color="#afa3c5"><B>Post Preview:</B></smallfont></TD>
</TR>

<tr bgcolor="#DEDEDE">
<td><normalfont>$previewmessage</normalfont></td>
</tr>
</table>

<br>
then edit your 'editpost' template:

insert the '$postpreview' variable at the appropiate place (look into the 'newthread' template for an example)

and replace:

Code:
<INPUT TYPE="Submit" NAME="SUBMIT" ACCESSKEY="S" VALUE="Submit Now">
with:

Code:
<INPUT TYPE="Submit" NAME="preview" ACCESSKEY="P" VALUE="Preview">
<INPUT TYPE="Submit" NAME="SUBMIT" ACCESSKEY="S" VALUE="Submit Now">
All done! Enjoy

Show Your Support

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

Comments
  #2  
Old 02-23-2001, 09:03 PM
Guest
 
Posts: n/a
Default

I'll be working on the pm-preview btw
Reply With Quote
  #3  
Old 02-24-2001, 06:05 PM
Guest
 
Posts: n/a
Default

No-one's interested?
Reply With Quote
  #4  
Old 02-24-2001, 07:55 PM
Guest
 
Posts: n/a
Default

Sure i will use them both, I just wasn't doing much with hacks yet until 2.0 is released. I didn't want a beta 3 to come out and have to re-hack a bunch of stuff.

It would be great if you wrote a upgrade script that you ran and it automatically fixed the things, that way you could just update the script for each beta released.
Reply With Quote
  #5  
Old 07-11-2001, 06:01 AM
ThomasP
Guest
 
Posts: n/a
Default

Hi there,

hopefully didn't overlook something in between,
but I definetely would appreciate to use that hack!

Does it work for 2.0.1?
Did you have a solution meantime for PM Preview - I know there's a hack, just interested if you worked on it, too.

Thanks,
-Tom
Reply With Quote
  #6  
Old 01-20-2002, 01:19 PM
Minimazz's Avatar
Minimazz Minimazz is offline
 
Join Date: Jan 2002
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes Mas*Mind, I am very interrested in that hack !

I run v 2.2.1 is your hack fixed for that version ?

any update since your former post ?

waiting for news, see you
Reply With Quote
  #7  
Old 01-20-2002, 02:28 PM
Shenlong's Avatar
Shenlong Shenlong is offline
 
Join Date: Nov 2001
Location: Manhattan, New York
Posts: 167
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great hack Mas*Mind
Reply With Quote
  #8  
Old 01-26-2002, 12:50 AM
Stretchr's Avatar
Stretchr Stretchr is offline
 
Join Date: Dec 2001
Location: Georgia, USA
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Mas*Mind! I really missed having the ability to preview my edited posts, especially when I'm using vB code. I keep finding myself using HTML instead and then I have to go in again and edit. This is a really good idea!
Reply With Quote
  #9  
Old 02-06-2002, 09:15 PM
LuBi LuBi is offline
 
Join Date: Oct 2001
Posts: 416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work on 2.2.2?
Reply With Quote
  #10  
Old 02-07-2002, 12:47 AM
bitbender's Avatar
bitbender bitbender is offline
 
Join Date: Jan 2002
Location: Sorta near Dallas, Texas
Posts: 166
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sweet Work!
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:58 AM.


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.04785 seconds
  • Memory Usage 2,313KB
  • Queries Executed 23 (?)
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
  • (3)bbcode_code
  • (8)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
  • (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
  • (6)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