Discovery Gaming Community
bbcode for reputation - Printable Version

+- Discovery Gaming Community (https://discoverygc.com/forums)
+-- Forum: Rules & Requests (https://discoverygc.com/forums/forumdisplay.php?fid=6)
+--- Forum: Site & Forum Feedback (https://discoverygc.com/forums/forumdisplay.php?fid=14)
+--- Thread: bbcode for reputation (/showthread.php?tid=139202)



bbcode for reputation - Corile - 05-11-2016

Wrote this in an hour at school. Currently only works on chrome because I couldn't be bothered to do vendor prefixes yet. Added vendor prefixes.

http://discotest.netai.net/showthread.php?tid=1

If anyone can write safe mybb regexes I'm done with regexes so this can be implemented here without much effort.

EDIT:
Okay, it's done. It's not the most elegant solution possible, because of how bbcode in MyBB works (and I can't use javascript in any reasonable way) so the user experience of this bbcode is, shall we say, slightly lacking. It works, however, and that's what counts.

Usage:
Code:
[rep=$1,$2]$3,$4,$5,$6[/rep]

$1 [0-100] - the width percentage of the first gradient break.
$2 [0-100] - the width percentage of the second gradient break.

$3 [#COL, #COLOUR, transparent] - the colour of the first anchor of the first gradient.
$4 [#COL, #COLOUR, transparent] - the colour of the second anchor of the first gradient.
$5 [#COL, #COLOUR, transparent] - the colour of the first anchor of the second gradient.
$6 [#COL, #COLOUR, transparent] - the colour of the second anchor of the second gradient.

Mind the gaps, spaces aren't allowed anywhere. This sounds complicated but believe me, it's the easiest it could have been.

Usage examples/templates:
Code:
[rep=50,100]transparent,transparent,#fff,#0c0[/rep]
+1 - allied.

Code:
[rep=50,75]transparent,transparent,#fff,#0c0[/rep]
+0.5 - friendly

Code:
[rep=50,50]#fff,#fff,#fff,#fff[/rep]
0 - neutral, empty bar.

Code:
[rep=0,50]#ff69b4,#fff,transparent,transparent[/rep]
-1 - full hostile in hot pink, for some reason.




RE: bbcode for reputation - Corile - 05-11-2016

Bump since finished. I added a poll, feel free to vote.


RE: bbcode for reputation - Thyrzul - 05-11-2016

Looks really nice, though I'm unfamiliar with this implementation template, could you explain me what those in the ([]{}) brackets exactly mean and what in the regular expression refers to what part of the replacement? Thanks.



RE: bbcode for reputation - Corile - 05-11-2016

(05-11-2016, 08:30 PM)Thyrzul Wrote: Looks really nice, though I'm unfamiliar with this implementation template, could you explain me what those in the ([]{}) brackets exactly mean and what in the regular expression refers to what part of the replacement? Thanks.
http://regexr.com/3ddcu


RE: bbcode for reputation - Thyrzul - 05-11-2016

Wow, thank you. Now one more question, do the expressions from $1 to $6 indeed mean the parameters from 1 to 6 in the order they were typed in, like how I suspect them to be?



RE: bbcode for reputation - Corile - 05-11-2016

Yes.

123


RE: bbcode for reputation - Thyrzul - 05-11-2016

Thank you.


RE: bbcode for reputation - Corile - 05-12-2016

No other opinions, seriously?


RE: bbcode for reputation - Mr.Badger - 05-12-2016

GIB IT, Implement this... looks really nice Smile

+1


RE: bbcode for reputation - HassLHoFF™ - 05-12-2016

easy vote...as only positives for this.