Posts: 3,659
Threads: 143
Joined: Aug 2009
Staff roles: Server Manager Coding Dev Moderator
@Corile has provided some code to implement a few BBCode tags.
These were done a while ago, I just never got around to writing a post for them.
If you want to try these out please use the 'Preview' function.
Here's a couple to assist in compliance with rule 2:
imgw automatically restricts display of images into the maximum width of 700px required by rule 2.1:
Code:
[imgw]https://i.redd.it/t74qxr8ycmnz.jpg[/imgw]
sigimg automatically restricts display of images into the 700*250px box required by rule 2.2:
In both cases, the URL provided must end in jpg/png/gif/jpeg. Also note that you must still ensure that signature images are less than 1MB in size.
anchor generates a hidden element that can be linked to directly. You don't add an end tag. You provide it with up to 5 characters (alphanumeric or underscore) which you can then link to with...
Code:
[anchor=abcde]
a generates a link that points to an anchor element generated with the above. Upon clicking on it the browser will jump to the target part of the page. You need to provide the ID of the anchor.
Code:
[a=abcde]Example[/a]
rep generates a reputation bar display on the forums.
The syntax for this is a bit complicated. It's slightly more generic than it generally (assuming you're representing a single fixed reputation and not some sort of range) needs to be - you can provide four colours (the start and end of two gradients - one ending at completely neutral and one beginning at completely neutral) and the starting and ending position (where 0 is most hostile and 100 most friendly, each block is 5).
This is slightly off because the starting point usually seems to need 1 added to it, but reference (again provided by @Corile):
So for negative reputations you'll give it the colours #f00,#fff,transparent,transparent, ending point 50 and your own start point. In this example I'll use 11 as each block shown is 5, then we add 1 extra for the starting point. This shows Freelancer reputation -0.8:
For positive reputations you'll give it the colours transparent,transparent,#fff,#0f0, starting point 51 and your own end point. In this example I'll use 90% as each block is 5. This shows Freelancer reputation 0.8:
Reputations are brilliant. However, I must ask, why can't we have the regular hex color syntax? And if we can't, how does one convert regular ones to these shorter one?
Posts: 3,659
Threads: 143
Joined: Aug 2009
Staff roles: Server Manager Coding Dev Moderator
(11-18-2017, 11:31 PM)SnakThree Wrote: why can't we have the regular hex color syntax? And if we can't, how does one convert regular ones to these shorter one?
Also I'll do a bit of a shameless plug: if you want to see how these new codes look in the wild Custodi info page has made use of the anchors while the LPI one uses repbars.
edit:
Also something I just remembered is that you can directly link to an anchor, so for instance if you wanted to link directly to Custodi diplomacy, you can use an anchor to do that, just append the link with #anchor-abcde.