BBCode addition requested

St George

RolePlay Moderator
-
Deputy Speaker
-
-
-
Pronouns
He/Him, They/Them
Hi admins and ting

I'd like - if possible and compatible with everything else the forum has going - for a justified bbcode to be added.

I'm not sure what else I should say in this topic. :s

Also, bonobos.
 
Eluvatar:
I've installed it on the testforum, and tested it out a bit here.

I'm not certain about translating it over: feedback solicited!
Elu, could you look at the first portion of your test language? it is showi the start and end of the
codes, but it seems to me that you're missing something in that first passage that is making the code visible, rather than applied, as i seen with the center and right justification.​
 
I was testing what happens if you just do without specifying a pixel width: it then does not work. The other piece of code madjack is suggesting does not have that problem.
 
Would the other piece of code be acceptable then? (My goal to have something very similar to [blocktext] on the NS forum).
 
Since we already have bbtags13_xanik installed, I would suggest adding a new tag through that, instead of adding a whole new script.

Justified text only requires changing the CSS text-align property to "justify". Adding the following in the Board Templates, right after the specification for the region tag, should work (I'd test it, but I can't seem to find the link to the testforum where I have admin access).
Code:
ubb_tag("Justified","justified","<span style='text-align: justify'><% INNER %></span>",0,"Make text justified.");
 
r3naissanc3r:
Since we already have bbtags13_xanik installed, I would suggest adding a new tag through that, instead of adding a whole new script.

Justified text only requires changing the CSS text-align property to "justify". Adding the following in the Board Templates, right after the specification for the region tag, should work (I'd test it, but I can't seem to find the link to the testforum where I have admin access).
Code:
ubb_tag("Justified","justified","<span style='text-align: justify'><% INNER %></span>",0,"Make text justified.");
Test forum URL:
http://testforum.thenorthpacific.org/index/http://testforum.thenorthpacific.org/index/
 
Thanks for the link. I've edited the code a bit and now it works fine:

http://testforum.thenorthpacific.org/single/?p=8336090&t=11279833

It works both with and without a width. Additionally, when a width is provided, it can be specified in a few different ways, e.g., as a percentage of the post width, or as a number of pixels.

Here is the code you need to add:
Code:
ubb_tag("Justified","justified","<span style='display: inline-block; text-align: justify;'><% INNER %></span>",0,"Make text justified.");

ubb_tag("Justified","justified","<span style='display: inline-block; text-align: justify; width: <% VAR %>;'><% INNER %></span>",1);

EDIT: Since we're on the subject, I'd also suggest replacing the currently installed version of bbtags31_xanik with this version, which was slightly modified by myself. The edits make the parsing of tags more robust (e.g., makes them case insensitive, as well as some other enhancements dealing with nested tags).

The modified version has been in use by several other NS forums for a few years now, so it's known to be stable.
 
r3naissanc3r:
EDIT: Since we're on the subject, I'd also suggest replacing the currently installed version of bbtags31_xanik with this version, which was slightly modified by myself. The edits make the parsing of tags more robust (e.g., makes them case insensitive, as well as some other enhancements dealing with nested tags).

The modified version has been in use by several other NS forums for a few years now, so it's known to be stable.
If you decide to also implement the thing I reference above, what you have to do is go to Board Templates and replace this line:
Code:
<script type='text/javascript' src='http://z1.ifrm.com/0/2/0/p401849/bbtags31_xanik.js'></script>
with this
Code:
<script type='text/javascript' src='http://z6.ifrm.com/4812/177/0/f5018893/bbtags31_xanik.js'></script>


Regarding the new tag for justifying text, here are the three use options:

1) Width specified as percentage of parent post width:
Code:
[justified=50%]your text[/justified]
2) Width specified as number of pixels:
Code:
[justified=40px]your text[/justified]
3) No width arguments (defaults to 100% of parent post width):
Code:
[justified]your text[/justified]
 
Back
Top