vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Remove Extra Quotes From PMs (https://vborg.vbsupport.ru/showthread.php?t=41074)

Raz 07-14-2002 10:00 PM

Remove Extra Quotes From PMs
 
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 :D

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

Boofo 07-14-2002 11:45 PM

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.

Velocd 07-15-2002 12:20 AM

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

I hate those annoying quotes having to delete them, so this is a good idea with the small change.

Raz 07-15-2002 08:07 AM

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.

Admin 07-15-2002 08:17 AM

Hmm, shouldn't the code be...
Code:

$message['message'] = trim(preg_replace('~\[quote\](.*)\[/quote\]~si', '', $message['message']));

Boofo 07-15-2002 08:23 AM

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']));


Raz 07-15-2002 09:45 AM

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

[edit]
Yup, the "stupid" board strips out any slashes from code.

Boofo 07-15-2002 09:52 AM

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.


Logician 07-15-2002 09:56 AM

nice hack Raz.. it is small but useful :)

Raz 07-15-2002 09:59 AM

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 \[ :rolleyes:


All times are GMT. The time now is 01:46 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.01105 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete