|
Post by Streamstrider on May 16, 2011 12:02:49 GMT -8
Okay, so I tried out the one on ProBoards Support which alphabetized the threads by page. I tried putting the code in the board's footer, but it didn't work. XD Then I thought of this question, which has probably been asked about before. Is it possible to create a code that will alphabetize all of the threads in a board/sub-board without doing it just page by page?
|
|
|
Post by Wormopolis on May 16, 2011 21:49:35 GMT -8
javascript can only manipulate what is already on the page, it wont be able to fetch new data from the server in order to get the entire thread list of each board.
|
|
|
Post by Streamstrider on May 17, 2011 11:04:36 GMT -8
Thanks, Wormo! Figured as much. And just because I'm wanting to ask, and it has something to do with this. . . . Would it be possible to make an alphabetizing code that also colors the thread title depending on the letter it starts with? (Would be cool. Haha.)
|
|
|
Post by Wormopolis on May 17, 2011 14:17:51 GMT -8
a code to color thread titles based off first letter is possible.
are you wanting to fill out an array or use some sort of calculation?
|
|
|
Post by Streamstrider on May 17, 2011 14:21:22 GMT -8
I'm really not sure which would work best, to tell you the truth. I would like to be able to input the hex colors individually.
|
|
|
Post by Wormopolis on May 18, 2011 19:42:31 GMT -8
<script type="text/javascript"> <!-- // Thread Title color based on First Letter // by Wormo - concept by streamstrider
var titleColorArray=new Array(); titleColorArray['A']='FF0000'; titleColorArray['B']='FF00A0'; titleColorArray['C']='00FF00'; titleColorArray['X']='000FF0'; titleColorArray['Y']='0000AF'; titleColorArray['Z']='0000FF';
for (tds=document.getElementsByTagName('td'), tt=0; tt<tds.length; tt++) { if (tds.width.match(/4(3|8)%/) && tds.className.match(/windowbg/) && tds.getElementsByTagName('font')[0]) { var fkeep=tds.getElementsByTagName('font')[0]; var lkeep=fkeep.innerHTML.substr(0,1).toUpperCase(); if (titleColorArray[lkeep]) fkeep.color=titleColorArray[lkeep]; } }
// --> </script>
untested, but see what happens
|
|
|
Post by Streamstrider on May 19, 2011 8:56:48 GMT -8
It changed the color of my announcements to red but did nothing with the thread titles. Can the announcements be excluded?
Link to Board (Code in Board Footer)
|
|
|
Post by Wormopolis on May 19, 2011 12:57:16 GMT -8
I dont see the code in that board footer.. URL correct?
|
|
|
Post by Wormopolis on May 19, 2011 13:41:00 GMT -8
<script type="text/javascript"> <!-- // Thread Title color based on First Letter // by Wormo - concept by streamstrider
var titleColorArray=new Array(); titleColorArray['A']='F09E47'; titleColorArray['B']='D72F20'; titleColorArray['C']='AFB70B'; titleColorArray['D']='A84505'; titleColorArray['E']='6C77B7'; titleColorArray['F']='6B809D'; titleColorArray['G']='765968'; titleColorArray['H']='A07688'; titleColorArray['I']='DC4314'; titleColorArray['C']='E3DAF3'; titleColorArray['K']='CBE813'; titleColorArray['L']='1FC3DC'; titleColorArray['M']='FA54C9'; titleColorArray['N']='CBEEF5'; titleColorArray['O']='20F102'; titleColorArray['P']='5118D9'; titleColorArray['Q']='E5E0D1'; titleColorArray['R']='8F0409'; titleColorArray['S']='AAB873'; titleColorArray['T']='F5DF18'; titleColorArray['U']='F63643'; titleColorArray['V']='1111DD'; titleColorArray['W']='0D6D59'; titleColorArray['X']='F5DF18'; titleColorArray['Y']='D36E02'; titleColorArray['Z']='F61825';
for (tds=document.getElementsByTagName('td'), tt=0; tt<tds.length; tt++) { if (tds[tt].width.match(/4(3|8)%/) && tds[tt].className.match(/windowbg/) && tds[tt].getElementsByTagName('font')[0]) { var fkeep=tds[tt].getElementsByTagName('font')[0]; var lkeep=(fkeep.innerText ? fkeep.innerText : fkeep.textContent).substr(0,1).toUpperCase(); if (titleColorArray[lkeep] && fkeep.firstChild && fkeep.firstChild.firstChild) fkeep.firstChild.firstChild.innerHTML='<font color="'+ titleColorArray[lkeep] +'">'+fkeep.firstChild.firstChild.innerHTML+'</font>'; } }
// --> </script>
|
|
|
Post by Streamstrider on May 19, 2011 20:19:01 GMT -8
Hmm.... The code was there. Just double-checked. *adds new code*
Awesome! It's working! Now I just need to change colors and find an alphabetizing code that works. The last ones I've tried just don't.
|
|
|
Post by Wormopolis on May 19, 2011 20:50:48 GMT -8
I can make that alphabetize too.. but its only going to see the threads already on the page. it cant get later pages. no code can.
|
|
|
Post by Streamstrider on May 19, 2011 22:43:22 GMT -8
That perfectly fine. I would love it!
|
|
|
Post by Streamstrider on Jul 18, 2011 12:44:13 GMT -8
Bump! Hope I'm not making you work too hard. xD
|
|
|
Post by Wormopolis on Jul 18, 2011 21:11:30 GMT -8
no.. I just get swamoed with work stuff and dealing with my hand that I forget things.
Im modding the ghost users code currently and can mod this one next.
|
|
|
Post by Streamstrider on Jul 18, 2011 21:34:30 GMT -8
Coolies! I understand about the work and other things. I hardly have time for freedom.
|
|