MyBB Community Forums

Full Version: Stop Quoting First Post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'd like to see/use a plug in that stops the first reply in a post thread quoting the very first post.
nice idea Smile
Yes, it gets to be pretty annoying when the thread creator adds a lengthy "first post", only to have the next poster quote the whole thing. It's like if someone is talking to just you, then when you reply you say everything that that person has just said...LOL!!
There is a mod for this but I found it had bugs and no one fixed it. I too would like to be able to remove quoted quotes.
Untested, but this is a thing I did in about 2 minutes - tell me if it works:
This stops "quote-in-quote" when quoting a message:


In both /newreply.php and /xmlhttp.php
FIND:
$quoted_post['message'] = preg_replace("#\[attachment=([0-9]+?)\]#i", '', $quoted_post['message']);
BELOW, Add:
$quoted_post['message'] = preg_replace("#\[quote=(?:"|\"|')?(.*?)[\"']?(?:"|\"|')?\](.*?)\[\/quote\](\r\n?|\n?)#si", '', $quoted_post['message']);
tested and working great here. thanks dear ZiNga BuRgA
Thanks ZiNga BuRgA. Smile
ZiNga BuRgA Wrote:Untested, but this is a thing I did in about 2 minutes - tell me if it works:
This stops "quote-in-quote" when quoting a message:


In both /newreply.php and /xmlhttp.php
FIND:
$quoted_post['message'] = preg_replace("#\[attachment=([0-9]+?)\]#i", '', $quoted_post['message']);
BELOW, Add:
$quoted_post['message'] = preg_replace("#\[quote=(?:"|\"|')?(.*?)[\"']?(?:"|\"|')?\](.*?)\[\/quote\](\r\n?|\n?)#si", '', $quoted_post['message']);


I tried that code but had deep problems when quotes were within a quote. Of course if you START a site using that method you won't have that problem. I wanted to implement this type of feature for my existing site though.

I just tried it again...doesn't work for me.

Quote:Warning: preg_replace() [function.preg-replace]: Unknown modifier '{' in /usr/home/admin/domains/democracyforums.com/public_html/newreply.php on line 510

Errors thrown even when quoting a post that only has one quote in it.
^ I suck at regular expressions... :|

But I don't get your error on a clean install of MyBB 1.2.9.
I just discover another little bug in this code
it'll remove the only example of the following qoute
user2 Wrote:
user1 Wrote:this the 1st qouted text
this is the 2nd qouted text

whene you qoute the above example it'll qoute the 2nd only (and that what we want)

but if the qouted text like this
user2 Wrote:blah blah blah
user1 Wrote:this is 1st qouted text
this is the 2nd qouted text
when you qoute the above example
it'll qoute it all!