Nested Quotes
Written on 03/28/05 at 01:01:03 EST by Jack Deth
This is something DenDen came up with a long time ago...

I like the look and have applied it to this site for now, of course with updates things may get lost but enjoy this for now



DenDen32 wrote:
OK, this is how to create nested threading in webAPP forums...  BEFORE DOING THIS, BACK UP YOUR SYSTEM!  You do this at your own risk!

First, open your style.css file, and add this to the bottom of your forums section.

code:
.quoting {  /* nested quotes */
      background-color: #aaaaaa;
      border-top: thin solid #555555;
      border-right: thin solid #555555;
      border-left: thin solid #555555;
      border-bottom: thin solid #555555;
      border-width: 1px 1px 1px 1px;
      color: #000000;
      font-size: 8pt;
      font-family: arial, helvetica, geneva;
}


You can change the values accoringly...

Next, in subs.pl, we need to change the ubbc codes.  There are 2 sections that need changed.  The line numbers pertain to an UNEDITED subs.pl file...

Lines 671,672,673

code:
$message =~ s~\(.+?)\s*\~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1 $msg{'685'}<br>$2</td></tr></table>~isg;
      $message =~ s~\<br>(.+?)<br>\~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1</td></tr></table>~isg;
      $message =~ s~\(.+?)\~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1</td></tr></table>~isg;



Lines 836,837,838

code:
$message =~ s~\(.+?)\s*\~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1 $msg{'685'}<br>$2</td></tr></table>~isg;
      $message =~ s~\<br>(.+?)<br>\~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1</td></tr></table>~isg;
      $message =~ s~\(.+?)\~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1</td></tr></table>~isg;



Now, all qoted messages will be in nested cells.


Other messages in this Thread:
 
 Re: Nested Quotes
Written on 03/28/05 at 01:01:46 EST by Jack Deth
OK, This is a test to show you what this can do!!!


 Re: Nested Quotes
Written on 03/28/05 at 01:02:04 EST by Jack Deth
Just showing you how it works


Jack Deth wrote:
OK, This is a test to show you what this can do!!!



 Re: Nested Quotes
Written on 03/28/05 at 01:03:20 EST by Jack Deth
The inner quote was removed by web-app when I decided to quote the above message...  I replaced these quotes in the right order and am testing to see if it will nest within a nest ;)


Jack Deth wrote:
Just showing you how it works

[quote]Jack Deth wrote:
OK, This is a test to show you what this can do!!!



[/quote]

 Re: Nested Quotes
Written on 03/28/05 at 01:03:35 EST by bantychick
I think it might be Anton's, or partly. Or he had something like it on his site. His was neater though if I remember right - it had the boxes nested and looked interesting. Anton is rather artistic at times.

 Re: Nested Quotes
Written on 03/28/05 at 01:05:37 EST by Jack Deth
Looks like I found something a little off with this here...

probably this would work right if there were 2 quote commands, the normal one, which is [ quote ] and maybe another one, [ quote2 ]...

quote 2 could be used with a lighter colour and set for use within quote 1 to allow for double-nested quotes.

 Re: Nested Quotes
Written on 03/28/05 at 01:47:15 EST by Jack Deth
This is the code as it stands where I have worked it to now...

in your styles.css you need to add to the bottom of the forums section these lines of text.

code:
.quoting {  /* nested quotes */
    background-color: #aaaaaa;
    border-top: thin solid #555555;
    border-right: thin solid #555555;
    border-left: thin solid #555555;
    border-bottom: thin solid #555555;
    border-width: 1px 1px 1px 1px;
    color: #000000;
    font-size: 8pt;
    font-family: arial, helvetica, geneva;
}
.quoting2 {  /* inner nested quotes */
    background-color: #FFC900;
    border-top: thin solid #555555;
    border-right: thin solid #555555;
    border-left: thin solid #555555;
    border-bottom: thin solid #555555;
    border-width: 1px 1px 1px 1px;
    color: #000000;
    font-size: 8pt;
    font-family: arial, helvetica, geneva;
}



After that you have to go hunting and find a 2 sets of 3 lines similar to these in your subs.pl  the upper and the lower ones, I am not sure if they are different or the same so I will paste them here for you to see...
replace lines 792-794 with these lines.

