horizontal line

Get help developing custom BBCodes or request one.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 21078
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket - definitely

Re: horizontal line

Post by Mick » Thu Apr 09, 2015 5:58 pm

Have a read of: Knowledge Base - Adding Custom BBCodes in phpBB3

Roberts code sample works and this is what it should look like in the ACP:

BBCode usage:

Code: Select all

[hr][/hr]
HTML replacement:

Code: Select all

<hr style="height:5px;border:none;color:#000;background-color:#000;" />
Help line:

Code: Select all

Creates a horizontal line.
"The more connected we get the more alone we become" - Kyle Broflovski

DWFII
Registered User
Posts: 335
Joined: Fri Oct 20, 2006 2:17 am
Name: D.W.
Contact:

Re: horizontal line

Post by DWFII » Thu Apr 09, 2015 6:03 pm

Thank you to both Roberts and Mick. I was hoping for something variable in terms of height (thickness ) and perhaps even colour. But this will do.

Again, sincere thanks and much appreciated.
DWFII
In the High Desert of Central Oregon

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21078
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket - definitely

Re: horizontal line

Post by Mick » Thu Apr 09, 2015 6:12 pm

DWFII wrote:I was hoping for something variable in terms of height (thickness ) and perhaps even colour
Adding variables would be quite complicated for the users as they would have to add several pieces of information but I don't think it's impossible. If you want it customisable you may be better off requesting an extension, if there isn't one already, or you could create several BBCodes with the parameters you want but it seems a bit of an overkill.
"The more connected we get the more alone we become" - Kyle Broflovski

User avatar
Lumpy Burgertushie
Registered User
Posts: 66268
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: horizontal line

Post by Lumpy Burgertushie » Thu Apr 09, 2015 8:15 pm

do you mean something you can change each time you use the bbcode or do you just want one hr bbcode but different thickness and color than what I posted?

if it is the latter, then you simply change the pixels to what you want and the color to what you want.


robert
I am going to be out of town and off line for a week . see ya when I get back.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

DWFII
Registered User
Posts: 335
Joined: Fri Oct 20, 2006 2:17 am
Name: D.W.
Contact:

Re: horizontal line

Post by DWFII » Thu Apr 09, 2015 11:20 pm

Lumpy Burgertushie wrote:do you mean something you can change each time you use the bbcode or do you just want one hr bbcode but different thickness and color than what I posted?

if it is the latter, then you simply change the pixels to what you want and the color to what you want.


robert
I meant user changeable. But I understand the html replacement and how it works and probably it will be more than sufficient.
DWFII
In the High Desert of Central Oregon

DWFII
Registered User
Posts: 335
Joined: Fri Oct 20, 2006 2:17 am
Name: D.W.
Contact:

Re: horizontal line

Post by DWFII » Thu Apr 09, 2015 11:23 pm

Lumpy Burgertushie wrote:show us the exact html replacement you are using for your custom hr bbcode.

then we can give you exact css to add to that code.

for instance, is you want a hr to be 5pixels wide/thick and black your html replacement would be like this:


Code: Select all

<hr style="height:5px;border:none;color:#000;background-color:#000;" />
robert
this will work I'm almost certain--it's in the clipboard right now so soon as I get done asking one more question I'm headed for th eACP.

Question: setting the colour...is that in hex then?
DWFII
In the High Desert of Central Oregon

DWFII
Registered User
Posts: 335
Joined: Fri Oct 20, 2006 2:17 am
Name: D.W.
Contact:

Re: horizontal line

Post by DWFII » Thu Apr 09, 2015 11:30 pm

Perfect. Thank you all.

If you guys are even mildly interested...

Crispin Colloquy posting with horizontal lines
DWFII
In the High Desert of Central Oregon

User avatar
Lumpy Burgertushie
Registered User
Posts: 66268
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: horizontal line

Post by Lumpy Burgertushie » Fri Apr 10, 2015 1:19 am

nice work. I was wondering what you were doing with this.

