![]() |
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:
Quote:
PHP Code:
PHP Code:
Enjoy! Raz |
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.
|
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. |
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. |
Hmm, shouldn't the code be...
Code:
$message['message'] = trim(preg_replace('~\[quote\](.*)\[/quote\]~si', '', $message['message'])); |
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:
|
*sigh* That is what I tried to post, but alas was parsed incorrectly...
[edit] Yup, the "stupid" board strips out any slashes from code. |
Can't you just attach it as a text file attachment? :) Or just use the [disable][disable][/disable][/disable] tags.
Quote:
|
nice hack Raz.. it is small but useful :)
|
Quote:
Just used a \\\\[ to get a \[ :rolleyes: |
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:
|
Quote:
|
Quote:
|
Yes, but it worked fine for Chen and I when we used it. :)
Quote:
|
Chen used the [code]tag[/code]. The problem with slashes seems to be when using the [php]tag[/php]. :)
|
Quote:
|
The problem may actually lay with the highlight_string() function.
Possibly doing a highlight_string(str_replace('\\', '\\\\', $data)) might fix it. |
You're right. I didn't try that. Strange that it would work fine for the code tags and not PHP. :)
Quote:
|
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. |
Let's see if I managed to fix this...
PHP Code:
|
Ok, looks like it worked! :) What do we need to change in the diable code hack to make it work like this?
|
Ok I'm confused now. What's the correct code that should be inserted into privat.php???
|
aidler: Use the code in the first post.
|
I (and most others) always update the first post with the latest code changes :)
|
nice little addition.
|
are you guys sure that it's private.php? i thought private was for the interface to access your PM's, and the actual PM view was another file.
i tried hacking this in, and my PM page got all asshurt and displayed a stupid error which is gone now. i'll try again... |
Parse error: parse error in /usr/local/etc/httpd/htdocs/forums/private.php on line 879
there the error i get when i try to install this hack. what's the deal here? |
Make sure you have applied the code in the correct place and that its the correct code. This hack is working fine right up to 2.2.9.
|
done and done...before I posted my complaint
OT: the girl in your avatar is quite beautiful. who is she? |
[disable]This is cool - I totally forgot about the "disable" tag:D[/disable]
Tee hee hee:p =-= Anyway - Nice - Thanks:) Satan |
Nice! It doesn't make any difference with quotes in the Quick PM Reply hack, however.
|
Is it working ok on 2.3.0 now?
I mean the first post? |
Quote:
|
Nice Hack, but when you forward a message containing "quote", the "quote" should remain all. Otherwise what forward is?
|
If you want to reply with the hack and to forward without the hack, you have instead to put the code
PHP Code:
PHP Code:
|
Don't you mean to put it under this?
Quote:
|
Quote:
|
All times are GMT. The time now is 04:43 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|