|
Post by Streamstrider on Apr 22, 2011 17:37:56 GMT -8
Alright, so I know there's a code for coloring board names by id, but is there a way to specify the board title color per category (not the category titles, just the board titles)? For instance, having all board titles of those boards in the general category be blue, and all the board titles of those boards in the rp category be red.
Is that possible?
|
|
2787cmt
Not New Member
Posts: 5
2787cmt said 0 great things
|
Post by 2787cmt on Apr 22, 2011 19:41:04 GMT -8
Instead of writing a code, you could just wrap each board name with the color UBBC. Thus, then you could customize it for boards in certain categories having certain colors, etc.
|
|
|
Post by Streamstrider on Apr 23, 2011 7:56:24 GMT -8
I know, but I don't want to color the category names. And I know I could just use that board title color code to color all the boards I needed to color, but I wanted to see if there was a way to color board titles in a category the same color. That way, when you add a board to the category, that board's title is colored for it, instead of going in and editing every board title in the code. (It would be cool if a section could be added when modifying/creating a category that allows you to put in the board title colors in the form of hex colors.) If it's too much, that's okay. I just figured a lot of people could benefit from something like this.
|
|
|
Post by Wormopolis on Apr 23, 2011 12:26:11 GMT -8
putting something on the category editor wouldnt really work because you wouldnt be able to send that information to the server to store anyways. the colors for the categories would have to be kept in the h/f
this code is possible, but will still involve looping through cells on the page to see what category each board is in.
stay tuned
|
|
|
Post by Wormopolis on Apr 24, 2011 13:42:01 GMT -8
working on this today
|
|
|
Post by Wormopolis on Apr 25, 2011 3:31:59 GMT -8
<script type="text/javascript"> <!-- // Color Board Titles based on Categories // by Wormo
var catColors=new Array(); //these are the category ids and the colors associated with them catColors['general']='#FF0000'; catColors['categ2']='#00FF00'; catColors['categ3']='#0000FF'; catColors['categ4']='#FFFF00';
if (pb_action=='home') { var brdChkArray=new Array(); var fj=document.getElementById('forumjump'); var currcat=''; for (opts=fj.options, oo=0; oo<opts.length; oo++) { if (opts[oo].value && opts[oo].value.match(/cgi#(.*?)$/)) currcat=RegExp.$1; if (opts[oo].value && opts[oo].value.match(/board=(.*?)$/)) brdChkArray[RegExp.$1]=currcat; } for (tds=document.getElementsByTagName('td'), tt=0; tt<tds.length; tt++) { if (tds.width=='66%' && tds.className.match(/windowbg/) && tds.firstChild && tds.firstChild.getElementsByTagName('a')[0] ) { tmpbrd=tds.firstChild.getElementsByTagName('a')[0]; if (tmpbrd.href.match(/board=(.*?)$/) && brdChkArray[RegExp.$1] && catColors[brdChkArray[RegExp.$1]]) { tmpbrd.innerHTML='<font color="'+ catColors[brdChkArray[RegExp.$1]] + '">' + tmpbrd.innerHTML + '</font>'; } } }
}
// --> </script>
|
|
|
Post by Streamstrider on Apr 25, 2011 17:46:15 GMT -8
It works beautifully. (I'm guessing global footer.)
Would it be possible to color the sub-boards in the category as well, though?
|
|
|
Post by Wormopolis on Apr 25, 2011 18:56:31 GMT -8
global footer.. and change this line
if (pb_action=='home') {
to this
if (pb_action.match(/home|boardindex/)) {
|
|
|
Post by Streamstrider on Apr 25, 2011 19:45:05 GMT -8
This is AWESOME! Thank you so much, Wormo!
|
|
|
Post by Wormopolis on Apr 25, 2011 20:33:07 GMT -8
what board did you use it on? Id like to see how you utilized it
|
|
|
Post by Streamstrider on Apr 26, 2011 11:11:58 GMT -8
I used the colors based on importance, specialty, and OOC, and left the RP boards the regular link color. (Didn't really want it to look like a rainbow. )
r-e-a-l-i-t-y-shift.proboards.com/
|
|
|
Post by Wormopolis on Apr 28, 2011 15:23:49 GMT -8
Looks perfect!
|
|