inherit
220772
0
Mar 24, 2023 21:43:23 GMT -8
Tiffy-Bean
I support plugin and theme makers rights to create themes and plugins that are paid for.
1,052
April 2015
tiffythecodingwhiz
|
Post by Tiffy-Bean on Sept 4, 2016 18:14:46 GMT -8
Any way I can have it auto alphabetize the thread titles in a single board based on first letter?
|
|
inherit
220772
0
Mar 24, 2023 21:43:23 GMT -8
Tiffy-Bean
I support plugin and theme makers rights to create themes and plugins that are paid for.
1,052
April 2015
tiffythecodingwhiz
|
Post by Tiffy-Bean on Sept 4, 2016 18:16:30 GMT -8
Todge I saw this for sub-boards that you wrote: <script type="text/javascript">
<!--
// Alphabetize sub-boards...
if(location.href.match(/board=/) && !location.href.match(/display=/))
{
var subTitles = new Array();
var subs = new Array();
var sT = 0;
var sub = document.getElementsByTagName('tr');
for(s=0; s<sub.length; s++)
{
if(sub[s].firstChild.width == '8%' && sub[s].firstChild.nextSibling.width == '66%')
{
subs[sT] = sub[s];
subTitles[sT] = sub[s].firstChild.nextSibling.getElementsByTagName('b')[0].innerHTML+'|'+sT;
sT++;
}}
subTitles = subTitles.sort();
for(s=0; s<subs.length; s++)
{
var subCell = subs[0].parentNode;
subCell.appendChild(subs[parseInt(subTitles[s].split('|')[1])]);
}}
// -->
</script>
Is there any way we can change this to just the subjects in a specific board? Like I can put it in the footer of just that board?
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Sept 5, 2016 12:35:26 GMT -8
The problem is paganation. If your threads span more than one page they'd not be included in the list, so you'd only be able to sort the threads you can currently see on-screen, and not necessarily all the threads of the viewed board.
|
|
inherit
220772
0
Mar 24, 2023 21:43:23 GMT -8
Tiffy-Bean
I support plugin and theme makers rights to create themes and plugins that are paid for.
1,052
April 2015
tiffythecodingwhiz
|
Post by Tiffy-Bean on Sept 5, 2016 17:27:36 GMT -8
The problem is paganation. If your threads span more than one page they'd not be included in the list, so you'd only be able to sort the threads you can currently see on-screen, and not necessarily all the threads of the viewed board. Thanks Todge. That does render it useless. Thank you. <3
|
|
inherit
220772
0
Mar 24, 2023 21:43:23 GMT -8
Tiffy-Bean
I support plugin and theme makers rights to create themes and plugins that are paid for.
1,052
April 2015
tiffythecodingwhiz
|
Post by Tiffy-Bean on Sept 5, 2016 18:25:32 GMT -8
Hey todge..I just realized none of them are going to be long enough to go onto the next page..so I'd still be interested in alphabetizing this if it's possible. It's just so much hassle to do the bumping.
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Sept 6, 2016 13:18:00 GMT -8
Here ya go then.. Put this in the Footer(s) of the Board(s) you want alphabetised.
<script type="text/javascript"> <!--
// Alphabetize sub-boards...
if(location.href.match(/board\/\d/)) { var subTitles = new Array(); var subs = $('.thread'); var sT = 0;
for(s=0; s<subs.length; s++) { subTitles[sT] = $(subs[s]).find('.thread-link').html()+'|'+sT; sT++; } subTitles = subTitles.sort();
for(s=0; s<subs.length; s++) { var subCell = $(subs[0]).parent(); $(subCell).append(subs[parseInt(subTitles[s].split('|')[1])]); } }
// --> </script>
Just remember it does not work with paganation.
|
|
inherit
220772
0
Mar 24, 2023 21:43:23 GMT -8
Tiffy-Bean
I support plugin and theme makers rights to create themes and plugins that are paid for.
1,052
April 2015
tiffythecodingwhiz
|
Post by Tiffy-Bean on Sept 6, 2016 16:34:23 GMT -8
Thank you Todge. I bow down to your superior knowledge. I'm just now starting to learn jquery and let's just say it's very new to me and I'm making a lot of mistakes. So, I appreciate it.
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Sept 8, 2016 8:54:15 GMT -8
No worries.. And making mistakes is how you learn.
|
|