php forum
php mysql forum
php mysql smarty
 
Topic Options
#317183 - 06/09/08 09:01 AM [7.3] Dissallow quotes more then 3 levels deep
blaaskaak Offline
Member

Registered: 02/25/07
Posts: 299
Loc: The Netherlands

   [7.3] Dissallow quotes more then 3 levels deep to Del.icio.us Add to del.icio.us
  Digg [7.3] Dissallow quotes more then 3 levels deep Digg it
UBB 7.3 kinda has a bug that I was happy with, you can't quote so deep.

I made some code that checks for the quote level, and gives an error if you quote more then 3 levels deep.

open /scripts/addpost.inc.php

find:
Code:
	// -------------------------------------
	// Make sure there is a subject and body


add above:

Code:
	// ---------------------
	// Check maximum quote level

	unset($total);
	preg_match_all('%(\[quote=.+?\]|\[quote\]|\[/quote\])%', $Body, $result, PREG_PATTERN_ORDER);
	for ($i = 0; $i < count($result[0]); $i++) {
		$total .= $result[0][$i];
	}
	if (preg_match('%(\[/quote\]){4,}%', $total)) {
		$html -> not_right($ubbt_lang['MAX_QUOTE']);
	};


open /languages/english/addpost.php (plus every other language you might have)

find
Code:
$ubbt_lang['VIEW_POST'] = "View your post.";


add below:
Code:
$ubbt_lang['MAX_QUOTE'] = "For readability you can only quote messages 3 levels deep. Please edit your message and try again.";


The 3 levels deep is hardcoded in the regex, so if you want to change it, change the regex.


Edited by blaaskaak (08/01/08 02:33 AM)
Edit Reason: update
_________________________

Top
#317201 - 06/11/08 09:16 AM Re: [7.3] Dissallow quotes more then 3 levels deep [Re: blaaskaak]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25432
Loc: Texas
Interesting smile Does your forum have issues with it? I understand there's a bug, but does your users actually exploit it? smile
_________________________
- Allen wavey
- What Drives You?

Top
#317203 - 06/11/08 10:25 AM Re: [7.3] Dissallow quotes more then 3 levels deep [Re: AllenAyres]
blaaskaak Offline
Member

Registered: 02/25/07
Posts: 299
Loc: The Netherlands
Well, issues...

Some users just hit quote, type their reply and that's it. If a couple users do that, imho it looks butt-ugly laugh over 5-6 quotes deep make little to no sense to me conversation wise.

SD can testify that I played with quote in quote regexes before. It's just that UBB's bug sort of made us tell the members "it is forbidden from now on to quote so deep".
_________________________

Top
#317207 - 06/11/08 11:33 AM Re: [7.3] Dissallow quotes more then 3 levels deep [Re: blaaskaak]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25432
Loc: Texas
Understand - I use the quickreply mostly, rarely the quote smile
_________________________
- Allen wavey
- What Drives You?

Top
#317209 - 06/11/08 12:22 PM Re: [7.3] Dissallow quotes more then 3 levels deep [Re: AllenAyres]
sirdude Moderator Offline
Bada bing!
Enthusiast

Registered: 11/08/03
Posts: 439
Loc: SoCal
Originally Posted By: AllenAyres
Understand - I use the quickreply mostly, rarely the quote smile


i'm a quick/quote kinda guy.. and we need to fix the quote bug too smile
_________________________

A taxpayer voting for Obama is like a chicken voting for Colonel Sanders.

Top
#317472 - 08/01/08 02:35 AM Re: [7.3] Dissallow quotes more then 3 levels deep [Re: sirdude]
blaaskaak Offline
Member

Registered: 02/25/07
Posts: 299
Loc: The Netherlands
First post is updated, the regex originally posted gave some false positives if you would have 7+ normal quotes in a message.

Thanks to SD for helping thinking this new construction up.
_________________________

Top


Moderator:  sirdude 
Who's Online
0 Registered (), 28 Guests and 10 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Blogs, love em or hate em?
by AllenAyres
10/07/08 02:05 PM
What do you use to edit the files
by Ian_W
10/05/08 03:33 PM
BeyondCompare v3.00
by Ian_W
10/05/08 03:32 PM
Glossy Black Theme with Image Reflection
by Gizmo
10/05/08 02:17 PM
ShareThis
by Gizmo
09/28/08 05:06 AM
[7.3] Viewing MySQL logfiles made easier
by AllenAyres
09/27/08 09:57 PM
Looking for a simple upload script
by Murphdog
09/26/08 08:45 PM
New Mods
[7.3] Viewing MySQL logfiles made easier
by blaaskaak
09/24/08 05:39 PM
[7.3.1] add search to showmembers page
by blaaskaak
09/07/08 04:50 AM
Multiple Identity Detector
by
12/30/06 06:39 PM
Newest Members
pisa666, ghengis317, NitroX, Dogan, EliYah-
13345 Registered Users
Top Posters Last 30 Days
AllenAyres 12
blaaskaak 8
tackaberry 7
FREAK1 5
Mike L_dup1 4
Chris Bale 4
Ian_W 4

 

 

 
fusionbb message board php hacks