code:
    $message =~ s~\[quote=\s*(\w+\+?)\](.+?)\s*\[/quote\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1 $msg{'685'}<br>$2</td></tr></table>~isg;
     $message =~ s~\[quote\]<br>(.+?)<br>\[\/quote\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1</td></tr></table>~isg;
     $message =~ s~\[quote\](.+?)\[\/quote\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1</td></tr></table>~isg;
     $message =~ s~\[quote2=\s*(\w+\+?)\](.+?)\s*\[/quote2\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting2"><tr><td>$1 $msg{'685'}<br>$2</td></tr></table>~isg;
     $message =~ s~\[quote2\]<br>(.+?)<br>\[\/quote2\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting2"><tr><td>$1</td></tr></table>~isg;
     $message =~ s~\[quote2\](.+?)\[\/quote2\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting2"><tr><td>$1</td></tr></table>~isg;



then replace lines 938-940 with these lines

code:
    $message =~ s~\[quote=\s*(\w+\+?)\](.+?)\s*\[/quote\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1 $msg{'685'}<br>$2</td></tr></table>~isg;
     $message =~ s~\[quote\]<br>(.+?)<br>\[\/quote\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1</td></tr></table>~isg;
     $message =~ s~\[quote\](.+?)\[\/quote\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1</td></tr></table>~isg;
     $message =~ s~\[quote2=\s*(\w+\+?)\](.+?)\s*\[/quote2\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting2"><tr><td>$1 $msg{'685'}<br>$2</td></tr></table>~isg;
     $message =~ s~\[quote2\]<br>(.+?)<br>\[\/quote2\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting2"><tr><td>$1</td></tr></table>~isg;
     $message =~ s~\[quote2\](.+?)\[\/quote2\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting2"><tr><td>$1</td></tr></table>~isg;



this is how I got this far along...
next I will need to:
  • change how quoting filters the text so not to delete the [ quote] tags.
  • figure out how to change existing [ quote] tags to [ quote2] tags when quoting.
  • figure out possible workaround so as not to need a [ quote3]

 Re: Nested Quotes
Written on 03/28/05 at 01:58:34 EST by bantychick
One of those is for articles, whichever is doubbctopics. I think it's the first one. How would you quote somebody in articles?

 Re: Nested Quotes
Written on 03/28/05 at 02:11:06 EST by Jack Deth
easy, you put in [ quote] marks...

I have done it before when quoting another source...

now, how would you quote a quote within an article?  I guess you wont...

Hurray, you found the first bug in my hack of a hack...

of course you might be able to quote a quote in the comments...  maybe?

UPDATE:  Here is a thought, if you are posting a message from an outside source that uses quoted information from another site, then it would be useful to have the secondary quotes available.

 Re: Nested Quotes
Written on 03/28/05 at 11:56:22 EST by Jack Deth

Jack Deth wrote:
I am just doing a test quote within a quote for demonstration purposes!!!

[quote2]Jack Deth wrote:
easy, you put in [ quote] marks...

I have done it before when quoting another source...[/quote2]
What other source could that be?
[quote2]
now, how would you quote a quote within an article?  I guess you wont...

Hurray, you found the first bug in my hack of a hack...

of course you might be able to quote a quote in the comments...  maybe?[/quote2]

Do you like the orange on dark grey layout?  I dont think it looks too bad...



No, it doesnt look bad at all!!!

aside from my eyeballs bleeding, I think some nice clean colours would work better...

 Re: Nested Quotes
Written on 04/21/05 at 09:10:08 EST by Jack Deth
By editing forum_post.pl looking for certain code, I was able to find where the [ quote] code gets filtered out.

It is at line 660

Here is the code:

code:
         #$form_message =~ s/\[(\S+?)\]//isg;



By commenting it out I end up with:
[ quote] [ quote] message [ /quote] [ /quote]
when quoting a post with a quote in it...

by editing the inside quote, adding in a 2 making the code look like this:
[ quote] [ quote2] message [ /quote2] [ /quote]

you end up with nested quotes...

Now how to change the filtering code so it changes it automatically?

this could be used up to say, 6 levels of quotes.  It could eventually end up with a colour-coded quoting system...

 Re: Nested Quotes
Written on 04/21/05 at 09:36:32 EST by Jack Deth
Quotes within Quotes within Quotes looks nice...

Jack Deth wrote:

[quote2]Jack Deth wrote:
just testing once again...

[quote3]Jack Deth wrote:
just testing something[/quote3]
[/quote2]



The above quoting is done like this:

code:
[quote][b]Jack Deth wrote:[/b]

[quote2][b]Jack Deth wrote:[/b]
just testing once again...

[quote3][b]Jack Deth wrote:[/b]
just testing something[/quote3]
[/quote2]
[/quote]


Also have to remove extra spaces from under [ code] blocks...  unless its done in the most updated web-app, will know after updating again.

To do the above, you need to modify the code in the earlier posts...

code:
    $message =~ s~\[quote=\s*(\w+\+?)\](.+?)\s*\[/quote\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1 $msg{'685'}<br>$2</td></tr></table>~isg;
     $message =~ s~\[quote\]<br>(.+?)<br>\[\/quote\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1</td></tr></table>~isg;
     $message =~ s~\[quote\](.+?)\[\/quote\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1</td></tr></table>~isg;
     $message =~ s~\[quote2=\s*(\w+\+?)\](.+?)\s*\[/quote2\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting2"><tr><td>$1 $msg{'685'}<br>$2</td></tr></table>~isg;
     $message =~ s~\[quote2\]<br>(.+?)<br>\[\/quote2\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting2"><tr><td>$1</td></tr></table>~isg;
     $message =~ s~\[quote2\](.+?)\[\/quote2\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting2"><tr><td>$1</td></tr></table>~isg;
     $message =~ s~\[quote3=\s*(\w+\+?)\](.+?)\s*\[/quote3\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1 $msg{'685'}<br>$2</td></tr></table>~isg;
     $message =~ s~\[quote3\]<br>(.+?)<br>\[\/quote3\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1</td></tr></table>~isg;
     $message =~ s~\[quote3\](.+?)\[\/quote3\]~<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="quoting"><tr><td>$1</td></tr></table>~isg;


That adds in the needed [ quote3] block...
Eventually there would be about 6 needed to make certain we wouldnt run out of quotes to place within eachother...

This would probably never happen, but if it did it would look bad...
it could also be used as a multi-colour-quoting system...

 Re: Nested Quotes
Written on 04/21/05 at 12:09:58 EST by bantychick
Pretty cool, Jack! You did it!

Right? Or I mean, is that it yet?

 Re: Nested Quotes
Written on 04/21/05 at 23:01:08 EST by Jack Deth


bantychick wrote:
Pretty cool, Jack! You did it!

Right? Or I mean, is that it yet?



No, unfortunately I didnt do it...

I did find the line where it filters out the [ quote]s and turned it off allowing me to end up with the message in a more usable form for editing in the 2 and 3 in there...

What I need to do is to figure out how to change the [ quote] to [ quote2] and the [ quote2] to [ quote3] up to about [ quote6]

let me know your thoughts on doing this...

Forums and Comments Brought to you by: www.2xlnt.com - WA
The comments are owned by the poster. We aren't responsible for its content.