you could setup several different bbcodes for different colors. just name then with the color:

[redhr][/redhr]

html:
<hr style="height:5px;border:none;color:#F9072B;background-color:#F9072B;" />

etc. etc.

robert
I am going to be out of town and off line for a week . see ya when I get back.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

DWFII
Registered User
Posts: 335
Joined: Fri Oct 20, 2006 2:17 am
Name: D.W.
Contact:

Re: horizontal line

Post by DWFII » Fri Apr 10, 2015 12:18 pm

Lumpy Burgertushie wrote:nice work. I was wondering what you were doing with this.

you could setup several different bbcodes for different colors. just name then with the color:

[redhr][/redhr]

html:
<hr style="height:5px;border:none;color:#F9072B;background-color:#F9072B;" />

etc. etc.

robert
That's interesting.

Right now, using the bbcode/html replacement you provided earlier, all horizontal lines...even those posted previously...are affected--reformatted to be thicker. So if I changed the html replacement to make the horizontal lines red, I assume all horizontal lines on the forum would turn red.

I understand that if I defined a different bbcode to be red then only the [redhr] would be red. But that could get cumbersome...with many different coloured and many different thicknesses of [hr] defined in the editing window--[redhr], [bluehr], [greenhr], [thickhr], [thinhr], [thinredhr], [medredhr], [thinbluehr] etc.. Not an attractive scenario.

It is passing strange to me that that kind of process doesn't work the same way for font colours. Glad it doesn't.
DWFII
In the High Desert of Central Oregon

User avatar
Lumpy Burgertushie
Registered User
Posts: 66268
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: horizontal line

Post by Lumpy Burgertushie » Fri Apr 10, 2015 2:22 pm

I can't think of a way that changing a bbcode could affect anything on the board other than that exact bbcode.

however, just to be sure, change your main hr bbcode like this:

bbcode: [hrcode][/hrcode]
html replacement: same as before

there is no possible way that making a new bbcode like redhr could do anything other than create a red hr in only the post you are using it in.


robert
I am going to be out of town and off line for a week . see ya when I get back.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
R3gi
Registered User
Posts: 101
Joined: Mon May 05, 2014 4:33 pm
Location: Czech Republic

Re: horizontal line

Post by R3gi » Thu Oct 15, 2015 8:52 am

Hello,
please is there some way to have only [hr] tag? Not [hr][/hr]. HR is not a pair tag...

User avatar
Lumpy Burgertushie
Registered User
Posts: 66268
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: horizontal line

Post by Lumpy Burgertushie » Thu Oct 15, 2015 9:15 pm

R3gi wrote:Hello,
please is there some way to have only [hr] tag? Not [hr][/hr]. HR is not a pair tag...
sorry, what does that mean? if you want to create a hr bbcode you must have both the open and close tags for it. the html replacement does not need a closing tag but the bbcode does.

robert
I am going to be out of town and off line for a week . see ya when I get back.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
R3gi
Registered User
Posts: 101
Joined: Mon May 05, 2014 4:33 pm
Location: Czech Republic

Re: horizontal line

Post by R3gi » Fri Oct 16, 2015 9:06 am

So the BBCode still can't have only one tag (not open and close tags)? Hmm, that's not very user-friendly…

steve1200
Registered User
Posts: 34
Joined: Wed Sep 06, 2017 6:38 pm
Location: Ohio
Name: Steven Davis

Re: horizontal line

Post by steve1200 » Sat Dec 30, 2017 9:45 pm

I'm a little late getting here but I wrote a BBcode for this on by board. You can set the color and height in your post. Click here to get the code.

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21078
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket - definitely

Re: horizontal line

Post by Mick » Mon Jan 01, 2018 9:48 am

You should make a new contribution here: https://www.phpbb.com/customise/db/custom_bbcodes-26
"The more connected we get the more alone we become" - Kyle Broflovski

Post Reply

Return to “Custom BBCode Development and Requests”