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
  #12  
Old 07-15-2002, 10:06 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You really ought to try the disable codes sometime. That has got to be my favorite hacks of all time. Chen has it working here. It sure saves a lot of headaches and parsing problems.

Quote:
Originally posted by Raz
Nah its fine, I've fixed the original post.

Just used a \\\\[ to get a \[
Reply With Quote
  #13  
Old 07-15-2002, 10:06 AM
Raz's Avatar
Raz Raz is offline
 
Join Date: Oct 2001
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Logician
nice hack Raz.. it is small but useful
Yup, its one of those hacks that should have been included with VB in the first place.
Reply With Quote
  #14  
Old 07-16-2002, 11:27 AM
Raz's Avatar
Raz Raz is offline
 
Join Date: Oct 2001
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Boofo
You really ought to try the disable codes sometime. That has got to be my favorite hacks of all time. Chen has it working here. It sure saves a lot of headaches and parsing problems.

It has nothing to do with BBCode, but the way it handles slashes (\)
Reply With Quote
  #15  
Old 07-16-2002, 11:30 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, but it worked fine for Chen and I when we used it.

Quote:
Originally posted by Raz
It has nothing to do with BBCode, but the way it handles slashes (\)
Reply With Quote
  #16  
Old 07-16-2002, 11:33 AM
Raz's Avatar
Raz Raz is offline
 
Join Date: Oct 2001
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Chen used the [code]tag[/code]. The problem with slashes seems to be when using the [php]tag[/php].
Reply With Quote
  #17  
Old 07-16-2002, 11:37 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Raz
Chen used the [code]tag[/code]. The problem with slashes seems to be when using the [php]tag[/php].
Yup, I noticed that as well and trying to fix that bug.
Reply With Quote
  #18  
Old 07-16-2002, 11:51 AM
Raz's Avatar
Raz Raz is offline
 
Join Date: Oct 2001
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The problem may actually lay with the highlight_string() function.

Possibly doing a highlight_string(str_replace('\\', '\\\\', $data)) might fix it.
Reply With Quote
  #19  
Old 07-16-2002, 11:53 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You're right. I didn't try that. Strange that it would work fine for the code tags and not PHP.

Quote:
Originally posted by Raz
Chen used the [code]tag[/code]. The problem with slashes seems to be when using the [php]tag[/php].
Reply With Quote
  #20  
Old 07-16-2002, 11:55 AM
Raz's Avatar
Raz Raz is offline
 
Join Date: Oct 2001
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The only difference between those two 'quotes' is that the [php] tag makes use of the highlight_string().

Presumely its strips out any slashes it sees.
Reply With Quote
  #21  
Old 07-16-2002, 12:09 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Let's see if I managed to fix this...

PHP Code:
$message[message] = trim(preg_replace("~\[quote\](.*)\[/quote\]~si"""$message[message])); 
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 03:20 PM.


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.10818 seconds
  • Memory Usage 2,311KB
  • 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
  • (3)bbcode_php
  • (10)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
  • (3)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