Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Remove Extra Quotes From PMs Details »»
Remove Extra Quotes From PMs
Version: 1.00, by Raz Raz is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 07-14-2002 Last Update: Never Installs: 32
 
No support by the author.

Heres a quickie hack that will remove any extra quotes from PMs when you reply to them.

It will save you (and your users) time from deleting them yourself and also reduce the size of your PM Db

Example:
Quote:
The first quote
Quote:
Quote:
The third quote (and so on)...
The second quote
becomes
Quote:
The first quote
OK open up 'private.php' in your favourite editor then goto line 542, which should have:
PHP Code:
    eval("\$message[message] = \"".gettemplate("priv_reply",1,0)."\";");
  } else {
    
$message = array();
  } 
and just above that place this
PHP Code:
    $message[message] = trim(preg_replace("~\[[b][/b]quote\](.*)\[/quote\]~si"""$message[message])); 
Its as easy as that!

Enjoy!
Raz

Show Your Support

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

Comments
  #2  
Old 07-14-2002, 11:45 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It took out ALL of the quotes. Can it leave just the last one when you reply to the message? Also, it placed a W] inside the quote that was there but nothing else.
Reply With Quote
  #3  
Old 07-15-2002, 12:20 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, I have to also agree with Boofo, just leaving the last QUOTE is the best method

I hate those annoying quotes having to delete them, so this is a good idea with the small change.
Reply With Quote
  #4  
Old 07-15-2002, 08:07 AM
Raz's Avatar
Raz Raz is offline
 
Join Date: Oct 2001
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Umm...did you follow the code *exactly* as I said? i.e. place the new code *above* the eval code?

I've tested it out on my own forums and is working great.
Reply With Quote
  #5  
Old 07-15-2002, 08:17 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, shouldn't the code be...
Code:
$message['message'] = trim(preg_replace('~\[quote\](.*)\[/quote\]~si', '', $message['message']));
Reply With Quote
  #6  
Old 07-15-2002, 08:23 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, Chen, you have once again proven yourself worthy to be called the MASTER! That worked great! And it only leaves the current quote.

Sincerely,
Grasshopper

Quote:
Originally posted by FireFly
Hmm, shouldn't the code be...
Code:
$message['message'] = trim(preg_replace('~\[quote\](.*)\[/quote\]~si', '', $message['message']));
Reply With Quote
  #7  
Old 07-15-2002, 09:45 AM
Raz's Avatar
Raz Raz is offline
 
Join Date: Oct 2001
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*sigh* That is what I tried to post, but alas was parsed incorrectly...

[edit]
Yup, the "stupid" board strips out any slashes from code.
Reply With Quote
  #8  
Old 07-15-2002, 09:52 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can't you just attach it as a text file attachment? Or just use the [disable][disable][/disable][/disable] tags.

Quote:
Originally posted by Raz
*sigh* That is what I tried to post, but alas was parsed incorrectly...

[edit]
Yup, the "stupid" board strips out any slashes from code.
Reply With Quote
  #9  
Old 07-15-2002, 09:56 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice hack Raz.. it is small but useful
Reply With Quote
  #10  
Old 07-15-2002, 09:59 AM
Raz's Avatar
Raz Raz is offline
 
Join Date: Oct 2001
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Boofo
Can't you just attach it as a text file attachment? Or just use the [disable][disable][/disable][/disable] tags.

Nah its fine, I've fixed the original post.

Just used a \\\\[ to get a \[
Reply With Quote
Reply

Thread Tools

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 05:15 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04851 seconds
  • Memory Usage 2,295KB
  • 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
  • (2)bbcode_code
  • (2)bbcode_php
  • (7)bbcode_quote
  • (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