Blank space after quote/code blocks

phpBB3 styling support, style coding, and style graphics assistance.
Forum rules
Style coding and style related questions only.

Blank space after quote/code blocks

Postby Electra736 » 06 Jun 2009, 23:05

I see noticeable blank space after quote/code blocks in both subsilver2 and prosilver. For example

Code: Select all
[quote]Test. This is a test.[/quote]

Test


shows up as

Test. This is a test.


Test
___________________

There needs to be only one blank line, rather than two, after the quote block. Is it possible to make it add only a single line break?
Electra736
Cadet I
Cadet I
 
Posts: 10
Joined: 21 May 2007, 19:31
Gender: Male




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: Blank space after quote/code blocks

Postby Mr_Bond » 06 Jun 2009, 23:39

The message parser parses each new line into an html <br />, to only have one line use only one line break after the quote, eg:
Code: Select all
[quote]Test. This is a test.[/quote]
Test

Test. This is a test.

Test

Or, if you don't want any <br />'s after the quote, you can do this
Code: Select all
[quote]Test. This is a test.[/quote]Test

Test. This is a test.
Test
User avatar
Mr_Bond    
Lieutenant
Lieutenant
 
Posts: 246
Joined: 14 Feb 2008, 14:45
Location: localhost
Favorite Team: Chicago Bears
Gender: Male
phpBB Knowledge: 7

Re: Blank space after quote/code blocks

Postby Electra736 » 06 Jun 2009, 23:57

Actually I converted from phpBB2 and the old posts have quotes like I mentioned in my post above. Would it be possible to directly edit the code and make them appear correctly?
Electra736
Cadet I
Cadet I
 
Posts: 10
Joined: 21 May 2007, 19:31
Gender: Male

Re: Blank space after quote/code blocks

Postby Electra736 » 09 Jun 2009, 10:20

Sorted. Wrote a line of code which solved the issue. In viewtopic.php, add

Code: Select all
    $message = preg_replace("!\[/(quote|code):(.*?)\][\r\n]+!is", "[/$1:$2]\n", $message); 

before

Code: Select all
    // Second parse bbcode here
    if ($row['bbcode_bitfield'])
    {
        $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
    } 


Seems to be working fine for me. Could someone verify it doesn't break anything?
Electra736
Cadet I
Cadet I
 
Posts: 10
Joined: 21 May 2007, 19:31
Gender: Male

Re: Blank space after quote/code blocks

Postby Yosiah » 10 Oct 2011, 20:06

I apologize for bumping such an old topic, but I can't seem to sort this out on my own.

Code: Select all
    $message = preg_replace("!\[/(quote|code):(.*?)\][\r\n]+!is", "[/$1:$2]\n", $message); 


This code worked perfectly to remove the extra space on viewtopic, but the space remains in private messages, private message previews, post previews and the topic review section on the full posting page. Where and how would I go about applying this fix to those areas?

Thanks for any help.
Yosiah
Crewman
Crewman
 
Posts: 9
Joined: 10 Oct 2011, 20:01
Gender: Male
phpBB Knowledge: 1

Re: Blank space after quote/code blocks

Postby Yosiah » 13 Oct 2011, 00:21

Sorry to bump, but I still can't figure this out. Anyone?
Yosiah
Crewman
Crewman
 
Posts: 9
Joined: 10 Oct 2011, 20:01
Gender: Male
phpBB Knowledge: 1


Return to phpBB3 Styling Assistance

Who is online

Users browsing this forum: No registered users and 14 guests