Page Index Toggle Pages: 1
Topic Tools
Normal Topic How do I remove BR's in Template? (Read 1,582 times)
Lopa
Junior Member
**
Offline



Posts: 95
Location: Australia
How do I remove BR's in Template?
Oct 4th, 2010 at 11:14am
Post Tools
I want to remove two <br>'s from the locations below as determined with view source - They're not in the html - because I fixed all of the <br>'s, so they must be in the perl script?

1. Good Afternoon YaBB Administrator, <br>you have <a href="http://127.0.0.1/cgi-bin/forum/YaBB.pl?action=im">0 messages</a>  &nbsp;</td>


2.
Code
Select All
		return F;
	}
	// Password_strength_meter end
// -->
</script>

		<br>

			</td></tr>
		</table>

		<br clear="all">

		<!-- content table end --> 




I've read perl for dummies, stupids and donkey's and found this >

Code
Select All
$something =~ s~<br \/>~\n~g; 



In YaBB I found at least one <br> that seems to have the / missing?

Code
Select All
$signature =~ s/<br.*?>/\n/g; 



So I can only assume that it should look like this?

Code
Select All
$signature =~ s/<br \/.*?>/\n/g; 



However, I don't want to try to fix them because I ain't no perl coder - What I would like to know is where to remove them - ONLY if they are not nested and are going to interfere with other script requirements.
  

I make mistakes - That's how I learn.
Back to top
WWW  
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: How do I remove BR's in Template?
Reply #1 - Oct 4th, 2010 at 1:30pm
Post Tools
Lopa wrote on Oct 4th, 2010 at 11:14am:
1. Good Afternoon YaBB Administrator, <br>you have <a href="http://127.0.0.1/cgi-bin/forum/YaBB.pl?action=im">0 messages</a>  &nbsp;</td>

This is actually in default.html:

Code (HTML)
Select All
               <td align="left" valign="middle" height="40">{yabb uname}<br />{yabb im}{yabb admin_alert}</td> 


I have no idea why you are missing the forward slash though - it should be there.

As for the second one, I haven't tracked that down yet...
  
Back to top
 
IP Logged
 
Captain John
Ex Member


Re: How do I remove BR's in Template?
Reply #2 - Oct 4th, 2010 at 2:57pm
Post Tools
Lopa wrote on Oct 4th, 2010 at 11:14am:
I've read perl for dummies, stupids and donkey's


   You realize br is html, not perl

http://www.w3schools.com/tags/tag_br.asp
  
Back to top
 
IP Logged
 
Carsten
Ex Member


Re: How do I remove BR's in Template?
Reply #3 - Oct 4th, 2010 at 3:37pm
Post Tools
Why are you showing the 'br' tags without the terminating slash in your code examples?? In the original code they all have the slash as they should have.

----------

2. is found in 'MyCenter.pl':
Code
Select All
        $MCContent .= qq~
            $showProfile
        <br />
        ~;
 



----------

Lopa wrote on Oct 4th, 2010 at 11:14am:
In YaBB I found at least one <br> that seems to have the / missing?

Code
Select All
$signature =~ s/<br.*?>/\n/g; 



So I can only assume that it should look like this?

Code
Select All
$signature =~ s/<br /.*?>/\n/g; 



No no - that would make no sense at all. The regex is made that way (i guess) to take care of new as well as very old signatures from way back when yabb used HTML (as opposed to XHTML) where there was no terminating slash in the tags.

The dot (.) means 'anything' - the asterisk (*) means 'none or some' and the question mark (?) means 'until the first instance of the following'. Put it together it says: None or some of anything until first instance of >
« Last Edit: Oct 4th, 2010 at 3:49pm by »  
Back to top
 
IP Logged
 
Lopa
Junior Member
**
Offline



Posts: 95
Location: Australia
Re: How do I remove BR's in Template?
Reply #4 - Oct 4th, 2010 at 10:41pm
Post Tools
Embarrassed Embarrassed

Thanks people because if this has/is driving you nuts - welcome to the club!  Grin

It appears that View Selection Source with FF is stripping the slashes for some reason?

DOM Selection:
Code
Select All
	</tr>
</tbody></table>
<input name="formsession" value="10247D0D382F317D043C1F1F7D1B322F28303C393034335D0" type="hidden"></form>
		<br> 



Whereas View Page Source doesn't!  Wink

Code
Select All
	</tr>
</table>
<input type="hidden" name="formsession" value="10247D0D382F317D043C1F1F7D1B322F28303C393034335D0" /></form>
		<br /> 



And now that I found that out - I should be able to find the <br /> I want to remove.  Cool

@CJ - It was this that threw me because I've never seen it before and assumed that it was an outdated br? But Carsten's explanation makes it quite clear as to its function.  Tongue
Code (Perl)
Select All
$signature =~ s/<br.*?>/\n/g 



Anyway CJ, here's where it was.  Tongue
Code
Select All
		$MCContent .= qq~
			$showProfile
		<br /> 

« Last Edit: Oct 5th, 2010 at 11:25am by Lopa »  

I make mistakes - That's how I learn.
Back to top
WWW  
IP Logged
 
Captain John
Ex Member


Re: How do I remove BR's in Template?
Reply #5 - Oct 5th, 2010 at 3:57pm
Post Tools
Simply a line break after the string showprofile is displayed.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools
 
  « Board Index ‹ Board  ^Top