Page 1 of 1

Horizontal rule tag [hr] without end tag

Posted: Fri Nov 16, 2012 4:05 pm
by DataNalle
I haven't been able to find a mod for this (Advanced BBCode is too extensive for my usage) and I've tried to hard code it without success.

I also find it odd that the [hr] tag exists in functions_convert.php.

Re: Horizontal rule tag [hr] without end tag

Posted: Fri Nov 16, 2012 5:36 pm
by AmigoJack
DataNalle wrote:I've tried to hard code it without success
What exactly have you done so far?
DataNalle wrote:the [hr] tag exists in functions_convert.php
Don't ignore the context: the whole file is for converting foreign data to phpBB data. So there's no hidden functionality - once found it will just be replaced by two CRs.

Re: Horizontal rule tag [hr] without end tag

Posted: Sat Nov 17, 2012 10:36 pm
by DataNalle
AmigoJack wrote:What exactly have you done so far?
Added the necessary button and other code changes to language files and such. (language/en/posting.php and prosilver/tempalte/posting_buttons.html) I've been pretty much following the trail of the [*] tag and adding similar lines of code for [hr].

The part that I did not get to work is actually inserting the [hr] tag into the message body (prosilver/template/editor.js) with a button press. I tried with bbstyle(-2) since [*] is -1. I didn't find the tag -> HTML code converter either.

Re: Horizontal rule tag [hr] without end tag

Posted: Sat Nov 17, 2012 11:15 pm
by AmigoJack
DataNalle wrote:I tried with bbstyle(-2) since [*] is -1.
bbstyle() is defined in /styles/*/template/editor.js and of course there is no -2 expected there.
I didn't find the tag -> HTML code converter either.
Roughly said you have to augment /includes/bbcode.php and /includes/message_parser.php by projecting the code of existing BBCodes to keep all the functionality (i.e. post settings "Disable BBCode" won't parse [hr] either) - there's no single point of code that handles it all and once.

Re: Horizontal rule tag [hr] without end tag

Posted: Sun Nov 18, 2012 2:02 am
by DionDesigns
DataNalle wrote:The part that I did not get to work is actually inserting the [hr] tag into the message body (prosilver/template/editor.js) with a button press. I tried with bbstyle(-2) since [*] is -1.
Try insert_text('[hr]') instead.

Re: Horizontal rule tag [hr] without end tag

Posted: Tue Nov 20, 2012 11:04 pm
by AGC
Why not trying this:

code:

[hr][/hr]

html:
<hr />

Re: Horizontal rule tag [hr] without end tag

Posted: Tue Nov 20, 2012 11:23 pm
by Jessica
AGC wrote:Why not trying this:

code:

[hr][/hr]

html:
<hr />
OP wants the code without end tag [/hr] so that you can just put [hr] and make a horizontal line.

Re: Horizontal rule tag [hr] without end tag

Posted: Wed Nov 21, 2012 1:20 am
by AGC
Jessica wrote:
AGC wrote:Why not trying this:

code:

[hr][/hr]

html:
<hr />
OP wants the code without end tag [/hr] so that you can just put [hr] and make a horizontal line.
So I see. But.....
The parser add a end tag to the [*] so trying to find some other way is pointless.
You should consider that.